cf 0.14.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.
Files changed (448) hide show
  1. package/dist/_meta/commands.json +4040 -1629
  2. package/dist/_meta/hand-written-commands.json +16 -43
  3. package/dist/_meta/schemas.json +445 -756
  4. package/dist/abuse-reports-BAQR1w79.mjs +26 -0
  5. package/dist/access-C8KMplzp.mjs +27 -0
  6. package/dist/account-B-KQSR0L.mjs +12 -0
  7. package/dist/account-tags-EncLJpLc.mjs +15 -0
  8. package/dist/accounts-BA4Mp3A_.mjs +132 -0
  9. package/dist/acm-ByxUJcqF.mjs +15 -0
  10. package/dist/addressing-C-ym0h0G.mjs +93 -0
  11. package/dist/agent-memory-CkPSiZDI.mjs +34 -0
  12. package/dist/ai-DkE_Q64s.mjs +31 -0
  13. package/dist/ai-audit-pPcjYWI5.mjs +6 -0
  14. package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
  15. package/dist/ai-search-DLD_kDS1.mjs +79 -0
  16. package/dist/ai-security-jyZcBl9g.mjs +10 -0
  17. package/dist/alerting-DOROjm8E.mjs +56 -0
  18. package/dist/analytics-rQ-h-plT.mjs +21 -0
  19. package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
  20. package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  21. package/dist/api-security-B8p8vp8u.mjs +154 -0
  22. package/dist/argo-g8SjUb_t.mjs +10 -0
  23. package/dist/artifacts-B1PaeF5h.mjs +43 -0
  24. package/dist/audit-logs-DmU_PHy_.mjs +4 -0
  25. package/dist/auth-CZqics6E.mjs +2 -0
  26. package/dist/auth-Cp7gT-AF.mjs +8 -0
  27. package/dist/billing-CvTbUg-H.mjs +23 -0
  28. package/dist/bot-management-z53tbcbH.mjs +9 -0
  29. package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
  30. package/dist/brand-protection-DzV211IQ.mjs +27 -0
  31. package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
  32. package/dist/browser-run-DYQvMAyo.mjs +46 -0
  33. package/dist/build-BPIp8J5F.mjs +2 -0
  34. package/dist/build-OC77a1zq.mjs +2 -0
  35. package/dist/builds-CwKRqjQ5.mjs +71 -0
  36. package/dist/cache-CugNPPsJ.mjs +45 -0
  37. package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
  38. package/dist/cf-oadujOtC.mjs +18 -0
  39. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  40. package/dist/chunk-DL5FNmn1.mjs +2 -0
  41. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  42. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  43. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  44. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  45. package/dist/client-certificates-DZUIqBTB.mjs +13 -0
  46. package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
  47. package/dist/cloud-connector-avpf86kG.mjs +6 -0
  48. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  49. package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
  50. package/dist/command-B2Qe-WUa.mjs +2 -0
  51. package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
  52. package/dist/command-D45NW-R3.mjs +2 -0
  53. package/dist/command-DIvPLK8x.mjs +2 -0
  54. package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
  55. package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
  56. package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
  57. package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
  58. package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
  59. package/dist/connectors-BSmhzNB7.mjs +15 -0
  60. package/dist/containers-B5vDcFzo.mjs +78 -0
  61. package/dist/{dist-CFQREIRi.mjs → containers-CFzvhmyz.mjs} +84 -83
  62. package/dist/content-scan-CeLZAcbT.mjs +14 -0
  63. package/dist/cps-BlI_Od72.mjs +6 -0
  64. package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
  65. package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
  66. package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
  67. package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
  68. package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
  69. package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
  70. package/dist/custom-pages-BgfhGksj.mjs +21 -0
  71. package/dist/d1-P2kWbdID.mjs +45 -0
  72. package/dist/data-security-pBIozmRL.mjs +71 -0
  73. package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
  74. package/dist/delegate-GctF_lrq.mjs +2 -0
  75. package/dist/delegate.mjs +1 -1
  76. package/dist/{deploy-BtETDvDA.mjs → deploy-CVYdt3NK.mjs} +1 -1
  77. package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-DpOgndz4.mjs} +1 -1
  78. package/dist/{dev-B5WcIpEr.mjs → dev-PPUBjWcm.mjs} +1 -1
  79. package/dist/diagnostics-C62habGQ.mjs +15 -0
  80. package/dist/{dialog-Bud0hiYv.mjs → dialog-C_ccBiZp.mjs} +1 -1
  81. package/dist/dist-B4pQ4CXK.mjs +48 -0
  82. package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
  83. package/dist/dist-dc4E1u01.mjs +272 -0
  84. package/dist/dls-CpkcyQ8C.mjs +17 -0
  85. package/dist/dns-DG1X4Wap.mjs +135 -0
  86. package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
  87. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  88. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  89. package/dist/durable-objects-D214VhxH.mjs +8 -0
  90. package/dist/email-auth-Ba4ONan2.mjs +6 -0
  91. package/dist/email-routing-BlqKnqNM.mjs +45 -0
  92. package/dist/email-security-Dl1E1Dko.mjs +160 -0
  93. package/dist/email-sending-DIRSSRIz.mjs +47 -0
  94. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  95. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  96. package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
  97. package/dist/firewall-DdsDh8GD.mjs +56 -0
  98. package/dist/flagship-CkUIVW7c.mjs +28 -0
  99. package/dist/fraud-BUpZgvQT.mjs +22 -0
  100. package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
  101. package/dist/healthchecks-DjQWb3EM.mjs +22 -0
  102. package/dist/hostnames-ClBLPbct.mjs +11 -0
  103. package/dist/hyperdrive-U54xZsWU.mjs +37 -0
  104. package/dist/iam-T-wWmOep.mjs +52 -0
  105. package/dist/images-ia5UG1GW.mjs +71 -0
  106. package/dist/index.mjs +1 -1
  107. package/dist/intel-BhswZLMI.mjs +76 -0
  108. package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
  109. package/dist/interactive-DnUvQHjc.mjs +2 -0
  110. package/dist/ips-Dad_EvhM.mjs +4 -0
  111. package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
  112. package/dist/keys-DjIPvqj4.mjs +4 -0
  113. package/dist/kv-DzXVnK94.mjs +21 -0
  114. package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
  115. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  116. package/dist/load-balancers-3wGHPsYz.mjs +76 -0
  117. package/dist/local-B6b2OIBW.mjs +2 -0
  118. package/dist/local-BrfySqnx.mjs +2 -0
  119. package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  120. package/dist/login-CEQbOgBM.mjs +5 -0
  121. package/dist/login-DEWvGuaU.mjs +2 -0
  122. package/dist/logo-matches-YGRPstPi.mjs +6 -0
  123. package/dist/logos-BirufUgo.mjs +7 -0
  124. package/dist/logpush-BlNbUHyV.mjs +46 -0
  125. package/dist/logs-DmFlVF9q.mjs +48 -0
  126. package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
  127. package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
  128. package/dist/magic-transit-CBVOK2aa.mjs +387 -0
  129. package/dist/managed-defense-BdW6s483.mjs +18 -0
  130. package/dist/managed-transforms-BIeiofIS.mjs +9 -0
  131. package/dist/matches-CAnwci0P.mjs +6 -0
  132. package/dist/mcp-BfhOMGFE.mjs +32 -0
  133. package/dist/mesh-CxUL2Wf-.mjs +26 -0
  134. package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
  135. package/dist/network-C68psMbz.mjs +50 -0
  136. package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
  137. package/dist/oauth-D4bkeMAw.mjs +14 -0
  138. package/dist/oauth-DouM-qz0.mjs +2 -0
  139. package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
  140. package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
  141. package/dist/observability-DpYxkFeZ.mjs +80 -0
  142. package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
  143. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  144. package/dist/organization-Dg55Xfz7.mjs +75 -0
  145. package/dist/organizations-QnyzGjB2.mjs +4 -0
  146. package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
  147. package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
  148. package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
  149. package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
  150. package/dist/page-rules--D3eXrCf.mjs +39 -0
  151. package/dist/pages-Ce8DDgNr.mjs +60 -0
  152. package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
  153. package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
  154. package/dist/pipelines-CAqCgBLh.mjs +44 -0
  155. package/dist/precursor-DBnn4Q35.mjs +4 -0
  156. package/dist/previews-y_nSqWK5.mjs +4 -0
  157. package/dist/progress-Bi02B6v4.mjs +2 -0
  158. package/dist/{prompt-BP8XrQSj.mjs → prompt-Bx2PB-tt.mjs} +1 -1
  159. package/dist/queries-dg-CVXjf.mjs +9 -0
  160. package/dist/queues-C_ilLbRI.mjs +63 -0
  161. package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
  162. package/dist/r2-hZAkra-l.mjs +127 -0
  163. package/dist/radar-BO9b0aZy.mjs +300 -0
  164. package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
  165. package/dist/realtime-eSavuSeE.mjs +172 -0
  166. package/dist/registrar-Ct30kOXZ.mjs +43 -0
  167. package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
  168. package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
  169. package/dist/reporting-B-F5aWUJ.mjs +14 -0
  170. package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
  171. package/dist/request-tracers-CaubpUFV.mjs +4 -0
  172. package/dist/resolve-BXemCSyA.mjs +2 -0
  173. package/dist/resolve-CUDKxUrW.mjs +2 -0
  174. package/dist/resource-sharing-6Snv-b69.mjs +40 -0
  175. package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
  176. package/dist/rules-C26eyeA5.mjs +18 -0
  177. package/dist/rulesets-BKzIwVtJ.mjs +37 -0
  178. package/dist/rum-Xdw5hyWY.mjs +30 -0
  179. package/dist/run-BBBMrSrs.mjs +2 -0
  180. package/dist/run-BRucX7Rz.mjs +2 -0
  181. package/dist/{schema-DmuJtMN5.mjs → schema-DqtYndhB.mjs} +1 -1
  182. package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags-CebDI0f1.mjs} +1 -1
  183. package/dist/scim-odJTXiIe.mjs +18 -0
  184. package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
  185. package/dist/secrets-store-RYpWWzaw.mjs +24 -0
  186. package/dist/security-center-B3D95vCa.mjs +30 -0
  187. package/dist/security-txt-BSytVv-9.mjs +9 -0
  188. package/dist/shared-D67owd9x.mjs +2 -0
  189. package/dist/smart-shield-C83Sfnf4.mjs +24 -0
  190. package/dist/snippets-B6oE9WIa.mjs +20 -0
  191. package/dist/source-BR4_k2ad.mjs +6 -0
  192. package/dist/spawn-CKqJ9J4_.mjs +523 -0
  193. package/dist/spectrum-CfxY--X_.mjs +83 -0
  194. package/dist/speed-DzK-kiWt.mjs +24 -0
  195. package/dist/src-B3h6tKMt.mjs +108 -0
  196. package/dist/ssl-dnjzPcSB.mjs +45 -0
  197. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  198. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  199. package/dist/state-BxCejn42.mjs +2 -0
  200. package/dist/state-DSzkxXML.mjs +2 -0
  201. package/dist/stream-oFyhS4Wi.mjs +102 -0
  202. package/dist/submit-4f-ravmC.mjs +4 -0
  203. package/dist/tags-DrIP6Uiq.mjs +4 -0
  204. package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  205. package/dist/telemetry-Ds4epd3D.mjs +2 -0
  206. package/dist/telemetry-mKEb8lYB.mjs +2 -0
  207. package/dist/tenant-C-gc3NWv.mjs +12 -0
  208. package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
  209. package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
  210. package/dist/tunnels-D0QYsskp.mjs +29 -0
  211. package/dist/turnstile-C6Q3spRB.mjs +33 -0
  212. package/dist/ui-DH95w1Qk.mjs +5 -0
  213. package/dist/undici-DTSBJHNS.mjs +96 -0
  214. package/dist/update-check-BBS1K1jt.mjs +2 -0
  215. package/dist/update-check-CTLoakFV.mjs +2 -0
  216. package/dist/update-check-worker.mjs +2 -0
  217. package/dist/url-info-Cs0V89qq.mjs +4 -0
  218. package/dist/url-normalization-DaEQYy5h.mjs +9 -0
  219. package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
  220. package/dist/user-BV1VY3Kl.mjs +112 -0
  221. package/dist/values-qDS63E43.mjs +4 -0
  222. package/dist/vectorize-NFzD3mP5.mjs +32 -0
  223. package/dist/version-W6_TN_kN.mjs +2 -0
  224. package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
  225. package/dist/web-assets-Gd6z8dbt.mjs +64 -0
  226. package/dist/web3-DCJx4NRp.mjs +28 -0
  227. package/dist/workers-B-j-1ygi.mjs +36 -0
  228. package/dist/workers-builds-DPrNKjZW.mjs +14 -0
  229. package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
  230. package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
  231. package/dist/workflows-C2KKIJjl.mjs +43 -0
  232. package/dist/zaraz-CVLCs1IX.mjs +22 -0
  233. package/dist/zero-trust-BtJi4OXF.mjs +795 -0
  234. package/dist/zone-hKgt0WzO.mjs +4 -0
  235. package/dist/zones-CCNyaD3J.mjs +124 -0
  236. package/package.json +12 -9
  237. package/dist/_meta/agent-context.json +0 -195
  238. package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
  239. package/dist/access-BoT1waG4.mjs +0 -11
  240. package/dist/account-agnMUKWj.mjs +0 -2
  241. package/dist/account-tags-BRMMHCee.mjs +0 -9
  242. package/dist/accounts-Cut77dAt.mjs +0 -30
  243. package/dist/acm-C8WgXNCl.mjs +0 -3
  244. package/dist/addressing-CR8EV42x.mjs +0 -13
  245. package/dist/agent-context-Wj5TRRbW.mjs +0 -8
  246. package/dist/agent-memory-CVJpKKZy.mjs +0 -6
  247. package/dist/ai-BbNYt-yI.mjs +0 -5
  248. package/dist/ai-audit-mVajM-2i.mjs +0 -2
  249. package/dist/ai-gateway-BsepSA_v.mjs +0 -13
  250. package/dist/ai-search-DbEJqm5-.mjs +0 -7
  251. package/dist/ai-security-DmyB5EYk.mjs +0 -4
  252. package/dist/alerting-dmy3hd8O.mjs +0 -6
  253. package/dist/analytics-B1xBMla0.mjs +0 -5
  254. package/dist/analytics_engine-DazCn3iC.mjs +0 -2
  255. package/dist/api-security-0HXCzfHk.mjs +0 -50
  256. package/dist/argo-DSHsE8zv.mjs +0 -2
  257. package/dist/artifacts-CwiU9Mxu.mjs +0 -5
  258. package/dist/audit-logs-DwFtMDwH.mjs +0 -2
  259. package/dist/auth-B0ZyXc3y.mjs +0 -5
  260. package/dist/auth-DWxtJ918.mjs +0 -8
  261. package/dist/billing-Cbpadkgu.mjs +0 -3
  262. package/dist/bot-management-B6M2Vyyn.mjs +0 -5
  263. package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
  264. package/dist/brand-protection-B5R0b3pu.mjs +0 -3
  265. package/dist/browser-extension-D55pYZf_.mjs +0 -3
  266. package/dist/browser-run-C1b2VkGB.mjs +0 -4
  267. package/dist/build-CP2JUfV1.mjs +0 -2
  268. package/dist/builds-CVEXO_4a.mjs +0 -9
  269. package/dist/cache-BU5xX82E.mjs +0 -9
  270. package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
  271. package/dist/cf-BV2HLCQm.mjs +0 -18
  272. package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
  273. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
  274. package/dist/chunk-vbHwaUoU.mjs +0 -2
  275. package/dist/client-certificates-DX84qeYG.mjs +0 -3
  276. package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
  277. package/dist/cloud-connector-cf8qlxap.mjs +0 -2
  278. package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
  279. package/dist/command-DYrspBc0.mjs +0 -2
  280. package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
  281. package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
  282. package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
  283. package/dist/connectors-aPQspZdg.mjs +0 -3
  284. package/dist/containers-D0Kjl8h-.mjs +0 -58
  285. package/dist/content-scan-BVx18XmS.mjs +0 -4
  286. package/dist/cps-ByazyM0x.mjs +0 -2
  287. package/dist/csamScanner-OG5lQxBC.mjs +0 -6
  288. package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
  289. package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
  290. package/dist/custom-csrs-CR_5qbST.mjs +0 -3
  291. package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
  292. package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
  293. package/dist/custom-pages-BmGXoTIo.mjs +0 -3
  294. package/dist/d1-DedC8N0N.mjs +0 -21
  295. package/dist/data-security-B2UB26ry.mjs +0 -7
  296. package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
  297. package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
  298. package/dist/dist-CyisSore.mjs +0 -371
  299. package/dist/dist-Dr4Hg_Up.mjs +0 -48
  300. package/dist/dls-R6PvHbhj.mjs +0 -3
  301. package/dist/dns-Cl8se64c.mjs +0 -29
  302. package/dist/dns-firewall-WtmKilDT.mjs +0 -57
  303. package/dist/dry-run-YSQndLvt.mjs +0 -2
  304. package/dist/durable-objects-jfVU6yp_.mjs +0 -2
  305. package/dist/email-auth-DPmZ85eW.mjs +0 -2
  306. package/dist/email-routing-Bf6DbNTr.mjs +0 -6
  307. package/dist/email-security-DTifjSxM.mjs +0 -18
  308. package/dist/email-sending-Dm3WkFHV.mjs +0 -7
  309. package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
  310. package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
  311. package/dist/firewall-D5N2APXO.mjs +0 -8
  312. package/dist/flagship-sUOy9jei.mjs +0 -4
  313. package/dist/fraud-WLW2Ep1Z.mjs +0 -20
  314. package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
  315. package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
  316. package/dist/hostnames-Ba6FuL8K.mjs +0 -3
  317. package/dist/hyperdrive-DMqcU639.mjs +0 -21
  318. package/dist/iam-CXlYm0uC.mjs +0 -6
  319. package/dist/images-D_g1oli6.mjs +0 -8
  320. package/dist/intel-B8bS0ARd.mjs +0 -8
  321. package/dist/ips-68fzniN4.mjs +0 -2
  322. package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
  323. package/dist/keys-DkVdS2lF.mjs +0 -2
  324. package/dist/kv-gDAN50BQ.mjs +0 -5
  325. package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
  326. package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
  327. package/dist/local-BwL_gesw.mjs +0 -2
  328. package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
  329. package/dist/logos-DFBJFAYJ.mjs +0 -3
  330. package/dist/logpush-gzmlZayc.mjs +0 -4
  331. package/dist/logs-BuzwQgt5.mjs +0 -18
  332. package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
  333. package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
  334. package/dist/magic-transit-ClSmJDKw.mjs +0 -111
  335. package/dist/managed-defense-EOihg1UR.mjs +0 -2
  336. package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
  337. package/dist/matches-B6sG0_fr.mjs +0 -2
  338. package/dist/mcp--kK0vS5i.mjs +0 -4
  339. package/dist/mesh-DfXYUHOO.mjs +0 -4
  340. package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
  341. package/dist/network-U6f_5ihp.mjs +0 -6
  342. package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
  343. package/dist/oauth-BdVr2hJp.mjs +0 -14
  344. package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
  345. package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
  346. package/dist/observability-Bsp-LdmJ.mjs +0 -10
  347. package/dist/organization-BSeMdj-7.mjs +0 -45
  348. package/dist/organizations-BroR48Nv.mjs +0 -2
  349. package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
  350. package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
  351. package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
  352. package/dist/page-rules-ZcdjPohY.mjs +0 -27
  353. package/dist/pages-W4tKa7xk.mjs +0 -14
  354. package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
  355. package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
  356. package/dist/pipelines-Dug0BR-c.mjs +0 -6
  357. package/dist/precursor-D-11DkRU.mjs +0 -4
  358. package/dist/previews-D_Nv4dR6.mjs +0 -4
  359. package/dist/progress-a5IKeKni.mjs +0 -2
  360. package/dist/queries-BdA2vJoe.mjs +0 -3
  361. package/dist/queues-Bu06ZqUE.mjs +0 -7
  362. package/dist/r2-COC9wMKb.mjs +0 -25
  363. package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
  364. package/dist/radar-L-yoLIHF.mjs +0 -2
  365. package/dist/realtime-JKIiXfzi.mjs +0 -20
  366. package/dist/registrar-_dYUZrK0.mjs +0 -43
  367. package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
  368. package/dist/reporting-3fyoMcmb.mjs +0 -2
  369. package/dist/request-headers-BhQQAfJt.mjs +0 -2
  370. package/dist/request-tracers-TisEth2p.mjs +0 -2
  371. package/dist/resolve-CYUp6YgC.mjs +0 -2
  372. package/dist/resource-sharing-C4-dnohU.mjs +0 -6
  373. package/dist/resource-tagging-BRDifKqM.mjs +0 -2
  374. package/dist/rules-BCF3gIkw.mjs +0 -4
  375. package/dist/rulesets-wp6rllt3.mjs +0 -5
  376. package/dist/rum-B77awgoB.mjs +0 -4
  377. package/dist/run-BS8otL3u.mjs +0 -2
  378. package/dist/scim-C9BmUYil.mjs +0 -4
  379. package/dist/secrets-store-ckkZR2dM.mjs +0 -7
  380. package/dist/security-center-BCahKT57.mjs +0 -2
  381. package/dist/security-txt-0SI5du7I.mjs +0 -3
  382. package/dist/shared-D0B-7q-D.mjs +0 -2
  383. package/dist/smart-shield-BDPbrZa4.mjs +0 -4
  384. package/dist/snippets-CVRR_h0i.mjs +0 -4
  385. package/dist/spawn-DP4T92ss.mjs +0 -519
  386. package/dist/spectrum-CjNXQIQE.mjs +0 -63
  387. package/dist/speed-CrXCHk3h.mjs +0 -4
  388. package/dist/src-BbnV77C4.mjs +0 -108
  389. package/dist/ssl-DKORhHkh.mjs +0 -15
  390. package/dist/startup-profile-CBIH6yZy.mjs +0 -17
  391. package/dist/state-QUu6HfxC.mjs +0 -2
  392. package/dist/stream-wY3zi3FK.mjs +0 -16
  393. package/dist/submit-B-4oCBSk.mjs +0 -2
  394. package/dist/tags-5uJEkYJZ.mjs +0 -2
  395. package/dist/telemetry-n3NJourL.mjs +0 -2
  396. package/dist/tenant-BkFvv2o3.mjs +0 -2
  397. package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
  398. package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
  399. package/dist/tunnels-9Zg3ePwD.mjs +0 -5
  400. package/dist/turnstile-BTwKYpzD.mjs +0 -23
  401. package/dist/ui-DQSZeaG5.mjs +0 -5
  402. package/dist/url-info-D7Y61BFd.mjs +0 -2
  403. package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
  404. package/dist/url-scanner-CiCIltSQ.mjs +0 -2
  405. package/dist/user-DDFDGJ0Y.mjs +0 -12
  406. package/dist/values-DRznB_Cl.mjs +0 -2
  407. package/dist/vectorize-CbznPhzq.mjs +0 -4
  408. package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
  409. package/dist/web-assets-C-ZoSkkh.mjs +0 -8
  410. package/dist/web3-DwlN4dOw.mjs +0 -4
  411. package/dist/workers-builds-ECw_x_kp.mjs +0 -2
  412. package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
  413. package/dist/workers-vpc-CCosFcxz.mjs +0 -3
  414. package/dist/workers-zFMrbUkg.mjs +0 -6
  415. package/dist/workflows-C8GXGDRW.mjs +0 -5
  416. package/dist/zaraz-B5UIREaz.mjs +0 -2
  417. package/dist/zero-trust-DUp0XoIo.mjs +0 -91
  418. package/dist/zone-BGLkk-mL.mjs +0 -2
  419. package/dist/zones-CwYjNXMH.mjs +0 -44
  420. /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
  421. /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
  422. /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  423. /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
  424. /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
  425. /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  426. /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  427. /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  428. /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  429. /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
  430. /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  431. /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
  432. /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
  433. /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
  434. /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
  435. /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  436. /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  437. /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
  438. /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  439. /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
  440. /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  441. /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  442. /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
  443. /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  444. /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  445. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  446. /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  447. /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  448. /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{a as i,r as a}from"./auth-DWxtJ918.mjs";import{t as o}from"./output-Z2lQmPUW.mjs";import{t as s}from"./dry-run-YSQndLvt.mjs";import{t as c}from"./progress-a5IKeKni.mjs";import{t as l}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-Cmw7PZ7a.mjs";import{n as m,t as h}from"./input-validation-nF-0Ze2h.mjs";import{a as g,i as _,n as v}from"./prompt-BP8XrQSj.mjs";import{t as y}from"./cli-types-abvWQN3T.mjs";import{n as ee,t as te}from"./raw-fetch-DNH2V8qH.mjs";function b(e){return e.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:`Generates a new short-lived certificate CA and public key.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Deletes 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);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.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:`Fetches a short-lived certificate CA and its public key.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists short-lived certificate CAs and their public keys.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/apps/ca`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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:`Adds a new application to Access.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/apps`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Deletes an application from Access.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
4
- `);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.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:`Fetches information about 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists all Access applications in an account or zone.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/apps`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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:`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.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`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.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
5
- `);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.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:`Fetches a single Access policy configured for an application. Returns both exclusively owned and reusable policies used by the application.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists Access policies configured for an application. Returns both exclusively scoped and reusable policies used by the application.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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:`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.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Starts an Access policy test.`,builder:J,handler:async r=>l({command:`zero-trust access applications policy-tests create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access applications policy-tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policy-tests`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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.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:`Fetches the current status of a given Access policy test.`,builder:X,handler:async r=>l({command:`zero-trust access applications policy-tests get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access applications policy-tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policy-tests/${r[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(r[`policy-test-id`]))}`,pathParams:{"policy-test-id":String(r[`policy-test-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.applications.policyTests.get({account_id:l,policy_test_id:r[`policy-test-id`]})),{successLabel:`Loaded`})})};function Q(e){return e.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:`Fetches a single page of user results from an Access policy test.`,builder:y(Q),handler:async r=>l({command:`zero-trust access applications policy-tests users list`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){s({command:`cf zero-trust access applications policy-tests users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policy-tests/${r[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(r[`policy-test-id`]))}/users`,pathParams:{"policy-test-id":String(r[`policy-test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.policyTests.users.list({account_id:u,policy_test_id:r[`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.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:`Revokes all tokens issued for an application.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications revoke-tokens`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.
6
- `);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.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:`Updates 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Updates 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Updates 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Tests if a specific user has permission to access an application.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=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}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`Returns a list of Authenticator Device AAGUIDs for MFA configuration.`,builder:ve,handler:async r=>l({command:`zero-trust access authenticator-device-aaguids list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access authenticator-device-aaguids list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/authenticator_device_aaguids`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.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.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 new Bookmark application.`,builder:xe,handler:async r=>l({command:`zero-trust access bookmarks create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access bookmarks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/bookmarks/${r[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(r[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(r[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.bookmarks.create({account_id:l,bookmark_id:r[`bookmark-id`]})),{successLabel:`Created`})})};function Ce(e){return e.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:`Deletes a Bookmark application.`,builder:Ce,handler:async r=>l({command:`zero-trust access bookmarks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access bookmarks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/bookmarks/${r[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(r[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(r[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
7
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.bookmarks.delete({account_id:l,bookmark_id:r[`bookmark-id`]})),{successLabel:`Deleted`})})};function Te(e){return e.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:`Fetches a single Bookmark application.`,builder:Te,handler:async r=>l({command:`zero-trust access bookmarks get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access bookmarks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/bookmarks/${r[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(r[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(r[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.get({account_id:l,bookmark_id:r[`bookmark-id`]})),{successLabel:`Loaded`})})};function De(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`Lists Bookmark applications.`,builder:De,handler:async r=>l({command:`zero-trust access bookmarks list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access bookmarks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/bookmarks`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.list({account_id:l})),{successLabel:`Loaded`})})};function ke(e){return e.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:`Updates a configured Bookmark application.`,builder:ke,handler:async r=>l({command:`zero-trust access bookmarks update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access bookmarks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/bookmarks/${r[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(r[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(r[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.access.bookmarks.update({account_id:l,bookmark_id:r[`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.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:`Adds a new mTLS root certificate to Access.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/certificates`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Deletes 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
8
- `);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.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:`Fetches a single 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists all mTLS root 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/certificates`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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 for this account or zone.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Updates 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Updates a configured 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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 r=>l({command:`zero-trust access custom-pages create`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access custom-pages create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({app_count:r[`app-count`],contract_version:r[`contract-version`],custom_html:m(r[`custom-html`],`custom-html`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`),uid:m(r.uid,`uid`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:e,account_id:l})),{successLabel:`Created`});return}r[`custom-html`]===void 0&&(r[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),r.name===void 0&&(r.name=await g(`name`,`Custom page name.`)),r.type===void 0&&(r.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:r[`app-count`],contract_version:r[`contract-version`],custom_html:m(r[`custom-html`],`custom-html`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`),uid:m(r.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.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 r=>l({command:`zero-trust access custom-pages delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access custom-pages delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages/${r[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(r[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(r[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
9
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.customPages.delete({account_id:l,custom_page_id:r[`custom-page-id`]})),{successLabel:`Deleted`})})};function Qe(e){return e.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:`Fetches a custom page and also returns its HTML.`,builder:Qe,handler:async r=>l({command:`zero-trust access custom-pages get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages/${r[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(r[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(r[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.customPages.get({account_id:l,custom_page_id:r[`custom-page-id`]})),{successLabel:`Loaded`})})};function et(e){return e.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 r=>l({command:`zero-trust access custom-pages list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust access custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.customPages.list({account_id:u,...i})),{successLabel:`Loaded`})})};function nt(e){return e.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 r=>l({command:`zero-trust access custom-pages update`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages/${r[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(r[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(r[`custom-page-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({app_count:r[`app-count`],contract_version:r[`contract-version`],custom_html:m(r[`custom-html`],`custom-html`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`),uid:m(r.uid,`uid`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:e,account_id:l,custom_page_id:r[`custom-page-id`]})),{successLabel:`Updated`});return}r[`custom-html`]===void 0&&(r[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),r.name===void 0&&(r.name=await g(`name`,`Custom page name.`)),r.type===void 0&&(r.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:r[`app-count`],contract_version:r[`contract-version`],custom_html:m(r[`custom-html`],`custom-html`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`),uid:m(r.uid,`uid`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:u,account_id:l,custom_page_id:r[`custom-page-id`]})),{successLabel:`Updated`})})};function it(e){return e.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 Liquid template and return its errors and warnings without persisting it.`,builder:it,handler:async r=>l({command:`zero-trust access custom-pages validate`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access custom-pages validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/custom_pages/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({template:m(r.template,`template`,`text`),type:m(r.type,`type`,`text`),version:r.version}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...e,account_id:l})),{successLabel:`Created`});return}r.template===void 0&&(r.template=await g(`template`,`The Liquid template to validate.`)),r.type===void 0&&(r.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({template:m(r.template,`template`,`text`),type:m(r.type,`type`,`text`),version:r.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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`create`,describe:`Adds a new SSH Certificate Authority (CA).`,builder:st,handler:async r=>l({command:`zero-trust access gateway-ca create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access gateway-ca create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.gatewayCa.create({account_id:l})),{successLabel:`Created`})})};function lt(e){return e.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:`Deletes an SSH Certificate Authority.`,builder:lt,handler:async r=>l({command:`zero-trust access gateway-ca delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access gateway-ca delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/gateway_ca/${r[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(r[`certificate-id`]))}`,pathParams:{"certificate-id":String(r[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
10
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.gatewayCa.delete({account_id:l,certificate_id:r[`certificate-id`]})),{successLabel:`Deleted`})})};function dt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`list`,describe:`Lists SSH Certificate Authorities (CA).`,builder:dt,handler:async r=>l({command:`zero-trust access gateway-ca list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access gateway-ca list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.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.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:`Creates a new 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/groups`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Deletes 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
11
- `);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.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:`Fetches a single 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists all 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/groups`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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:`Updates a configured 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`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.`,builder:Tt,handler:async r=>l({command:`zero-trust access idp-federation-grants create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access idp-federation-grants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({idp_id:m(r[`idp-id`],`idp-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.idpFederationGrants.create({...e,account_id:l})),{successLabel:`Created`});return}r[`idp-id`]===void 0&&(r[`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(r[`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.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:`Deletes an IdP federation grant. The identity provider remains in the account, but it is no longer available for federation to other accounts.`,builder:Dt,handler:async r=>l({command:`zero-trust access idp-federation-grants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access idp-federation-grants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/idp_federation_grants/${r[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(r[`grant-id`]))}`,pathParams:{"grant-id":String(r[`grant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
12
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.idpFederationGrants.delete({account_id:l,grant_id:r[`grant-id`]})),{successLabel:`Deleted`})})};function kt(e){return e.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:`Retrieves a single IdP federation grant by its UID.`,builder:kt,handler:async r=>l({command:`zero-trust access idp-federation-grants get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access idp-federation-grants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/idp_federation_grants/${r[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(r[`grant-id`]))}`,pathParams:{"grant-id":String(r[`grant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.idpFederationGrants.get({account_id:l,grant_id:r[`grant-id`]})),{successLabel:`Loaded`})})};function jt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`list`,describe:`Lists the IdP federation grants owned by the account.`,builder:jt,handler:async r=>l({command:`zero-trust access idp-federation-grants list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access idp-federation-grants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`get`,describe:`Gets the Access key rotation settings for an account.`,builder:Pt,handler:async r=>l({command:`zero-trust access keys get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.keys.get({account_id:l})),{successLabel:`Loaded`})})};function It(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lt={command:`rotate`,describe:`Perfoms a key rotation for an account.`,builder:It,handler:async r=>l({command:`zero-trust access keys rotate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access keys rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/keys/rotate`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.keys.rotate({account_id:l})),{successLabel:`Created`})})};function Rt(e){return e.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:`Updates the Access key rotation settings for an account.`,builder:Rt,handler:async r=>l({command:`zero-trust access keys update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({key_rotation_interval_days:r[`key-rotation-interval-days`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.access.keys.update({...e,account_id:l})),{successLabel:`Updated`});return}if(r[`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:r[`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.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.
13
- 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:`Gets a list of Access authentication audit logs for an account.`,builder:y(Vt),handler:async r=>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`]}},r,async()=>{let i={limit:r.limit,direction:r.direction,since:r.since,until:r.until,page:r.page,per_page:r[`per-page`],email:r.email,email_exact:r[`email-exact`],user_id:r[`user-id`],allowedOp:r[`allowed-op`],country_codeOp:r[`country-code-op`],app_typeOp:r[`app-type-op`],app_uidOp:r[`app-uid-op`],ray_idOp:r[`ray-id-op`],emailOp:r[`email-op`],idpOp:r[`idp-op`],non_identityOp:r[`non-identity-op`],user_idOp:r[`user-id-op`],fields:r.fields};if(r.dryRun){s({command:`cf zero-trust access logs access-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/logs/access_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.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.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:`Gets an account-scoped Access JIT request summary and its lifecycle events in chronological order.`,builder:Wt,handler:async r=>l({command:`zero-trust access logs jit-requests get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access logs jit-requests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/logs/jit_requests/${r[`knock-request-id`]==null?`<knock-request-id>`:encodeURIComponent(String(r[`knock-request-id`]))}`,pathParams:{"knock-request-id":String(r[`knock-request-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.logs.jitRequests.get({account_id:l,knock_request_id:r[`knock-request-id`]})),{successLabel:`Loaded`})})};function Kt(e){return e.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:`Lists account-wide Access JIT request logs reconstructed from request lifecycle events.`,builder:y(Kt),handler:async r=>l({command:`zero-trust access logs jit-requests list`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],status:r.status,search:r.search,since:r.since,until:r.until};if(r.dryRun){s({command:`cf zero-trust access logs jit-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/logs/jit_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.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.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:`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).`,builder:y(Yt),handler:async r=>l({command:`zero-trust access logs scim updates list`,classification:{safeFlags:[`direction`,`dry-run`]}},r,async()=>{let i={limit:r.limit,direction:r.direction,since:r.since,until:r.until,idp_id:r[`idp-id`],status:r.status,resource_type:r[`resource-type`],request_method:r[`request-method`],resource_user_email:r[`resource-user-email`],resource_group_name:r[`resource-group-name`],cf_resource_id:r[`cf-resource-id`],idp_resource_id:r[`idp-resource-id`],page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust access logs scim updates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/logs/scim/updates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.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.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:`Creates a new Access reusable policy.`,builder:en,handler:async r=>l({command:`zero-trust access policies create`,classification:{safeFlags:[`decision`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policies`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({decision:m(r.decision,`decision`,`text`),exclude:f(r.exclude,`exclude`),include:f(r.include,`include`),name:m(r.name,`name`,`text`),require:f(r.require,`require`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.decision===void 0&&(r.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`])),r.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(r.decision,`decision`,`text`),exclude:f(r.exclude,`exclude`),include:f(r.include,`include`),name:m(r.name,`name`,`text`),require:f(r.require,`require`)});o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:u,account_id:l})),{successLabel:`Created`})})};function nn(e){return e.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:`Deletes an Access reusable policy.`,builder:nn,handler:async r=>l({command:`zero-trust access policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policies/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
14
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.policies.delete({account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Deleted`})})};function an(e){return e.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:`Fetches a single Access reusable policy.`,builder:an,handler:async r=>l({command:`zero-trust access policies get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policies/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.policies.get({account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Loaded`})})};function sn(e){return e.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:`Lists Access reusable policies.`,builder:sn,handler:async r=>l({command:`zero-trust access policies list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust access policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.policies.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ln(e){return e.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:`Updates a Access reusable policy.`,builder:ln,handler:async r=>l({command:`zero-trust access policies update`,classification:{safeFlags:[`decision`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/policies/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({decision:m(r.decision,`decision`,`text`),exclude:f(r.exclude,`exclude`),include:f(r.include,`include`),name:m(r.name,`name`,`text`),require:f(r.require,`require`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:e,account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Updated`});return}if(r.decision===void 0&&(r.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`])),r.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(r.decision,`decision`,`text`),exclude:f(r.exclude,`exclude`),include:f(r.include,`include`),name:m(r.name,`name`,`text`),require:f(r.require,`require`)});o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:u,account_id:l,policy_id:r[`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.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:`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.`,builder:fn,handler:async r=>l({command:`zero-trust access saml-certificates get-pem`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access saml-certificates get-pem`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/saml_certificates/${r[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(r[`saml-cert-set-id`]))}/pem`,pathParams:{"saml-cert-set-id":String(r[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.getPem({account_id:l,saml_cert_set_id:r[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function mn(e){return e.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:`Retrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.`,builder:mn,handler:async r=>l({command:`zero-trust access saml-certificates get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access saml-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/saml_certificates/${r[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(r[`saml-cert-set-id`]))}`,pathParams:{"saml-cert-set-id":String(r[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.get({account_id:l,saml_cert_set_id:r[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function gn(e){return e.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:`Returns a paginated list of the organization's SAML encryption certificate sets. Each certificate set includes the current and (if present) previous certificates.`,builder:gn,handler:async r=>l({command:`zero-trust access saml-certificates list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],id:r.id};if(r.dryRun){s({command:`cf zero-trust access saml-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/saml_certificates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.samlCertificates.list({account_id:u,...i})),{successLabel:`Loaded`})})};function vn(e){return e.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:`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.`,builder:vn,handler:async r=>l({command:`zero-trust access saml-certificates rotate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access saml-certificates rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/saml_certificates/${r[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(r[`saml-cert-set-id`]))}/rotate`,pathParams:{"saml-cert-set-id":String(r[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.samlCertificates.rotate({account_id:l,saml_cert_set_id:r[`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.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:`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.`,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/service_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Deletes 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
15
- `);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.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:`Fetches a single 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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:`Lists all 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/service_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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.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:`Refreshes the expiration of a service token.`,builder:kn,handler:async r=>l({command:`zero-trust access service-tokens refresh`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access service-tokens refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/service_tokens/${r[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(r[`service-token-id`]))}/refresh`,pathParams:{"service-token-id":String(r[`service-token-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.refresh({account_id:l,service_token_id:r[`service-token-id`]})),{successLabel:`Created`})})};function jn(e){return e.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:`Generates a new Client Secret for a service token and revokes the old one.`,builder:jn,handler:async r=>l({command:`zero-trust access service-tokens rotate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access service-tokens rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/service_tokens/${r[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(r[`service-token-id`]))}/rotate`,pathParams:{"service-token-id":String(r[`service-token-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({previous_client_secret_expires_at:m(r[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...e,account_id:l,service_token_id:r[`service-token-id`]})),{successLabel:`Created`});return}let u=p({previous_client_secret_expires_at:m(r[`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:r[`service-token-id`]})),{successLabel:`Created`})})};function Nn(e){return e.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:`Updates a configured 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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.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 r=>l({command:`zero-trust access tags create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/tags`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...u,account_id:l})),{successLabel:`Created`})})};function Rn(e){return e.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 r=>l({command:`zero-trust access tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/tags/${r[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(r[`tag-name`]))}`,pathParams:{"tag-name":String(r[`tag-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
16
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.tags.delete({account_id:l,tag_name:r[`tag-name`]})),{successLabel:`Deleted`})})};function Bn(e){return e.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 r=>l({command:`zero-trust access tags get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/tags/${r[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(r[`tag-name`]))}`,pathParams:{"tag-name":String(r[`tag-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.tags.get({account_id:l,tag_name:r[`tag-name`]})),{successLabel:`Loaded`})})};function Hn(e){return e.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 r=>l({command:`zero-trust access tags list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust access tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/tags`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.tags.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Wn(e){return e.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 r=>l({command:`zero-trust access tags update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/tags/${r[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(r[`tag-name`]))}`,pathParams:{"tag-name":String(r[`tag-name`]??``)},bodyKind:`json`,body:r.body===void 0?p({name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...e,account_id:l,tag_name:r[`tag-name`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await g(`name`,`The name of the tag`));let u=p({name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...u,account_id:l,tag_name:r[`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.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 an active session for a single user.`,builder:qn,handler:async r=>l({command:`zero-trust access users active-sessions get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users active-sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/active_sessions/${r.nonce==null?`<nonce>`:encodeURIComponent(String(r.nonce))}`,pathParams:{"user-id":String(r[`user-id`]??``),nonce:String(r.nonce??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.get({account_id:l,user_id:r[`user-id`],nonce:r.nonce})),{successLabel:`Loaded`})})};function Yn(e){return e.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 for a single user.`,builder:Yn,handler:async r=>l({command:`zero-trust access users active-sessions list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users active-sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/active_sessions`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.list({account_id:l,user_id:r[`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.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:`Creates a new user.`,builder:Qn,handler:async r=>l({command:`zero-trust access users create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({email:m(r.email,`email`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...e,account_id:l})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await g(`email`,`The email of the user.`));let u=p({email:m(r.email,`email`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...u,account_id:l})),{successLabel:`Created`})})};function er(e){return e.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:`Deletes a specific user for an account. This will also revoke any active seats and tokens for the user.`,builder:er,handler:async r=>l({command:`zero-trust access users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
17
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.users.delete({account_id:l,user_id:r[`user-id`]})),{successLabel:`Deleted`})})};function nr(e){return e.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 all failed login attempts for a single user.`,builder:nr,handler:async r=>l({command:`zero-trust access users failed-logins list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users failed-logins list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/failed_logins`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.failedLogins.list({account_id:l,user_id:r[`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.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:`Gets a specific user for an account.`,builder:ar,handler:async r=>l({command:`zero-trust access users get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.get({account_id:l,user_id:r[`user-id`]})),{successLabel:`Loaded`})})};function sr(e){return e.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 for a single user.`,builder:sr,handler:async r=>l({command:`zero-trust access users last-seen-identity get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users last-seen-identity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/last_seen_identity`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.lastSeenIdentity.get({account_id:l,user_id:r[`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.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:`Gets a list of users for an account.`,builder:ur,handler:async r=>l({command:`zero-trust access users list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={name:r.name,email:r.email,search:r.search,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust access users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.users.list({account_id:u,...i})),{successLabel:`Loaded`})})};function fr(e){return e.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:`Updates a specific user's name for an account. Requires the user's current email as confirmation (email cannot be changed).`,builder:fr,handler:async r=>l({command:`zero-trust access users update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust access users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({email:m(r.email,`email`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...e,account_id:l,user_id:r[`user-id`]})),{successLabel:`Updated`});return}r.email===void 0&&(r.email=await g(`email`,`The email of the user.`)),r.name===void 0&&(r.name=await g(`name`,`The name of the user.`));let u=p({email:m(r.email,`email`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...u,account_id:l,user_id:r[`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.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:`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.`,builder:gr,handler:async r=>l({command:`zero-trust apps policies make reusable update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust apps policies make reusable update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/policies/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}/make_reusable`,pathParams:{"app-id":String(r[`app-id`]??``),"policy-id":String(r[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.apps.policies.make.reusable.update({account_id:l,app_id:r[`app-id`],policy_id:r[`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.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sr={command:`list`,describe:`Retrieve the statuses of your applications.`,builder:xr,handler:async r=>l({command:`zero-trust apps review status list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust apps review status list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.apps.review.status.list({account_id:l})),{successLabel:`Loaded`})})};function Cr(e){return e.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 the statuses of your applications.`,builder:Cr,handler:async r=>l({command:`zero-trust apps review status update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust apps review status update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({approved_apps:r[`approved-apps`],in_review_apps:r[`in-review-apps`],unapproved_apps:r[`unapproved-apps`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...e,account_id:l})),{successLabel:`Updated`});return}if(r[`approved-apps`]===void 0)throw Error(`--approved-apps is required (or pass --body with this field set).`);if(r[`in-review-apps`]===void 0)throw Error(`--in-review-apps is required (or pass --body with this field set).`);if(r[`unapproved-apps`]===void 0)throw Error(`--unapproved-apps is required (or pass --body with this field set).`);let u=p({approved_apps:r[`approved-apps`],in_review_apps:r[`in-review-apps`],unapproved_apps:r[`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.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:`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.`,builder:y(Or),handler:async r=>l({command:`zero-trust casb applications auth-methods list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,page_size:r[`page-size`]};if(r.dryRun){s({command:`cf zero-trust casb applications auth-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/applications/${r[`application-id`]==null?`<application-id>`:encodeURIComponent(String(r[`application-id`]))}/auth-methods`,pathParams:{"application-id":String(r[`application-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.authMethods.list({account_id:u,application_id:r[`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.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:`Returns full application details including auth methods, use cases, and permissions.`,builder:y(jr),handler:async r=>l({command:`zero-trust casb applications get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/applications/${r[`application-id`]==null?`<application-id>`:encodeURIComponent(String(r[`application-id`]))}`,pathParams:{"application-id":String(r[`application-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.applications.get({account_id:l,application_id:r[`application-id`]})),{successLabel:`Loaded`})})};function Nr(e){return e.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:`Returns a list of available applications with use cases and permissions.`,builder:Nr,handler:async r=>l({command:`zero-trust casb applications list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={environment:r.environment,page:r.page,page_size:r[`page-size`]};if(r.dryRun){s({command:`cf zero-trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Fr(e){return e.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:`Returns all available setup flows for the application, one per auth method.`,builder:y(Fr),handler:async r=>l({command:`zero-trust casb applications setup-flows list`,classification:{safeFlags:[`environment`,`dry-run`]}},r,async()=>{let i={auth_method:r[`auth-method`],environment:r.environment,page:r.page,page_size:r[`page-size`]};if(r.dryRun){s({command:`cf zero-trust casb applications setup-flows list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/applications/${r[`application-id`]==null?`<application-id>`:encodeURIComponent(String(r[`application-id`]))}/setup-flows`,pathParams:{"application-id":String(r[`application-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.setupFlows.list({account_id:u,application_id:r[`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.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:"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.",builder:zr,handler:async r=>l({command:`zero-trust casb integrations create`,classification:{safeFlags:[`application`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({application:m(r.application,`application`,`text`),auth_method:m(r[`auth-method`],`auth-method`,`text`),dlp_profiles:r[`dlp-profiles`],name:m(r.name,`name`,`text`),permissions:r.permissions,use_cases:r[`use-cases`]}):d(r.body)});return}let l=await a(r),f=r.local?e:await t();if(r.accountId=f,r.file){let e=h(r.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(r.body){let e=d(r.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:e})),{successLabel:`Created`});return}r.application===void 0&&(r.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`])),r.name===void 0&&(r.name=await g(`name`,`Name of the integration.`));let v={};r.application!==void 0&&u(v,[`application`],m(r.application,`application`,`text`)),r[`auth-method`]!==void 0&&u(v,[`auth_method`],m(r[`auth-method`],`auth-method`,`text`)),r[`dlp-profiles`]!==void 0&&u(v,[`dlp_profiles`],r[`dlp-profiles`]),r.name!==void 0&&u(v,[`name`],m(r.name,`name`,`text`)),r.permissions!==void 0&&u(v,[`permissions`],r.permissions),r[`use-cases`]!==void 0&&u(v,[`use_cases`],r[`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.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 an integration by soft-deleting it.`,builder:Vr,handler:async r=>l({command:`zero-trust casb integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
18
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.casb.integrations.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})})};function Ur(e){return e.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:`Returns full integration details including use cases and permissions.`,builder:Ur,handler:async r=>l({command:`zero-trust casb integrations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.integrations.get({account_id:l,id:r.id})),{successLabel:`Loaded`})})};function Gr(e){return e.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:`Returns a paginated list of integrations for the account.`,builder:y(Gr),handler:async r=>l({command:`zero-trust casb integrations list`,classification:{safeFlags:[`direction`,`dlp-enabled`,`order`,`status`,`dry-run`]}},r,async()=>{let i={application:r.application,direction:r.direction,dlp_enabled:r[`dlp-enabled`],order:r.order,page:r.page,page_size:r[`page-size`],search:r.search,status:r.status,use_cases:r[`use-cases`]};if(r.dryRun){s({command:`cf zero-trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.integrations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function qr(e){return e.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:`Pauses an integration, stopping all crawlers.`,builder:qr,handler:async r=>l({command:`zero-trust casb integrations pause`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/pause`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.pause({account_id:l,id:r.id})),{successLabel:`Created`})})};function Yr(e){return e.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:`Resumes a paused integration, restarting crawlers.`,builder:Yr,handler:async r=>l({command:`zero-trust casb integrations resume`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/resume`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.resume({account_id:l,id:r.id})),{successLabel:`Created`})})};function Zr(e){return e.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:`Updates an integration's name, permissions, DLP profiles, use cases, or credentials.`,builder:Zr,handler:async r=>l({command:`zero-trust casb integrations update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/one/integrations/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?p({dlp_profiles:r[`dlp-profiles`],name:m(r.name,`name`,`text`),permissions:r.permissions,use_cases:r[`use-cases`]}):d(r.body)});return}let l=await a(r),f=r.local?e:await t();if(r.accountId=f,r.file){let e=h(r.file);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(r.id))}`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}})),{successLabel:`Updated`});return}if(r.body){let e=d(r.body);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(r.id))}`,{body:e})),{successLabel:`Updated`});return}let g={};r[`dlp-profiles`]!==void 0&&u(g,[`dlp_profiles`],r[`dlp-profiles`]),r.name!==void 0&&u(g,[`name`],m(r.name,`name`,`text`)),r.permissions!==void 0&&u(g,[`permissions`],r.permissions),r[`use-cases`]!==void 0&&u(g,[`use_cases`],r[`use-cases`]),o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(r.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.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 for the given account.`,builder:ti,handler:async r=>l({command:`zero-trust connectivity-settings edit`,classification:{safeFlags:[`icmp-proxy-enabled`,`offramp-warp-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust connectivity-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({icmp_proxy_enabled:r[`icmp-proxy-enabled`],offramp_warp_enabled:r[`offramp-warp-enabled`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({icmp_proxy_enabled:r[`icmp-proxy-enabled`],offramp_warp_enabled:r[`offramp-warp-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...u,account_id:l})),{successLabel:`Updated`})})};function ri(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ii={command:`get`,describe:`Gets the Zero Trust Connectivity Settings for the given account.`,builder:ri,handler:async r=>l({command:`zero-trust connectivity-settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust connectivity-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.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.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:`Lists available WARP client versions for a specific target environment and release track. This endpoint is in Beta.`,builder:y(oi),handler:async r=>l({command:`zero-trust devices client-versions list`,classification:{safeFlags:[`release-track`,`dry-run`]}},r,async()=>{let i={target_environment:r[`target-environment`],release_track:r[`release-track`],page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust devices client-versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/client-versions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.clientVersions.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ci(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const li={command:`list`,describe:`Retrieves a list of all available target environments with their display names. This endpoint is in Beta.`,builder:ci,handler:async r=>l({command:`zero-trust devices client-versions target-environments list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices client-versions target-environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/client-versions/target-environments`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.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.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:`Deletes a WARP device.`,builder:fi,handler:async r=>l({command:`zero-trust devices delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/physical-devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}`,pathParams:{"device-id":String(r[`device-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
19
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.delete({account_id:l,device_id:r[`device-id`]})),{successLabel:`Deleted`})})};function mi(e){return e.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:`Creates a new deployment group. Policy IDs must be unique across all deployment groups. This endpoint is in Beta.`,builder:mi,handler:async r=>l({command:`zero-trust devices deployment-groups create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices deployment-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/deployment-groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({name:m(r.name,`name`,`text`),policy_ids:r[`policy-ids`],version_config:f(r[`version-config`],`version-config`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.deploymentGroups.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await g(`name`,`A user-friendly name for the deployment group.`)),r[`version-config`]===void 0)throw Error(`--version-config is required (or pass --body with this field set).`);let u=p({name:m(r.name,`name`,`text`),policy_ids:r[`policy-ids`],version_config:f(r[`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.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:`Deletes a deployment group. Associated policies no longer apply and devices stop receiving version targets. This endpoint is in Beta.`,builder:gi,handler:async r=>l({command:`zero-trust devices deployment-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices deployment-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/deployment-groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
20
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.deploymentGroups.delete({account_id:l,group_id:r[`group-id`]})),{successLabel:`Deleted`})})};function vi(e){return e.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:`Fetches a single deployment group by its ID. This endpoint is in Beta.`,builder:vi,handler:async r=>l({command:`zero-trust devices deployment-groups get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices deployment-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/deployment-groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.deploymentGroups.get({account_id:l,group_id:r[`group-id`]})),{successLabel:`Loaded`})})};function bi(e){return e.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:`Lists all deployment groups for an account. Use deployment groups to assign target WARP client versions to specific devices. This endpoint is in Beta.`,builder:bi,handler:async r=>l({command:`zero-trust devices deployment-groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust devices deployment-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/deployment-groups`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.deploymentGroups.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Si(e){return e.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:`Updates a deployment group. Returns 409 if any newly added policy IDs already belong to another deployment group. This endpoint is in Beta.`,builder:Si,handler:async r=>l({command:`zero-trust devices deployment-groups update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices deployment-groups update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/deployment-groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({name:m(r.name,`name`,`text`),policy_ids:r[`policy-ids`],version_config:f(r[`version-config`],`version-config`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...e,account_id:l,group_id:r[`group-id`]})),{successLabel:`Updated`});return}let u=p({name:m(r.name,`name`,`text`),policy_ids:r[`policy-ids`],version_config:f(r[`version-config`],`version-config`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.deploymentGroups.update({...u,account_id:l,group_id:r[`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.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 Ei={command:`get <device-id>`,describe:`Fetches a single WARP device.`,builder:Ti,handler:async r=>l({command:`zero-trust devices get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={include:r.include};if(r.dryRun){s({command:`cf zero-trust devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/physical-devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}`,pathParams:{"device-id":String(r[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.get({account_id:u,device_id:r[`device-id`],...i})),{successLabel:`Loaded`})})};function Di(e){return e.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 Oi={command:`create`,describe:`Creates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`,builder:Di,handler:async r=>l({command:`zero-trust devices ip-profiles create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices ip-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/ip-profiles`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,subnet_id:m(r[`subnet-id`],`subnet-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.match===void 0&&(r.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".`)),r.name===void 0&&(r.name=await g(`name`,`A user-friendly name for the Device IP profile.`)),r.precedence===void 0)throw Error(`--precedence is required (or pass --body with this field set).`);r[`subnet-id`]===void 0&&(r[`subnet-id`]=await g(`subnet-id`,`The ID of the Subnet.`));let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,subnet_id:m(r[`subnet-id`],`subnet-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.ipProfiles.create({...u,account_id:l})),{successLabel:`Created`})})};function ki(e){return e.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 Ai={command:`delete <profile-id>`,describe:`Delete a WARP Device IP profile.`,builder:ki,handler:async r=>l({command:`zero-trust devices ip-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices ip-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/ip-profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
21
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.ipProfiles.delete({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Deleted`})})};function ji(e){return e.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 Mi={command:`get <profile-id>`,describe:`Fetches a single WARP Device IP profile.`,builder:ji,handler:async r=>l({command:`zero-trust devices ip-profiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices ip-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/ip-profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.ipProfiles.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function Ni(e){return e.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 Pi={command:`list`,describe:`Lists WARP Device IP profiles.`,builder:Ni,handler:async r=>l({command:`zero-trust devices ip-profiles list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust devices ip-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/ip-profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.ipProfiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Fi(e){return e.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 Ii={command:`update <profile-id>`,describe:`Updates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`,builder:Fi,handler:async r=>l({command:`zero-trust devices ip-profiles update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices ip-profiles update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/ip-profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,subnet_id:m(r[`subnet-id`],`subnet-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,subnet_id:m(r[`subnet-id`],`subnet-id`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.ipProfiles.update({...u,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`})})},Li={command:`ip-profiles`,describe:`Operations for devices.ip-profiles`,builder:e=>e.command(Oi).command(Ai).command(Mi).command(Pi).command(Ii).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ri(e){return e.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 zi={command:`list`,describe:`Lists WARP devices.`,builder:y(Ri),handler:async r=>l({command:`zero-trust devices list`,classification:{safeFlags:[`sort-by`,`sort-order`,`active-registrations`,`has-registration-type`,`dry-run`]}},r,async()=>{let i={cursor:r.cursor,sort_by:r[`sort-by`],sort_order:r[`sort-order`],"last_seen_user.email":r[`last-seen-user-email`],seen_after:r[`seen-after`],seen_before:r[`seen-before`],per_page:r[`per-page`],search:r.search,active_registrations:r[`active-registrations`],has_registration_type:r[`has-registration-type`],id:r.id,tag:r.tag,"last_seen_registration.policy.id":r[`last-seen-registration-policy-id`],include:r.include};if(r.dryRun){s({command:`cf zero-trust devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/physical-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Bi(e){return e.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 Vi={command:`create`,describe:`Creates a new device managed network.`,builder:Bi,handler:async r=>l({command:`zero-trust devices networks create`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({config:{sha256:m(r[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(r[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...e,account_id:l})),{successLabel:`Created`});return}r[`config-tls-sockaddr`]===void 0&&(r[`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.`)),r.name===void 0&&(r.name=await g(`name`,`The name of the device managed network. This name must be unique.`)),r.type===void 0&&(r.type=await _(`type`,`The type of device managed network.`,[`tls`]));let u=p({config:{sha256:m(r[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(r[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.networks.create({...u,account_id:l})),{successLabel:`Created`})})};function Hi(e){return e.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 Ui={command:`delete <network-id>`,describe:`Deletes a device managed network and fetches a list of the remaining device managed networks for an account.`,builder:Hi,handler:async r=>l({command:`zero-trust devices networks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/networks/${r[`network-id`]==null?`<network-id>`:encodeURIComponent(String(r[`network-id`]))}`,pathParams:{"network-id":String(r[`network-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
22
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.networks.delete({account_id:l,network_id:r[`network-id`]})),{successLabel:`Deleted`})})};function Wi(e){return e.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 Gi={command:`get <network-id>`,describe:`Fetches details for a single managed network.`,builder:Wi,handler:async r=>l({command:`zero-trust devices networks get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices networks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/networks/${r[`network-id`]==null?`<network-id>`:encodeURIComponent(String(r[`network-id`]))}`,pathParams:{"network-id":String(r[`network-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.networks.get({account_id:l,network_id:r[`network-id`]})),{successLabel:`Loaded`})})};function Ki(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qi={command:`list`,describe:`Fetches a list of managed networks for an account.`,builder:Ki,handler:async r=>l({command:`zero-trust devices networks list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices networks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.networks.list({account_id:l})),{successLabel:`Loaded`})})};function Ji(e){return e.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 Yi={command:`update <network-id>`,describe:`Updates a configured device managed network.`,builder:Ji,handler:async r=>l({command:`zero-trust devices networks update`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices networks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/networks/${r[`network-id`]==null?`<network-id>`:encodeURIComponent(String(r[`network-id`]))}`,pathParams:{"network-id":String(r[`network-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({config:{sha256:m(r[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(r[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...e,account_id:l,network_id:r[`network-id`]})),{successLabel:`Updated`});return}let u=p({config:{sha256:m(r[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:m(r[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.networks.update({...u,account_id:l,network_id:r[`network-id`]})),{successLabel:`Updated`})})},Xi={command:`networks`,describe:`Operations for devices.networks`,builder:e=>e.command(Vi).command(Ui).command(Gi).command(qi).command(Yi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zi(e){return e.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 Qi={command:`create`,describe:`Generates an account-wide or device-specific uninstall protection override code.`,builder:Zi,handler:async r=>l({command:`zero-trust devices override-codes create`,classification:{safeFlags:[`scope`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices override-codes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/override_codes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({device_id:m(r[`device-id`],`device-id`,`text`),duration_hours:r[`duration-hours`],scope:m(r.scope,`scope`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`duration-hours`]===void 0)throw Error(`--duration-hours is required (or pass --body with this field set).`);r.scope===void 0&&(r.scope=await _(`scope`,`Whether the code applies to every device in the account or one physical device.`,[`account`,`device`])),r.type===void 0&&(r.type=await _(`type`,`The feature that the override code applies to.`,[`uninstall_protection`]));let u=p({device_id:m(r[`device-id`],`device-id`,`text`),duration_hours:r[`duration-hours`],scope:m(r.scope,`scope`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.overrideCodes.create({...u,account_id:l})),{successLabel:`Created`})})};function $i(e){return e.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 ea={command:`get <registration-id>`,describe:`Fetches one-time use admin override codes for a registration. This relies on the **Admin Override** setting being enabled in your device configuration.`,builder:$i,handler:async r=>l({command:`zero-trust devices override-codes get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices override-codes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/registrations/${r[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(r[`registration-id`]))}/override_codes`,pathParams:{"registration-id":String(r[`registration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.overrideCodes.get({account_id:l,registration_id:r[`registration-id`]})),{successLabel:`Loaded`})})};function ta(e){return e.option(`device-id`,{type:`string`,description:`Registration ID. Equal to Device ID except for accounts which enabled [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const na={command:`list`,describe:`Fetches a one-time use admin override code for a device. This relies on the **Admin Override** setting being enabled in your device configuration. Not supported when [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) is enabled for the account. **Deprecated:** please use GET /accounts/{account_id}/devices/registrations/{registration_id}/override_codes instead.`,builder:ta,handler:async r=>l({command:`zero-trust devices override-codes list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices override-codes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}/override_codes`,pathParams:{"device-id":String(r[`device-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.overrideCodes.list({account_id:l,device_id:r[`device-id`]})),{successLabel:`Loaded`})})},ra={command:`override-codes`,describe:`Operations for devices.override-codes`,builder:e=>e.command(Qi).command(ea).command(na).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ia(e){return e.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 aa={command:`create`,describe:`Create a new device posture integration.`,builder:ia,handler:async r=>l({command:`zero-trust devices posture integrations create`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({config:{api_url:m(r[`config-api-url`],`config-api-url`,`text`),auth_url:m(r[`config-auth-url`],`config-auth-url`,`text`),client_id:m(r[`config-client-id`],`config-client-id`,`text`),client_secret:m(r[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(r[`config-customer-id`],`config-customer-id`,`text`),client_key:m(r[`config-client-key`],`config-client-key`,`text`),access_client_id:m(r[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(r[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...e,account_id:l})),{successLabel:`Created`});return}r.interval===void 0&&(r.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`).")),r.name===void 0&&(r.name=await g(`name`,`The name of the device posture integration.`)),r.type===void 0&&(r.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(r[`config-api-url`],`config-api-url`,`text`),auth_url:m(r[`config-auth-url`],`config-auth-url`,`text`),client_id:m(r[`config-client-id`],`config-client-id`,`text`),client_secret:m(r[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(r[`config-customer-id`],`config-customer-id`,`text`),client_key:m(r[`config-client-key`],`config-client-key`,`text`),access_client_id:m(r[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(r[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.integrations.create({...u,account_id:l})),{successLabel:`Created`})})};function oa(e){return e.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 sa={command:`delete <integration-id>`,describe:`Delete a configured device posture integration.`,builder:oa,handler:async r=>l({command:`zero-trust devices posture integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/integration/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
23
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.posture.integrations.delete({account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Deleted`})})};function ca(e){return e.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 la={command:`get <integration-id>`,describe:`Fetches details for a single device posture integration.`,builder:ca,handler:async r=>l({command:`zero-trust devices posture integrations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/integration/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.get({account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Loaded`})})};function ua(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const da={command:`list`,describe:`Fetches the list of device posture integrations for an account.`,builder:ua,handler:async r=>l({command:`zero-trust devices posture integrations list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.integrations.list({account_id:l})),{successLabel:`Loaded`})})};function fa(e){return e.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 pa={command:`update <integration-id>`,describe:`Updates a configured device posture integration.`,builder:fa,handler:async r=>l({command:`zero-trust devices posture integrations update`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/integration/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({config:{api_url:m(r[`config-api-url`],`config-api-url`,`text`),auth_url:m(r[`config-auth-url`],`config-auth-url`,`text`),client_id:m(r[`config-client-id`],`config-client-id`,`text`),client_secret:m(r[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(r[`config-customer-id`],`config-customer-id`,`text`),client_key:m(r[`config-client-key`],`config-client-key`,`text`),access_client_id:m(r[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(r[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...e,account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Updated`});return}let u=p({config:{api_url:m(r[`config-api-url`],`config-api-url`,`text`),auth_url:m(r[`config-auth-url`],`config-auth-url`,`text`),client_id:m(r[`config-client-id`],`config-client-id`,`text`),client_secret:m(r[`config-client-secret`],`config-client-secret`,`text`),customer_id:m(r[`config-customer-id`],`config-customer-id`,`text`),client_key:m(r[`config-client-key`],`config-client-key`,`text`),access_client_id:m(r[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:m(r[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.integrations.update({...u,account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Updated`})})},ma={command:`integrations`,describe:`Operations for devices.posture.integrations`,builder:e=>e.command(aa).command(sa).command(la).command(da).command(pa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ha(e){return e.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 ga={command:`create`,describe:`Creates a new device posture rule.`,builder:ha,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),expiration:m(r.expiration,`expiration`,`text`),input:{exists:r[`input-exists`],operating_system:m(r[`input-operating-system`],`input-operating-system`,`text`),path:m(r[`input-path`],`input-path`,`text`),sha256:m(r[`input-sha256`],`input-sha256`,`text`),thumbprint:m(r[`input-thumbprint`],`input-thumbprint`,`text`),id:m(r[`input-id`],`input-id`,`text`),domain:m(r[`input-domain`],`input-domain`,`text`),operator:m(r[`input-operator`],`input-operator`,`text`),os_distro_name:m(r[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(r[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(r[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(r[`input-version`],`input-version`,`text`),enabled:r[`input-enabled`],checkDisks:r[`input-check-disks`],requireAll:r[`input-require-all`],certificate_id:m(r[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(r[`input-cn`],`input-cn`,`text`),check_private_key:r[`input-check-private-key`],extended_key_usage:r[`input-extended-key-usage`],locations:{paths:r[`input-locations-paths`],trust_stores:r[`input-locations-trust-stores`]},subject_alternative_names:r[`input-subject-alternative-names`],update_window_days:r[`input-update-window-days`],compliance_status:m(r[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(r[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(r[`input-last-seen`],`input-last-seen`,`text`),os:m(r[`input-os`],`input-os`,`text`),overall:m(r[`input-overall`],`input-overall`,`text`),sensor_config:m(r[`input-sensor-config`],`input-sensor-config`,`text`),state:m(r[`input-state`],`input-state`,`text`),versionOperator:m(r[`input-version-operator`],`input-version-operator`,`text`),auth_state:r[`input-auth-state`],countOperator:m(r[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(r[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(r[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(r[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(r[`input-score-operator`],`input-score-operator`,`text`),total_score:r[`input-total-score`],active_threats:r[`input-active-threats`],infected:r[`input-infected`],is_active:r[`input-is-active`],network_status:m(r[`input-network-status`],`input-network-status`,`text`),operational_state:m(r[`input-operational-state`],`input-operational-state`,`text`),score:r[`input-score`]},match:f(r.match,`match`),name:m(r.name,`name`,`text`),schedule:m(r.schedule,`schedule`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name of the device posture rule.`)),r.type===void 0&&(r.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(r.description,`description`,`text`),expiration:m(r.expiration,`expiration`,`text`),input:{exists:r[`input-exists`],operating_system:m(r[`input-operating-system`],`input-operating-system`,`text`),path:m(r[`input-path`],`input-path`,`text`),sha256:m(r[`input-sha256`],`input-sha256`,`text`),thumbprint:m(r[`input-thumbprint`],`input-thumbprint`,`text`),id:m(r[`input-id`],`input-id`,`text`),domain:m(r[`input-domain`],`input-domain`,`text`),operator:m(r[`input-operator`],`input-operator`,`text`),os_distro_name:m(r[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(r[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(r[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(r[`input-version`],`input-version`,`text`),enabled:r[`input-enabled`],checkDisks:r[`input-check-disks`],requireAll:r[`input-require-all`],certificate_id:m(r[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(r[`input-cn`],`input-cn`,`text`),check_private_key:r[`input-check-private-key`],extended_key_usage:r[`input-extended-key-usage`],locations:{paths:r[`input-locations-paths`],trust_stores:r[`input-locations-trust-stores`]},subject_alternative_names:r[`input-subject-alternative-names`],update_window_days:r[`input-update-window-days`],compliance_status:m(r[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(r[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(r[`input-last-seen`],`input-last-seen`,`text`),os:m(r[`input-os`],`input-os`,`text`),overall:m(r[`input-overall`],`input-overall`,`text`),sensor_config:m(r[`input-sensor-config`],`input-sensor-config`,`text`),state:m(r[`input-state`],`input-state`,`text`),versionOperator:m(r[`input-version-operator`],`input-version-operator`,`text`),auth_state:r[`input-auth-state`],countOperator:m(r[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(r[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(r[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(r[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(r[`input-score-operator`],`input-score-operator`,`text`),total_score:r[`input-total-score`],active_threats:r[`input-active-threats`],infected:r[`input-infected`],is_active:r[`input-is-active`],network_status:m(r[`input-network-status`],`input-network-status`,`text`),operational_state:m(r[`input-operational-state`],`input-operational-state`,`text`),score:r[`input-score`]},match:f(r.match,`match`),name:m(r.name,`name`,`text`),schedule:m(r.schedule,`schedule`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.posture.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function _a(e){return e.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 va={command:`delete <rule-id>`,describe:`Deletes a device posture rule.`,builder:_a,handler:async r=>l({command:`zero-trust devices posture rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
24
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.posture.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function ya(e){return e.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 ba={command:`get <rule-id>`,describe:`Fetches a single device posture rule.`,builder:ya,handler:async r=>l({command:`zero-trust devices posture rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function xa(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sa={command:`list`,describe:`Fetches device posture rules for a Zero Trust account.`,builder:xa,handler:async r=>l({command:`zero-trust devices posture rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.posture.rules.list({account_id:l})),{successLabel:`Loaded`})})};function Ca(e){return e.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 wa={command:`update <rule-id>`,describe:`Updates a device posture rule.`,builder:Ca,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices posture rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/posture/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),expiration:m(r.expiration,`expiration`,`text`),input:{exists:r[`input-exists`],operating_system:m(r[`input-operating-system`],`input-operating-system`,`text`),path:m(r[`input-path`],`input-path`,`text`),sha256:m(r[`input-sha256`],`input-sha256`,`text`),thumbprint:m(r[`input-thumbprint`],`input-thumbprint`,`text`),id:m(r[`input-id`],`input-id`,`text`),domain:m(r[`input-domain`],`input-domain`,`text`),operator:m(r[`input-operator`],`input-operator`,`text`),os_distro_name:m(r[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(r[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(r[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(r[`input-version`],`input-version`,`text`),enabled:r[`input-enabled`],checkDisks:r[`input-check-disks`],requireAll:r[`input-require-all`],certificate_id:m(r[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(r[`input-cn`],`input-cn`,`text`),check_private_key:r[`input-check-private-key`],extended_key_usage:r[`input-extended-key-usage`],locations:{paths:r[`input-locations-paths`],trust_stores:r[`input-locations-trust-stores`]},subject_alternative_names:r[`input-subject-alternative-names`],update_window_days:r[`input-update-window-days`],compliance_status:m(r[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(r[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(r[`input-last-seen`],`input-last-seen`,`text`),os:m(r[`input-os`],`input-os`,`text`),overall:m(r[`input-overall`],`input-overall`,`text`),sensor_config:m(r[`input-sensor-config`],`input-sensor-config`,`text`),state:m(r[`input-state`],`input-state`,`text`),versionOperator:m(r[`input-version-operator`],`input-version-operator`,`text`),auth_state:r[`input-auth-state`],countOperator:m(r[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(r[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(r[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(r[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(r[`input-score-operator`],`input-score-operator`,`text`),total_score:r[`input-total-score`],active_threats:r[`input-active-threats`],infected:r[`input-infected`],is_active:r[`input-is-active`],network_status:m(r[`input-network-status`],`input-network-status`,`text`),operational_state:m(r[`input-operational-state`],`input-operational-state`,`text`),score:r[`input-score`]},match:f(r.match,`match`),name:m(r.name,`name`,`text`),schedule:m(r.schedule,`schedule`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await g(`name`,`The name of the device posture rule.`)),r.type===void 0&&(r.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(r.description,`description`,`text`),expiration:m(r.expiration,`expiration`,`text`),input:{exists:r[`input-exists`],operating_system:m(r[`input-operating-system`],`input-operating-system`,`text`),path:m(r[`input-path`],`input-path`,`text`),sha256:m(r[`input-sha256`],`input-sha256`,`text`),thumbprint:m(r[`input-thumbprint`],`input-thumbprint`,`text`),id:m(r[`input-id`],`input-id`,`text`),domain:m(r[`input-domain`],`input-domain`,`text`),operator:m(r[`input-operator`],`input-operator`,`text`),os_distro_name:m(r[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:m(r[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:m(r[`input-os-version-extra`],`input-os-version-extra`,`text`),version:m(r[`input-version`],`input-version`,`text`),enabled:r[`input-enabled`],checkDisks:r[`input-check-disks`],requireAll:r[`input-require-all`],certificate_id:m(r[`input-certificate-id`],`input-certificate-id`,`text`),cn:m(r[`input-cn`],`input-cn`,`text`),check_private_key:r[`input-check-private-key`],extended_key_usage:r[`input-extended-key-usage`],locations:{paths:r[`input-locations-paths`],trust_stores:r[`input-locations-trust-stores`]},subject_alternative_names:r[`input-subject-alternative-names`],update_window_days:r[`input-update-window-days`],compliance_status:m(r[`input-compliance-status`],`input-compliance-status`,`text`),connection_id:m(r[`input-connection-id`],`input-connection-id`,`text`),last_seen:m(r[`input-last-seen`],`input-last-seen`,`text`),os:m(r[`input-os`],`input-os`,`text`),overall:m(r[`input-overall`],`input-overall`,`text`),sensor_config:m(r[`input-sensor-config`],`input-sensor-config`,`text`),state:m(r[`input-state`],`input-state`,`text`),versionOperator:m(r[`input-version-operator`],`input-version-operator`,`text`),auth_state:r[`input-auth-state`],countOperator:m(r[`input-count-operator`],`input-count-operator`,`text`),issue_count:m(r[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:m(r[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:m(r[`input-risk-level`],`input-risk-level`,`text`),scoreOperator:m(r[`input-score-operator`],`input-score-operator`,`text`),total_score:r[`input-total-score`],active_threats:r[`input-active-threats`],infected:r[`input-infected`],is_active:r[`input-is-active`],network_status:m(r[`input-network-status`],`input-network-status`,`text`),operational_state:m(r[`input-operational-state`],`input-operational-state`,`text`),score:r[`input-score`]},match:f(r.match,`match`),name:m(r.name,`name`,`text`),schedule:m(r.schedule,`schedule`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.devices.posture.rules.update({...u,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},Ta={command:`rules`,describe:`Operations for devices.posture.rules`,builder:e=>e.command(ga).command(va).command(ba).command(Sa).command(wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ea={command:`posture`,describe:`Operations for devices.posture`,builder:e=>e.command(ma).command(Ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Da(e){return e.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 Oa={command:`create`,describe:`Creates a device settings profile to be applied to certain devices matching the criteria.`,builder:Da,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({allow_mode_switch:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],browser_extension_config:{proxy_control:m(r[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:r[`browser-extension-config-proxy-enabled`]},captive_portal:r[`captive-portal`],default:r.default,disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),enabled:r.enabled,exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,profile_type:m(r[`profile-type`],`profile-type`,`text`),register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.profiles.custom.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name of the device settings profile.`));let u=p({allow_mode_switch:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],browser_extension_config:{proxy_control:m(r[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:r[`browser-extension-config-proxy-enabled`]},captive_portal:r[`captive-portal`],default:r.default,disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),enabled:r.enabled,exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,profile_type:m(r[`profile-type`],`profile-type`,`text`),register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`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 ka(e){return e.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 Aa={command:`delete <policy-id>`,describe:`Deletes a device settings profile and fetches a list of the remaining profiles for an account.`,builder:ka,handler:async r=>l({command:`zero-trust devices profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
25
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.profiles.custom.delete({account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Deleted`})})};function ja(e){return e.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 Ma={command:`get <policy-id>`,describe:`Fetches a device settings profile by ID.`,builder:ja,handler:async r=>l({command:`zero-trust devices profiles custom get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.profiles.custom.get({account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Loaded`})})};function Na(e){return e.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 Pa={command:`list`,describe:`Fetches a list of the device settings profiles for an account.`,builder:y(Na),handler:async r=>l({command:`zero-trust devices profiles custom list`,classification:{safeFlags:[`profile-type`,`dry-run`]}},r,async()=>{let i={profile_type:r[`profile-type`]};if(r.dryRun){s({command:`cf zero-trust devices profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.profiles.custom.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Fa(e){return e.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 Ia={command:`update <policy-id>`,describe:`Updates a configured device settings profile.`,builder:Fa,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles custom update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy/${r[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(r[`policy-id`]))}`,pathParams:{"policy-id":String(r[`policy-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({allow_mode_switch:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],browser_extension_config:{proxy_control:m(r[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:r[`browser-extension-config-proxy-enabled`]},captive_portal:r[`captive-portal`],default:r.default,description:m(r.description,`description`,`text`),disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),enabled:r.enabled,exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...e,account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Updated`});return}let u=p({allow_mode_switch:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],browser_extension_config:{proxy_control:m(r[`browser-extension-config-proxy-control`],`browser-extension-config-proxy-control`,`text`),proxy_enabled:r[`browser-extension-config-proxy-enabled`]},captive_portal:r[`captive-portal`],default:r.default,description:m(r.description,`description`,`text`),disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),enabled:r.enabled,exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`virtual-networks-default`],`virtual-networks-default`,`text`)}});o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.custom.update({...u,account_id:l,policy_id:r[`policy-id`]})),{successLabel:`Updated`})})},La={command:`custom`,describe:`Operations for devices.profiles.custom`,builder:e=>e.command(Oa).command(Aa).command(Ma).command(Pa).command(Ia).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ra(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const za={command:`get`,describe:`Fetches the default device settings profile for an account.`,builder:Ra,handler:async r=>l({command:`zero-trust devices profiles default get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.profiles.default.get({account_id:l})),{successLabel:`Loaded`})})};function Ba(e){return e.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 Va={command:`update`,describe:`Updates the default device settings profile for an account.`,builder:Ba,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices profiles default update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({allow_mode_switch:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],captive_portal:r[`captive-portal`],disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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:r[`allow-mode-switch`],allow_updates:r[`allow-updates`],allowed_to_leave:r[`allowed-to-leave`],auto_connect:r[`auto-connect`],captive_portal:r[`captive-portal`],disable_auto_fallback:r[`disable-auto-fallback`],dns_search_suffixes:f(r[`dns-search-suffixes`],`dns-search-suffixes`),exclude:f(r.exclude,`exclude`),exclude_office_ips:r[`exclude-office-ips`],global_acceleration:{api_endpoints:r[`global-acceleration-api-endpoints`],autoswitch:r[`global-acceleration-autoswitch`],enabled:r[`global-acceleration-enabled`],masque_endpoints:r[`global-acceleration-masque-endpoints`],wireguard_endpoints:r[`global-acceleration-wireguard-endpoints`]},include:f(r.include,`include`),lan_allow_minutes:r[`lan-allow-minutes`],lan_allow_subnet_size:r[`lan-allow-subnet-size`],register_interface_ip_with_dns:r[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:r[`sccm-vpn-boundary-support`],service_mode_v2:{mode:m(r[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:r[`service-mode-v2-port`]},support_url:m(r[`support-url`],`support-url`,`text`),switch_locked:r[`switch-locked`],tunnel_protocol:m(r[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:r[`uninstall-protection`],virtual_networks:{allowed:r[`virtual-networks-allowed`],default:m(r[`virtual-networks-default`],`virtual-networks-default`,`text`)}});o(await c(`Updating`,async()=>i.zeroTrust.devices.profiles.default.update({...u,account_id:l})),{successLabel:`Updated`})})},Ha={command:`default`,describe:`Operations for devices.profiles.default`,builder:e=>e.command(za).command(Va).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ua={command:`profiles`,describe:`Operations for devices.profiles`,builder:e=>e.command(La).command(Ha).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wa(e){return e.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 Ga={command:`bulk-delete`,describe:`Deletes a list of WARP registrations.`,builder:Wa,handler:async r=>l({command:`zero-trust devices registrations bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{let i={id:r.id};if(r.dryRun){s({command:`cf zero-trust devices registrations bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,!await v({force:!!r.force})){process.stderr.write(`Aborted.
26
- `);return}o(await c(`Deleting`,async()=>l.zeroTrust.devices.registrations.bulkDelete({account_id:u,...i})),{successLabel:`Deleted`})})};function Ka(e){return e.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 qa={command:`delete <registration-id>`,describe:`Deletes a WARP registration.`,builder:Ka,handler:async r=>l({command:`zero-trust devices registrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices registrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/registrations/${r[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(r[`registration-id`]))}`,pathParams:{"registration-id":String(r[`registration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
27
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.registrations.delete({account_id:l,registration_id:r[`registration-id`]})),{successLabel:`Deleted`})})};function Ja(e){return e.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 Ya={command:`get <registration-id>`,describe:`Fetches a single WARP registration.`,builder:Ja,handler:async r=>l({command:`zero-trust devices registrations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={include:r.include};if(r.dryRun){s({command:`cf zero-trust devices registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/registrations/${r[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(r[`registration-id`]))}`,pathParams:{"registration-id":String(r[`registration-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.registrations.get({account_id:u,registration_id:r[`registration-id`],...i})),{successLabel:`Loaded`})})};function Xa(e){return e.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 Za={command:`list`,describe:`Lists WARP registrations.`,builder:y(Xa),handler:async r=>l({command:`zero-trust devices registrations list`,classification:{safeFlags:[`status`,`registration-type`,`sort-by`,`sort-order`,`dry-run`]}},r,async()=>{let i={"user.id":r[`user-id`],seen_after:r[`seen-after`],seen_before:r[`seen-before`],status:r.status,registration_type:r[`registration-type`],per_page:r[`per-page`],search:r.search,sort_by:r[`sort-by`],sort_order:r[`sort-order`],cursor:r.cursor,id:r.id,"device.id":r[`device-id`],"policy.id":r[`policy-id`],include:r.include};if(r.dryRun){s({command:`cf zero-trust devices registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/registrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.devices.registrations.list({account_id:u,...i})),{successLabel:`Loaded`})})},Qa={command:`registrations`,describe:`Operations for devices.registrations`,builder:e=>e.command(Ga).command(qa).command(Ya).command(Za).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eo={command:`get-global-disconnect`,describe:`Fetch the Global WARP disconnect state.`,builder:$a,handler:async r=>l({command:`zero-trust devices resilience get-global-disconnect`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices resilience get-global-disconnect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.resilience.getGlobalDisconnect({account_id:l})),{successLabel:`Loaded`})})};function to(e){return e.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 no={command:`set-global-disconnect`,describe:`Sets the Global WARP disconnect state.`,builder:to,handler:async r=>l({command:`zero-trust devices resilience set-global-disconnect`,classification:{safeFlags:[`disconnect`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices resilience set-global-disconnect`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({disconnect:r.disconnect,justification:m(r.justification,`justification`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.devices.resilience.setGlobalDisconnect({...e,account_id:l})),{successLabel:`Created`});return}if(r.disconnect===void 0)throw Error(`--disconnect is required (or pass --body with this field set).`);let u=p({disconnect:r.disconnect,justification:m(r.justification,`justification`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.devices.resilience.setGlobalDisconnect({...u,account_id:l})),{successLabel:`Created`})})},ro={command:`resilience`,describe:`Operations for devices.resilience`,builder:e=>e.command(eo).command(no).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function io(e){return e.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 ao={command:`delete`,describe:`Resets the current device settings for a Zero Trust account.`,builder:io,handler:async r=>l({command:`zero-trust devices settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
28
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.devices.settings.delete({account_id:l})),{successLabel:`Deleted`})})};function oo(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const so={command:`get`,describe:`Describes the current device settings for a Zero Trust account.`,builder:oo,handler:async r=>l({command:`zero-trust devices settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.devices.settings.get({account_id:l})),{successLabel:`Loaded`})})};function co(e){return e.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 lo={command:`update`,describe:`Updates the device settings for a Zero Trust account.`,builder:co,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({disable_for_time:r[`disable-for-time`],external_emergency_signal_enabled:r[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:m(r[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:m(r[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:m(r[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:r[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:r[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:r[`root-certificate-installation-enabled`],use_zt_virtual_ip:r[`use-zt-virtual-ip`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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:r[`disable-for-time`],external_emergency_signal_enabled:r[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:m(r[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:m(r[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:m(r[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:r[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:r[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:r[`root-certificate-installation-enabled`],use_zt_virtual_ip:r[`use-zt-virtual-ip`]});o(await c(`Updating`,async()=>i.zeroTrust.devices.settings.update({body:u,account_id:l})),{successLabel:`Updated`})})},uo={command:`settings`,describe:`Operations for devices.settings`,builder:e=>e.command(ao).command(so).command(lo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fo(e){return e.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 po={command:`update <device-id>`,describe:`Updates properties of a WARP device.`,builder:fo,handler:async r=>l({command:`zero-trust devices update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust devices update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/devices/physical-devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}`,pathParams:{"device-id":String(r[`device-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.devices.update({...e,account_id:l,device_id:r[`device-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i.zeroTrust.devices.update({account_id:l,device_id:r[`device-id`]})),{successLabel:`Updated`})})},mo={command:`devices`,describe:`Operations for devices`,builder:e=>e.command(pi).command(Ei).command(zi).command(po).command(di).command(wi).command(Li).command(Xi).command(ra).command(Ea).command(Ua).command(Qa).command(ro).command(uo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ho(e){return e.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 go={command:`list`,describe:`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.`,builder:y(ho),handler:async r=>l({command:`zero-trust dex colos list`,classification:{safeFlags:[`sort-by`,`dry-run`]}},r,async()=>{let i={from:r.from,to:r.to,sortBy:r[`sort-by`]};if(r.dryRun){s({command:`cf zero-trust dex colos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/colos`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.colos.list({account_id:u,...i})),{successLabel:`Loaded`})})},_o={command:`colos`,describe:`Operations for dex.colos`,builder:e=>e.command(go).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vo(e){return e.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 yo={command:`create`,describe:`Initiate commands for up to 10 devices per account.`,builder:vo,handler:async r=>l({command:`zero-trust dex commands create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex commands create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/commands`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({commands:f(r.commands,`commands`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.commands===void 0)throw Error(`--commands is required (or pass --body with this field set).`);let u=p({commands:f(r.commands,`commands`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...u,account_id:l})),{successLabel:`Created`})})};function bo(e){return e.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 xo={command:`list`,describe:`List devices with WARP client support for remote captures which have been connected in the last 1 hour.`,builder:bo,handler:async r=>l({command:`zero-trust dex commands eligible-devices list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],search:r.search};if(r.dryRun){s({command:`cf zero-trust dex commands eligible-devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/commands/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.eligibleDevices.list({account_id:u,...i})),{successLabel:`Loaded`})})},So={command:`eligible-devices`,describe:`Operations for dex.commands.eligible-devices`,builder:e=>e.command(xo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Co(e){return e.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 wo={command:`list`,describe:`Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters`,builder:y(Co),handler:async r=>l({command:`zero-trust dex commands list`,classification:{safeFlags:[`command-type`,`status`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],from:r.from,to:r.to,device_id:r[`device-id`],user_email:r[`user-email`],command_type:r[`command-type`],status:r.status};if(r.dryRun){s({command:`cf zero-trust dex commands list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/commands`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.list({account_id:u,...i})),{successLabel:`Loaded`})})};function To(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Eo={command:`get`,describe:`Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset`,builder:To,handler:async r=>l({command:`zero-trust dex commands quota get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex commands quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/commands/quota`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.commands.quota.get({account_id:l})),{successLabel:`Loaded`})})},Do={command:`quota`,describe:`Operations for dex.commands.quota`,builder:e=>e.command(Eo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oo(e){return e.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 ko={command:`get <filename>`,describe:`Downloads artifacts for an executed command. Bulk downloads are not supported`,builder:Oo,handler:async r=>l({command:`zero-trust dex commands results get`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex commands results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/commands/${r[`command-id`]==null?`<command-id>`:encodeURIComponent(String(r[`command-id`]))}/downloads/${r.filename==null?`<filename>`:encodeURIComponent(String(r.filename))}`,pathParams:{"command-id":String(r[`command-id`]??``),filename:String(r.filename??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>te(`/accounts/${i}/dex/commands/${encodeURIComponent(String(r[`command-id`]))}/downloads/${encodeURIComponent(String(r.filename))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?o.toString(`utf-8`):o)})},Ao={command:`results`,describe:`Operations for dex.commands.results`,builder:e=>e.command(ko).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jo={command:`commands`,describe:`Operations for dex.commands`,builder:e=>e.command(yo).command(wo).command(So).command(Do).command(Ao).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mo(e){return e.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 No={command:`get`,describe:`Get details for live (up to 60 minutes) devices using WARP.`,builder:Mo,handler:async r=>l({command:`zero-trust dex devices aggregates live get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={since_minutes:r[`since-minutes`]};if(r.dryRun){s({command:`cf zero-trust dex devices aggregates live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/fleet-status/live`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.live.get({account_id:u,...i})),{successLabel:`Loaded`})})},Po={command:`live`,describe:`Operations for dex.devices.aggregates.live`,builder:e=>e.command(No).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fo(e){return e.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 Io={command:`get`,describe:`Get aggregate details for devices using WARP, up to 7 days.`,builder:Fo,handler:async r=>l({command:`zero-trust dex devices aggregates over-time get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={to:r.to,from:r.from,colo:r.colo,device_id:r[`device-id`]};if(r.dryRun){s({command:`cf zero-trust dex devices aggregates over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/fleet-status/over-time`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.overTime.get({account_id:u,...i})),{successLabel:`Loaded`})})},Lo={command:`over-time`,describe:`Operations for dex.devices.aggregates.over-time`,builder:e=>e.command(Io).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ro={command:`aggregates`,describe:`Operations for dex.devices.aggregates`,builder:e=>e.command(Po).command(Lo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function zo(e){return e.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 Bo={command:`get <device-id>`,describe:`Get the latest status of a device given device_id from the device_state table.`,builder:zo,handler:async r=>l({command:`zero-trust dex devices get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={since_minutes:r[`since-minutes`],time_now:r[`time-now`],colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}/fleet-status/live`,pathParams:{"device-id":String(r[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.get({account_id:u,device_id:r[`device-id`],...i})),{successLabel:`Loaded`})})};function Vo(e){return e.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 Ho={command:`list`,describe:`List details of devices using WARP.`,builder:y(Vo),handler:async r=>l({command:`zero-trust dex devices list`,classification:{safeFlags:[`sort-by`,`source`,`dry-run`]}},r,async()=>{let i={to:r.to,from:r.from,page:r.page,per_page:r[`per-page`],sort_by:r[`sort-by`],colo:r.colo,device_id:r[`device-id`],status:r.status,platform:r.platform,version:r.version,source:r.source};if(r.dryRun){s({command:`cf zero-trust dex devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/fleet-status/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Uo(e){return e.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 Wo={command:`get <device-id>`,describe:`Get time-bucketed status metrics for a specific device.`,builder:y(Uo),handler:async r=>l({command:`zero-trust dex devices over-time get`,classification:{safeFlags:[`interval`,`dry-run`]}},r,async()=>{let i={from:r.from,to:r.to,interval:r.interval,colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex devices over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}/fleet-status/over-time`,pathParams:{"device-id":String(r[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.overTime.get({account_id:u,device_id:r[`device-id`],...i})),{successLabel:`Loaded`})})},Go={command:`over-time`,describe:`Operations for dex.devices.over-time`,builder:e=>e.command(Wo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ko={command:`devices`,describe:`Operations for dex.devices`,builder:e=>e.command(Bo).command(Ho).command(Ro).command(Go).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qo(e){return e.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 Jo={command:`list`,describe:`List ISP information observed for a specific device during traceroute tests.`,builder:y(qo),handler:async r=>l({command:`zero-trust dex isps list`,classification:{safeFlags:[`sort-by`,`sort-order`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],cursor:r.cursor,sort_by:r[`sort-by`],sort_order:r[`sort-order`],from:r.from,to:r.to};if(r.dryRun){s({command:`cf zero-trust dex isps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/${r[`device-id`]==null?`<device-id>`:encodeURIComponent(String(r[`device-id`]))}/isps`,pathParams:{"device-id":String(r[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.isps.list({account_id:u,device_id:r[`device-id`],...i})),{successLabel:`Loaded`})})},Yo={command:`isps`,describe:`Operations for dex.isps`,builder:e=>e.command(Jo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xo(e){return e.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 Zo={command:`list`,describe:`List DEX tests with overview metrics.`,builder:y(Xo),handler:async r=>l({command:`zero-trust dex overview tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},r,async()=>{let i={colo:r.colo,testName:r[`test-name`],deviceId:r[`device-id`],registration_id:r[`registration-id`],page:r.page,per_page:r[`per-page`],kind:r.kind};if(r.dryRun){s({command:`cf zero-trust dex overview tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/tests/overview`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Qo(e){return e.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 $o={command:`get`,describe:`Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days.`,builder:Qo,handler:async r=>l({command:`zero-trust dex overview tests unique-devices get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={testName:r[`test-name`],deviceId:r[`device-id`]};if(r.dryRun){s({command:`cf zero-trust dex overview tests unique-devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/tests/unique-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.uniqueDevices.get({account_id:u,...i})),{successLabel:`Loaded`})})},es={command:`unique-devices`,describe:`Operations for dex.overview.tests.unique-devices`,builder:e=>e.command($o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ts={command:`tests`,describe:`Operations for dex.overview.tests`,builder:e=>e.command(Zo).command(es).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ns={command:`overview`,describe:`Operations for dex.overview`,builder:e=>e.command(ts).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rs(e){return e.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 is={command:`create`,describe:`Create a DEX Rule.`,builder:rs,handler:async r=>l({command:`zero-trust dex rules create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r.match===void 0&&(r.match=await g(`match`,`The wirefilter expression to match.`)),r.name===void 0&&(r.name=await g(`name`,`The name of the Rule.`));let u=p({description:m(r.description,`description`,`text`),match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function as(e){return e.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 os={command:`delete <rule-id>`,describe:`Delete a DEX Rule.`,builder:as,handler:async r=>l({command:`zero-trust dex rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
29
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function ss(e){return e.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 cs={command:`get <rule-id>`,describe:`Get details for a DEX Rule.`,builder:ss,handler:async r=>l({command:`zero-trust dex rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function ls(e){return e.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 us={command:`list`,describe:`List DEX Rules.`,builder:y(ls),handler:async r=>l({command:`zero-trust dex rules list`,classification:{safeFlags:[`sort-order`,`sort-by`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],sort_order:r[`sort-order`],sort_by:r[`sort-by`],name:r.name};if(r.dryRun){s({command:`cf zero-trust dex rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ds(e){return e.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 fs={command:`update <rule-id>`,describe:`Update a DEX Rule.`,builder:ds,handler:async r=>l({command:`zero-trust dex rules update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),match:m(r.match,`match`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...u,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},ps={command:`rules`,describe:`Operations for dex.rules`,builder:e=>e.command(is).command(os).command(cs).command(us).command(fs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ms(e){return e.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 hs={command:`get <test-id>`,describe:`Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.`,builder:y(ms),handler:async r=>l({command:`zero-trust dex test-results http get`,classification:{safeFlags:[`interval`,`dry-run`]}},r,async()=>{let i={deviceId:r[`device-id`],from:r.from,to:r.to,interval:r.interval,colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex test-results http get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/http-tests/${r[`test-id`]==null?`<test-id>`:encodeURIComponent(String(r[`test-id`]))}`,pathParams:{"test-id":String(r[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.get({account_id:u,test_id:r[`test-id`],...i})),{successLabel:`Loaded`})})};function gs(e){return e.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 _s={command:`get <test-id>`,describe:`Get percentiles for an http test for a given time period between 1 hour and 7 days.`,builder:gs,handler:async r=>l({command:`zero-trust dex test-results http percentiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={deviceId:r[`device-id`],from:r.from,to:r.to,colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex test-results http percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/http-tests/${r[`test-id`]==null?`<test-id>`:encodeURIComponent(String(r[`test-id`]))}/percentiles`,pathParams:{"test-id":String(r[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.percentiles.get({account_id:u,test_id:r[`test-id`],...i})),{successLabel:`Loaded`})})},vs={command:`percentiles`,describe:`Operations for dex.test-results.http.percentiles`,builder:e=>e.command(_s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ys={command:`http`,describe:`Operations for dex.test-results.http`,builder:e=>e.command(hs).command(vs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bs(e){return e.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 xs={command:`get <test-id>`,describe:`Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days.`,builder:y(bs),handler:async r=>l({command:`zero-trust dex test-results traceroute get`,classification:{safeFlags:[`interval`,`dry-run`]}},r,async()=>{let i={deviceId:r[`device-id`],from:r.from,to:r.to,interval:r.interval,colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex test-results traceroute get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/traceroute-tests/${r[`test-id`]==null?`<test-id>`:encodeURIComponent(String(r[`test-id`]))}`,pathParams:{"test-id":String(r[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.get({account_id:u,test_id:r[`test-id`],...i})),{successLabel:`Loaded`})})};function Ss(e){return e.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 Cs={command:`get <test-result-id>`,describe:`Get a breakdown of hops and performance metrics for a specific traceroute test run`,builder:Ss,handler:async r=>l({command:`zero-trust dex test-results traceroute network-path get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex test-results traceroute network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/traceroute-test-results/${r[`test-result-id`]==null?`<test-result-id>`:encodeURIComponent(String(r[`test-result-id`]))}/network-path`,pathParams:{"test-result-id":String(r[`test-result-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.testResults.traceroute.networkPath.get({account_id:l,test_result_id:r[`test-result-id`]})),{successLabel:`Loaded`})})},ws={command:`network-path`,describe:`Operations for dex.test-results.traceroute.network-path`,builder:e=>e.command(Cs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ts(e){return e.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 Es={command:`get <test-id>`,describe:`Get percentiles for a traceroute test for a given time period between 1 hour and 7 days.`,builder:Ts,handler:async r=>l({command:`zero-trust dex test-results traceroute percentiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={deviceId:r[`device-id`],from:r.from,to:r.to,colo:r.colo};if(r.dryRun){s({command:`cf zero-trust dex test-results traceroute percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/traceroute-tests/${r[`test-id`]==null?`<test-id>`:encodeURIComponent(String(r[`test-id`]))}/percentiles`,pathParams:{"test-id":String(r[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.percentiles.get({account_id:u,test_id:r[`test-id`],...i})),{successLabel:`Loaded`})})},Ds={command:`percentiles`,describe:`Operations for dex.test-results.traceroute.percentiles`,builder:e=>e.command(Es).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Os={command:`traceroute`,describe:`Operations for dex.test-results.traceroute`,builder:e=>e.command(xs).command(ws).command(Ds).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ks={command:`test-results`,describe:`Operations for dex.test-results`,builder:e=>e.command(ys).command(Os).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function As(e){return e.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 js={command:`create`,describe:`Create a DEX test.`,builder:As,handler:async r=>l({command:`zero-trust dex tests create`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({data:{host:m(r[`data-host`],`data-host`,`text`),kind:m(r[`data-kind`],`data-kind`,`text`),method:m(r[`data-method`],`data-method`,`text`)},description:m(r.description,`description`,`text`),enabled:r.enabled,interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),targeted:r.targeted}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r[`data-host`]===void 0&&(r[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),r[`data-kind`]===void 0&&(r[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.interval===void 0&&(r.interval=await g(`interval`,`How often the test will run.`)),r.name===void 0&&(r.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(r[`data-host`],`data-host`,`text`),kind:m(r[`data-kind`],`data-kind`,`text`),method:m(r[`data-method`],`data-method`,`text`)},description:m(r.description,`description`,`text`),enabled:r.enabled,interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),targeted:r.targeted});o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:u,account_id:l})),{successLabel:`Created`})})};function Ms(e){return e.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 Ns={command:`delete <dex-test-id>`,describe:`Delete a Device DEX test. Returns the remaining device dex tests for the account.`,builder:Ms,handler:async r=>l({command:`zero-trust dex tests delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/dex_tests/${r[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(r[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(r[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
30
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.tests.delete({account_id:l,dex_test_id:r[`dex-test-id`]})),{successLabel:`Deleted`})})};function Ps(e){return e.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 Fs={command:`get <dex-test-id>`,describe:`Fetch a single DEX test.`,builder:Ps,handler:async r=>l({command:`zero-trust dex tests get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/dex_tests/${r[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(r[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(r[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.tests.get({account_id:l,dex_test_id:r[`dex-test-id`]})),{successLabel:`Loaded`})})};function Is(e){return e.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 Ls={command:`list`,describe:`Fetch all DEX tests.`,builder:y(Is),handler:async r=>l({command:`zero-trust dex tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],testName:r[`test-name`],kind:r.kind};if(r.dryRun){s({command:`cf zero-trust dex tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Rs(e){return e.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 zs={command:`get <test-id>`,describe:`Get a breakdown of metrics by hop for individual traceroute test runs.`,builder:y(Rs),handler:async r=>l({command:`zero-trust dex tests network-path get`,classification:{safeFlags:[`interval`,`dry-run`]}},r,async()=>{let i={deviceId:r[`device-id`],from:r.from,to:r.to,interval:r.interval};if(r.dryRun){s({command:`cf zero-trust dex tests network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/traceroute-tests/${r[`test-id`]==null?`<test-id>`:encodeURIComponent(String(r[`test-id`]))}/network-path`,pathParams:{"test-id":String(r[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.networkPath.get({account_id:u,test_id:r[`test-id`],...i})),{successLabel:`Loaded`})})},Bs={command:`network-path`,describe:`Operations for dex.tests.network-path`,builder:e=>e.command(zs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vs(e){return e.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 Hs={command:`update <dex-test-id>`,describe:`Update a DEX test.`,builder:Vs,handler:async r=>l({command:`zero-trust dex tests update`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dex tests update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/devices/dex_tests/${r[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(r[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(r[`dex-test-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({data:{host:m(r[`data-host`],`data-host`,`text`),kind:m(r[`data-kind`],`data-kind`,`text`),method:m(r[`data-method`],`data-method`,`text`)},description:m(r.description,`description`,`text`),enabled:r.enabled,interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),targeted:r.targeted}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:e,account_id:l,dex_test_id:r[`dex-test-id`]})),{successLabel:`Updated`});return}if(r[`data-host`]===void 0&&(r[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),r[`data-kind`]===void 0&&(r[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.interval===void 0&&(r.interval=await g(`interval`,`How often the test will run.`)),r.name===void 0&&(r.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(r[`data-host`],`data-host`,`text`),kind:m(r[`data-kind`],`data-kind`,`text`),method:m(r[`data-method`],`data-method`,`text`)},description:m(r.description,`description`,`text`),enabled:r.enabled,interval:m(r.interval,`interval`,`text`),name:m(r.name,`name`,`text`),targeted:r.targeted});o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:u,account_id:l,dex_test_id:r[`dex-test-id`]})),{successLabel:`Updated`})})},Us={command:`tests`,describe:`Operations for dex.tests`,builder:e=>e.command(js).command(Ns).command(Fs).command(Ls).command(Hs).command(Bs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ws(e){return e.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 Gs={command:`list`,describe:`List WARP configuration and enablement toggle change events by device.`,builder:y(Ws),handler:async r=>l({command:`zero-trust dex warp-change-events list`,classification:{safeFlags:[`type`,`toggle`,`sort-order`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],from:r.from,to:r.to,type:r.type,toggle:r.toggle,config_name:r[`config-name`],account_name:r[`account-name`],sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf zero-trust dex warp-change-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dex/warp-change-events`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.warpChangeEvents.list({account_id:u,...i})),{successLabel:`Loaded`})})},Ks={command:`warp-change-events`,describe:`Operations for dex.warp-change-events`,builder:e=>e.command(Gs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qs={command:`dex`,describe:`Digital Experience Monitoring — synthetic tests, fleet-wide device metrics, and network path diagnostics`,builder:e=>e.command(_o).command(jo).command(Ko).command(Yo).command(ns).command(ps).command(ks).command(Us).command(Ks).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Js(e){return e.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 Ys={command:`create`,describe:`Creates a DLP custom prompt topic entry.`,builder:Js,handler:async r=>l({command:`zero-trust dlp custom-prompt-topics create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`),topic:m(r.topic,`topic`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`)),r.topic===void 0&&(r.topic=await g(`topic`,`The topic field`));let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`),topic:m(r.topic,`topic`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...u,account_id:l})),{successLabel:`Created`})})};function Xs(e){return e.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 Zs={command:`delete <entry-id>`,describe:`Deletes a DLP custom prompt topic entry.`,builder:Xs,handler:async r=>l({command:`zero-trust dlp custom-prompt-topics delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/custom_prompt_topics/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
31
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.customPromptTopics.delete({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Deleted`})})};function Qs(e){return e.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 $s={command:`get <entry-id>`,describe:`Fetches a DLP custom prompt topic entry by ID.`,builder:Qs,handler:async r=>l({command:`zero-trust dlp custom-prompt-topics get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/custom_prompt_topics/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.get({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Loaded`})})};function ec(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tc={command:`list`,describe:`Lists all DLP custom prompt topic entries in an account.`,builder:ec,handler:async r=>l({command:`zero-trust dlp custom-prompt-topics list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.list({account_id:l})),{successLabel:`Loaded`})})};function nc(e){return e.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 rc={command:`update <entry-id>`,describe:`Updates a DLP custom prompt topic entry.`,builder:nc,handler:async r=>l({command:`zero-trust dlp custom-prompt-topics update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/custom_prompt_topics/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),topic:m(r.topic,`topic`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...e,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`)),r.topic===void 0&&(r.topic=await g(`topic`,`The topic field`));let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),topic:m(r.topic,`topic`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...u,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`})})},ic={command:`custom-prompt-topics`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ys).command(Zs).command($s).command(tc).command(rc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ac(e){return e.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 oc={command:`create`,describe:`Creates a data class for use in DLP profiles.`,builder:ac,handler:async r=>l({command:`zero-trust dlp data-classes create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-classes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),expression:m(r.expression,`expression`,`text`),name:m(r.name,`name`,`text`),sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...e,account_id:l})),{successLabel:`Created`});return}if(r[`data-tags`]===void 0)throw Error(`--data-tags is required (or pass --body with this field set).`);if(r.expression===void 0&&(r.expression=await g(`expression`,`The expression field`)),r.name===void 0&&(r.name=await g(`name`,`The name field`)),r[`sensitivity-levels`]===void 0)throw Error(`--sensitivity-levels is required (or pass --body with this field set).`);let u=p({data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),expression:m(r.expression,`expression`,`text`),name:m(r.name,`name`,`text`),sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...u,account_id:l})),{successLabel:`Created`})})};function sc(e){return e.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 cc={command:`delete <data-class-id>`,describe:`Deletes a data class from the account.`,builder:sc,handler:async r=>l({command:`zero-trust dlp data-classes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-classes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_classes/${r[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(r[`data-class-id`]))}`,pathParams:{"data-class-id":String(r[`data-class-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
32
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataClasses.delete({account_id:l,data_class_id:r[`data-class-id`]})),{successLabel:`Deleted`})})};function lc(e){return e.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 uc={command:`get <data-class-id>`,describe:`Gets the configuration for a data class.`,builder:lc,handler:async r=>l({command:`zero-trust dlp data-classes get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-classes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_classes/${r[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(r[`data-class-id`]))}`,pathParams:{"data-class-id":String(r[`data-class-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.get({account_id:l,data_class_id:r[`data-class-id`]})),{successLabel:`Loaded`})})};function dc(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fc={command:`list`,describe:`Lists data classes configured for the account.`,builder:dc,handler:async r=>l({command:`zero-trust dlp data-classes list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-classes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.list({account_id:l})),{successLabel:`Loaded`})})};function pc(e){return e.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 mc={command:`update <data-class-id>`,describe:`Updates the configuration for a data class.`,builder:pc,handler:async r=>l({command:`zero-trust dlp data-classes update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-classes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_classes/${r[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(r[`data-class-id`]))}`,pathParams:{"data-class-id":String(r[`data-class-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),expression:m(r.expression,`expression`,`text`),name:m(r.name,`name`,`text`),sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...e,account_id:l,data_class_id:r[`data-class-id`]})),{successLabel:`Updated`});return}let u=p({data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),expression:m(r.expression,`expression`,`text`),name:m(r.name,`name`,`text`),sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...u,account_id:l,data_class_id:r[`data-class-id`]})),{successLabel:`Updated`})})},hc={command:`data-classes`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(oc).command(cc).command(uc).command(fc).command(mc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gc(e){return e.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 _c={command:`create`,describe:`Creates a data tag category, optionally from a template.`,builder:gc,handler:async r=>l({command:`zero-trust dlp data-tag-categories create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),tags:f(r.tags,`tags`),template_id:m(r[`template-id`],`template-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),tags:f(r.tags,`tags`),template_id:m(r[`template-id`],`template-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...u,account_id:l})),{successLabel:`Created`})})};function vc(e){return e.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 yc={command:`delete <category-id>`,describe:`Deletes a data tag category and its tags.`,builder:vc,handler:async r=>l({command:`zero-trust dlp data-tag-categories delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
33
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTagCategories.delete({account_id:l,category_id:r[`category-id`]})),{successLabel:`Deleted`})})};function bc(e){return e.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 xc={command:`get <category-id>`,describe:`Gets a data tag category and its tags.`,builder:bc,handler:async r=>l({command:`zero-trust dlp data-tag-categories get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.get({account_id:l,category_id:r[`category-id`]})),{successLabel:`Loaded`})})};function Sc(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cc={command:`list`,describe:`Lists data tag categories configured for the account.`,builder:Sc,handler:async r=>l({command:`zero-trust dlp data-tag-categories list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.list({account_id:l})),{successLabel:`Loaded`})})};function wc(e){return e.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 $={command:`update <category-id>`,describe:`Updates a data tag category and its tags.`,builder:wc,handler:async r=>l({command:`zero-trust dlp data-tag-categories update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-categories update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),tags:f(r.tags,`tags`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...e,account_id:l,category_id:r[`category-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),tags:f(r.tags,`tags`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...u,account_id:l,category_id:r[`category-id`]})),{successLabel:`Updated`})})},Tc={command:`data-tag-categories`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(_c).command(yc).command(xc).command(Cc).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ec(e){return e.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 Dc={command:`get <template-id>`,describe:`Gets an available data tag category template.`,builder:Ec,handler:async r=>l({command:`zero-trust dlp data-tag-category-templates get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_category_templates/${r[`template-id`]==null?`<template-id>`:encodeURIComponent(String(r[`template-id`]))}`,pathParams:{"template-id":String(r[`template-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.get({account_id:l,template_id:r[`template-id`]})),{successLabel:`Loaded`})})};function Oc(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kc={command:`list`,describe:`Lists available data tag category templates.`,builder:Oc,handler:async r=>l({command:`zero-trust dlp data-tag-category-templates list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_category_templates`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.list({account_id:l})),{successLabel:`Loaded`})})},Ac={command:`data-tag-category-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Dc).command(kc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jc(e){return e.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 Mc={command:`create <category-id>`,describe:`Creates a data tag in a category.`,builder:jc,handler:async r=>l({command:`zero-trust dlp data-tags create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}/data_tags`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:e,account_id:l,category_id:r[`category-id`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:u,account_id:l,category_id:r[`category-id`]})),{successLabel:`Created`})})};function Nc(e){return e.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 Pc={command:`delete <tag-id>`,describe:`Deletes a data tag from a category.`,builder:Nc,handler:async r=>l({command:`zero-trust dlp data-tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}/data_tags/${r[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(r[`tag-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``),"tag-id":String(r[`tag-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
34
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTags.delete({account_id:l,category_id:r[`category-id`],tag_id:r[`tag-id`]})),{successLabel:`Deleted`})})};function Fc(e){return e.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 Ic={command:`get <tag-id>`,describe:`Gets a data tag from a category.`,builder:Fc,handler:async r=>l({command:`zero-trust dlp data-tags get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}/data_tags/${r[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(r[`tag-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``),"tag-id":String(r[`tag-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.get({account_id:l,category_id:r[`category-id`],tag_id:r[`tag-id`]})),{successLabel:`Loaded`})})};function Lc(e){return e.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 Rc={command:`list`,describe:`Lists data tags in a category.`,builder:Lc,handler:async r=>l({command:`zero-trust dlp data-tags list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}/data_tags`,pathParams:{"category-id":String(r[`category-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.list({account_id:l,category_id:r[`category-id`]})),{successLabel:`Loaded`})})};function zc(e){return e.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 Bc={command:`update <tag-id>`,describe:`Updates a data tag in a category.`,builder:zc,handler:async r=>l({command:`zero-trust dlp data-tags update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp data-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/data_tag_categories/${r[`category-id`]==null?`<category-id>`:encodeURIComponent(String(r[`category-id`]))}/data_tags/${r[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(r[`tag-id`]))}`,pathParams:{"category-id":String(r[`category-id`]??``),"tag-id":String(r[`tag-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...e,account_id:l,category_id:r[`category-id`],tag_id:r[`tag-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...u,account_id:l,category_id:r[`category-id`],tag_id:r[`tag-id`]})),{successLabel:`Updated`})})},Vc={command:`data-tags`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Mc).command(Pc).command(Ic).command(Rc).command(Bc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Hc(e){return e.option(`case-sensitive`,{type:`boolean`,description:`Only applies to custom word lists.
35
- Determines if the words should be matched in a case-sensitive manner
36
- 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
37
-
38
- Non-secret custom word lists with no header are always version 1.
39
- Secret EDM lists with no header are version 1.
40
- Multicolumn CSV with headers are version 2.
41
- Omitting this field provides the default value 0, which is interpreted
42
- the same as 1.`}).option(`name`,{type:`string`,description:`The name field`}).option(`secret`,{type:`boolean`,description:`Generate a secret dataset.
43
-
44
- If true, the response will include a secret to use with the EDM encoder.
45
- 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 Uc={command:`create`,describe:`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.`,builder:Hc,handler:async r=>l({command:`zero-trust dlp datasets create`,classification:{safeFlags:[`case-sensitive`,`secret`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({case_sensitive:r[`case-sensitive`],description:m(r.description,`description`,`text`),encoding_version:r[`encoding-version`],name:m(r.name,`name`,`text`),secret:r.secret}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({case_sensitive:r[`case-sensitive`],description:m(r.description,`description`,`text`),encoding_version:r[`encoding-version`],name:m(r.name,`name`,`text`),secret:r.secret});o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...u,account_id:l})),{successLabel:`Created`})})};function Wc(e){return e.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 Gc={command:`delete <dataset-id>`,describe:`This deletes all versions of the dataset.`,builder:Wc,handler:async r=>l({command:`zero-trust dlp datasets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
46
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.datasets.delete({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Deleted`})})};function Kc(e){return e.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:`get <dataset-id>`,describe:`Gets a dataset and its latest upload status.`,builder:Kc,handler:async r=>l({command:`zero-trust dlp datasets get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.get({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Loaded`})})};function Jc(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yc={command:`list`,describe:`Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.`,builder:Jc,handler:async r=>l({command:`zero-trust dlp datasets list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.list({account_id:l})),{successLabel:`Loaded`})})};function Xc(e){return e.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.
47
-
48
- 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 Zc={command:`update <dataset-id>`,describe:`Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.`,builder:Xc,handler:async r=>l({command:`zero-trust dlp datasets update`,classification:{safeFlags:[`case-sensitive`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({case_sensitive:r[`case-sensitive`],description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...e,account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Updated`});return}let u=p({case_sensitive:r[`case-sensitive`],description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...u,account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Updated`})})};function Qc(e){return e.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 $c={command:`create <dataset-id>`,describe:`Creates a new version of a DLP dataset, allowing you to stage changes before activation. Used for single-column EDM and custom word lists.`,builder:Qc,handler:async r=>l({command:`zero-trust dlp datasets upload create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/upload`,pathParams:{"dataset-id":String(r[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.upload.create({account_id:l,dataset_id:r[`dataset-id`]})),{successLabel:`Created`})})};function el(e){return e.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 tl={command:`edit <version>`,describe:`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.`,builder:el,handler:async r=>l({command:`zero-trust dlp datasets upload edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets upload edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/upload/${r.version==null?`<version>`:encodeURIComponent(String(r.version))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``),version:String(r.version??``)},bodyKind:`octet-stream`,body:r.body});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file){let e=h(r.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(r[`dataset-id`]))}/upload/${encodeURIComponent(String(r.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(r.body){let e=m(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(r[`dataset-id`]))}/upload/${encodeURIComponent(String(r.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},nl={command:`upload`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command($c).command(tl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rl(e){return e.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 il={command:`create <version>`,describe:`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.`,builder:rl,handler:async r=>l({command:`zero-trust dlp datasets versions create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/versions/${r.version==null?`<version>`:encodeURIComponent(String(r.version))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``),version:String(r.version??``)},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.versions.create({body:e,account_id:l,dataset_id:r[`dataset-id`],version:r.version})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function al(e){return e.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 ol={command:`create <entry-id>`,describe:`This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard.`,builder:al,handler:async r=>l({command:`zero-trust dlp datasets versions entries create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp datasets versions entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/datasets/${r[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(r[`dataset-id`]))}/versions/${r.version==null?`<version>`:encodeURIComponent(String(r.version))}/entries/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"dataset-id":String(r[`dataset-id`]??``),version:String(r.version??``),"entry-id":String(r[`entry-id`]??``)},bodyKind:`octet-stream`,body:r.body});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file){let e=h(r.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(r[`dataset-id`]))}/versions/${encodeURIComponent(String(r.version))}/entries/${encodeURIComponent(String(r[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(r.body){let e=m(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(r[`dataset-id`]))}/versions/${encodeURIComponent(String(r.version))}/entries/${encodeURIComponent(String(r[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},sl={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ol).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cl={command:`versions`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(il).command(sl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ll={command:`datasets`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Uc).command(Gc).command(qc).command(Yc).command(Zc).command(nl).command(cl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ul(e){return e.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 dl={command:`create`,describe:`Creates a mapping between a Cloudflare account and an email provider for DLP email scanning integration.`,builder:ul,handler:async r=>l({command:`zero-trust dlp email account-mapping create`,classification:{safeFlags:[`auth-requirements-type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email account-mapping create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({auth_requirements:{allowed_microsoft_organizations:r[`auth-requirements-allowed-microsoft-organizations`],type:m(r[`auth-requirements-type`],`auth-requirements-type`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...e,account_id:l})),{successLabel:`Created`});return}r[`auth-requirements-type`]===void 0&&(r[`auth-requirements-type`]=await _(`auth-requirements-type`,`The auth_requirements.type field`,[`Org`,`NoAuth`]));let u=p({auth_requirements:{allowed_microsoft_organizations:r[`auth-requirements-allowed-microsoft-organizations`],type:m(r[`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 fl(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pl={command:`get`,describe:`Retrieves the email provider mapping configuration for DLP email scanning.`,builder:fl,handler:async r=>l({command:`zero-trust dlp email account-mapping get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email account-mapping get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.accountMapping.get({account_id:l})),{successLabel:`Loaded`})})},ml={command:`account-mapping`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(dl).command(pl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hl(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule priorities.`})}const gl={command:`bulk-edit`,describe:`Reorders DLP email scanning rules by updating their priority values. Higher priority rules are evaluated first.`,builder:hl,handler:async r=>l({command:`zero-trust dlp email rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.bulkEdit({...e,account_id:l})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function _l(e){return e.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 vl={command:`create`,describe:`Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.`,builder:_l,handler:async r=>l({command:`zero-trust dlp email rules create`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({action:{action:m(r[`action-action`],`action-action`,`text`),message:m(r[`action-message`],`action-message`,`text`)},conditions:f(r.conditions,`conditions`),description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r[`action-action`]===void 0&&(r[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),r.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({action:{action:m(r[`action-action`],`action-action`,`text`),message:m(r[`action-message`],`action-message`,`text`)},conditions:f(r.conditions,`conditions`),description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:u,account_id:l})),{successLabel:`Created`})})};function yl(e){return e.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 bl={command:`delete <rule-id>`,describe:`Removes a DLP email scanning rule. The rule will no longer be applied to email messages.`,builder:yl,handler:async r=>l({command:`zero-trust dlp email rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
49
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.email.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function xl(e){return e.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 Sl={command:`get <rule-id>`,describe:`Gets detailed configuration for a specific DLP email scanning rule, including detection patterns and actions.`,builder:xl,handler:async r=>l({command:`zero-trust dlp email rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function Cl(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wl={command:`list`,describe:`Lists all email scanner rules for an account.`,builder:Cl,handler:async r=>l({command:`zero-trust dlp email rules list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.list({account_id:l})),{successLabel:`Loaded`})})};function Tl(e){return e.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 El={command:`update <rule-id>`,describe:`Updates a DLP email scanning rule.`,builder:Tl,handler:async r=>l({command:`zero-trust dlp email rules update`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp email rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/email/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({action:{action:m(r[`action-action`],`action-action`,`text`),message:m(r[`action-message`],`action-message`,`text`)},conditions:f(r.conditions,`conditions`),description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}if(r[`action-action`]===void 0&&(r[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),r.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({action:{action:m(r[`action-action`],`action-action`,`text`),message:m(r[`action-message`],`action-message`,`text`)},conditions:f(r.conditions,`conditions`),description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:u,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},Dl={command:`rules`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(gl).command(vl).command(bl).command(Sl).command(wl).command(El).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ol={command:`email`,describe:`Operations for dlp.email`,builder:e=>e.command(ml).command(Dl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function kl(e){return e.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 Al={command:`create`,describe:`Creates a DLP custom entry.`,builder:kl,handler:async r=>l({command:`zero-trust dlp entries create`,classification:{safeFlags:[`enabled`,`pattern-validation`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(r[`profile-id`],`profile-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`)),r[`pattern-regex`]===void 0&&(r[`pattern-regex`]=await g(`pattern-regex`,`The pattern.regex field`));let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(r[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...u,account_id:l})),{successLabel:`Created`})})};function jl(e){return e.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 Ml={command:`update <entry-id>`,describe:`Updates a DLP custom entry.`,builder:jl,handler:async r=>l({command:`zero-trust dlp entries custom update`,classification:{safeFlags:[`pattern-validation`,`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/custom/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},enabled:r.enabled}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...e,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`});return}if(r.name===void 0&&(r.name=await g(`name`,`The name field`)),r[`pattern-regex`]===void 0&&(r[`pattern-regex`]=await g(`pattern-regex`,`The pattern.regex field`)),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},enabled:r.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...u,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`})})},Nl={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ml).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pl(e){return e.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 Fl={command:`delete <entry-id>`,describe:`Deletes a DLP custom entry.`,builder:Pl,handler:async r=>l({command:`zero-trust dlp entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
50
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.delete({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Deleted`})})};function Il(e){return e.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 Ll={command:`get <entry-id>`,describe:`Fetches a DLP entry by ID.`,builder:Il,handler:async r=>l({command:`zero-trust dlp entries get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.get({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Loaded`})})};function Rl(e){return e.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.
51
- 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 zl={command:`create`,describe:`Integration entries can't be created, this will update an existing integration entry. This is needed for our generated terraform API.`,builder:Rl,handler:async r=>l({command:`zero-trust dlp entries integration create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries integration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/integration`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({enabled:r.enabled,entry_id:m(r[`entry-id`],`entry-id`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r[`entry-id`]===void 0&&(r[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:r.enabled,entry_id:m(r[`entry-id`],`entry-id`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:u,account_id:l})),{successLabel:`Created`})})};function Bl(e){return e.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 Vl={command:`delete <entry-id>`,describe:`This is a no-op as integration entires can't be deleted but is needed for our generated terraform API.`,builder:Bl,handler:async r=>l({command:`zero-trust dlp entries integration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries integration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/integration/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
52
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.integration.delete({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Deleted`})})};function Hl(e){return e.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 Ul={command:`update <entry-id>`,describe:`Updates a DLP entry.`,builder:Hl,handler:async r=>l({command:`zero-trust dlp entries integration update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries integration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/integration/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({enabled:r.enabled}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:e,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:r.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:u,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`})})},Wl={command:`integration`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(zl).command(Vl).command(Ul).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gl(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kl={command:`list`,describe:`Lists all DLP entries in an account.`,builder:Gl,handler:async r=>l({command:`zero-trust dlp entries list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.list({account_id:l})),{successLabel:`Loaded`})})};function ql(e){return e.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.
53
- 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 Jl={command:`create`,describe:`Predefined entries can't be created, this will update an existing predefined entry. This is needed for our generated terraform API.`,builder:ql,handler:async r=>l({command:`zero-trust dlp entries predefined create`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/predefined`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({enabled:r.enabled,entry_id:m(r[`entry-id`],`entry-id`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);r[`entry-id`]===void 0&&(r[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:r.enabled,entry_id:m(r[`entry-id`],`entry-id`,`text`),profile_id:m(r[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:u,account_id:l})),{successLabel:`Created`})})};function Yl(e){return e.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 Xl={command:`delete <entry-id>`,describe:`This is a no-op as predefined entires can't be deleted but is needed for our generated terraform API.`,builder:Yl,handler:async r=>l({command:`zero-trust dlp entries predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/predefined/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
54
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.predefined.delete({account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Deleted`})})};function Zl(e){return e.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 Ql={command:`update <entry-id>`,describe:`Updates a DLP entry.`,builder:Zl,handler:async r=>l({command:`zero-trust dlp entries predefined update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/predefined/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({enabled:r.enabled}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:e,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:r.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:u,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`})})},$l={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Jl).command(Xl).command(Ql).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function eu(e){return e.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 tu={command:`update <entry-id>`,describe:`Updates a DLP entry.`,builder:eu,handler:async r=>l({command:`zero-trust dlp entries update`,classification:{safeFlags:[`pattern-validation`,`type`,`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/entries/${r[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(r[`entry-id`]))}`,pathParams:{"entry-id":String(r[`entry-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},type:m(r.type,`type`,`text`),enabled:r.enabled}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:e,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`});return}if(r.type===void 0&&(r.type=await _(`type`,`The type field`,[`custom`,`predefined`,`integration`])),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),pattern:{regex:m(r[`pattern-regex`],`pattern-regex`,`text`),validation:m(r[`pattern-validation`],`pattern-validation`,`text`)},type:m(r.type,`type`,`text`),enabled:r.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:u,account_id:l,entry_id:r[`entry-id`]})),{successLabel:`Updated`})})},nu={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Al).command(Fl).command(Ll).command(Kl).command(tu).command(Nl).command(Wl).command($l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ru(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const iu={command:`list`,describe:`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.`,builder:ru,handler:async r=>l({command:`zero-trust dlp limits list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/limits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.limits.list({account_id:l})),{successLabel:`Loaded`})})},au={command:`limits`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(iu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ou(e){return e.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 su={command:`validate`,describe:"Validates 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}`.",builder:ou,handler:async r=>l({command:`zero-trust dlp patterns validate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp patterns validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/patterns/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({max_match_bytes:r[`max-match-bytes`],regex:m(r.regex,`regex`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...e,account_id:l})),{successLabel:`Created`});return}r.regex===void 0&&(r.regex=await g(`regex`,`The regex field`));let u=p({max_match_bytes:r[`max-match-bytes`],regex:m(r.regex,`regex`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...u,account_id:l})),{successLabel:`Created`})})},cu={command:`patterns`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(su).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lu(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uu={command:`get`,describe:`Gets the current payload logging configuration for DLP, showing whether matched content is being logged.`,builder:lu,handler:async r=>l({command:`zero-trust dlp payload-logs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp payload-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.payloadLogs.get({account_id:l})),{successLabel:`Loaded`})})};function du(e){return e.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.
55
-
56
- - Set to null or empty string to disable payload logging.
57
- - Set to a non-empty base64 string to enable payload logging with the given key.
58
-
59
- For customers with configurable payload masking feature rolled out:
60
- - If the field is missing, the existing setting will be kept. Note that this is different from setting to null or empty string.
61
-
62
- For all other customers:
63
- - 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 fu={command:`update`,describe:`Enables or disables payload logging for DLP matches. When enabled, matched content is stored for review.`,builder:du,handler:async r=>l({command:`zero-trust dlp payload-logs update`,classification:{safeFlags:[`masking-level`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp payload-logs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({masking_level:m(r[`masking-level`],`masking-level`,`text`),public_key:m(r[`public-key`],`public-key`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({masking_level:m(r[`masking-level`],`masking-level`,`text`),public_key:m(r[`public-key`],`public-key`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...u,account_id:l})),{successLabel:`Updated`})})},pu={command:`payload-logs`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(uu).command(fu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mu(e){return e.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 hu={command:`create`,describe:`Creates a DLP custom profile.`,builder:mu,handler:async r=>l({command:`zero-trust dlp profiles custom create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},data_classes:r[`data-classes`],data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),entries:f(r.entries,`entries`),name:m(r.name,`name`,`text`),ocr_enabled:r[`ocr-enabled`],sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(r[`shared-entries`],`shared-entries`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},data_classes:r[`data-classes`],data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),entries:f(r.entries,`entries`),name:m(r.name,`name`,`text`),ocr_enabled:r[`ocr-enabled`],sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(r[`shared-entries`],`shared-entries`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...u,account_id:l})),{successLabel:`Created`})})};function gu(e){return e.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 _u={command:`delete <profile-id>`,describe:`Deletes a DLP custom profile.`,builder:gu,handler:async r=>l({command:`zero-trust dlp profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/custom/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
64
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.custom.delete({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Deleted`})})};function vu(e){return e.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 yu={command:`get <profile-id>`,describe:`Fetches a custom DLP profile by id.`,builder:vu,handler:async r=>l({command:`zero-trust dlp profiles custom get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/custom/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.custom.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function bu(e){return e.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.
65
- 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 xu={command:`update <profile-id>`,describe:`Updates a DLP custom profile.`,builder:bu,handler:async r=>l({command:`zero-trust dlp profiles custom update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/custom/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},data_classes:r[`data-classes`],data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),entries:f(r.entries,`entries`),name:m(r.name,`name`,`text`),ocr_enabled:r[`ocr-enabled`],sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(r[`shared-entries`],`shared-entries`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},data_classes:r[`data-classes`],data_tags:r[`data-tags`],description:m(r.description,`description`,`text`),entries:f(r.entries,`entries`),name:m(r.name,`name`,`text`),ocr_enabled:r[`ocr-enabled`],sensitivity_levels:f(r[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(r[`shared-entries`],`shared-entries`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...u,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`})})},Su={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(hu).command(_u).command(yu).command(xu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cu(e){return e.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 wu={command:`get <profile-id>`,describe:`Fetches a DLP profile by ID.`,builder:Cu,handler:async r=>l({command:`zero-trust dlp profiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function Tu(e){return e.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 Eu={command:`list`,describe:`Lists all DLP profiles in an account.`,builder:Tu,handler:async r=>l({command:`zero-trust dlp profiles list`,classification:{safeFlags:[`all`,`dry-run`]}},r,async()=>{let i={all:r.all};if(r.dryRun){s({command:`cf zero-trust dlp profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dlp.profiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Du(e){return e.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 Ou={command:`create <profile-id>`,describe:"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.",builder:Du,handler:async r=>l({command:`zero-trust dlp profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}/config`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:r[`enabled-entries`],entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Created`});return}let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:r[`enabled-entries`],entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:u,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Created`})})};function ku(e){return e.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 Au={command:`delete <profile-id>`,describe:`This is a no-op as predefined profiles can't be deleted but is needed for our generated terraform API.`,builder:ku,handler:async r=>l({command:`zero-trust dlp profiles predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
66
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.predefined.delete({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Deleted`})})};function ju(e){return e.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 Mu={command:`get <profile-id>`,describe:"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.",builder:ju,handler:async r=>l({command:`zero-trust dlp profiles predefined get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}/config`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.predefined.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function Nu(e){return e.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 Pu={command:`update <profile-id>`,describe:"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.",builder:Nu,handler:async r=>l({command:`zero-trust dlp profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}/config`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:r[`enabled-entries`],entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`});return}let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:r[`enabled-entries`],entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:u,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`})})},Fu={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ou).command(Au).command(Mu).command(Pu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Iu={command:`profiles`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(wu).command(Eu).command(Su).command(Fu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Lu(e){return e.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 Ru={command:`get <template-id>`,describe:`Gets an available sensitivity group template.`,builder:Lu,handler:async r=>l({command:`zero-trust dlp sensitivity-group-templates get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/templates/${r[`template-id`]==null?`<template-id>`:encodeURIComponent(String(r[`template-id`]))}`,pathParams:{"template-id":String(r[`template-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.get({account_id:l,template_id:r[`template-id`]})),{successLabel:`Loaded`})})};function zu(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bu={command:`list`,describe:`Lists available sensitivity group templates.`,builder:zu,handler:async r=>l({command:`zero-trust dlp sensitivity-group-templates list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/templates`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.list({account_id:l})),{successLabel:`Loaded`})})},Vu={command:`sensitivity-group-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ru).command(Bu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Hu(e){return e.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 Uu={command:`create`,describe:`Creates a sensitivity group, optionally from a template.`,builder:Hu,handler:async r=>l({command:`zero-trust dlp sensitivity-groups create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),levels:f(r.levels,`levels`),name:m(r.name,`name`,`text`),template_id:m(r[`template-id`],`template-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({description:m(r.description,`description`,`text`),levels:f(r.levels,`levels`),name:m(r.name,`name`,`text`),template_id:m(r[`template-id`],`template-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...u,account_id:l})),{successLabel:`Created`})})};function Wu(e){return e.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 Gu={command:`delete <sensitivity-group-id>`,describe:`Deletes a sensitivity group and its levels.`,builder:Wu,handler:async r=>l({command:`zero-trust dlp sensitivity-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
67
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityGroups.delete({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Deleted`})})};function Ku(e){return e.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 qu={command:`get-level-order <sensitivity-group-id>`,describe:`Gets the current order of sensitivity levels in a group.`,builder:Ku,handler:async r=>l({command:`zero-trust dlp sensitivity-groups get-level-order`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get-level-order`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.getLevelOrder({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function Ju(e){return e.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 Yu={command:`get <sensitivity-group-id>`,describe:`Gets a sensitivity group and its levels.`,builder:Ju,handler:async r=>l({command:`zero-trust dlp sensitivity-groups get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.get({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function Xu(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zu={command:`list`,describe:`Lists sensitivity groups configured for the account.`,builder:Xu,handler:async r=>l({command:`zero-trust dlp sensitivity-groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.list({account_id:l})),{successLabel:`Loaded`})})};function Qu(e){return e.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 $u={command:`update-level-order <sensitivity-group-id>`,describe:`Updates the order of sensitivity levels in a group.`,builder:Qu,handler:async r=>l({command:`zero-trust dlp sensitivity-groups update-level-order`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update-level-order`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({level_ids:r[`level-ids`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:e,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Updated`});return}if(r[`level-ids`]===void 0)throw Error(`--level-ids is required (or pass --body with this field set).`);let u=p({level_ids:r[`level-ids`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:u,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Updated`})})};function ed(e){return e.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 td={command:`update <sensitivity-group-id>`,describe:`Updates a sensitivity group and its levels.`,builder:ed,handler:async r=>l({command:`zero-trust dlp sensitivity-groups update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),levels:f(r.levels,`levels`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...e,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),levels:f(r.levels,`levels`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...u,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Updated`})})},nd={command:`sensitivity-groups`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Uu).command(Gu).command(Yu).command(qu).command(Zu).command(td).command($u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rd(e){return e.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 id={command:`create <sensitivity-group-id>`,describe:`Creates a sensitivity level in a group.`,builder:rd,handler:async r=>l({command:`zero-trust dlp sensitivity-levels create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-levels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:e,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:u,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Created`})})};function ad(e){return e.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 od={command:`delete <sensitivity-level-id>`,describe:`Deletes a sensitivity level from a group.`,builder:ad,handler:async r=>l({command:`zero-trust dlp sensitivity-levels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-levels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/levels/${r[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(r[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``),"sensitivity-level-id":String(r[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
68
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityLevels.delete({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`],sensitivity_level_id:r[`sensitivity-level-id`]})),{successLabel:`Deleted`})})};function sd(e){return e.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 cd={command:`get <sensitivity-level-id>`,describe:`Gets a sensitivity level from a group.`,builder:sd,handler:async r=>l({command:`zero-trust dlp sensitivity-levels get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-levels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/levels/${r[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(r[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``),"sensitivity-level-id":String(r[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.get({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`],sensitivity_level_id:r[`sensitivity-level-id`]})),{successLabel:`Loaded`})})};function ld(e){return e.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 ud={command:`list`,describe:`Lists sensitivity levels in a sensitivity group.`,builder:ld,handler:async r=>l({command:`zero-trust dlp sensitivity-levels list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-levels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.list({account_id:l,sensitivity_group_id:r[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function dd(e){return e.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 fd={command:`update <sensitivity-level-id>`,describe:`Updates a sensitivity level in a group.`,builder:dd,handler:async r=>l({command:`zero-trust dlp sensitivity-levels update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust dlp sensitivity-levels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/sensitivity_groups/${r[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(r[`sensitivity-group-id`]))}/levels/${r[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(r[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(r[`sensitivity-group-id`]??``),"sensitivity-level-id":String(r[`sensitivity-level-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...e,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`],sensitivity_level_id:r[`sensitivity-level-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...u,account_id:l,sensitivity_group_id:r[`sensitivity-group-id`],sensitivity_level_id:r[`sensitivity-level-id`]})),{successLabel:`Updated`})})},pd={command:`sensitivity-levels`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(id).command(od).command(cd).command(ud).command(fd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},md={command:`dlp`,describe:`Operations for dlp`,builder:e=>e.command(ic).command(hc).command(Tc).command(Ac).command(Vc).command(ll).command(Ol).command(nu).command(au).command(cu).command(pu).command(Iu).command(Vu).command(nd).command(pd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hd(e){return e.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 gd={command:`fingerprints`,describe:`Creates a new document fingerprint for DLP scanning. Document fingerprints detect documents that are structurally similar to the uploaded sample.`,builder:hd,handler:async r=>l({command:`zero-trust document-fingerprints create document fingerprints`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints create document fingerprints`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),match_percent:r[`match-percent`],name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...e,account_id:l})),{successLabel:`Created`});return}if(r[`match-percent`]===void 0)throw Error(`--match-percent is required (or pass --body with this field set).`);r.name===void 0&&(r.name=await g(`name`,`The name field`));let u=p({description:m(r.description,`description`,`text`),match_percent:r[`match-percent`],name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...u,account_id:l})),{successLabel:`Created`})})},_d={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(gd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vd(e){return e.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 yd={command:`v2 <document-fingerprint-id>`,describe:`Updates metadata for an existing document fingerprint, such as its name or description.`,builder:vd,handler:async r=>l({command:`zero-trust document-fingerprints create v2`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints/${r[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(r[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(r[`document-fingerprint-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),match_percent:r[`match-percent`],name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...e,account_id:l,document_fingerprint_id:r[`document-fingerprint-id`]})),{successLabel:`Created`});return}let u=p({description:m(r.description,`description`,`text`),match_percent:r[`match-percent`],name:m(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...u,account_id:l,document_fingerprint_id:r[`document-fingerprint-id`]})),{successLabel:`Created`})})},bd={command:`create`,describe:`Document Fingerprints operations`,builder:e=>e.command(yd).command(_d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xd(e){return e.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 Sd={command:`delete <document-fingerprint-id>`,describe:`Removes a document fingerprint from DLP configuration. Documents matching this fingerprint will no longer be detected.`,builder:xd,handler:async r=>l({command:`zero-trust document-fingerprints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints/${r[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(r[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(r[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
69
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.documentFingerprints.delete({account_id:l,document_fingerprint_id:r[`document-fingerprint-id`]})),{successLabel:`Deleted`})})};function Cd(e){return e.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 wd={command:`fingerprints <document-fingerprint-id>`,describe:`Gets a document fingerprint and its latest upload status.`,builder:Cd,handler:async r=>l({command:`zero-trust document-fingerprints get document fingerprints`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints get document fingerprints`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints/${r[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(r[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(r[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.document.fingerprints({account_id:l,document_fingerprint_id:r[`document-fingerprint-id`]})),{successLabel:`Loaded`})})},Td={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(wd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ed(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dd={command:`all`,describe:`Lists all document fingerprints configured for DLP scanning in the account.`,builder:Ed,handler:async r=>l({command:`zero-trust document-fingerprints get fingerprints all`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints get fingerprints all`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.fingerprints.all({account_id:l})),{successLabel:`Loaded`})})},Od={command:`fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(Dd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kd={command:`get`,describe:`Operations for document-fingerprints.get`,builder:e=>e.command(Td).command(Od).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ad(e){return e.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 jd={command:`update <document-fingerprint-id>`,describe:`Uploads a new document to create or update a fingerprint. The document structure is analyzed to enable detection of similar documents.`,builder:Ad,handler:async r=>l({command:`zero-trust document-fingerprints update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust document-fingerprints update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/document_fingerprints/${r[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(r[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(r[`document-fingerprint-id`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0){let e=new FormData;if(r.file){let t=h(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(r[`document-fingerprint-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(r.body){let e=m(r.body,`body`,`binary`);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(r[`document-fingerprint-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Md={command:`document-fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(Sd).command(jd).command(bd).command(kd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Nd(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pd={command:`list`,describe:`List all application and application type mappings.`,builder:Nd,handler:async r=>l({command:`zero-trust gateway app-types list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway app-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/app_types`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.appTypes.list({account_id:l})),{successLabel:`Loaded`})})},Fd={command:`app-types`,describe:`Operations for gateway.app-types`,builder:e=>e.command(Pd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Id(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ld={command:`get`,describe:`Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`,builder:Id,handler:async r=>l({command:`zero-trust gateway audit-ssh-settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.auditSshSettings.get({account_id:l})),{successLabel:`Loaded`})})};function Rd(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zd={command:`rotate-seed`,describe:`Rotate the SSH account seed that generates the host key identity when connecting through the Cloudflare SSH Proxy.`,builder:Rd,handler:async r=>l({command:`zero-trust gateway audit-ssh-settings rotate-seed`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings rotate-seed`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/audit_ssh_settings/rotate_seed`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.auditSshSettings.rotateSeed({account_id:l})),{successLabel:`Created`})})};function Bd(e){return e.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 Vd={command:`update`,describe:`Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`,builder:Bd,handler:async r=>l({command:`zero-trust gateway audit-ssh-settings update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({public_key:m(r[`public-key`],`public-key`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...e,account_id:l})),{successLabel:`Updated`});return}r[`public-key`]===void 0&&(r[`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(r[`public-key`],`public-key`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...u,account_id:l})),{successLabel:`Updated`})})},Hd={command:`audit-ssh-settings`,describe:`Operations for gateway.audit-ssh-settings`,builder:e=>e.command(Ld).command(zd).command(Vd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ud(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wd={command:`list`,describe:`List all categories.`,builder:Ud,handler:async r=>l({command:`zero-trust gateway categories list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/categories`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.categories.list({account_id:l})),{successLabel:`Loaded`})})},Gd={command:`categories`,describe:`Operations for gateway.categories`,builder:e=>e.command(Wd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kd(e){return e.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 qd={command:`activate <certificate-id>`,describe:`Bind a single Zero Trust certificate to the edge.`,builder:Kd,handler:async r=>l({command:`zero-trust gateway certificates activate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates activate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates/${r[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(r[`certificate-id`]))}/activate`,pathParams:{"certificate-id":String(r[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.activate({account_id:l,certificate_id:r[`certificate-id`]})),{successLabel:`Created`})})};function Jd(e){return e.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 Yd={command:`create`,describe:`Create a new Zero Trust certificate.`,builder:Jd,handler:async r=>l({command:`zero-trust gateway certificates create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({validity_period_days:r[`validity-period-days`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({validity_period_days:r[`validity-period-days`]});o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...u,account_id:l})),{successLabel:`Created`})})};function Xd(e){return e.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 Zd={command:`deactivate <certificate-id>`,describe:`Unbind a single Zero Trust certificate from the edge.`,builder:Xd,handler:async r=>l({command:`zero-trust gateway certificates deactivate`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates deactivate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates/${r[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(r[`certificate-id`]))}/deactivate`,pathParams:{"certificate-id":String(r[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.deactivate({account_id:l,certificate_id:r[`certificate-id`]})),{successLabel:`Created`})})};function Qd(e){return e.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 $d={command:`delete <certificate-id>`,describe:`Delete a gateway-managed Zero Trust certificate. You must deactivate the certificate from the edge (inactive) before deleting it.`,builder:Qd,handler:async r=>l({command:`zero-trust gateway certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates/${r[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(r[`certificate-id`]))}`,pathParams:{"certificate-id":String(r[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
70
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.certificates.delete({account_id:l,certificate_id:r[`certificate-id`]})),{successLabel:`Deleted`})})};function ef(e){return e.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 tf={command:`get <certificate-id>`,describe:`Get a single Zero Trust certificate.`,builder:ef,handler:async r=>l({command:`zero-trust gateway certificates get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates/${r[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(r[`certificate-id`]))}`,pathParams:{"certificate-id":String(r[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.get({account_id:l,certificate_id:r[`certificate-id`]})),{successLabel:`Loaded`})})};function nf(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rf={command:`list`,describe:`List all Zero Trust certificates for an account.`,builder:nf,handler:async r=>l({command:`zero-trust gateway certificates list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.list({account_id:l})),{successLabel:`Loaded`})})},af={command:`certificates`,describe:`Operations for gateway.certificates`,builder:e=>e.command(qd).command(Yd).command(Zd).command($d).command(tf).command(rf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function of(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sf={command:`get`,describe:`Retrieve the current Zero Trust certificate configuration.`,builder:of,handler:async r=>l({command:`zero-trust gateway configurations custom-certificate get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway configurations custom-certificate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/configuration/custom_certificate`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.configurations.customCertificate.get({account_id:l})),{successLabel:`Loaded`})})},cf={command:`custom-certificate`,describe:`Operations for gateway.configurations.custom-certificate`,builder:e=>e.command(sf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lf(e){return e.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:`edit`,describe:"Update (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.",builder:lf,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway configurations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({settings:{activity_log:{enabled:r[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:r[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:r[`settings-antivirus-enabled-upload-phase`],fail_closed:r[`settings-antivirus-fail-closed`],notification_settings:{enabled:r[`settings-antivirus-notification-settings-enabled`],include_context:r[`settings-antivirus-notification-settings-include-context`],msg:m(r[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(r[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(r[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:r[`settings-block-page-enabled`],footer_text:m(r[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(r[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:r[`settings-block-page-include-context`],logo_path:m(r[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(r[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(r[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(r[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(r[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:r[`settings-block-page-suppress-footer`],target_uri:m(r[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(r[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:r[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:r[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(r[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:r[`settings-custom-certificate-enabled`],id:m(r[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:r[`settings-extended-email-matching-enabled`]},fips:{tls:r[`settings-fips-tls`]},host_selector:{enabled:r[`settings-host-selector-enabled`]},inspection:{mode:m(r[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:r[`settings-max-ttl-secs`],protocol_detection:{enabled:r[`settings-protocol-detection-enabled`]},sandbox:{enabled:r[`settings-sandbox-enabled`],fallback_action:m(r[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:r[`settings-tls-decrypt-enabled`]}}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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:r[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:r[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:r[`settings-antivirus-enabled-upload-phase`],fail_closed:r[`settings-antivirus-fail-closed`],notification_settings:{enabled:r[`settings-antivirus-notification-settings-enabled`],include_context:r[`settings-antivirus-notification-settings-include-context`],msg:m(r[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(r[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(r[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:r[`settings-block-page-enabled`],footer_text:m(r[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(r[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:r[`settings-block-page-include-context`],logo_path:m(r[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(r[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(r[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(r[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(r[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:r[`settings-block-page-suppress-footer`],target_uri:m(r[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(r[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:r[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:r[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(r[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:r[`settings-custom-certificate-enabled`],id:m(r[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:r[`settings-extended-email-matching-enabled`]},fips:{tls:r[`settings-fips-tls`]},host_selector:{enabled:r[`settings-host-selector-enabled`]},inspection:{mode:m(r[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:r[`settings-max-ttl-secs`],protocol_detection:{enabled:r[`settings-protocol-detection-enabled`]},sandbox:{enabled:r[`settings-sandbox-enabled`],fallback_action:m(r[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:r[`settings-tls-decrypt-enabled`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:u,account_id:l})),{successLabel:`Updated`})})};function df(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ff={command:`get`,describe:`Retrieve the current Zero Trust account configuration.`,builder:df,handler:async r=>l({command:`zero-trust gateway configurations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.configurations.get({account_id:l})),{successLabel:`Loaded`})})};function pf(e){return e.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 mf={command:`update`,describe:`Update the current Zero Trust account configuration.`,builder:pf,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({settings:{activity_log:{enabled:r[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:r[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:r[`settings-antivirus-enabled-upload-phase`],fail_closed:r[`settings-antivirus-fail-closed`],notification_settings:{enabled:r[`settings-antivirus-notification-settings-enabled`],include_context:r[`settings-antivirus-notification-settings-include-context`],msg:m(r[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(r[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(r[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:r[`settings-block-page-enabled`],footer_text:m(r[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(r[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:r[`settings-block-page-include-context`],logo_path:m(r[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(r[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(r[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(r[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(r[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:r[`settings-block-page-suppress-footer`],target_uri:m(r[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(r[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:r[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:r[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(r[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:r[`settings-custom-certificate-enabled`],id:m(r[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:r[`settings-extended-email-matching-enabled`]},fips:{tls:r[`settings-fips-tls`]},host_selector:{enabled:r[`settings-host-selector-enabled`]},inspection:{mode:m(r[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:r[`settings-max-ttl-secs`],protocol_detection:{enabled:r[`settings-protocol-detection-enabled`]},sandbox:{enabled:r[`settings-sandbox-enabled`],fallback_action:m(r[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:r[`settings-tls-decrypt-enabled`]}}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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:r[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:r[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:r[`settings-antivirus-enabled-upload-phase`],fail_closed:r[`settings-antivirus-fail-closed`],notification_settings:{enabled:r[`settings-antivirus-notification-settings-enabled`],include_context:r[`settings-antivirus-notification-settings-include-context`],msg:m(r[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(r[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(r[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:r[`settings-block-page-enabled`],footer_text:m(r[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(r[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:r[`settings-block-page-include-context`],logo_path:m(r[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(r[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(r[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(r[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(r[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:r[`settings-block-page-suppress-footer`],target_uri:m(r[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(r[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:r[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:r[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(r[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:r[`settings-custom-certificate-enabled`],id:m(r[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:r[`settings-extended-email-matching-enabled`]},fips:{tls:r[`settings-fips-tls`]},host_selector:{enabled:r[`settings-host-selector-enabled`]},inspection:{mode:m(r[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:r[`settings-max-ttl-secs`],protocol_detection:{enabled:r[`settings-protocol-detection-enabled`]},sandbox:{enabled:r[`settings-sandbox-enabled`],fallback_action:m(r[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:r[`settings-tls-decrypt-enabled`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:u,account_id:l})),{successLabel:`Updated`})})},hf={command:`configurations`,describe:`Operations for gateway.configurations`,builder:e=>e.command(uf).command(ff).command(mf).command(cf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gf(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _f={command:`create`,describe:`Create a Zero Trust account for an existing Cloudflare account.`,builder:gf,handler:async r=>l({command:`zero-trust gateway create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.create({account_id:l})),{successLabel:`Created`})})};function vf(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yf={command:`list`,describe:`List Zero Trust Gateway IPv4 address pairs for an account.`,builder:vf,handler:async r=>l({command:`zero-trust gateway dns-destination-ips list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway dns-destination-ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/dns_destination_ips`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.dnsDestinationIps.list({account_id:l})),{successLabel:`Loaded`})})},bf={command:`dns-destination-ips`,describe:`Operations for gateway.dns-destination-ips`,builder:e=>e.command(yf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xf(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sf={command:`list`,describe:`Retrieve the list of egress CIDRs allocated to this Zero Trust account.`,builder:xf,handler:async r=>l({command:`zero-trust gateway egress-cidr-pairs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway egress-cidr-pairs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/egress_cidr_pairs`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.egressCidrPairs.list({account_id:l})),{successLabel:`Loaded`})})},Cf={command:`egress-cidr-pairs`,describe:`Operations for gateway.egress-cidr-pairs`,builder:e=>e.command(Sf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wf(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tf={command:`list`,describe:`Retrieve information about the current Zero Trust account.`,builder:wf,handler:async r=>l({command:`zero-trust gateway list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.list({account_id:l})),{successLabel:`Loaded`})})};function Ef(e){return e.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 Df={command:`create`,describe:`Creates a new Zero Trust list.`,builder:Ef,handler:async r=>l({command:`zero-trust gateway lists create`,classification:{safeFlags:[`type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),items:f(r.items,`items`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`Specify the list name.`)),r.type===void 0&&(r.type=await _(`type`,`Specify the list type.`,[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]));let u=p({description:m(r.description,`description`,`text`),items:f(r.items,`items`),name:m(r.name,`name`,`text`),type:m(r.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...u,account_id:l})),{successLabel:`Created`})})};function Of(e){return e.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 kf={command:`delete <list-id>`,describe:`Deletes a Zero Trust list.`,builder:Of,handler:async r=>l({command:`zero-trust gateway lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/${r[`list-id`]==null?`<list-id>`:encodeURIComponent(String(r[`list-id`]))}`,pathParams:{"list-id":String(r[`list-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
71
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.lists.delete({account_id:l,list_id:r[`list-id`]})),{successLabel:`Deleted`})})};function Af(e){return e.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 jf={command:`edit <list-id>`,describe:`Appends or removes an item from a configured Zero Trust list.`,builder:Af,handler:async r=>l({command:`zero-trust gateway lists edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/${r[`list-id`]==null?`<list-id>`:encodeURIComponent(String(r[`list-id`]))}`,pathParams:{"list-id":String(r[`list-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({append:f(r.append,`append`),remove:r.remove}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...e,account_id:l,list_id:r[`list-id`]})),{successLabel:`Updated`});return}let u=p({append:f(r.append,`append`),remove:r.remove});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...u,account_id:l,list_id:r[`list-id`]})),{successLabel:`Updated`})})};function Mf(e){return e.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 Nf={command:`get <list-id>`,describe:`Fetch a single Zero Trust list.`,builder:Mf,handler:async r=>l({command:`zero-trust gateway lists get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/${r[`list-id`]==null?`<list-id>`:encodeURIComponent(String(r[`list-id`]))}`,pathParams:{"list-id":String(r[`list-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.lists.get({account_id:l,list_id:r[`list-id`]})),{successLabel:`Loaded`})})};function Pf(e){return e.option(`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 Ff={command:`list`,describe:`Fetch all items in a single Zero Trust list.`,builder:Pf,handler:async r=>l({command:`zero-trust gateway lists items list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/${r[`list-id`]==null?`<list-id>`:encodeURIComponent(String(r[`list-id`]))}/items`,pathParams:{"list-id":String(r[`list-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.lists.items.list({account_id:l,list_id:r[`list-id`]})),{successLabel:`Loaded`})})},If={command:`items`,describe:`Operations for gateway.lists.items`,builder:e=>e.command(Ff).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Lf(e){return e.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 Rf={command:`list`,describe:`Fetch all Zero Trust lists for an account.`,builder:y(Lf),handler:async r=>l({command:`zero-trust gateway lists list`,classification:{safeFlags:[`type`,`order-by`,`direction`,`dry-run`]}},r,async()=>{let i={type:r.type,filter:r.filter,search:r.search,order_by:r[`order-by`],direction:r.direction};if(r.dryRun){s({command:`cf zero-trust gateway lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.lists.list({account_id:u,...i})),{successLabel:`Loaded`})})};function zf(e){return e.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 Bf={command:`update <list-id>`,describe:`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.`,builder:zf,handler:async r=>l({command:`zero-trust gateway lists update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/${r[`list-id`]==null?`<list-id>`:encodeURIComponent(String(r[`list-id`]))}`,pathParams:{"list-id":String(r[`list-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),items:f(r.items,`items`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...e,account_id:l,list_id:r[`list-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await g(`name`,`Specify the list name.`));let u=p({description:m(r.description,`description`,`text`),items:f(r.items,`items`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...u,account_id:l,list_id:r[`list-id`]})),{successLabel:`Updated`})})};function Vf(e){return e.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 Hf={command:`upload`,describe:"Create 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.",builder:Vf,handler:async r=>l({command:`zero-trust gateway lists upload`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway lists upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/lists/upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0){let e=new FormData;if(r.file){let t=h(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=m(r.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(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Uf={command:`lists`,describe:`Operations for gateway.lists`,builder:e=>e.command(Df).command(kf).command(jf).command(Nf).command(Rf).command(Bf).command(Hf).command(If).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wf(e){return e.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 Gf={command:`create`,describe:`Create a new Zero Trust Gateway location.`,builder:Wf,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway locations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/locations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({client_default:r[`client-default`],dns_destination_ips_id:m(r[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:r[`ecs-support`],endpoints:{doh:{enabled:r[`endpoints-doh-enabled`],require_token:r[`endpoints-doh-require-token`]},dot:{enabled:r[`endpoints-dot-enabled`]},ipv4:{enabled:r[`endpoints-ipv4-enabled`]},ipv6:{enabled:r[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(r[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:r[`max-ttl-ttl-secs`]},name:m(r.name,`name`,`text`),networks:f(r.networks,`networks`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...e,account_id:l})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await g(`name`,`Specify the location name.`));let u=p({client_default:r[`client-default`],dns_destination_ips_id:m(r[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:r[`ecs-support`],endpoints:{doh:{enabled:r[`endpoints-doh-enabled`],require_token:r[`endpoints-doh-require-token`]},dot:{enabled:r[`endpoints-dot-enabled`]},ipv4:{enabled:r[`endpoints-ipv4-enabled`]},ipv6:{enabled:r[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(r[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:r[`max-ttl-ttl-secs`]},name:m(r.name,`name`,`text`),networks:f(r.networks,`networks`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...u,account_id:l})),{successLabel:`Created`})})};function Kf(e){return e.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 qf={command:`delete <location-id>`,describe:`Delete a configured Zero Trust Gateway location.`,builder:Kf,handler:async r=>l({command:`zero-trust gateway locations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway locations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/locations/${r[`location-id`]==null?`<location-id>`:encodeURIComponent(String(r[`location-id`]))}`,pathParams:{"location-id":String(r[`location-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
72
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.locations.delete({account_id:l,location_id:r[`location-id`]})),{successLabel:`Deleted`})})};function Jf(e){return e.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 Yf={command:`get <location-id>`,describe:`Get a single Zero Trust Gateway location.`,builder:Jf,handler:async r=>l({command:`zero-trust gateway locations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway locations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/locations/${r[`location-id`]==null?`<location-id>`:encodeURIComponent(String(r[`location-id`]))}`,pathParams:{"location-id":String(r[`location-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.locations.get({account_id:l,location_id:r[`location-id`]})),{successLabel:`Loaded`})})};function Xf(e){return e.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 Zf={command:`list`,describe:`List Zero Trust Gateway locations for an account.`,builder:y(Xf),handler:async r=>l({command:`zero-trust gateway locations list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},r,async()=>{let i={filter:r.filter,search:r.search,order_by:r[`order-by`],direction:r.direction};if(r.dryRun){s({command:`cf zero-trust gateway locations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/locations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.locations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Qf(e){return e.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 $f={command:`update <location-id>`,describe:`Update a configured Zero Trust Gateway location.`,builder:Qf,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway locations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/locations/${r[`location-id`]==null?`<location-id>`:encodeURIComponent(String(r[`location-id`]))}`,pathParams:{"location-id":String(r[`location-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({client_default:r[`client-default`],dns_destination_ips_id:m(r[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:r[`ecs-support`],endpoints:{doh:{enabled:r[`endpoints-doh-enabled`],require_token:r[`endpoints-doh-require-token`]},dot:{enabled:r[`endpoints-dot-enabled`]},ipv4:{enabled:r[`endpoints-ipv4-enabled`]},ipv6:{enabled:r[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(r[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:r[`max-ttl-ttl-secs`]},name:m(r.name,`name`,`text`),networks:f(r.networks,`networks`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...e,account_id:l,location_id:r[`location-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await g(`name`,`Specify the location name.`));let u=p({client_default:r[`client-default`],dns_destination_ips_id:m(r[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:r[`ecs-support`],endpoints:{doh:{enabled:r[`endpoints-doh-enabled`],require_token:r[`endpoints-doh-require-token`]},dot:{enabled:r[`endpoints-dot-enabled`]},ipv4:{enabled:r[`endpoints-ipv4-enabled`]},ipv6:{enabled:r[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(r[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:r[`max-ttl-ttl-secs`]},name:m(r.name,`name`,`text`),networks:f(r.networks,`networks`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...u,account_id:l,location_id:r[`location-id`]})),{successLabel:`Updated`})})},ep={command:`locations`,describe:`Operations for gateway.locations`,builder:e=>e.command(Gf).command(qf).command(Yf).command(Zf).command($f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tp(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const np={command:`get`,describe:`Retrieve the current logging settings for the Zero Trust account.`,builder:tp,handler:async r=>l({command:`zero-trust gateway logging get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway logging get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.logging.get({account_id:l})),{successLabel:`Loaded`})})};function rp(e){return e.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 ip={command:`update`,describe:`Update logging settings for the current Zero Trust account.`,builder:rp,handler:async r=>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`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway logging update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({redact_pii:r[`redact-pii`],settings_by_rule_type:{dns:{log_all:r[`settings-by-rule-type-dns-log-all`],log_blocks:r[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:r[`settings-by-rule-type-http-log-all`],log_blocks:r[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:r[`settings-by-rule-type-l4-log-all`],log_blocks:r[`settings-by-rule-type-l4-log-blocks`]}}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({redact_pii:r[`redact-pii`],settings_by_rule_type:{dns:{log_all:r[`settings-by-rule-type-dns-log-all`],log_blocks:r[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:r[`settings-by-rule-type-http-log-all`],log_blocks:r[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:r[`settings-by-rule-type-l4-log-all`],log_blocks:r[`settings-by-rule-type-l4-log-blocks`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:u,account_id:l})),{successLabel:`Updated`})})},ap={command:`logging`,describe:`Operations for gateway.logging`,builder:e=>e.command(np).command(ip).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function op(e){return e.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 sp={command:`get <operation-id>`,describe:`Fetch a single Zero Trust Gateway operation by its ID.`,builder:op,handler:async r=>l({command:`zero-trust gateway operations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/operations/${r[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(r[`operation-id`]))}`,pathParams:{"operation-id":String(r[`operation-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.get({account_id:l,operation_id:r[`operation-id`]})),{successLabel:`Loaded`})})};function cp(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lp={command:`list`,describe:`List all Zero Trust Gateway operations for an account.`,builder:cp,handler:async r=>l({command:`zero-trust gateway operations list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/operations`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.list({account_id:l})),{successLabel:`Loaded`})})},up={command:`operations`,describe:`Operations for gateway.operations`,builder:e=>e.command(sp).command(lp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dp(e){return e.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 fp={command:`create`,describe:`Create a new Zero Trust Gateway PAC file.`,builder:dp,handler:async r=>l({command:`zero-trust gateway pacfiles create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway pacfiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/pacfiles`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({contents:m(r.contents,`contents`,`text`),description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),slug:m(r.slug,`slug`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...e,account_id:l})),{successLabel:`Created`});return}r.contents===void 0&&(r.contents=await g(`contents`,`Actual contents of the PAC file`)),r.name===void 0&&(r.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(r.contents,`contents`,`text`),description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`),slug:m(r.slug,`slug`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...u,account_id:l})),{successLabel:`Created`})})};function pp(e){return e.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 mp={command:`delete <pacfile-id>`,describe:`Delete a configured Zero Trust Gateway PAC file.`,builder:pp,handler:async r=>l({command:`zero-trust gateway pacfiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway pacfiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/pacfiles/${r[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(r[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(r[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
73
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.pacfiles.delete({account_id:l,pacfile_id:r[`pacfile-id`]})),{successLabel:`Deleted`})})};function hp(e){return e.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 gp={command:`get <pacfile-id>`,describe:`Get a single Zero Trust Gateway PAC file.`,builder:hp,handler:async r=>l({command:`zero-trust gateway pacfiles get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway pacfiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/pacfiles/${r[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(r[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(r[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.pacfiles.get({account_id:l,pacfile_id:r[`pacfile-id`]})),{successLabel:`Loaded`})})};function _p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vp={command:`list`,describe:`List all Zero Trust Gateway PAC files for an account.`,builder:_p,handler:async r=>l({command:`zero-trust gateway pacfiles list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway pacfiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/pacfiles`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.pacfiles.list({account_id:l})),{successLabel:`Loaded`})})};function yp(e){return e.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 bp={command:`update <pacfile-id>`,describe:`Update a configured Zero Trust Gateway PAC file.`,builder:yp,handler:async r=>l({command:`zero-trust gateway pacfiles update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway pacfiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/pacfiles/${r[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(r[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(r[`pacfile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({contents:m(r.contents,`contents`,`text`),description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...e,account_id:l,pacfile_id:r[`pacfile-id`]})),{successLabel:`Updated`});return}r.contents===void 0&&(r.contents=await g(`contents`,`Actual contents of the PAC file`)),r.description===void 0&&(r.description=await g(`description`,`Detailed description of the PAC file.`)),r.name===void 0&&(r.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(r.contents,`contents`,`text`),description:m(r.description,`description`,`text`),name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...u,account_id:l,pacfile_id:r[`pacfile-id`]})),{successLabel:`Updated`})})},xp={command:`pacfiles`,describe:`Operations for gateway.pacfiles`,builder:e=>e.command(fp).command(mp).command(gp).command(vp).command(bp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sp(e){return e.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 Cp={command:`create`,describe:`Create a new Zero Trust Gateway proxy endpoint.`,builder:Sp,handler:async r=>l({command:`zero-trust gateway proxy-endpoints create`,classification:{safeFlags:[`kind`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway proxy-endpoints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({kind:m(r.kind,`kind`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:e,account_id:l})),{successLabel:`Created`});return}r.kind===`identity`&&r.kind===void 0&&(r.kind=await g(`kind`,`The proxy endpoint kind.`,{question:`Enter value for --kind`}));let u=p({kind:m(r.kind,`kind`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:u,account_id:l})),{successLabel:`Created`})})};function wp(e){return e.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 Tp={command:`delete <proxy-endpoint-id>`,describe:`Delete a configured Zero Trust Gateway proxy endpoint.`,builder:wp,handler:async r=>l({command:`zero-trust gateway proxy-endpoints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway proxy-endpoints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/proxy_endpoints/${r[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(r[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(r[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
74
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.proxyEndpoints.delete({account_id:l,proxy_endpoint_id:r[`proxy-endpoint-id`]})),{successLabel:`Deleted`})})};function Ep(e){return e.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 Dp={command:`edit <proxy-endpoint-id>`,describe:`Update a configured Zero Trust Gateway proxy endpoint.`,builder:Ep,handler:async r=>l({command:`zero-trust gateway proxy-endpoints edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway proxy-endpoints edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/proxy_endpoints/${r[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(r[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(r[`proxy-endpoint-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({ips:r.ips,name:m(r.name,`name`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...e,account_id:l,proxy_endpoint_id:r[`proxy-endpoint-id`]})),{successLabel:`Updated`});return}let u=p({ips:r.ips,name:m(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...u,account_id:l,proxy_endpoint_id:r[`proxy-endpoint-id`]})),{successLabel:`Updated`})})};function Op(e){return e.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 kp={command:`get <proxy-endpoint-id>`,describe:`Get a single Zero Trust Gateway proxy endpoint.`,builder:Op,handler:async r=>l({command:`zero-trust gateway proxy-endpoints get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway proxy-endpoints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/proxy_endpoints/${r[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(r[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(r[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.proxyEndpoints.get({account_id:l,proxy_endpoint_id:r[`proxy-endpoint-id`]})),{successLabel:`Loaded`})})};function Ap(e){return e.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 jp={command:`list`,describe:`List all Zero Trust Gateway proxy endpoints for an account.`,builder:y(Ap),handler:async r=>l({command:`zero-trust gateway proxy-endpoints list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},r,async()=>{let i={filter:r.filter,search:r.search,order_by:r[`order-by`],direction:r.direction};if(r.dryRun){s({command:`cf zero-trust gateway proxy-endpoints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.proxyEndpoints.list({account_id:u,...i})),{successLabel:`Loaded`})})},Mp={command:`proxy-endpoints`,describe:`Operations for gateway.proxy-endpoints`,builder:e=>e.command(Cp).command(Tp).command(Dp).command(kp).command(jp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Np(e){return e.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 Pp={command:`bulk-edit`,describe:`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.`,builder:Np,handler:async r=>l({command:`zero-trust gateway rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.bulkEdit({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Fp(e){return e.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 Ip={command:`create`,describe:`Create a new Zero Trust Gateway rule.`,builder:Fp,handler:async r=>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(`.`)}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({action:m(r.action,`action`,`text`),description:m(r.description,`description`,`text`),device_posture:m(r[`device-posture`],`device-posture`,`text`),enabled:r.enabled,expiration:{duration:r[`expiration-duration`]},filters:r.filters,identity:m(r.identity,`identity`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,rule_settings:{allow_child_bypass:r[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:r[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(r[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:r[`rule-settings-biso-admin-controls-dcp`],dd:r[`rule-settings-biso-admin-controls-dd`],dk:r[`rule-settings-biso-admin-controls-dk`],download:m(r[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:r[`rule-settings-biso-admin-controls-dp`],du:r[`rule-settings-biso-admin-controls-du`],keyboard:m(r[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(r[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(r[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(r[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(r[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(r[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:r[`rule-settings-block-page-include-context`],target_uri:m(r[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:r[`rule-settings-block-page-enabled`],block_reason:m(r[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:r[`rule-settings-bypass-parent-rule`],check_session:{duration:m(r[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:r[`rule-settings-check-session-enforce`]},delete_headers:r[`rule-settings-delete-headers`],egress:{ipv4:m(r[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(r[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(r[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:r[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:r[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:r[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:r[`rule-settings-ip-categories`],ip_indicator_feeds:r[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(r[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:r[`rule-settings-l4override-port`]},notification_settings:{enabled:r[`rule-settings-notification-settings-enabled`],include_context:r[`rule-settings-notification-settings-include-context`],msg:m(r[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(r[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(r[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:r[`rule-settings-override-ips`],payload_log:{enabled:r[`rule-settings-payload-log-enabled`]},quarantine:{file_types:r[`rule-settings-quarantine-file-types`]},redirect:{include_context:r[`rule-settings-redirect-include-context`],preserve_path_and_query:r[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(r[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(r[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(r[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:r[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(r[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(r[`schedule-fri`],`schedule-fri`,`text`),mon:m(r[`schedule-mon`],`schedule-mon`,`text`),sat:m(r[`schedule-sat`],`schedule-sat`,`text`),sun:m(r[`schedule-sun`],`schedule-sun`,`text`),thu:m(r[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(r[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(r[`schedule-tue`],`schedule-tue`,`text`),wed:m(r[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(r.traffic,`traffic`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...e,account_id:l})),{successLabel:`Created`});return}r.action===void 0&&(r.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`])),r.name===void 0&&(r.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(r.action,`action`,`text`),description:m(r.description,`description`,`text`),device_posture:m(r[`device-posture`],`device-posture`,`text`),enabled:r.enabled,expiration:{duration:r[`expiration-duration`]},filters:r.filters,identity:m(r.identity,`identity`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,rule_settings:{allow_child_bypass:r[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:r[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(r[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:r[`rule-settings-biso-admin-controls-dcp`],dd:r[`rule-settings-biso-admin-controls-dd`],dk:r[`rule-settings-biso-admin-controls-dk`],download:m(r[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:r[`rule-settings-biso-admin-controls-dp`],du:r[`rule-settings-biso-admin-controls-du`],keyboard:m(r[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(r[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(r[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(r[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(r[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(r[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:r[`rule-settings-block-page-include-context`],target_uri:m(r[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:r[`rule-settings-block-page-enabled`],block_reason:m(r[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:r[`rule-settings-bypass-parent-rule`],check_session:{duration:m(r[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:r[`rule-settings-check-session-enforce`]},delete_headers:r[`rule-settings-delete-headers`],egress:{ipv4:m(r[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(r[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(r[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:r[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:r[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:r[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:r[`rule-settings-ip-categories`],ip_indicator_feeds:r[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(r[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:r[`rule-settings-l4override-port`]},notification_settings:{enabled:r[`rule-settings-notification-settings-enabled`],include_context:r[`rule-settings-notification-settings-include-context`],msg:m(r[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(r[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(r[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:r[`rule-settings-override-ips`],payload_log:{enabled:r[`rule-settings-payload-log-enabled`]},quarantine:{file_types:r[`rule-settings-quarantine-file-types`]},redirect:{include_context:r[`rule-settings-redirect-include-context`],preserve_path_and_query:r[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(r[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(r[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(r[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:r[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(r[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(r[`schedule-fri`],`schedule-fri`,`text`),mon:m(r[`schedule-mon`],`schedule-mon`,`text`),sat:m(r[`schedule-sat`],`schedule-sat`,`text`),sun:m(r[`schedule-sun`],`schedule-sun`,`text`),thu:m(r[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(r[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(r[`schedule-tue`],`schedule-tue`,`text`),wed:m(r[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(r.traffic,`traffic`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function Lp(e){return e.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 Rp={command:`delete <rule-id>`,describe:`Delete a Zero Trust Gateway rule.`,builder:Lp,handler:async r=>l({command:`zero-trust gateway rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
75
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.rules.delete({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Deleted`})})};function zp(e){return e.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 Bp={command:`edit <rule-id>`,describe:"Update 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.",builder:zp,handler:async r=>l({command:`zero-trust gateway rules edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),precedence:r.precedence}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(r.description,`description`,`text`),enabled:r.enabled,name:m(r.name,`name`,`text`),precedence:r.precedence});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...u,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})};function Vp(e){return e.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 Hp={command:`get <rule-id>`,describe:`Get a single Zero Trust Gateway rule.`,builder:Vp,handler:async r=>l({command:`zero-trust gateway rules get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.get({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Loaded`})})};function Up(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wp={command:`list-tenant`,describe:`List Zero Trust Gateway rules for the parent account of an account in the MSP configuration.`,builder:Up,handler:async r=>l({command:`zero-trust gateway rules list-tenant`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules list-tenant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/tenant`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.listTenant({account_id:l})),{successLabel:`Loaded`})})};function Gp(e){return e.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 Kp={command:`list`,describe:`List Zero Trust Gateway rules for an account.`,builder:y(Gp),handler:async r=>l({command:`zero-trust gateway rules list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},r,async()=>{let i={filter:r.filter,search:r.search,order_by:r[`order-by`],direction:r.direction};if(r.dryRun){s({command:`cf zero-trust gateway rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function qp(e){return e.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 Jp={command:`reset-expiration <rule-id>`,describe:"Resets 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`.",builder:qp,handler:async r=>l({command:`zero-trust gateway rules reset-expiration`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules reset-expiration`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}/reset_expiration`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.resetExpiration({account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Created`})})};function Yp(e){return e.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 Xp={command:`update <rule-id>`,describe:`Update a configured Zero Trust Gateway rule.`,builder:Yp,handler:async r=>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(`.`)}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust gateway rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/gateway/rules/${r[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(r[`rule-id`]))}`,pathParams:{"rule-id":String(r[`rule-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({action:m(r.action,`action`,`text`),description:m(r.description,`description`,`text`),device_posture:m(r[`device-posture`],`device-posture`,`text`),enabled:r.enabled,expiration:{duration:r[`expiration-duration`]},filters:r.filters,identity:m(r.identity,`identity`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,rule_settings:{allow_child_bypass:r[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:r[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(r[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:r[`rule-settings-biso-admin-controls-dcp`],dd:r[`rule-settings-biso-admin-controls-dd`],dk:r[`rule-settings-biso-admin-controls-dk`],download:m(r[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:r[`rule-settings-biso-admin-controls-dp`],du:r[`rule-settings-biso-admin-controls-du`],keyboard:m(r[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(r[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(r[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(r[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(r[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(r[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:r[`rule-settings-block-page-include-context`],target_uri:m(r[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:r[`rule-settings-block-page-enabled`],block_reason:m(r[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:r[`rule-settings-bypass-parent-rule`],check_session:{duration:m(r[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:r[`rule-settings-check-session-enforce`]},delete_headers:r[`rule-settings-delete-headers`],egress:{ipv4:m(r[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(r[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(r[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:r[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:r[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:r[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:r[`rule-settings-ip-categories`],ip_indicator_feeds:r[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(r[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:r[`rule-settings-l4override-port`]},notification_settings:{enabled:r[`rule-settings-notification-settings-enabled`],include_context:r[`rule-settings-notification-settings-include-context`],msg:m(r[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(r[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(r[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:r[`rule-settings-override-ips`],payload_log:{enabled:r[`rule-settings-payload-log-enabled`]},quarantine:{file_types:r[`rule-settings-quarantine-file-types`]},redirect:{include_context:r[`rule-settings-redirect-include-context`],preserve_path_and_query:r[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(r[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(r[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(r[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:r[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(r[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(r[`schedule-fri`],`schedule-fri`,`text`),mon:m(r[`schedule-mon`],`schedule-mon`,`text`),sat:m(r[`schedule-sat`],`schedule-sat`,`text`),sun:m(r[`schedule-sun`],`schedule-sun`,`text`),thu:m(r[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(r[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(r[`schedule-tue`],`schedule-tue`,`text`),wed:m(r[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(r.traffic,`traffic`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...e,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`});return}r.action===void 0&&(r.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`])),r.name===void 0&&(r.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(r.action,`action`,`text`),description:m(r.description,`description`,`text`),device_posture:m(r[`device-posture`],`device-posture`,`text`),enabled:r.enabled,expiration:{duration:r[`expiration-duration`]},filters:r.filters,identity:m(r.identity,`identity`,`text`),name:m(r.name,`name`,`text`),precedence:r.precedence,rule_settings:{allow_child_bypass:r[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:r[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(r[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:r[`rule-settings-biso-admin-controls-dcp`],dd:r[`rule-settings-biso-admin-controls-dd`],dk:r[`rule-settings-biso-admin-controls-dk`],download:m(r[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:r[`rule-settings-biso-admin-controls-dp`],du:r[`rule-settings-biso-admin-controls-du`],keyboard:m(r[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(r[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(r[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(r[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(r[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(r[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:r[`rule-settings-block-page-include-context`],target_uri:m(r[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:r[`rule-settings-block-page-enabled`],block_reason:m(r[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:r[`rule-settings-bypass-parent-rule`],check_session:{duration:m(r[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:r[`rule-settings-check-session-enforce`]},delete_headers:r[`rule-settings-delete-headers`],egress:{ipv4:m(r[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(r[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(r[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:r[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:r[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:r[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:r[`rule-settings-ip-categories`],ip_indicator_feeds:r[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(r[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:r[`rule-settings-l4override-port`]},notification_settings:{enabled:r[`rule-settings-notification-settings-enabled`],include_context:r[`rule-settings-notification-settings-include-context`],msg:m(r[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(r[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(r[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:r[`rule-settings-override-ips`],payload_log:{enabled:r[`rule-settings-payload-log-enabled`]},quarantine:{file_types:r[`rule-settings-quarantine-file-types`]},redirect:{include_context:r[`rule-settings-redirect-include-context`],preserve_path_and_query:r[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(r[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(r[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(r[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:r[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(r[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(r[`schedule-fri`],`schedule-fri`,`text`),mon:m(r[`schedule-mon`],`schedule-mon`,`text`),sat:m(r[`schedule-sat`],`schedule-sat`,`text`),sun:m(r[`schedule-sun`],`schedule-sun`,`text`),thu:m(r[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(r[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(r[`schedule-tue`],`schedule-tue`,`text`),wed:m(r[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(r.traffic,`traffic`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...u,account_id:l,rule_id:r[`rule-id`]})),{successLabel:`Updated`})})},Zp={command:`rules`,describe:`Operations for gateway.rules`,builder:e=>e.command(Pp).command(Ip).command(Rp).command(Bp).command(Hp).command(Kp).command(Wp).command(Jp).command(Xp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qp={command:`gateway`,describe:`Operations for gateway`,builder:e=>e.command(_f).command(Tf).command(Fd).command(Hd).command(Gd).command(af).command(hf).command(bf).command(Cf).command(Uf).command(ep).command(ap).command(up).command(xp).command(Mp).command(Zp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $p(e){return e.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 em={command:`create`,describe:`Adds a new identity provider to Access.`,builder:$p,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/identity_providers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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 tm(e){return e.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 nm={command:`delete <identity-provider-id>`,describe:`Deletes an identity provider from Access.`,builder:tm,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
76
- `);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 rm(e){return e.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:`get <identity-provider-id>`,describe:`Fetches a configured identity provider.`,builder:rm,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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 am(e){return e.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 om={command:`list`,describe:`Lists all configured identity providers.`,builder:am,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/identity_providers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();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 sm(e){return e.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 cm={command:`create <identity-provider-id>`,describe:"Creates 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",builder:sm,handler:async r=>l({command:`zero-trust identity-providers saml-certificate create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust identity-providers saml-certificate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/identity_providers/${r[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(r[`identity-provider-id`]))}/saml_certificate`,pathParams:{"identity-provider-id":String(r[`identity-provider-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.identityProviders.samlCertificate.create({account_id:l,identity_provider_id:r[`identity-provider-id`]})),{successLabel:`Created`})})},lm={command:`saml-certificate`,describe:`Operations for identity-providers.saml-certificate`,builder:e=>e.command(cm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function um(e){return e.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 dm={command:`list`,describe:`Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`,builder:um,handler:async r=>l({command:`zero-trust identity-providers scim groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={cf_resource_id:r[`cf-resource-id`],idp_resource_id:r[`idp-resource-id`],name:r.name,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust identity-providers scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/identity_providers/${r[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(r[`identity-provider-id`]))}/scim/groups`,pathParams:{"identity-provider-id":String(r[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.groups.list({account_id:u,identity_provider_id:r[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},fm={command:`groups`,describe:`Operations for identity-providers.scim.groups`,builder:e=>e.command(dm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pm(e){return e.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 mm={command:`list`,describe:`Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`,builder:pm,handler:async r=>l({command:`zero-trust identity-providers scim users list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={cf_resource_id:r[`cf-resource-id`],idp_resource_id:r[`idp-resource-id`],username:r.username,email:r.email,name:r.name,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf zero-trust identity-providers scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/identity_providers/${r[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(r[`identity-provider-id`]))}/scim/users`,pathParams:{"identity-provider-id":String(r[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.users.list({account_id:u,identity_provider_id:r[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},hm={command:`users`,describe:`Operations for identity-providers.scim.users`,builder:e=>e.command(mm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},gm={command:`scim`,describe:`Operations for identity-providers.scim`,builder:e=>e.command(fm).command(hm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _m(e){return e.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 vm={command:`update <identity-provider-id>`,describe:`Updates a configured identity provider.`,builder:_m,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/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(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.`)})},ym={command:`identity-providers`,describe:`Operations for identity-providers`,builder:e=>e.command(em).command(nm).command(im).command(om).command(vm).command(lm).command(gm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bm(e){return e.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 xm={command:`create`,describe:`Sets up a Zero Trust organization for your account or zone.`,builder:bm,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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 Sm(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cm={command:`get`,describe:`Returns the DoH settings for your Zero Trust organization.`,builder:Sm,handler:async r=>l({command:`zero-trust organizations doh get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust organizations doh get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.organizations.doh.get({account_id:l})),{successLabel:`Loaded`})})};function wm(e){return e.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 Tm={command:`update`,describe:`Updates the DoH settings for your Zero Trust organization.`,builder:wm,handler:async r=>l({command:`zero-trust organizations doh update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust organizations doh update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({doh_jwt_duration:m(r[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(r[`service-token-id`],`service-token-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.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(r[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(r[`service-token-id`],`service-token-id`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.organizations.doh.update({...u,account_id:l})),{successLabel:`Updated`})})},Em={command:`doh`,describe:`Operations for organizations.doh`,builder:e=>e.command(Cm).command(Tm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Dm(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Om={command:`list`,describe:`Returns the configuration for your Zero Trust organization.`,builder:Dm,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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 km(e){return e.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 Am={command:`revoke-users`,describe:`Revokes a user's access across all applications.`,builder:km,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations revoke-users`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/organizations/revoke_user`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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.
77
- `);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 jm(e){return e.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 Mm={command:`update`,describe:`Updates the configuration for your Zero Trust organization.`,builder:jm,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 n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/access/organizations`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},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 r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();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`})})},Nm={command:`organizations`,describe:`Operations for organizations`,builder:e=>e.command(xm).command(Om).command(Am).command(Mm).command(Em).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pm(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fm={command:`list`,describe:`Lists all DLP custom profiles in an account.`,builder:Pm,handler:async r=>l({command:`zero-trust profiles custom list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.custom.list({account_id:l})),{successLabel:`Loaded`})})},Im={command:`custom`,describe:`Profiles operations`,builder:e=>e.command(Fm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Lm(e){return e.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 Rm={command:`create`,describe:`Creates a DLP predefined profile. Only supports enabling/disabling entries.`,builder:Lm,handler:async r=>l({command:`zero-trust profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`],profile_id:m(r[`profile-id`],`profile-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...e,account_id:l})),{successLabel:`Created`});return}r[`profile-id`]===void 0&&(r[`profile-id`]=await g(`profile-id`,`The profile_id field`));let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`],profile_id:m(r[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...u,account_id:l})),{successLabel:`Created`})})};function zm(e){return e.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 Bm={command:`get <profile-id>`,describe:`Fetches a predefined DLP profile by id.`,builder:zm,handler:async r=>l({command:`zero-trust profiles predefined get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.predefined.get({account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Loaded`})})};function Vm(e){return e.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 Hm={command:`update <profile-id>`,describe:`Updates a DLP predefined profile. Only supports enabling/disabling entries.`,builder:Vm,handler:async r=>l({command:`zero-trust profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/profiles/predefined/${r[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(r[`profile-id`]))}`,pathParams:{"profile-id":String(r[`profile-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...e,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`});return}let u=p({ai_context_enabled:r[`ai-context-enabled`],allowed_match_count:r[`allowed-match-count`],confidence_threshold:m(r[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:r[`context-awareness-enabled`],skip:{files:r[`context-awareness-skip-files`]}},entries:f(r.entries,`entries`),ocr_enabled:r[`ocr-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...u,account_id:l,profile_id:r[`profile-id`]})),{successLabel:`Updated`})})},Um={command:`predefined`,describe:`Profiles operations`,builder:e=>e.command(Rm).command(Bm).command(Hm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wm={command:`profiles`,describe:`Operations for profiles`,builder:e=>e.command(Im).command(Um).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gm(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Km={command:`get`,describe:`Retrieves configured risk score behaviors that define how user actions affect their overall risk score.`,builder:Gm,handler:async r=>l({command:`zero-trust risk-scoring behaviours get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring behaviours get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.behaviours.get({account_id:l})),{successLabel:`Loaded`})})};function qm(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Behaviors.`})}const Jm={command:`update`,describe:`Updates risk score behavior configurations, defining weights and thresholds for risk calculation.`,builder:qm,handler:async r=>l({command:`zero-trust risk-scoring behaviours update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring behaviours update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.behaviours.update({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ym={command:`behaviours`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Km).command(Jm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xm(e){return e.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 Zm={command:`get <user-id>`,describe:`Retrieves the detailed risk score breakdown for a specific user, including contributing factors.`,builder:Xm,handler:async r=>l({command:`zero-trust risk-scoring get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.get({account_id:l,user_id:r[`user-id`]})),{successLabel:`Loaded`})})};function Qm(e){return e.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).
78
- 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 $m={command:`create`,describe:`Creates a new Zero Trust risk score integration, connecting external risk signals to Cloudflare's risk scoring system.`,builder:Qm,handler:async r=>l({command:`zero-trust risk-scoring integrations create`,classification:{safeFlags:[`integration-type`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({integration_type:m(r[`integration-type`],`integration-type`,`text`),reference_id:m(r[`reference-id`],`reference-id`,`text`),tenant_url:m(r[`tenant-url`],`tenant-url`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...e,account_id:l})),{successLabel:`Created`});return}r[`integration-type`]===void 0&&(r[`integration-type`]=await _(`integration-type`,`The integration_type field`,[`Okta`])),r[`tenant-url`]===void 0&&(r[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({integration_type:m(r[`integration-type`],`integration-type`,`text`),reference_id:m(r[`reference-id`],`reference-id`,`text`),tenant_url:m(r[`tenant-url`],`tenant-url`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...u,account_id:l})),{successLabel:`Created`})})};function eh(e){return e.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 th={command:`delete <integration-id>`,describe:`Removes a Zero Trust risk score integration, disconnecting the external risk signal source.`,builder:eh,handler:async r=>l({command:`zero-trust risk-scoring integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
79
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.integrations.delete({account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Deleted`})})};function nh(e){return e.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 rh={command:`get <integration-id>`,describe:`Gets a Zero Trust risk score integration by ID.`,builder:nh,handler:async r=>l({command:`zero-trust risk-scoring integrations get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.get({account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Loaded`})})};function ih(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ah={command:`list`,describe:`Lists all configured Zero Trust risk score integrations for the account.`,builder:ih,handler:async r=>l({command:`zero-trust risk-scoring integrations list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.list({account_id:l})),{successLabel:`Loaded`})})};function oh(e){return e.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 sh={command:`get <reference-id>`,describe:`Retrieves a Zero Trust risk score integration using its external reference ID.`,builder:oh,handler:async r=>l({command:`zero-trust risk-scoring integrations references get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations/reference_id/${r[`reference-id`]==null?`<reference-id>`:encodeURIComponent(String(r[`reference-id`]))}`,pathParams:{"reference-id":String(r[`reference-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.references.get({account_id:l,reference_id:r[`reference-id`]})),{successLabel:`Loaded`})})},ch={command:`references`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(sh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lh(e){return e.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).
80
- 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 uh={command:`update <integration-id>`,describe:`Overwrite the reference_id, tenant_url, and active values with the ones provided.`,builder:lh,handler:async r=>l({command:`zero-trust risk-scoring integrations update`,classification:{safeFlags:[`active`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/integrations/${r[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(r[`integration-id`]))}`,pathParams:{"integration-id":String(r[`integration-id`]??``)},bodyKind:`json`,body:r.body===void 0?p({active:r.active,reference_id:m(r[`reference-id`],`reference-id`,`text`),tenant_url:m(r[`tenant-url`],`tenant-url`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...e,account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Updated`});return}if(r.active===void 0)throw Error(`--active is required (or pass --body with this field set).`);r[`tenant-url`]===void 0&&(r[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({active:r.active,reference_id:m(r[`reference-id`],`reference-id`,`text`),tenant_url:m(r[`tenant-url`],`tenant-url`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...u,account_id:l,integration_id:r[`integration-id`]})),{successLabel:`Updated`})})},dh={command:`integrations`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command($m).command(th).command(rh).command(ah).command(uh).command(ch).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fh(e){return e.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 ph={command:`reset <user-id>`,describe:`Resets risk scores for specified users, clearing their accumulated risk history.`,builder:fh,handler:async r=>l({command:`zero-trust risk-scoring reset`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring reset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/reset`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force,message:`This operation wipes risk-scoring history.`})){process.stderr.write(`Aborted.
81
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.reset({account_id:l,user_id:r[`user-id`]})),{successLabel:`Deleted`})})};function mh(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hh={command:`get`,describe:`Gets an aggregate summary of risk scores across the account, including distribution and trends.`,builder:mh,handler:async r=>l({command:`zero-trust risk-scoring summary get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust risk-scoring summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zt_risk_scoring/summary`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.summary.get({account_id:l})),{successLabel:`Loaded`})})},gh={command:`summary`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(hh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_h={command:`risk-scoring`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Zm).command(ph).command(Ym).command(dh).command(gh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vh(e){return e.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 yh={command:`edit`,describe:"Removes a user from a Zero Trust seat when both `access_seat` and `gateway_seat` are set to false.",builder:vh,handler:async r=>l({command:`zero-trust seats edit`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust seats edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/seats`,pathParams:{},bodyKind:`json`,body:r.body===void 0?void 0:d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.seats.edit({body:e,account_id:l})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},bh={command:`seats`,describe:`Operations for seats`,builder:e=>e.command(yh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xh(e){return e.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 Sh={command:`delete`,describe:`Deletes account-level DLP settings and returns the initial values.`,builder:xh,handler:async r=>l({command:`zero-trust settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
82
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.settings.delete({account_id:l})),{successLabel:`Deleted`})})};function Ch(e){return e.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.
83
-
84
- - Set to a non-empty base64 string to enable payload logging with the given key.
85
- - Set to an empty string to disable payload logging.
86
- - 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 wh={command:`edit`,describe:`Missing fields keep their existing values.`,builder:Ch,handler:async r=>l({command:`zero-trust settings edit`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({ai_context_analysis:r[`ai-context-analysis`],ocr:r.ocr,payload_logging:{masking_level:m(r[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(r[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.edit({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({ai_context_analysis:r[`ai-context-analysis`],ocr:r.ocr,payload_logging:{masking_level:m(r[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(r[`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 Th(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Eh={command:`get`,describe:`Gets the account-level DLP settings.`,builder:Th,handler:async r=>l({command:`zero-trust settings get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.settings.get({account_id:l})),{successLabel:`Loaded`})})};function Dh(e){return e.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.
87
-
88
- - Set to a non-empty base64 string to enable payload logging with the given key.
89
- - Set to an empty string to disable payload logging.
90
- - 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 Oh={command:`update`,describe:`Missing fields are reset to initial (unconfigured) values.`,builder:Dh,handler:async r=>l({command:`zero-trust settings update`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({ai_context_analysis:r[`ai-context-analysis`],ocr:r.ocr,payload_logging:{masking_level:m(r[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(r[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.update({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({ai_context_analysis:r[`ai-context-analysis`],ocr:r.ocr,payload_logging:{masking_level:m(r[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(r[`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`})})},kh={command:`settings`,describe:`Settings operations`,builder:e=>e.command(Sh).command(wh).command(Eh).command(Oh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ah(e){return e.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 jh={command:`delete <authenticator-id>`,describe:`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.`,builder:Ah,handler:async r=>l({command:`zero-trust users mfa authenticators delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({command:`cf zero-trust users mfa authenticators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}/mfa_authenticators/${r[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(r[`authenticator-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``),"authenticator-id":String(r[`authenticator-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await v({force:!!r.force})){process.stderr.write(`Aborted.
91
- `);return}o(await c(`Deleting`,async()=>i.zeroTrust.users.mfa.authenticators.delete({account_id:l,user_id:r[`user-id`],authenticator_id:r[`authenticator-id`]})),{successLabel:`Deleted`})})},Mh={command:`authenticators`,describe:`Operations for users.mfa.authenticators`,builder:e=>e.command(jh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Nh={command:`mfa`,describe:`Operations for users.mfa`,builder:e=>e.command(Mh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ph={command:`users`,describe:`Operations for users`,builder:e=>e.command(Nh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fh={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(mo).command(qs).command(md).command(Md).command(Qp).command(ym).command(Nm).command(Wm).command(_h).command(bh).command(kh).command(Ph).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Fh as default};