cf 1.0.0-beta.14 → 1.0.0-beta.16

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 (458) hide show
  1. package/README.md +10 -0
  2. package/dist/_meta/commands.json +6545 -3180
  3. package/dist/_meta/hand-written-commands.json +35 -2
  4. package/dist/_meta/schemas.json +7031 -4599
  5. package/dist/abuse-reports-17K-TRhO.mjs +24 -0
  6. package/dist/{access-k1QjF5rE.mjs → access-BwB7sg1D.mjs} +1 -1
  7. package/dist/account-tags-povXTDAu.mjs +15 -0
  8. package/dist/accounts-BnIGu_ac.mjs +132 -0
  9. package/dist/acm-CQRcu_zw.mjs +15 -0
  10. package/dist/addressing-Qcm9jd3C.mjs +105 -0
  11. package/dist/agent-memory-B3xN9I6-.mjs +34 -0
  12. package/dist/ai-BRKOCckA.mjs +31 -0
  13. package/dist/ai-audit-Cd9Rc2Fc.mjs +6 -0
  14. package/dist/ai-gateway-BWU5064V.mjs +80 -0
  15. package/dist/ai-search-CJ3b8eot.mjs +79 -0
  16. package/dist/ai-security-Dn0Ee6QS.mjs +10 -0
  17. package/dist/alerting-BXTiMfXo.mjs +56 -0
  18. package/dist/analytics-Jyd04TRW.mjs +17 -0
  19. package/dist/analytics-engine-CzrNfUeh.mjs +4 -0
  20. package/dist/api-eMuS5GI1.mjs +3 -0
  21. package/dist/api-security-DRBHZaf_.mjs +154 -0
  22. package/dist/argo-DiQt0pSb.mjs +14 -0
  23. package/dist/artifacts-eBZ4YN53.mjs +43 -0
  24. package/dist/audit-logs-Bb4HTZay.mjs +4 -0
  25. package/dist/auth-C6My1gI6.mjs +2 -0
  26. package/dist/auth-OFqV2M4q.mjs +2 -0
  27. package/dist/auth-eVI_UEt8.mjs +2 -0
  28. package/dist/{auth-token-Dop0wLCw.mjs → auth-token-Cfj2yehs.mjs} +1 -1
  29. package/dist/{autoconfig-RQ3HS4m1.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
  30. package/dist/basin-catalog-Cwk1RSMX.mjs +46 -0
  31. package/dist/billing-CfV8oi6A.mjs +23 -0
  32. package/dist/blocks-Bat9A8V_.mjs +5 -0
  33. package/dist/bot-management-CH4_Kewx.mjs +9 -0
  34. package/dist/botnet-feed-Cg_Wp8ei.mjs +11 -0
  35. package/dist/brand-protection-Cp2ckWou.mjs +27 -0
  36. package/dist/browser-run-CfQ30dB6.mjs +42 -0
  37. package/dist/build-Bm6kGyzo.mjs +2 -0
  38. package/dist/{build-CCe7IrWT.mjs → build-sBpqm9ga.mjs} +1 -1
  39. package/dist/builds-B2RBgVL9.mjs +71 -0
  40. package/dist/cache-yvrYPvRI.mjs +45 -0
  41. package/dist/certificate-authorities-BdMRaOnD.mjs +6 -0
  42. package/dist/cf-Bq4pA4n6.mjs +18 -0
  43. package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
  44. package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
  45. package/dist/{chunk-DSGVRFIS-CPI5cYtB.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
  46. package/dist/{cli-ht4q6i2y.mjs → cli-CsnoQloF.mjs} +1 -1
  47. package/dist/client-certificates-CuWGvZSr.mjs +13 -0
  48. package/dist/client-side-security-D50iZjd_.mjs +63 -0
  49. package/dist/cloud-connector-wvSGdxWT.mjs +6 -0
  50. package/dist/{cloudflared-D83U8Yn3.mjs → cloudflared-By8BzYXc.mjs} +1 -1
  51. package/dist/cloudforce-one-j6vlmaMB.mjs +405 -0
  52. package/dist/{command-9VAc7b30.mjs → command-74P4_CTx.mjs} +1 -1
  53. package/dist/{command-B_Ixlz8Q.mjs → command-BDpm-U8z.mjs} +1 -1
  54. package/dist/{command-OHov3PEc.mjs → command-BSbhJRmu.mjs} +1 -1
  55. package/dist/{command-DjEJaOwV.mjs → command-BbO3sBQ2.mjs} +1 -1
  56. package/dist/{command-CtVUNm__.mjs → command-Bgb-3yPg.mjs} +1 -1
  57. package/dist/{command-DtgJilOK.mjs → command-C6w1OdoC.mjs} +1 -1
  58. package/dist/{command-CyJQ40fc.mjs → command-CM_f48gs.mjs} +1 -1
  59. package/dist/command-CmUtmu5j.mjs +2 -0
  60. package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
  61. package/dist/{command-SmWD-MeI.mjs → command-DFRsim8q.mjs} +1 -1
  62. package/dist/command-DQojhTEQ.mjs +2 -0
  63. package/dist/{command-CUNMrMou.mjs → command-DZfKHiru.mjs} +1 -1
  64. package/dist/{command-BtDY_MKv.mjs → command-DiqRELHF.mjs} +1 -1
  65. package/dist/{command-DXaRn1ls.mjs → command-DppVezAB.mjs} +1 -1
  66. package/dist/{command-Ckb9FufU.mjs → command-Dr4PEvB2.mjs} +1 -1
  67. package/dist/{completions-CuqAO3N_.mjs → completions-oD1EcuHk.mjs} +1 -1
  68. package/dist/config.mjs +0 -0
  69. package/dist/connector-interrupts-DP4rbOe8.mjs +6 -0
  70. package/dist/connector-telemetry-events-BQGBQwzR.mjs +6 -0
  71. package/dist/connector-telemetry-snapshots-DBO0Mdcj.mjs +6 -0
  72. package/dist/connectors-BSVr3Kz1.mjs +15 -0
  73. package/dist/containers-BOpKpipz.mjs +376 -0
  74. package/dist/containers-BTqAeVV2.mjs +78 -0
  75. package/dist/content-scan-B9Keyxe-.mjs +14 -0
  76. package/dist/{context-BBLtgdR1.mjs → context-B-vEsyrK.mjs} +2 -2
  77. package/dist/{cps-C5phNoVU.mjs → cps-VRP794c5.mjs} +3 -3
  78. package/dist/create-OXylMu6m.mjs +2 -0
  79. package/dist/csam-scanner-C1jOgXVu.mjs +10 -0
  80. package/dist/ct-alerting-Y9vfa6Fo.mjs +5 -0
  81. package/dist/custom-certificates-CojTEC0E.mjs +17 -0
  82. package/dist/custom-csrs-DM5X-K6H.mjs +11 -0
  83. package/dist/custom-hostnames-BBjqaiFF.mjs +27 -0
  84. package/dist/custom-nameservers-C0NDMLPJ.mjs +9 -0
  85. package/dist/custom-pages-M4RUxcn6.mjs +21 -0
  86. package/dist/{d1-EQMUlHTJ.mjs → d1-hin5PmxW.mjs} +31 -31
  87. package/dist/dcv-delegation-KOO8syyQ.mjs +4 -0
  88. package/dist/delegate.mjs +0 -0
  89. package/dist/{deploy-B22sEVHd.mjs → deploy-Bo7FtE44.mjs} +1 -1
  90. package/dist/deploy-context-ClvBD87y.mjs +56 -0
  91. package/dist/{deploy-input-BCjcuP6u.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
  92. package/dist/{dev-ClhhXuNU.mjs → dev-EtnMYA7K.mjs} +1 -1
  93. package/dist/diagnostics-LZuMrGjK.mjs +15 -0
  94. package/dist/{dist-DmRM6WSZ.mjs → dist-DZRTPMMA.mjs} +4 -4
  95. package/dist/dls-Bq8k3iy-.mjs +17 -0
  96. package/dist/dns-firewall-zavP5Qxj.mjs +71 -0
  97. package/dist/dns-ry5E2Bsa.mjs +144 -0
  98. package/dist/docs-B08YtL0U.mjs +3 -0
  99. package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
  100. package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
  101. package/dist/durable-objects-B9fo41B1.mjs +6 -0
  102. package/dist/email-auth-D9LGjFlh.mjs +6 -0
  103. package/dist/email-routing-6iDnNPhY.mjs +45 -0
  104. package/dist/email-security-ty4ufRnJ.mjs +158 -0
  105. package/dist/email-sending-d7LO_Cz_.mjs +47 -0
  106. package/dist/error-sanitization-CIQOep3I.mjs +2 -0
  107. package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
  108. package/dist/field-extractors-DkgQ7PSw.mjs +9 -0
  109. package/dist/firewall-Q88YyEwD.mjs +36 -0
  110. package/dist/flagship-CzI8zhd6.mjs +28 -0
  111. package/dist/fraud-CvFXTR0w.mjs +22 -0
  112. package/dist/get-By1q8YlI.mjs +2 -0
  113. package/dist/get-CRKvqCu6.mjs +2 -0
  114. package/dist/get-iPUHxD1r.mjs +2 -0
  115. package/dist/google-tag-gateway-Y2zbyey8.mjs +6 -0
  116. package/dist/healthchecks-4Hz-6xYi.mjs +22 -0
  117. package/dist/{hostnames-DvaUSzsj.mjs → hostnames-B3k7fIUL.mjs} +6 -6
  118. package/dist/hyperdrive-BWGYz95H.mjs +37 -0
  119. package/dist/iam-AXco_qmt.mjs +52 -0
  120. package/dist/images-BzYh8y0u.mjs +71 -0
  121. package/dist/index.mjs +1 -1
  122. package/dist/{init-Da8pe296.mjs → init-DlenHBtS.mjs} +2 -2
  123. package/dist/intel-BBi3i_GU.mjs +76 -0
  124. package/dist/ips-CWG2b7AM.mjs +4 -0
  125. package/dist/k2-DXdMe3Cb.mjs +11 -0
  126. package/dist/keyless-certificates-B4ta_OGS.mjs +13 -0
  127. package/dist/keys-B9zvFzrf.mjs +4 -0
  128. package/dist/kv-FUd7UdDu.mjs +15 -0
  129. package/dist/{lazy-command-CDWwCsD2.mjs → lazy-command-BC8rIlHu.mjs} +1 -1
  130. package/dist/leaked-credential-checks-BufVA9vL.mjs +18 -0
  131. package/dist/{load-balancers-Bu9pd2SV.mjs → load-balancers-CWd9mSWM.mjs} +40 -40
  132. package/dist/{local-BcPM4I0s.mjs → local-Dil4fTWX.mjs} +1 -1
  133. package/dist/local-DxWDQDnG.mjs +2 -0
  134. package/dist/{local-runtime-BHKyRlCP.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
  135. package/dist/login-BJr2PBaJ.mjs +5 -0
  136. package/dist/login-DVbXZ_Tv.mjs +2 -0
  137. package/dist/logo-matches-BluaPvMa.mjs +6 -0
  138. package/dist/logos-CXtmYWEJ.mjs +7 -0
  139. package/dist/logpush-DCYgrqz0.mjs +46 -0
  140. package/dist/logs-as60IP29.mjs +36 -0
  141. package/dist/magic-cloud-networking-0RsHugUF.mjs +71 -0
  142. package/dist/magic-network-monitoring-CPqvZdcb.mjs +36 -0
  143. package/dist/magic-transit-ClPyGzOE.mjs +386 -0
  144. package/dist/managed-defense-P4_QWSbK.mjs +18 -0
  145. package/dist/managed-transforms-CUwQXMij.mjs +9 -0
  146. package/dist/matches-BjckDBW1.mjs +6 -0
  147. package/dist/mcp-C2EG2c7L.mjs +32 -0
  148. package/dist/mesh-CpMZA7Xt.mjs +26 -0
  149. package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
  150. package/dist/monetization-DypuCZmU.mjs +20 -0
  151. package/dist/mtls-certificates-B5AWTU6u.mjs +13 -0
  152. package/dist/network-DQ5Ridgy.mjs +50 -0
  153. package/dist/network-interconnects-ifU4JhGE.mjs +72 -0
  154. package/dist/o11y-CzssfRHt.mjs +93 -0
  155. package/dist/{oauth-n8um6MFk.mjs → oauth-BDdhqasa.mjs} +1 -1
  156. package/dist/oauth-BNTiErBG.mjs +4 -0
  157. package/dist/oauth-clients-gknNcBdV.mjs +16 -0
  158. package/dist/oauth-scopes-BJeSanuF.mjs +4 -0
  159. package/dist/organization-CXAM41sd.mjs +71 -0
  160. package/dist/organizations-kfFFW4uO.mjs +4 -0
  161. package/dist/origin-ca-certificates-DwhYV3m_.mjs +11 -0
  162. package/dist/origin-post-quantum-encryption-DfrnptJ1.mjs +6 -0
  163. package/dist/origin-tls-client-auth-COSxTc2q.mjs +30 -0
  164. package/dist/output-Co4xdFf6.mjs +2 -0
  165. package/dist/page-rules-ByrDMDBZ.mjs +39 -0
  166. package/dist/{pages-Bn0Sg1ay.mjs → pages-DuGcBC6k.mjs} +29 -29
  167. package/dist/path-DRw6Y-nd.mjs +2 -0
  168. package/dist/pay-per-crawl-B3_Gn9Cj.mjs +38 -0
  169. package/dist/pay-per-use-49EXt75f.mjs +33 -0
  170. package/dist/pipelines-Bvgh1BQZ.mjs +44 -0
  171. package/dist/precursor-VobQf--m.mjs +4 -0
  172. package/dist/previews-DkwFHNRx.mjs +7 -0
  173. package/dist/progress-R-1tIuep.mjs +2 -0
  174. package/dist/prompt-dgLm0iFJ.mjs +4 -0
  175. package/dist/queries-EbIadtC5.mjs +9 -0
  176. package/dist/queues-C4GZ-O3f.mjs +57 -0
  177. package/dist/r2-DEuFfWBR.mjs +128 -0
  178. package/dist/{radar-CdvQL4xm.mjs → radar-CDOERVcR.mjs} +150 -150
  179. package/dist/raw-fetch-BapeoreV.mjs +2 -0
  180. package/dist/realtime-D_A9Qgly.mjs +172 -0
  181. package/dist/registrar-X1YLlnmg.mjs +43 -0
  182. package/dist/registrar-sandbox-BF3cYO3n.mjs +56 -0
  183. package/dist/{registry-PI6sO95I.mjs → registry-CRnk93ur.mjs} +1 -1
  184. package/dist/reporting-BWm9jIF8.mjs +14 -0
  185. package/dist/{request-headers-D8L95bEQ.mjs → request-headers-BRxv6NkA.mjs} +1 -1
  186. package/dist/request-tracers-CHWpiejG.mjs +4 -0
  187. package/dist/resolve-BpgXeklt.mjs +2 -0
  188. package/dist/resolve-C3FmNlSO.mjs +2 -0
  189. package/dist/resource-sharing-C186jZv0.mjs +40 -0
  190. package/dist/resource-tagging-BTagOZli.mjs +4 -0
  191. package/dist/rules-DYnGIU_0.mjs +18 -0
  192. package/dist/rulesets-BcNrbVcq.mjs +37 -0
  193. package/dist/rum-BDyRecfp.mjs +30 -0
  194. package/dist/{run-CW2Cgi0S.mjs → run-BvDCuZ8q.mjs} +1 -1
  195. package/dist/run-roYb_Odh.mjs +2 -0
  196. package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
  197. package/dist/{schema-flags-BTItUu1K.mjs → schema-flags-DcKjAxI1.mjs} +1 -1
  198. package/dist/scim-zn-CNCsc.mjs +18 -0
  199. package/dist/secrets-store-CFhyQUV6.mjs +24 -0
  200. package/dist/security-insights-D8XgtCed.mjs +40 -0
  201. package/dist/security-txt-CCM-Vro0.mjs +9 -0
  202. package/dist/session-Cq3YNLoI.mjs +2 -0
  203. package/dist/shared-ouAF7o4S.mjs +2 -0
  204. package/dist/smart-shield-DwW7N92r.mjs +24 -0
  205. package/dist/snippets-B2jBY0m_.mjs +20 -0
  206. package/dist/{spawn-D07wH-MH.mjs → spawn-DQttFH05.mjs} +1 -1
  207. package/dist/{spectrum-B6qkjR_Z.mjs → spectrum-Cf_4cGE8.mjs} +16 -16
  208. package/dist/speed-DoXdyIYK.mjs +24 -0
  209. package/dist/sql-Bze4h80q.mjs +4 -0
  210. package/dist/src-BguQDHjS.mjs +125 -0
  211. package/dist/ssl-u_0gUhPA.mjs +45 -0
  212. package/dist/{startup-profile-CrtCP-6-.mjs → startup-profile-BOaseXnO.mjs} +1 -1
  213. package/dist/startup-profile-BwEZFVGS.mjs +2 -0
  214. package/dist/{state-DIiIGEtR.mjs → state-Boubf1X6.mjs} +1 -1
  215. package/dist/state-CODDG9Nx.mjs +2 -0
  216. package/dist/stream-BcReYIHJ.mjs +102 -0
  217. package/dist/submit-ldFVNfNC.mjs +4 -0
  218. package/dist/{tags-CX23P4jg.mjs → tags-D_Hc_A-r.mjs} +2 -2
  219. package/dist/{telemetry-ZlCi5Xhc.mjs → telemetry-Cojgz4Sv.mjs} +1 -1
  220. package/dist/telemetry-Ct_2AaO4.mjs +2 -0
  221. package/dist/tenant-AZ0EAsmT.mjs +10 -0
  222. package/dist/tenant-custom-nameservers-aozjaasc.mjs +9 -0
  223. package/dist/theme-BGHWSKCw.mjs +6 -0
  224. package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
  225. package/dist/tunnels-CXez5LPB.mjs +29 -0
  226. package/dist/turnstile-B2NQ8Nsk.mjs +33 -0
  227. package/dist/ui-BtIBQeaG.mjs +2 -0
  228. package/dist/{update-check-HFkPml6x.mjs → update-check-BlyKN8m0.mjs} +1 -1
  229. package/dist/update-check-BnGDxswi.mjs +2 -0
  230. package/dist/update-check-worker.mjs +1 -1
  231. package/dist/url-info-D_UqGiWD.mjs +4 -0
  232. package/dist/url-normalization-CF1YHpIN.mjs +9 -0
  233. package/dist/url-scanner-ChF3GO2U.mjs +16 -0
  234. package/dist/{user-rXca0J9M.mjs → user-BfWRsdJh.mjs} +58 -58
  235. package/dist/values-CLfxkAUJ.mjs +4 -0
  236. package/dist/vectorize-CRYbWKg5.mjs +32 -0
  237. package/dist/version-CVlh2Zaq.mjs +2 -0
  238. package/dist/{waiting-rooms-DrA3-0bw.mjs → waiting-rooms-Crp7MVd9.mjs} +25 -25
  239. package/dist/web-assets-CgyrPnT-.mjs +64 -0
  240. package/dist/web3-Cd0Yd0eQ.mjs +28 -0
  241. package/dist/workers-CTwJpTfJ.mjs +40 -0
  242. package/dist/workers-builds-f2nVw7EZ.mjs +14 -0
  243. package/dist/workers-for-platforms-DjeKp2uy.mjs +40 -0
  244. package/dist/workers-vpc-B_L3TEg2.mjs +13 -0
  245. package/dist/workflows-CBPGf65x.mjs +52 -0
  246. package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
  247. package/dist/zaraz-3VDxl0gF.mjs +22 -0
  248. package/dist/zero-trust-B9xY8zcn.mjs +957 -0
  249. package/dist/zone-CmwVqTI2.mjs +4 -0
  250. package/dist/zones-Bf0VVpMf.mjs +124 -0
  251. package/package.json +17 -19
  252. package/dist/Page-BShsqCXr.mjs +0 -2
  253. package/dist/abuse-reports-CVv52Q2w.mjs +0 -24
  254. package/dist/account-tags-RhvWOkOf.mjs +0 -15
  255. package/dist/accounts--3lrEkmu.mjs +0 -125
  256. package/dist/acm-BJxINEcu.mjs +0 -15
  257. package/dist/addressing-BqByG9JW.mjs +0 -105
  258. package/dist/agent-memory-D4dQMGbh.mjs +0 -34
  259. package/dist/ai-CRkQ4pjC.mjs +0 -31
  260. package/dist/ai-audit-fMSn4c5L.mjs +0 -6
  261. package/dist/ai-gateway-CbhvQK4L.mjs +0 -80
  262. package/dist/ai-search-CvVSnOA0.mjs +0 -79
  263. package/dist/ai-security-Z_qpI92I.mjs +0 -10
  264. package/dist/alerting-CpbCB8br.mjs +0 -56
  265. package/dist/alerts-BSON-vFh.mjs +0 -2
  266. package/dist/analytics-DkY9dOP1.mjs +0 -17
  267. package/dist/analytics_engine-DE_jvlx_.mjs +0 -4
  268. package/dist/api-security-BHnOU5MM.mjs +0 -154
  269. package/dist/argo-DhC5L_aN.mjs +0 -14
  270. package/dist/args-CfbYkeXd.mjs +0 -2
  271. package/dist/artifacts-CrIupY7P.mjs +0 -43
  272. package/dist/audit-logs-BjeBxTox.mjs +0 -4
  273. package/dist/auth-BNYfOMl0.mjs +0 -2
  274. package/dist/auth-CAWalgW0.mjs +0 -2
  275. package/dist/auth-DOwC01PW.mjs +0 -2
  276. package/dist/autorag-kNrLiqDX.mjs +0 -2
  277. package/dist/banner-D03JEqRs.mjs +0 -2
  278. package/dist/basin-catalog-DZ7QV-_N.mjs +0 -46
  279. package/dist/billing-BFyte9fL.mjs +0 -23
  280. package/dist/bot-management-DXcbV3am.mjs +0 -9
  281. package/dist/botnet-feed-bGGp_cwX.mjs +0 -11
  282. package/dist/brand-protection-DN36XkxH.mjs +0 -27
  283. package/dist/brands-bBJgbbOH.mjs +0 -2
  284. package/dist/browser-extension-C1_fcw7h.mjs +0 -2
  285. package/dist/browser-run-hHD1RT43.mjs +0 -42
  286. package/dist/build-BhpWYgNm.mjs +0 -2
  287. package/dist/builds-6aO61R9R.mjs +0 -71
  288. package/dist/cache-C5YJpMqi.mjs +0 -45
  289. package/dist/certificate-authorities-CbqDAktQ.mjs +0 -6
  290. package/dist/cf-oRSQKirD.mjs +0 -18
  291. package/dist/chunk-NDZDTP46-Civns3WA.mjs +0 -361
  292. package/dist/clear-BW9vLgI3.mjs +0 -2
  293. package/dist/cli-types-9oYmRTHJ.mjs +0 -2
  294. package/dist/client-certificates-balaN_my.mjs +0 -13
  295. package/dist/client-side-security-3_4Ermmg.mjs +0 -63
  296. package/dist/cloud-connector-avx27sLw.mjs +0 -6
  297. package/dist/cloudforce-one-CXdeqJ9l.mjs +0 -405
  298. package/dist/command-DPX9sJVi.mjs +0 -2
  299. package/dist/command-OWe3v69l.mjs +0 -2
  300. package/dist/connector-interrupts-ftd10Du-.mjs +0 -6
  301. package/dist/connector-telemetry-events-TwDZYdEM.mjs +0 -6
  302. package/dist/connector-telemetry-events-latest-BQdOvbWh.mjs +0 -2
  303. package/dist/connector-telemetry-snapshots-CZxkOuC3.mjs +0 -6
  304. package/dist/connector-telemetry-snapshots-latest-CtdN_dGu.mjs +0 -2
  305. package/dist/connectors-6lVSr-fd.mjs +0 -15
  306. package/dist/containers-Dqs_ZnO2.mjs +0 -78
  307. package/dist/containers-ncw3bd3a.mjs +0 -376
  308. package/dist/content-scan-BWFbqfQ0.mjs +0 -14
  309. package/dist/csamScanner-BwZNZu0A.mjs +0 -10
  310. package/dist/ct-alerting-DPp3qLqO.mjs +0 -5
  311. package/dist/custom-certificates-pfpZcr06.mjs +0 -17
  312. package/dist/custom-csrs-DrvGRAkl.mjs +0 -11
  313. package/dist/custom-hostnames-wGtmFbz1.mjs +0 -27
  314. package/dist/custom-nameservers-HTG6MPKv.mjs +0 -9
  315. package/dist/custom-pages-DqEHBSVt.mjs +0 -21
  316. package/dist/dcv-delegation-D6nj0Z5N.mjs +0 -4
  317. package/dist/deploy-context-DmG9rgPO.mjs +0 -56
  318. package/dist/diagnostics-tqHjq-Pl.mjs +0 -15
  319. package/dist/dls-BEHj4X9T.mjs +0 -17
  320. package/dist/dns-firewall-zwbkutyf.mjs +0 -71
  321. package/dist/dns-n4mfYBZg.mjs +0 -144
  322. package/dist/domain-info-BkcBcyfF.mjs +0 -2
  323. package/dist/durable-objects-CQ2dHhho.mjs +0 -6
  324. package/dist/email-auth-DOi6yOt3.mjs +0 -6
  325. package/dist/email-routing-WcSPt22u.mjs +0 -45
  326. package/dist/email-security-BXu3OGay.mjs +0 -158
  327. package/dist/email-sending-B9zTlIjt.mjs +0 -47
  328. package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
  329. package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
  330. package/dist/errors-_sob7Ihu.mjs +0 -3
  331. package/dist/fieldExtractors-B37m2lKW.mjs +0 -9
  332. package/dist/firewall-CRtYO0Ha.mjs +0 -36
  333. package/dist/flagship-DvTFZSay.mjs +0 -28
  334. package/dist/fraud-uSyibsit.mjs +0 -22
  335. package/dist/google-tag-gateway-BFXiiokq.mjs +0 -6
  336. package/dist/health-CTaCeVyC.mjs +0 -2
  337. package/dist/healthchecks-27u7b7Jb.mjs +0 -22
  338. package/dist/hyperdrive-BzJvPdu6.mjs +0 -37
  339. package/dist/iam-Dl3cU9GI.mjs +0 -52
  340. package/dist/images-C2OkI1j7.mjs +0 -71
  341. package/dist/intel-DoB1g_K7.mjs +0 -76
  342. package/dist/internal-BYS7hO8c.mjs +0 -2
  343. package/dist/ips-BRt68epr.mjs +0 -4
  344. package/dist/k2-_eq5ZY2t.mjs +0 -11
  345. package/dist/keyless-certificates-DaO2yqYu.mjs +0 -13
  346. package/dist/keys-7BQ3Zq6Y.mjs +0 -4
  347. package/dist/kv-BTYCXKML.mjs +0 -15
  348. package/dist/leaked-credential-checks-CPHOK_dE.mjs +0 -18
  349. package/dist/live-BJE_YWE1.mjs +0 -2
  350. package/dist/local-BundUuDT.mjs +0 -2
  351. package/dist/login-BBYC_BtH.mjs +0 -2
  352. package/dist/login-D2uoWhWh.mjs +0 -5
  353. package/dist/logo-matches-Bc1DQ4-g.mjs +0 -6
  354. package/dist/logos-X5B8z7Iv.mjs +0 -7
  355. package/dist/logpush-C2ENi1et.mjs +0 -46
  356. package/dist/logs-BKDz7kBW.mjs +0 -36
  357. package/dist/magic-cloud-networking-B60Gld8A.mjs +0 -71
  358. package/dist/magic-network-monitoring-CxXI3Y-H.mjs +0 -36
  359. package/dist/magic-transit-ZCSaCbl8.mjs +0 -386
  360. package/dist/managed-defense-DrxMb7xi.mjs +0 -18
  361. package/dist/managed-transforms-AI7KrRU1.mjs +0 -9
  362. package/dist/matches-rPMLS3Ip.mjs +0 -6
  363. package/dist/mcp-DXUMvEWt.mjs +0 -32
  364. package/dist/mesh-MmBCQ37q.mjs +0 -26
  365. package/dist/monetization-DQE5VtUO.mjs +0 -20
  366. package/dist/mtls-certificates-DwkEb-Hy.mjs +0 -13
  367. package/dist/network-BcfobxQY.mjs +0 -50
  368. package/dist/network-interconnects-BU3tN_Ab.mjs +0 -72
  369. package/dist/o11y-BBv7nedp.mjs +0 -93
  370. package/dist/oauth-BUr8bPwo.mjs +0 -9
  371. package/dist/oauth-clients-qWVImhHE.mjs +0 -16
  372. package/dist/oauth-scopes-CdeIgJIx.mjs +0 -4
  373. package/dist/organization-CJeOVWH7.mjs +0 -71
  374. package/dist/organizations-BpfoqZcG.mjs +0 -4
  375. package/dist/origin-ca-certificates-Bimf07RF.mjs +0 -11
  376. package/dist/origin-post-quantum-encryption-CM-If38w.mjs +0 -6
  377. package/dist/origin-tls-client-auth-BPwYPhc9.mjs +0 -30
  378. package/dist/output-BOe-3AQG.mjs +0 -2
  379. package/dist/page-rules-DOeekMrj.mjs +0 -39
  380. package/dist/pay-per-crawl-qJpseNNx.mjs +0 -38
  381. package/dist/pay-per-use-C1MWKJ4O.mjs +0 -33
  382. package/dist/pipelines-rCwXQw6S.mjs +0 -44
  383. package/dist/precursor-Bk8Pp6jT.mjs +0 -4
  384. package/dist/previews-BEheHO3T.mjs +0 -4
  385. package/dist/progress-CQqDtgmF.mjs +0 -2
  386. package/dist/prompt-C8FyienX.mjs +0 -3
  387. package/dist/queries-DJ8looyq.mjs +0 -9
  388. package/dist/queues-BBH9Q-Tt.mjs +0 -57
  389. package/dist/r2-CdJKpP2w.mjs +0 -128
  390. package/dist/r2-data-catalog-BRo-Rx2I.mjs +0 -2
  391. package/dist/rate-limit-analytics-BiRyU0Xd.mjs +0 -2
  392. package/dist/rate-limits-Cr2zpncO.mjs +0 -2
  393. package/dist/raw-fetch-DbXN3SlE.mjs +0 -2
  394. package/dist/ready-B3pLxnjc.mjs +0 -2
  395. package/dist/realtime-onrXppzh.mjs +0 -172
  396. package/dist/recent-submissions-JLOvuZq-.mjs +0 -2
  397. package/dist/refute-Dp3VodMn.mjs +0 -2
  398. package/dist/registrar-CbEBc5IE.mjs +0 -43
  399. package/dist/registrar-sandbox-BJhn1HFT.mjs +0 -56
  400. package/dist/reporting-bXZY6obP.mjs +0 -14
  401. package/dist/request-tracers-CihskC2A.mjs +0 -4
  402. package/dist/resolve-CaTBV-c6.mjs +0 -2
  403. package/dist/resolve-DCGSzUDQ.mjs +0 -2
  404. package/dist/resource-sharing-DDqcCHVs.mjs +0 -40
  405. package/dist/resource-tagging-D63RpBce.mjs +0 -4
  406. package/dist/rules-CAW0-Wde.mjs +0 -18
  407. package/dist/rulesets-CPir63Qc.mjs +0 -37
  408. package/dist/rum-BfwTcuup.mjs +0 -30
  409. package/dist/run-DEynXvCc.mjs +0 -2
  410. package/dist/scan-logo-3Zr6CDJB.mjs +0 -2
  411. package/dist/scan-page-CxeudOzj.mjs +0 -2
  412. package/dist/scim-CtZ1FeQE.mjs +0 -18
  413. package/dist/search-B_P5ZTQj.mjs +0 -2
  414. package/dist/secrets-store-BIuBYUJT.mjs +0 -24
  415. package/dist/security-insights-DfUus0bs.mjs +0 -40
  416. package/dist/security-txt-CgZOsAIZ.mjs +0 -9
  417. package/dist/session-BcM8Vyyx.mjs +0 -2
  418. package/dist/shared-CpS23WwR.mjs +0 -2
  419. package/dist/signed-url-D5RwvrQq.mjs +0 -2
  420. package/dist/smart-shield-ClgB7r-9.mjs +0 -24
  421. package/dist/snippets-DLO3iFAg.mjs +0 -20
  422. package/dist/speed-DX5X2EIR.mjs +0 -24
  423. package/dist/sql-CF044HDW.mjs +0 -4
  424. package/dist/src-BMATTZU_.mjs +0 -125
  425. package/dist/ssl-CM-rChEC.mjs +0 -45
  426. package/dist/startup-profile-D662WI9s.mjs +0 -2
  427. package/dist/state-D7uNYnoi.mjs +0 -2
  428. package/dist/stream-5EmUOQvy.mjs +0 -102
  429. package/dist/submission-info-_t78q2OE.mjs +0 -2
  430. package/dist/submit-lEAaRSMR.mjs +0 -4
  431. package/dist/telemetry-0Y5hAtCX.mjs +0 -2
  432. package/dist/tenant-DnI7QziH.mjs +0 -10
  433. package/dist/tenant-custom-nameservers-MR0dlcGm.mjs +0 -9
  434. package/dist/theme-CQ_TYifs.mjs +0 -6
  435. package/dist/total-queries-CPrKEciQ.mjs +0 -2
  436. package/dist/tracked-domains-CTRItgFT.mjs +0 -2
  437. package/dist/tunnels-NzYpsfi_.mjs +0 -29
  438. package/dist/turnstile-M7sKCEz3.mjs +0 -33
  439. package/dist/ui-YmjF66Ct.mjs +0 -5
  440. package/dist/update-check-aTutXNRd.mjs +0 -2
  441. package/dist/url-info-Dos9VOXV.mjs +0 -4
  442. package/dist/url-normalization-CZbFOq_v.mjs +0 -9
  443. package/dist/url-scanner-B7quLPGW.mjs +0 -16
  444. package/dist/values-D-rrZrDa.mjs +0 -4
  445. package/dist/vectorize-D2tf_oA8.mjs +0 -32
  446. package/dist/verify-5KcvRk-q.mjs +0 -2
  447. package/dist/version-BGnqDvNR.mjs +0 -2
  448. package/dist/web-assets-DQAfvPT9.mjs +0 -64
  449. package/dist/web3-MI0GQDnu.mjs +0 -28
  450. package/dist/workers-By6Pf8fv.mjs +0 -40
  451. package/dist/workers-builds-6YsWsCmC.mjs +0 -14
  452. package/dist/workers-for-platforms-DL8fC1qR.mjs +0 -40
  453. package/dist/workers-vpc-BYx6sbgd.mjs +0 -13
  454. package/dist/workflows-ByQLnV0E.mjs +0 -52
  455. package/dist/zaraz-CgbpmA85.mjs +0 -22
  456. package/dist/zero-trust-CpjTkkWt.mjs +0 -837
  457. package/dist/zone-DnKIe6po.mjs +0 -4
  458. package/dist/zones--5ZzsDmQ.mjs +0 -124
@@ -0,0 +1,957 @@
1
+ #!/usr/bin/env node
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-eVI_UEt8.mjs";import{a as i,i as a,t as o}from"./context-B-vEsyrK.mjs";import{t as s}from"./output-Co4xdFf6.mjs";import{t as c}from"./dry-run-C2KjGX10.mjs";import{t as l}from"./progress-R-1tIuep.mjs";import{t as u}from"./run-BvDCuZ8q.mjs";import"./telemetry-Ct_2AaO4.mjs";import{i as d,n as f,r as p,t as m}from"./body-parser-DkHKPkJ7.mjs";import{n as h,t as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-dgLm0iFJ.mjs";import{n as ee,t as te}from"./raw-fetch-BapeoreV.mjs";var ne={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps`,body:`json`};function re(e){return e.usage(`$0 zero-trust access applications create
3
+
4
+ Adds a new application to Access.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`create`,describe:`Add an Access application`,builder:re,handler:async e=>u({command:`zero-trust access applications create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(ne,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var ae={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}`};function oe(e){return e.usage(`$0 zero-trust access applications delete <app-id>
5
+
6
+ Deletes an application from Access.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const se={command:`delete <app-id>`,describe:`Delete an Access application`,builder:oe,handler:async e=>u({command:`zero-trust access applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
7
+ `);return}let f=await l(`Deleting`,async()=>n.send(ae,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Deleted`})})};var ce={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}`};function le(e){return e.usage(`$0 zero-trust access applications get <app-id>
8
+
9
+ Fetches information about an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <app-id>`,describe:`Get an Access application`,builder:le,handler:async e=>u({command:`zero-trust access applications get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(ce,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Loaded`})})};var de={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps`,query:[`name`,`domain`,`aud`,`target_attributes`,`exact`,`search`,`page`,`per_page`]};function fe(e){return e.usage(`$0 zero-trust access applications list
10
+
11
+ Lists all Access applications in an account or zone.`).option(`name`,{type:`string`,description:`The name of the app.`}).option(`domain`,{type:`string`,description:`The domain of the app.`}).option(`aud`,{type:`string`,description:`The aud of the app.`}).option(`target-attributes`,{type:`string`,description:`Target Criteria attributes in key=value format.`}).option(`exact`,{type:`boolean`,description:`True for only exact string matches against passed name/domain query parameters.`}).option(`search`,{type:`string`,description:`Search for apps by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List Access applications`,builder:fe,handler:async e=>u({command:`zero-trust access applications list`,classification:{safeFlags:[`exact`,`dry-run`]}},e,async()=>{let n={name:e.name,domain:e.domain,aud:e.aud,target_attributes:e[`target-attributes`],exact:e.exact,search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/apps`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(de,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var me={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/apps/${t.app_id}/policies/${t.policy_id}/make_reusable`};function he(e){return e.usage(`$0 zero-trust access applications policies make-reusable <policy-id>
12
+
13
+ Converts an application-scoped policy to a reusable policy. The policy will no longer be exclusively scoped to the application. Further updates to the policy should go through the /accounts/{account_id}/policies/{uid} endpoint.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`make-reusable <policy-id>`,describe:`Convert an Access application policy to a reusable policy`,builder:he,handler:async e=>u({command:`zero-trust access applications policies make-reusable`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access applications policies make-reusable`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}/make_reusable`,pathParams:{"app-id":String(e[`app-id`]??``),"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Updating`,async()=>n.send(me,{account_id:a,app_id:e[`app-id`],policy_id:e[`policy-id`]}));s(u,{successLabel:`Updated`})})},_e={command:`policies`,describe:`Operations for access.applications.policies`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ve={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/policy-tests`,body:`json`,errors:{400:`BadRequestError`}};function ye(e){return e.usage(`$0 zero-trust access applications policy-tests create
14
+
15
+ Starts an Access policy test.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`create`,describe:`Start Access policy test`,builder:ye,handler:async e=>u({command:`zero-trust access applications policy-tests create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access applications policy-tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policy-tests`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(ve,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var xe={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/policy-tests/${t.policy_test_id}`,errors:{400:`BadRequestError`}};function Se(e){return e.usage(`$0 zero-trust access applications policy-tests get <policy-test-id>
16
+
17
+ Fetches the current status of a given Access policy test.`).positional(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get <policy-test-id>`,describe:`Get the current status of a given Access policy test`,builder:Se,handler:async e=>u({command:`zero-trust access applications policy-tests get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access applications policy-tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policy-tests/${e[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(e[`policy-test-id`]))}`,pathParams:{"policy-test-id":String(e[`policy-test-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(xe,{account_id:a,policy_test_id:e[`policy-test-id`]}));s(u,{successLabel:`Loaded`})})};var we={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/policy-tests/${t.policy_test_id}/users`,query:[`page`,`per_page`,`status`],errors:{400:`BadRequestError`}};function Te(e){return e.usage(`$0 zero-trust access applications policy-tests users list
18
+
19
+ Fetches a single page of user results from an Access policy test.`).option(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Filter users by their policy evaluation status.`,choices:[`success`,`fail`,`error`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`list`,describe:`Get an Access policy test users page`,builder:Te,handler:async e=>u({command:`zero-trust access applications policy-tests users list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){let t=await i();c({command:`cf zero-trust access applications policy-tests users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policy-tests/${e[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(e[`policy-test-id`]))}/users`,pathParams:{"policy-test-id":String(e[`policy-test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(we,{account_id:u,policy_test_id:e[`policy-test-id`],...n}));s(d,{successLabel:`Loaded`})})},De={command:`users`,describe:`Operations for access.applications.policy-tests.users`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`policy-tests`,describe:`Operations for access.applications.policy-tests`,builder:e=>e.command(be).command(Ce).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ke={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/revoke_tokens`};function Ae(e){return e.usage(`$0 zero-trust access applications revoke-tokens <app-id>
20
+
21
+ Revokes all tokens issued for an application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const je={command:`revoke-tokens <app-id>`,describe:`Revoke application tokens`,builder:Ae,handler:async e=>u({command:`zero-trust access applications revoke-tokens`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications revoke-tokens`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/revoke_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force,message:`This operation invalidates every service token for the app.`})){process.stderr.write(`Aborted.
22
+ `);return}let f=await l(`Deleting`,async()=>n.send(ke,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Deleted`})})};var Me={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/settings`,body:`json`};function Ne(e){return e.usage(`$0 zero-trust access applications settings update <app-id>
23
+
24
+ Updates Access application settings.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`allow-iframe`,{type:`boolean`,description:`Enables loading application content in an iFrame.`}).option(`skip-interstitial`,{type:`boolean`,description:`Enables automatic authentication through cloudflared.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`update <app-id>`,describe:`Update Access application settings`,builder:Ne,handler:async e=>u({command:`zero-trust access applications settings update`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({allow_iframe:e[`allow-iframe`],skip_interstitial:e[`skip-interstitial`]}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Me,{body:t,account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(r,{successLabel:`Updated`});return}let p=m({allow_iframe:e[`allow-iframe`],skip_interstitial:e[`skip-interstitial`]}),h=await l(`Updating`,async()=>n.send(Me,{body:p,account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(h,{successLabel:`Updated`})})},Fe={command:`settings`,describe:`Operations for access.applications.settings`,builder:e=>e.command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ie={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/ca`};function Le(e){return e.usage(`$0 zero-trust access applications short-lived-certificates create <app-id>
25
+
26
+ Generates a new short-lived certificate CA and public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`create <app-id>`,describe:`Create a short-lived certificate CA`,builder:Le,handler:async e=>u({command:`zero-trust access applications short-lived-certificates create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications short-lived-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Creating`,async()=>n.send(Ie,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Created`})})};var ze={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/ca`};function Be(e){return e.usage(`$0 zero-trust access applications short-lived-certificates delete <app-id>
27
+
28
+ Deletes a short-lived certificate CA.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ve={command:`delete <app-id>`,describe:`Delete a short-lived certificate CA`,builder:Be,handler:async e=>u({command:`zero-trust access applications short-lived-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications short-lived-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
29
+ `);return}let f=await l(`Deleting`,async()=>n.send(ze,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Deleted`})})};var He={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/ca`};function Ue(e){return e.usage(`$0 zero-trust access applications short-lived-certificates get <app-id>
30
+
31
+ Fetches a short-lived certificate CA and its public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`get <app-id>`,describe:`Get a short-lived certificate CA`,builder:Ue,handler:async e=>u({command:`zero-trust access applications short-lived-certificates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications short-lived-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(He,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Loaded`})})};var Ge={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/ca`,query:[`page`,`per_page`]};function Ke(e){return e.usage(`$0 zero-trust access applications short-lived-certificates list
32
+
33
+ Lists short-lived certificate CAs and their public keys.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qe={command:`list`,describe:`List short-lived certificate CAs`,builder:Ke,handler:async e=>u({command:`zero-trust access applications short-lived-certificates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications short-lived-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/apps/ca`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(Ge,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})},Je={command:`short-lived-certificates`,describe:`Operations for access.applications.short-lived-certificates`,builder:e=>e.command(Re).command(Ve).command(We).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ye={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}`,body:`json`};function Xe(e){return e.usage(`$0 zero-trust access applications update <app-id>
34
+
35
+ Updates an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ze={command:`update <app-id>`,describe:`Update an Access application`,builder:Xe,handler:async e=>u({command:`zero-trust access applications update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Ye,{body:t,account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var Qe={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/apps/${t.app_id}/user_policy_checks`};function $e(e){return e.usage(`$0 zero-trust access applications user-policy-checks list
36
+
37
+ Tests if a specific user has permission to access an application.`).option(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`list`,describe:`Test Access policies`,builder:$e,handler:async e=>u({command:`zero-trust access applications user-policy-checks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access applications user-policy-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${e[`app-id`]==null?`<app-id>`:encodeURIComponent(String(e[`app-id`]))}/user_policy_checks`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"app-id":String(e[`app-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(Qe,{account_or_zone:u,account_or_zone_id:d,app_id:e[`app-id`]}));s(f,{successLabel:`Loaded`})})},tt={command:`user-policy-checks`,describe:`Operations for access.applications.user-policy-checks`,builder:e=>e.command(et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},nt={command:`applications`,describe:`Operations for access.applications`,builder:e=>e.command(ie).command(se).command(ue).command(pe).command(je).command(Ze).command(_e).command(Oe).command(Fe).command(Je).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var rt={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/custom_pages`,body:`json`,errors:{422:`UnprocessableEntityError`}};function it(e){return e.usage(`$0 zero-trust access custom-pages create
38
+
39
+ Create a custom page`).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).coerce(`type`,e=>h(e,`type`,`text`)).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 at={command:`create`,describe:`Create a custom page`,builder:it,handler:async e=>u({command:`zero-trust access custom-pages create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access custom-pages create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/custom_pages`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({app_count:e[`app-count`],contract_version:e[`contract-version`],custom_html:h(e[`custom-html`],`custom-html`,`text`),name:h(e.name,`name`,`text`),type:e.type,uid:h(e.uid,`uid`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(rt,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`custom-html`]===void 0&&(e[`custom-html`]=await _(`custom-html`,`Custom page HTML.`)),e.name===void 0&&(e.name=await _(`name`,`Custom page name.`)),e.type===void 0&&(e.type=await v(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=m({app_count:e[`app-count`],contract_version:e[`contract-version`],custom_html:h(e[`custom-html`],`custom-html`,`text`),name:h(e.name,`name`,`text`),type:e.type,uid:h(e.uid,`uid`,`text`)}),d=await l(`Creating`,async()=>n.send(rt,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var ot={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/custom_pages/${t.custom_page_id}`};function st(e){return e.usage(`$0 zero-trust access custom-pages delete <custom-page-id>
40
+
41
+ Delete a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ct={command:`delete <custom-page-id>`,describe:`Delete a custom page`,builder:st,handler:async e=>u({command:`zero-trust access custom-pages delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access custom-pages delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/custom_pages/${e[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(e[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(e[`custom-page-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
42
+ `);return}let u=await l(`Deleting`,async()=>n.send(ot,{account_id:a,custom_page_id:e[`custom-page-id`]}));s(u,{successLabel:`Deleted`})})};var lt={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/custom_pages/${t.custom_page_id}`};function ut(e){return e.usage(`$0 zero-trust access custom-pages get <custom-page-id>
43
+
44
+ Fetches a custom page and also returns its HTML.`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dt={command:`get <custom-page-id>`,describe:`Get a custom page`,builder:ut,handler:async e=>u({command:`zero-trust access custom-pages get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/custom_pages/${e[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(e[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(e[`custom-page-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(lt,{account_id:a,custom_page_id:e[`custom-page-id`]}));s(u,{successLabel:`Loaded`})})};var ft={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/custom_pages`,query:[`page`,`per_page`]};function pt(e){return e.usage(`$0 zero-trust access custom-pages list
45
+
46
+ List custom pages`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`list`,describe:`List custom pages`,builder:pt,handler:async e=>u({command:`zero-trust access custom-pages list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/custom_pages`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ft,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var ht={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/custom_pages/${t.custom_page_id}`,body:`json`,errors:{422:`UnprocessableEntityError`}};function gt(e){return e.usage(`$0 zero-trust access custom-pages update <custom-page-id>
47
+
48
+ Update a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).coerce(`type`,e=>h(e,`type`,`text`)).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 _t={command:`update <custom-page-id>`,describe:`Update a custom page`,builder:gt,handler:async e=>u({command:`zero-trust access custom-pages update`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/custom_pages/${e[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(e[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(e[`custom-page-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({app_count:e[`app-count`],contract_version:e[`contract-version`],custom_html:h(e[`custom-html`],`custom-html`,`text`),name:h(e.name,`name`,`text`),type:e.type,uid:h(e.uid,`uid`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ht,{body:t,account_id:a,custom_page_id:e[`custom-page-id`]}));s(r,{successLabel:`Updated`});return}e[`custom-html`]===void 0&&(e[`custom-html`]=await _(`custom-html`,`Custom page HTML.`)),e.name===void 0&&(e.name=await _(`name`,`Custom page name.`)),e.type===void 0&&(e.type=await v(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=m({app_count:e[`app-count`],contract_version:e[`contract-version`],custom_html:h(e[`custom-html`],`custom-html`,`text`),name:h(e.name,`name`,`text`),type:e.type,uid:h(e.uid,`uid`,`text`)}),d=await l(`Updating`,async()=>n.send(ht,{body:u,account_id:a,custom_page_id:e[`custom-page-id`]}));s(d,{successLabel:`Updated`})})};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/custom_pages/validate`,body:`json`};function vt(e){return e.usage(`$0 zero-trust access custom-pages validate
49
+
50
+ Validate a Liquid template and return its errors and warnings without persisting it.`).option(`template`,{type:`string`,description:`The Liquid template to validate.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`contract-version`,{type:`number`,description:`Contract version to validate against; omit for the latest.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A template to validate without persisting it.`})}const yt={command:`validate`,describe:`Validate a custom page template`,builder:vt,handler:async e=>u({command:`zero-trust access custom-pages validate`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access custom-pages validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/custom_pages/validate`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({template:h(e.template,`template`,`text`),type:e.type,version:e[`contract-version`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(b,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.template===void 0&&(e.template=await _(`template`,`The Liquid template to validate.`)),e.type===void 0&&(e.type=await v(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=m({template:h(e.template,`template`,`text`),type:e.type,version:e[`contract-version`]}),d=await l(`Creating`,async()=>n.send(b,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},bt={command:`custom-pages`,describe:`Operations for access.custom-pages`,builder:e=>e.command(at).command(ct).command(dt).command(mt).command(_t).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var xt={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/audit_ssh_settings`};function St(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings get
51
+
52
+ Retrieve all Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ct={command:`get`,describe:`Get Zero Trust SSH settings`,builder:St,handler:async e=>u({command:`zero-trust access infrastructure audit-ssh-settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access infrastructure audit-ssh-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(xt,{account_id:a}));s(u,{successLabel:`Loaded`})})};var wt={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/audit_ssh_settings/rotate_seed`};function Tt(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings rotate-seed
53
+
54
+ Rotate the SSH account seed that generates the host key identity when connecting through the Cloudflare SSH Proxy.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Et={command:`rotate-seed`,describe:`Rotate Zero Trust SSH account seed`,builder:Tt,handler:async e=>u({command:`zero-trust access infrastructure audit-ssh-settings rotate-seed`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access infrastructure audit-ssh-settings rotate-seed`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/audit_ssh_settings/rotate_seed`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(wt,{account_id:a}));s(u,{successLabel:`Created`})})};var x={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/audit_ssh_settings`,body:`json`};function Dt(e){return e.usage(`$0 zero-trust access infrastructure audit-ssh-settings update
55
+
56
+ Update Zero Trust Audit SSH and SSH with Access for Infrastructure settings for an account.`).option(`public-key`,{type:`string`,description:`Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ot={command:`update`,describe:`Update Zero Trust SSH settings`,builder:Dt,handler:async e=>u({command:`zero-trust access infrastructure audit-ssh-settings update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access infrastructure audit-ssh-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({public_key:h(e[`public-key`],`public-key`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(x,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}e[`public-key`]===void 0&&(e[`public-key`]=await _(`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=m({public_key:h(e[`public-key`],`public-key`,`text`)}),d=await l(`Updating`,async()=>n.send(x,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},kt={command:`audit-ssh-settings`,describe:`Operations for access.infrastructure.audit-ssh-settings`,builder:e=>e.command(Ct).command(Et).command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var At={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/gateway_ca`};function jt(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca create
57
+
58
+ Adds a new SSH Certificate Authority (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`create`,describe:`Add a new SSH Certificate Authority (CA)`,builder:jt,handler:async e=>u({command:`zero-trust access infrastructure ssh-ca create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access infrastructure ssh-ca create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(At,{account_id:a}));s(u,{successLabel:`Created`})})};var Nt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/gateway_ca/${t.certificate_id}`};function Pt(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca delete <certificate-id>
59
+
60
+ Deletes an SSH Certificate Authority.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ft={command:`delete <certificate-id>`,describe:`Delete an SSH Certificate Authority (CA)`,builder:Pt,handler:async e=>u({command:`zero-trust access infrastructure ssh-ca delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access infrastructure ssh-ca delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/gateway_ca/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
61
+ `);return}let u=await l(`Deleting`,async()=>n.send(Nt,{account_id:a,certificate_id:e[`certificate-id`]}));s(u,{successLabel:`Deleted`})})};var It={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/gateway_ca`};function Lt(e){return e.usage(`$0 zero-trust access infrastructure ssh-ca list
62
+
63
+ Lists SSH Certificate Authorities (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`list`,describe:`List SSH Certificate Authorities (CA)`,builder:Lt,handler:async e=>u({command:`zero-trust access infrastructure ssh-ca list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access infrastructure ssh-ca list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(It,{account_id:a}));s(u,{successLabel:`Loaded`})})},zt={command:`ssh-ca`,describe:`Operations for access.infrastructure.ssh-ca`,builder:e=>e.command(Mt).command(Ft).command(Rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Bt={command:`infrastructure`,describe:`Operations for access.infrastructure`,builder:e=>e.command(kt).command(zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Vt={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/logs/access_requests`,query:[`limit`,`direction`,`since`,`until`,`page`,`per_page`,`email`,`email_exact`,`user_id`,`allowedOp`,`country_codeOp`,`app_typeOp`,`app_uidOp`,`ray_idOp`,`emailOp`,`idpOp`,`non_identityOp`,`user_idOp`,`fields`]};function Ht(e){return e.usage(`$0 zero-trust access logs access-requests list
64
+
65
+ Gets a list of Access authentication audit logs for an account.`).option(`limit`,{type:`number`,description:`The maximum number of log entries to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological sorting order for the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`The earliest event timestamp to query.`}).option(`until`,{type:`string`,description:`The latest event timestamp to query.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`email`,{type:`string`,description:"Filter by user email. Match mode is controlled by `emailOp` (preferred) or the legacy `email_exact` flag.\n- Default (no `emailOp`, `email_exact=false` or unset): substring match — `email=@example.com` returns all events with that domain.\n- Exact match: set `emailOp=eq` (preferred) or `email_exact=true` — e.g. `email=user@example.com&email_exact=true` returns only that user.\n- Explicit substring match: set `emailOp=contains` (without `email_exact=true`). When both are set, `email_exact=true` takes precedence and the match is exact.\n- Exclusion: set `emailOp=neq`. With `email_exact=true` this is an exact-value exclusion; without it, a fuzzy substring exclusion."}).option(`email-exact`,{type:`boolean`,description:"When true, `email` is matched exactly instead of substring matching."}).option(`user-id`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter. Use `email` instead."}).option(`allowed-op`,{type:`string`,description:"Operator for the `allowed` filter.",choices:[`eq`,`neq`]}).option(`country-code-op`,{type:`string`,description:"Operator for the `country_code` filter.",choices:[`eq`,`neq`]}).option(`app-type-op`,{type:`string`,description:"Operator for the `app_type` filter.",choices:[`eq`,`neq`]}).option(`app-uid-op`,{type:`string`,description:"Operator for the `app_uid` filter.",choices:[`eq`,`neq`]}).option(`ray-id-op`,{type:`string`,description:"Operator for the `ray_id` filter.",choices:[`eq`,`neq`]}).option(`email-op`,{type:`string`,description:"Operator for the `email` filter.\n`contains` performs a substring (case-sensitive) match. When `email_exact=true`\nis also set, `email_exact` takes precedence and `contains` is ignored.",choices:[`eq`,`neq`,`contains`]}).option(`idp-op`,{type:`string`,description:"Operator for the `idp` filter.",choices:[`eq`,`neq`]}).option(`non-identity-op`,{type:`string`,description:"Operator for the `non_identity` filter.",choices:[`eq`,`neq`]}).option(`user-id-op`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter (the `user_id` parameter is itself deprecated).",choices:[`eq`,`neq`]}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response.
66
+ When omitted, all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ut={command:`list`,describe:`Get Access authentication logs`,builder:Ht,handler:async e=>u({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`]}},e,async()=>{let n={limit:e.limit,direction:e.direction,since:e.since,until:e.until,page:e.page,per_page:e[`per-page`],email:e.email,email_exact:e[`email-exact`],user_id:e[`user-id`],allowedOp:e[`allowed-op`],country_codeOp:e[`country-code-op`],app_typeOp:e[`app-type-op`],app_uidOp:e[`app-uid-op`],ray_idOp:e[`ray-id-op`],emailOp:e[`email-op`],idpOp:e[`idp-op`],non_identityOp:e[`non-identity-op`],user_idOp:e[`user-id-op`],fields:e.fields};if(e.dryRun){let e=await i();c({command:`cf zero-trust access logs access-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/access_requests`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Vt,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Wt={command:`access-requests`,describe:`Operations for access.logs.access-requests`,builder:e=>e.command(Ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/logs/jit_requests/${t.knock_request_id}`,errors:{404:`NotFoundError`}};function Kt(e){return e.usage(`$0 zero-trust access logs jit-requests get <knock-request-id>
67
+
68
+ Gets an account-scoped Access JIT request summary and its lifecycle events in chronological order.`).positional(`knock-request-id`,{type:`string`,description:`Knock request ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qt={command:`get <knock-request-id>`,describe:`Get an Access JIT request log`,builder:Kt,handler:async e=>u({command:`zero-trust access logs jit-requests get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access logs jit-requests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/logs/jit_requests/${e[`knock-request-id`]==null?`<knock-request-id>`:encodeURIComponent(String(e[`knock-request-id`]))}`,pathParams:{"knock-request-id":String(e[`knock-request-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Gt,{account_id:a,knock_request_id:e[`knock-request-id`]}));s(u,{successLabel:`Loaded`})})};var Jt={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/logs/jit_requests`,query:[`page`,`per_page`,`status`,`search`,`since`,`until`]};function Yt(e){return e.usage(`$0 zero-trust access logs jit-requests list
69
+
70
+ Lists account-wide Access JIT request logs reconstructed from request lifecycle events.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`status`,{type:`string`,description:"JIT request status. `SPENT` is deprecated and interpreted as `APPROVED`.",choices:[`PENDING`,`APPROVED`,`DENIED`,`CANCELED`,`SPENT`]}).option(`search`,{type:`string`,description:`Case-insensitive search over request ID, requester email, application audience, and application hostname.`}).option(`since`,{type:`string`,description:`The earliest request timestamp to query. Defaults to 366 days before the current time.`}).option(`until`,{type:`string`,description:`The latest request timestamp to query. Defaults to the current time.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xt={command:`list`,describe:`List Access JIT request logs`,builder:Yt,handler:async e=>u({command:`zero-trust access logs jit-requests list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],status:e.status,search:e.search,since:e.since,until:e.until};if(e.dryRun){let e=await i();c({command:`cf zero-trust access logs jit-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/jit_requests`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Jt,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Zt={command:`jit-requests`,describe:`Operations for access.logs.jit-requests`,builder:e=>e.command(qt).command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Qt={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/logs/scim/updates`,query:[`limit`,`direction`,`since`,`until`,`idp_id`,`status`,`resource_type`,`request_method`,`resource_user_email`,`resource_group_name`,`cf_resource_id`,`idp_resource_id`,`page`,`per_page`]};function $t(e){return e.usage(`$0 zero-trust access logs scim updates list
71
+
72
+ Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`limit`,{type:`number`,description:`The maximum number of update logs to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological order used to sort the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`the timestamp of the earliest update log.`}).option(`until`,{type:`string`,description:`the timestamp of the most-recent update log.`}).option(`idp-id`,{type:`string`,description:`The unique Id of the IdP that has SCIM enabled.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status of the SCIM request.`}).option(`resource-type`,{type:`string`,description:`The resource type of the SCIM request.`}).option(`request-method`,{type:`string`,description:`The request method of the SCIM request.`}).option(`resource-user-email`,{type:`string`,description:"The email address of the SCIM User resource. Pass once for a single\nlookup (`?resource_user_email=A`) or repeat the parameter\n(`?resource_user_email=A&resource_user_email=B`) to filter by multiple\nemails in one request."}).option(`resource-group-name`,{type:`string`,description:"The display name of the SCIM Group resource. Pass once for a single\nlookup (`?resource_group_name=A`) or repeat the parameter\n(`?resource_group_name=A&resource_group_name=B`) to filter by multiple\ngroup names in one request."}).option(`cf-resource-id`,{type:`string`,description:"The unique Cloudflare-generated Id of the SCIM resource. Pass once for\na single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to filter by multiple resources\nin one request."}).option(`idp-resource-id`,{type:`string`,description:"The IdP-generated Id of the SCIM resource. Pass once for a single\nlookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to filter by multiple\nresources in one request."}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const en={command:`list`,describe:`List Access SCIM update logs`,builder:$t,handler:async e=>u({command:`zero-trust access logs scim updates list`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let n={limit:e.limit,direction:e.direction,since:e.since,until:e.until,idp_id:e[`idp-id`],status:e.status,resource_type:e[`resource-type`],request_method:e[`request-method`],resource_user_email:e[`resource-user-email`],resource_group_name:e[`resource-group-name`],cf_resource_id:e[`cf-resource-id`],idp_resource_id:e[`idp-resource-id`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access logs scim updates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/logs/scim/updates`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Qt,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},tn={command:`updates`,describe:`Operations for access.logs.scim.updates`,builder:e=>e.command(en).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},nn={command:`scim`,describe:`Operations for access.logs.scim`,builder:e=>e.command(tn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rn={command:`logs`,describe:`Operations for access.logs`,builder:e=>e.command(Wt).command(Zt).command(nn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var an={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/authenticator_device_aaguids`};function on(e){return e.usage(`$0 zero-trust access mfa authenticator-catalog list
73
+
74
+ Returns a list of Authenticator Device AAGUIDs for MFA configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sn={command:`list`,describe:`List authenticator device AAGUIDs`,builder:on,handler:async e=>u({command:`zero-trust access mfa authenticator-catalog list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access mfa authenticator-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/authenticator_device_aaguids`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(an,{account_id:a}));s(u,{successLabel:`Loaded`})})},cn={command:`authenticator-catalog`,describe:`Operations for access.mfa.authenticator-catalog`,builder:e=>e.command(sn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ln={command:`mfa`,describe:`Operations for access.mfa`,builder:e=>e.command(cn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var S={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates`,body:`json`};function un(e){return e.usage(`$0 zero-trust access mtls-certificates create
75
+
76
+ Adds a new mTLS root certificate to Access.`).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`certificate`,{type:`string`,description:`The certificate content.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const dn={command:`create`,describe:`Add an mTLS certificate`,builder:un,handler:async e=>u({command:`zero-trust access mtls-certificates create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({associated_hostnames:e[`associated-hostnames`],certificate:h(e.certificate,`certificate`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(S,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}e.certificate===void 0&&(e.certificate=await _(`certificate`,`The certificate content.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the certificate.`));let p=m({associated_hostnames:e[`associated-hostnames`],certificate:h(e.certificate,`certificate`,`text`),name:h(e.name,`name`,`text`)}),g=await l(`Creating`,async()=>n.send(S,{body:p,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Created`})})};var fn={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates/${t.certificate_id}`};function pn(e){return e.usage(`$0 zero-trust access mtls-certificates delete <certificate-id>
77
+
78
+ Deletes an mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const mn={command:`delete <certificate-id>`,describe:`Delete an mTLS certificate`,builder:pn,handler:async e=>u({command:`zero-trust access mtls-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
79
+ `);return}let f=await l(`Deleting`,async()=>n.send(fn,{account_or_zone:u,account_or_zone_id:d,certificate_id:e[`certificate-id`]}));s(f,{successLabel:`Deleted`})})};var hn={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates/${t.certificate_id}`};function gn(e){return e.usage(`$0 zero-trust access mtls-certificates get <certificate-id>
80
+
81
+ Fetches a single mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _n={command:`get <certificate-id>`,describe:`Get an mTLS certificate`,builder:gn,handler:async e=>u({command:`zero-trust access mtls-certificates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(hn,{account_or_zone:u,account_or_zone_id:d,certificate_id:e[`certificate-id`]}));s(f,{successLabel:`Loaded`})})};var vn={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates`,query:[`page`,`per_page`]};function yn(e){return e.usage(`$0 zero-trust access mtls-certificates list
82
+
83
+ Lists all mTLS root certificates.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bn={command:`list`,describe:`List mTLS certificates`,builder:yn,handler:async e=>u({command:`zero-trust access mtls-certificates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/certificates`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(vn,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var xn={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates/settings`};function Sn(e){return e.usage(`$0 zero-trust access mtls-certificates settings get
84
+
85
+ List all mTLS hostname settings for this account or zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cn={command:`get`,describe:`List all mTLS hostname settings`,builder:Sn,handler:async e=>u({command:`zero-trust access mtls-certificates settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(xn,{account_or_zone:u,account_or_zone_id:d}));s(f,{successLabel:`Loaded`})})};var C={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates/settings`,body:`json`};function wn(e){return e.usage(`$0 zero-trust access mtls-certificates settings update
86
+
87
+ Updates an mTLS certificate's hostname settings.`).option(`settings`,{type:`string`,description:`The settings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tn={command:`update`,describe:`Update an mTLS certificate's hostname settings`,builder:wn,handler:async e=>u({command:`zero-trust access mtls-certificates settings update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({settings:p(e.settings,`settings`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(C,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Updated`});return}if(e.settings===void 0)throw Error(`--settings is required (or pass --body with this field set).`);let h=m({settings:p(e.settings,`settings`)}),g=await l(`Updating`,async()=>n.send(C,{body:h,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Updated`})})},En={command:`settings`,describe:`Operations for access.mtls-certificates.settings`,builder:e=>e.command(Cn).command(Tn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var w={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/certificates/${t.certificate_id}`,body:`json`};function Dn(e){return e.usage(`$0 zero-trust access mtls-certificates update <certificate-id>
88
+
89
+ Updates a configured mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const On={command:`update <certificate-id>`,describe:`Update an mTLS certificate`,builder:Dn,handler:async e=>u({command:`zero-trust access mtls-certificates update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access mtls-certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({associated_hostnames:e[`associated-hostnames`],name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(w,{body:t,account_or_zone:u,account_or_zone_id:d,certificate_id:e[`certificate-id`]}));s(r,{successLabel:`Updated`});return}if(e[`associated-hostnames`]===void 0)throw Error(`--associated-hostnames is required (or pass --body with this field set).`);let p=m({associated_hostnames:e[`associated-hostnames`],name:h(e.name,`name`,`text`)}),g=await l(`Updating`,async()=>n.send(w,{body:p,account_or_zone:u,account_or_zone_id:d,certificate_id:e[`certificate-id`]}));s(g,{successLabel:`Updated`})})},kn={command:`mtls-certificates`,describe:`Operations for access.mtls-certificates`,builder:e=>e.command(dn).command(mn).command(_n).command(bn).command(On).command(En).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var T={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/policies`,body:`json`};function An(e){return e.usage(`$0 zero-trust access policies create
90
+
91
+ Creates a new Access reusable policy.`).option(`approval-groups`,{type:`string`,description:`Administrators who can approve a temporary authentication request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`approval-required`,{type:`boolean`,description:`Requires the user to request access from an administrator at the start of each session.`}).option(`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`,{type:`string`,array:!0,description:`Clipboard formats allowed when copying from local machine to remote RDP session.`}).option(`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`,{type:`string`,array:!0,description:`Clipboard formats allowed when copying from remote RDP session to local machine.`}).option(`isolation-required`,{type:`boolean`,description:`Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:`Lists the MFA methods that users can authenticate with.`}).option(`mfa-config-mfa-disabled`,{type:`boolean`,description:`Indicates whether to disable MFA for this resource. This option is available at the application and policy level.`}).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(`purpose-justification-prompt`,{type:`string`,description:`A custom message that will appear on the purpose justification screen.`}).option(`purpose-justification-required`,{type:`boolean`,description:`Require users to enter a justification when they log in to the application.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for the application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).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`]}).coerce(`decision`,e=>h(e,`decision`,`text`)).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 jn={command:`create`,describe:`Create an Access reusable policy`,builder:An,handler:async e=>u({command:`zero-trust access policies create`,classification:{safeFlags:[`approval-required`,`isolation-required`,`mfa-config-mfa-disabled`,`purpose-justification-required`,`decision`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({approval_groups:p(e[`approval-groups`],`approval-groups`),approval_required:e[`approval-required`],connection_rules:{rdp:{allowed_clipboard_local_to_remote_formats:e[`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`],allowed_clipboard_remote_to_local_formats:e[`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`]}},isolation_required:e[`isolation-required`],mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],mfa_disabled:e[`mfa-config-mfa-disabled`],session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},purpose_justification_prompt:h(e[`purpose-justification-prompt`],`purpose-justification-prompt`,`text`),purpose_justification_required:e[`purpose-justification-required`],session_duration:h(e[`session-duration`],`session-duration`,`text`),decision:e.decision,exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),name:h(e.name,`name`,`text`),require:p(e.require,`require`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(T,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.decision===void 0&&(e.decision=await v(`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`])),e.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name of the Access policy.`));let u=m({approval_groups:p(e[`approval-groups`],`approval-groups`),approval_required:e[`approval-required`],connection_rules:{rdp:{allowed_clipboard_local_to_remote_formats:e[`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`],allowed_clipboard_remote_to_local_formats:e[`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`]}},isolation_required:e[`isolation-required`],mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],mfa_disabled:e[`mfa-config-mfa-disabled`],session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},purpose_justification_prompt:h(e[`purpose-justification-prompt`],`purpose-justification-prompt`,`text`),purpose_justification_required:e[`purpose-justification-required`],session_duration:h(e[`session-duration`],`session-duration`,`text`),decision:e.decision,exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),name:h(e.name,`name`,`text`),require:p(e.require,`require`)}),d=await l(`Creating`,async()=>n.send(T,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Mn={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/policies/${t.policy_id}`};function Nn(e){return e.usage(`$0 zero-trust access policies delete <policy-id>
92
+
93
+ Deletes an Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pn={command:`delete <policy-id>`,describe:`Delete an Access reusable policy`,builder:Nn,handler:async e=>u({command:`zero-trust access policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
94
+ `);return}let u=await l(`Deleting`,async()=>n.send(Mn,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Deleted`})})};var Fn={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/policies/${t.policy_id}`};function In(e){return e.usage(`$0 zero-trust access policies get <policy-id>
95
+
96
+ Fetches a single Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ln={command:`get <policy-id>`,describe:`Get an Access reusable policy`,builder:In,handler:async e=>u({command:`zero-trust access policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Fn,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Loaded`})})};var Rn={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/policies`,query:[`page`,`per_page`]};function zn(e){return e.usage(`$0 zero-trust access policies list
97
+
98
+ Lists Access reusable policies.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bn={command:`list`,describe:`List Access reusable policies`,builder:zn,handler:async e=>u({command:`zero-trust access policies list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/policies`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Rn,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var E={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/policies/${t.policy_id}`,body:`json`};function Vn(e){return e.usage(`$0 zero-trust access policies update <policy-id>
99
+
100
+ Updates a Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`approval-groups`,{type:`string`,description:`Administrators who can approve a temporary authentication request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`approval-required`,{type:`boolean`,description:`Requires the user to request access from an administrator at the start of each session.`}).option(`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`,{type:`string`,array:!0,description:`Clipboard formats allowed when copying from local machine to remote RDP session.`}).option(`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`,{type:`string`,array:!0,description:`Clipboard formats allowed when copying from remote RDP session to local machine.`}).option(`isolation-required`,{type:`boolean`,description:`Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:`Lists the MFA methods that users can authenticate with.`}).option(`mfa-config-mfa-disabled`,{type:`boolean`,description:`Indicates whether to disable MFA for this resource. This option is available at the application and policy level.`}).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(`purpose-justification-prompt`,{type:`string`,description:`A custom message that will appear on the purpose justification screen.`}).option(`purpose-justification-required`,{type:`boolean`,description:`Require users to enter a justification when they log in to the application.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for the application will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).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`]}).coerce(`decision`,e=>h(e,`decision`,`text`)).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 Hn={command:`update <policy-id>`,describe:`Update an Access reusable policy`,builder:Vn,handler:async e=>u({command:`zero-trust access policies update`,classification:{safeFlags:[`approval-required`,`isolation-required`,`mfa-config-mfa-disabled`,`purpose-justification-required`,`decision`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({approval_groups:p(e[`approval-groups`],`approval-groups`),approval_required:e[`approval-required`],connection_rules:{rdp:{allowed_clipboard_local_to_remote_formats:e[`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`],allowed_clipboard_remote_to_local_formats:e[`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`]}},isolation_required:e[`isolation-required`],mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],mfa_disabled:e[`mfa-config-mfa-disabled`],session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},purpose_justification_prompt:h(e[`purpose-justification-prompt`],`purpose-justification-prompt`,`text`),purpose_justification_required:e[`purpose-justification-required`],session_duration:h(e[`session-duration`],`session-duration`,`text`),decision:e.decision,exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),name:h(e.name,`name`,`text`),require:p(e.require,`require`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(E,{body:t,account_id:a,policy_id:e[`policy-id`]}));s(r,{successLabel:`Updated`});return}if(e.decision===void 0&&(e.decision=await v(`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`])),e.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name of the Access policy.`));let u=m({approval_groups:p(e[`approval-groups`],`approval-groups`),approval_required:e[`approval-required`],connection_rules:{rdp:{allowed_clipboard_local_to_remote_formats:e[`connection-rules-rdp-allowed-clipboard-local-to-remote-formats`],allowed_clipboard_remote_to_local_formats:e[`connection-rules-rdp-allowed-clipboard-remote-to-local-formats`]}},isolation_required:e[`isolation-required`],mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],mfa_disabled:e[`mfa-config-mfa-disabled`],session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},purpose_justification_prompt:h(e[`purpose-justification-prompt`],`purpose-justification-prompt`,`text`),purpose_justification_required:e[`purpose-justification-required`],session_duration:h(e[`session-duration`],`session-duration`,`text`),decision:e.decision,exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),name:h(e.name,`name`,`text`),require:p(e.require,`require`)}),d=await l(`Updating`,async()=>n.send(E,{body:u,account_id:a,policy_id:e[`policy-id`]}));s(d,{successLabel:`Updated`})})},Un={command:`policies`,describe:`Operations for access.policies`,builder:e=>e.command(jn).command(Pn).command(Ln).command(Bn).command(Hn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var D={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/groups`,body:`json`};function Wn(e){return e.usage(`$0 zero-trust access rule-groups create
101
+
102
+ Creates a new Access group.`).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Gn={command:`create`,describe:`Create an Access group`,builder:Wn,handler:async e=>u({command:`zero-trust access rule-groups create`,classification:{safeFlags:[`is-default`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access rule-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),is_default:e[`is-default`],name:h(e.name,`name`,`text`),require:p(e.require,`require`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(D,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}if(e.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name of the Access group.`));let g=m({exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),is_default:e[`is-default`],name:h(e.name,`name`,`text`),require:p(e.require,`require`)}),v=await l(`Creating`,async()=>n.send(D,{body:g,account_or_zone:u,account_or_zone_id:d}));s(v,{successLabel:`Created`})})};var Kn={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/groups/${t.group_id}`};function qn(e){return e.usage(`$0 zero-trust access rule-groups delete <group-id>
103
+
104
+ Deletes an Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Jn={command:`delete <group-id>`,describe:`Delete an Access group`,builder:qn,handler:async e=>u({command:`zero-trust access rule-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access rule-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
105
+ `);return}let f=await l(`Deleting`,async()=>n.send(Kn,{account_or_zone:u,account_or_zone_id:d,group_id:e[`group-id`]}));s(f,{successLabel:`Deleted`})})};var Yn={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/groups/${t.group_id}`};function Xn(e){return e.usage(`$0 zero-trust access rule-groups get <group-id>
106
+
107
+ Fetches a single Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zn={command:`get <group-id>`,describe:`Get an Access group`,builder:Xn,handler:async e=>u({command:`zero-trust access rule-groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access rule-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(Yn,{account_or_zone:u,account_or_zone_id:d,group_id:e[`group-id`]}));s(f,{successLabel:`Loaded`})})};var Qn={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/groups`,query:[`name`,`search`,`page`,`per_page`]};function $n(e){return e.usage(`$0 zero-trust access rule-groups list
108
+
109
+ Lists all Access groups.`).option(`name`,{type:`string`,description:`The name of the group.`}).option(`search`,{type:`string`,description:`Search for groups by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const er={command:`list`,describe:`List Access groups`,builder:$n,handler:async e=>u({command:`zero-trust access rule-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={name:e.name,search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust access rule-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/groups`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(Qn,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var O={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/groups/${t.group_id}`,body:`json`};function tr(e){return e.usage(`$0 zero-trust access rule-groups update <group-id>
110
+
111
+ Updates a configured Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const nr={command:`update <group-id>`,describe:`Update an Access group`,builder:tr,handler:async e=>u({command:`zero-trust access rule-groups update`,classification:{safeFlags:[`is-default`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access rule-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"group-id":String(e[`group-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),is_default:e[`is-default`],name:h(e.name,`name`,`text`),require:p(e.require,`require`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(O,{body:t,account_or_zone:u,account_or_zone_id:d,group_id:e[`group-id`]}));s(r,{successLabel:`Updated`});return}if(e.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name of the Access group.`));let g=m({exclude:p(e.exclude,`exclude`),include:p(e.include,`include`),is_default:e[`is-default`],name:h(e.name,`name`,`text`),require:p(e.require,`require`)}),v=await l(`Updating`,async()=>n.send(O,{body:g,account_or_zone:u,account_or_zone_id:d,group_id:e[`group-id`]}));s(v,{successLabel:`Updated`})})},rr={command:`rule-groups`,describe:`Operations for access.rule-groups`,builder:e=>e.command(Gn).command(Jn).command(Zn).command(er).command(nr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ir={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/saml_certificates/${t.saml_cert_set_id}/pem`,response:!1,errors:{404:`NotFoundError`}};function ar(e){return e.usage(`$0 zero-trust access saml-encryption-certificates get-pem <saml-cert-set-id>
112
+
113
+ Downloads the current SAML encryption certificate's public key in PEM format for the specified certificate set. This endpoint is useful for providing the certificate to Identity Providers for SAML assertion encryption configuration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const or={command:`get-pem <saml-cert-set-id>`,describe:`Download current certificate in PEM format`,builder:ar,handler:async e=>u({command:`zero-trust access saml-encryption-certificates get-pem`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access saml-encryption-certificates get-pem`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/saml_certificates/${e[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(e[`saml-cert-set-id`]))}/pem`,pathParams:{"saml-cert-set-id":String(e[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ir,{account_id:a,saml_cert_set_id:e[`saml-cert-set-id`]}));s(u,{successLabel:`Loaded`})})};var sr={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/saml_certificates/${t.saml_cert_set_id}`,errors:{404:`NotFoundError`}};function cr(e){return e.usage(`$0 zero-trust access saml-encryption-certificates get <saml-cert-set-id>
114
+
115
+ Retrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lr={command:`get <saml-cert-set-id>`,describe:`Get SAML certificate set`,builder:cr,handler:async e=>u({command:`zero-trust access saml-encryption-certificates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access saml-encryption-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/saml_certificates/${e[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(e[`saml-cert-set-id`]))}`,pathParams:{"saml-cert-set-id":String(e[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(sr,{account_id:a,saml_cert_set_id:e[`saml-cert-set-id`]}));s(u,{successLabel:`Loaded`})})};var ur={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/saml_certificates`,query:[`page`,`per_page`,`id`]};function dr(e){return e.usage(`$0 zero-trust access saml-encryption-certificates list
116
+
117
+ Returns a paginated list of the organization's SAML encryption certificate sets. Each certificate set includes the current and (if present) previous certificates.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`id`,{type:`string`,description:`Filter by SAML certificate set UID. Accepts a comma-separated list of UIDs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fr={command:`list`,describe:`List SAML certificate sets`,builder:dr,handler:async e=>u({command:`zero-trust access saml-encryption-certificates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],id:e.id};if(e.dryRun){let e=await i();c({command:`cf zero-trust access saml-encryption-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/saml_certificates`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ur,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var pr={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/saml_certificates/${t.saml_cert_set_id}/rotate`,errors:{404:`NotFoundError`}};function mr(e){return e.usage(`$0 zero-trust access saml-encryption-certificates rotate <saml-cert-set-id>
118
+
119
+ Rotates the SAML encryption certificates within the specified certificate set. This generates a new certificate and moves the current certificate to the previous slot. If a previous certificate exists, it will be deactivated and removed. This endpoint ensures zero-downtime rotation by maintaining both current and previous certificates during the transition period, allowing IdPs time to update their configurations. Automated rotation happens 30 days before a current certificate's expiration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set to rotate.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hr={command:`rotate <saml-cert-set-id>`,describe:`Rotate SAML certificate`,builder:mr,handler:async e=>u({command:`zero-trust access saml-encryption-certificates rotate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access saml-encryption-certificates rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/saml_certificates/${e[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(e[`saml-cert-set-id`]))}/rotate`,pathParams:{"saml-cert-set-id":String(e[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(pr,{account_id:a,saml_cert_set_id:e[`saml-cert-set-id`]}));s(u,{successLabel:`Created`})})},gr={command:`saml-encryption-certificates`,describe:`Operations for access.saml-encryption-certificates`,builder:e=>e.command(lr).command(or).command(fr).command(hr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var k={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/service_tokens`,body:`json`};function _r(e){return e.usage(`$0 zero-trust access service-tokens create
120
+
121
+ Generates a new service token. **Note:** This is the only time you can get the Client Secret. If you lose the Client Secret, you will have to rotate the Client Secret or create a new service token.`).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`.",default:1}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).",default:`8760h`}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const vr={command:`create`,describe:`Create a service token`,builder:_r,handler:async e=>u({command:`zero-trust access service-tokens create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access service-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({client_secret_version:e[`client-secret-version`],duration:h(e.duration,`duration`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(k,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the service token.`));let p=m({client_secret_version:e[`client-secret-version`],duration:h(e.duration,`duration`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),g=await l(`Creating`,async()=>n.send(k,{body:p,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Created`})})};var yr={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/service_tokens/${t.service_token_id}`};function br(e){return e.usage(`$0 zero-trust access service-tokens delete <service-token-id>
122
+
123
+ Deletes a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const xr={command:`delete <service-token-id>`,describe:`Delete a service token`,builder:br,handler:async e=>u({command:`zero-trust access service-tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access service-tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${e[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(e[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"service-token-id":String(e[`service-token-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
124
+ `);return}let f=await l(`Deleting`,async()=>n.send(yr,{account_or_zone:u,account_or_zone_id:d,service_token_id:e[`service-token-id`]}));s(f,{successLabel:`Deleted`})})};var Sr={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/service_tokens/${t.service_token_id}`};function Cr(e){return e.usage(`$0 zero-trust access service-tokens get <service-token-id>
125
+
126
+ Fetches a single service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wr={command:`get <service-token-id>`,describe:`Get a service token`,builder:Cr,handler:async e=>u({command:`zero-trust access service-tokens get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access service-tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${e[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(e[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"service-token-id":String(e[`service-token-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(Sr,{account_or_zone:u,account_or_zone_id:d,service_token_id:e[`service-token-id`]}));s(f,{successLabel:`Loaded`})})};var Tr={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/service_tokens`,query:[`name`,`search`,`page`,`per_page`]};function Er(e){return e.usage(`$0 zero-trust access service-tokens list
127
+
128
+ Lists all service tokens.`).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`search`,{type:`string`,description:`Search for service tokens by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dr={command:`list`,describe:`List service tokens`,builder:Er,handler:async e=>u({command:`zero-trust access service-tokens list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={name:e.name,search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust access service-tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/service_tokens`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(Tr,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var Or={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/service_tokens/${t.service_token_id}/refresh`};function kr(e){return e.usage(`$0 zero-trust access service-tokens refresh <service-token-id>
129
+
130
+ Refreshes the expiration of a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ar={command:`refresh <service-token-id>`,describe:`Refresh a service token`,builder:kr,handler:async e=>u({command:`zero-trust access service-tokens refresh`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access service-tokens refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/service_tokens/${e[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(e[`service-token-id`]))}/refresh`,pathParams:{"service-token-id":String(e[`service-token-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Or,{account_id:a,service_token_id:e[`service-token-id`]}));s(u,{successLabel:`Created`})})};var A={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/service_tokens/${t.service_token_id}/rotate`,body:`json`};function jr(e){return e.usage(`$0 zero-trust access service-tokens rotate <service-token-id>
131
+
132
+ Generates a new Client Secret for a service token and revokes the old one.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. If not provided, it defaults to the current timestamp in order to immediately expire the previous secret."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Mr={command:`rotate <service-token-id>`,describe:`Rotate a service token`,builder:jr,handler:async e=>u({command:`zero-trust access service-tokens rotate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access service-tokens rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/service_tokens/${e[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(e[`service-token-id`]))}/rotate`,pathParams:{"service-token-id":String(e[`service-token-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(A,{body:t,account_id:a,service_token_id:e[`service-token-id`]}));s(r,{successLabel:`Created`});return}let u=m({previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),d=await l(`Creating`,async()=>n.send(A,{body:u,account_id:a,service_token_id:e[`service-token-id`]}));s(d,{successLabel:`Created`})})};var j={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/service_tokens/${t.service_token_id}`,body:`json`};function Nr(e){return e.usage(`$0 zero-trust access service-tokens update <service-token-id>
133
+
134
+ Updates a configured service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`."}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h)."}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pr={command:`update <service-token-id>`,describe:`Update a service token`,builder:Nr,handler:async e=>u({command:`zero-trust access service-tokens update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access service-tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${e[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(e[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"service-token-id":String(e[`service-token-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({client_secret_version:e[`client-secret-version`],duration:h(e.duration,`duration`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(j,{body:t,account_or_zone:u,account_or_zone_id:d,service_token_id:e[`service-token-id`]}));s(r,{successLabel:`Updated`});return}let p=m({client_secret_version:e[`client-secret-version`],duration:h(e.duration,`duration`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),previous_client_secret_expires_at:h(e[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}),g=await l(`Updating`,async()=>n.send(j,{body:p,account_or_zone:u,account_or_zone_id:d,service_token_id:e[`service-token-id`]}));s(g,{successLabel:`Updated`})})},Fr={command:`service-tokens`,describe:`Operations for access.service-tokens`,builder:e=>e.command(vr).command(xr).command(wr).command(Dr).command(Ar).command(Mr).command(Pr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ir={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/keys`};function Lr(e){return e.usage(`$0 zero-trust access signing-keys get
135
+
136
+ Gets the Access key rotation settings for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rr={command:`get`,describe:`Get the Access key configuration`,builder:Lr,handler:async e=>u({command:`zero-trust access signing-keys get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access signing-keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ir,{account_id:a}));s(u,{successLabel:`Loaded`})})};var zr={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/keys/rotate`};function Br(e){return e.usage(`$0 zero-trust access signing-keys rotate
137
+
138
+ Perfoms a key rotation for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vr={command:`rotate`,describe:`Rotate Access keys`,builder:Br,handler:async e=>u({command:`zero-trust access signing-keys rotate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust access signing-keys rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/keys/rotate`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(zr,{account_id:a}));s(u,{successLabel:`Created`})})};var M={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/keys`,body:`json`};function Hr(e){return e.usage(`$0 zero-trust access signing-keys update
139
+
140
+ Updates the Access key rotation settings for an account.`).option(`key-rotation-interval-days`,{type:`number`,description:`The number of days between key rotations.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ur={command:`update`,describe:`Update the Access key configuration`,builder:Hr,handler:async e=>u({command:`zero-trust access signing-keys update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access signing-keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({key_rotation_interval_days:e[`key-rotation-interval-days`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(M,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e[`key-rotation-interval-days`]===void 0)throw Error(`--key-rotation-interval-days is required (or pass --body with this field set).`);let u=m({key_rotation_interval_days:e[`key-rotation-interval-days`]}),d=await l(`Updating`,async()=>n.send(M,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},Wr={command:`signing-keys`,describe:`Operations for access.signing-keys`,builder:e=>e.command(Rr).command(Vr).command(Ur).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var N={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/tags`,body:`json`};function Gr(e){return e.usage(`$0 zero-trust access tags create
141
+
142
+ Create a tag`).option(`name`,{type:`string`,description:`The name of the tag`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Kr={command:`create`,describe:`Create a tag`,builder:Gr,handler:async e=>u({command:`zero-trust access tags create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/tags`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(N,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}let u=m({name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(N,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var qr={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/tags/${t.tag_name}`};function Jr(e){return e.usage(`$0 zero-trust access tags delete <tag-name>
143
+
144
+ Delete a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Yr={command:`delete <tag-name>`,describe:`Delete a tag`,builder:Jr,handler:async e=>u({command:`zero-trust access tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/tags/${e[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(e[`tag-name`]))}`,pathParams:{"tag-name":String(e[`tag-name`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
145
+ `);return}let u=await l(`Deleting`,async()=>n.send(qr,{account_id:a,tag_name:e[`tag-name`]}));s(u,{successLabel:`Deleted`})})};var Xr={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/tags/${t.tag_name}`};function Zr(e){return e.usage(`$0 zero-trust access tags get <tag-name>
146
+
147
+ Get a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qr={command:`get <tag-name>`,describe:`Get a tag`,builder:Zr,handler:async e=>u({command:`zero-trust access tags get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/tags/${e[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(e[`tag-name`]))}`,pathParams:{"tag-name":String(e[`tag-name`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Xr,{account_id:a,tag_name:e[`tag-name`]}));s(u,{successLabel:`Loaded`})})};var $r={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/tags`,query:[`page`,`per_page`]};function ei(e){return e.usage(`$0 zero-trust access tags list
148
+
149
+ List tags`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ti={command:`list`,describe:`List tags`,builder:ei,handler:async e=>u({command:`zero-trust access tags list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/tags`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send($r,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var P={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/tags/${t.tag_name}`,body:`json`};function ni(e){return e.usage(`$0 zero-trust access tags update <tag-name>
150
+
151
+ Update a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the tag`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A tag`})}const ri={command:`update <tag-name>`,describe:`Update a tag`,builder:ni,handler:async e=>u({command:`zero-trust access tags update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/tags/${e[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(e[`tag-name`]))}`,pathParams:{"tag-name":String(e[`tag-name`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(P,{body:t,account_id:a,tag_name:e[`tag-name`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the tag`));let u=m({name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(P,{body:u,account_id:a,tag_name:e[`tag-name`]}));s(d,{successLabel:`Updated`})})},ii={command:`tags`,describe:`Operations for access.tags`,builder:e=>e.command(Kr).command(Yr).command(Qr).command(ti).command(ri).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`POST`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/batch_delete`,body:`json`,response:!1};function ai(e){return e.usage(`$0 zero-trust access targets bulk delete
152
+
153
+ Removes one or more targets.`).option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oi={command:`delete`,describe:`Delete targets`,builder:ai,handler:async e=>u({command:`zero-trust access targets bulk delete`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({target_ids:e[`target-ids`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(F,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let u=m({target_ids:e[`target-ids`]}),d=await l(`Creating`,async()=>n.send(F,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var I={method:`POST`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/batch_tags`,body:`json`};function si(e){return e.usage(`$0 zero-trust access targets bulk replace-tags
154
+
155
+ Replaces tags for one or more existing infrastructure access targets.`).option(`items`,{type:`string`,description:`The items field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ci={command:`replace-tags`,describe:`Replace tags on existing targets`,builder:si,handler:async e=>u({command:`zero-trust access targets bulk replace-tags`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets bulk replace-tags`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/batch_tags`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({items:p(e.items,`items`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(I,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.items===void 0)throw Error(`--items is required (or pass --body with this field set).`);let u=m({items:p(e.items,`items`)}),d=await l(`Creating`,async()=>n.send(I,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var li={method:`PUT`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/batch`,body:`json`};function ui(e){return e.usage(`$0 zero-trust access targets bulk update
156
+
157
+ Adds one or more targets.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const di={command:`update`,describe:`Create new targets`,builder:ui,handler:async e=>u({command:`zero-trust access targets bulk update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(li,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},fi={command:`bulk`,describe:`Operations for access.targets.bulk`,builder:e=>e.command(oi).command(ci).command(di).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var L={method:`POST`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets`,body:`json`};function pi(e){return e.usage(`$0 zero-trust access targets create
158
+
159
+ Creates a new infrastructure access target in the account.`).option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
160
+ length of 255 characters, supports the use of special characters dash
161
+ and period, does not support spaces, and must start and end with an
162
+ alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const mi={command:`create`,describe:`Create new target`,builder:pi,handler:async e=>u({command:`zero-trust access targets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({hostname:h(e.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:h(e[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:h(e[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(L,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.hostname===void 0&&(e.hostname=await _(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let u=m({hostname:h(e.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:h(e[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:h(e[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}),d=await l(`Creating`,async()=>n.send(L,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var hi={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/${t.target_id}`,response:!1};function gi(e){return e.usage(`$0 zero-trust access targets delete <target-id>
163
+
164
+ Removes a single infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _i={command:`delete <target-id>`,describe:`Delete target`,builder:gi,handler:async e=>u({command:`zero-trust access targets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/${e[`target-id`]==null?`<target-id>`:encodeURIComponent(String(e[`target-id`]))}`,pathParams:{"target-id":String(e[`target-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
165
+ `);return}let u=await l(`Deleting`,async()=>n.send(hi,{account_id:a,target_id:e[`target-id`]}));s(u,{successLabel:`Deleted`})})};var vi={method:`GET`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/${t.target_id}`};function yi(e){return e.usage(`$0 zero-trust access targets get <target-id>
166
+
167
+ Fetches a single infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bi={command:`get <target-id>`,describe:`Get target`,builder:yi,handler:async e=>u({command:`zero-trust access targets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/${e[`target-id`]==null?`<target-id>`:encodeURIComponent(String(e[`target-id`]))}`,pathParams:{"target-id":String(e[`target-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(vi,{account_id:a,target_id:e[`target-id`]}));s(u,{successLabel:`Loaded`})})};var xi={method:`GET`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets`,query:[`hostname`,`hostname_contains`,`virtual_network_id`,`ip_v4`,`ip_v6`,`created_before`,`created_after`,`modified_before`,`modified_after`,`ips`,`target_ids`,`ip_like`,`ipv4_start`,`ipv4_end`,`ipv6_start`,`ipv6_end`,`tag`,`page`,`per_page`,`order`,`direction`]};function Si(e){return e.usage(`$0 zero-trust access targets list
168
+
169
+ Lists and sorts an account's targets. Filters are optional and are ANDed together.`).option(`hostname`,{type:`string`,description:`Hostname of a target`}).option(`hostname-contains`,{type:`string`,description:`Partial match to the hostname of a target`}).option(`virtual-network-id`,{type:`string`,description:`Private virtual network identifier of the target`}).option(`ip-v4`,{type:`string`,description:`IPv4 address of the target`}).option(`ip-v6`,{type:`string`,description:`IPv6 address of the target`}).option(`created-before`,{type:`string`,description:`Date and time at which the target was created before (inclusive)`}).option(`created-after`,{type:`string`,description:`Date and time at which the target was created after (inclusive)`}).option(`modified-before`,{type:`string`,description:`Date and time at which the target was modified before (inclusive)`}).option(`modified-after`,{type:`string`,description:`Date and time at which the target was modified after (inclusive)`}).option(`ips`,{type:`string`,description:"Filters for targets that have any of the following IP addresses. Specify\n`ips` multiple times in query parameter to build list of candidates."}).option(`target-ids`,{type:`string`,description:`Filters for targets that have any of the following UUIDs. Specify
170
+ \`target_ids\` multiple times in query parameter to build list of
171
+ candidates.`}).option(`ip-like`,{type:`string`,description:"Filters for targets whose IP addresses look like the specified string.\nSupports `*` as a wildcard character"}).option(`ipv4-start`,{type:`string`,description:"Defines an IPv4 filter range's starting value (inclusive). Requires\n`ipv4_end` to be specified as well."}).option(`ipv4-end`,{type:`string`,description:"Defines an IPv4 filter range's ending value (inclusive). Requires\n`ipv4_start` to be specified as well."}).option(`ipv6-start`,{type:`string`,description:"Defines an IPv6 filter range's starting value (inclusive). Requires\n`ipv6_end` to be specified as well."}).option(`ipv6-end`,{type:`string`,description:"Defines an IPv6 filter range's ending value (inclusive). Requires\n`ipv6_start` to be specified as well."}).option(`tag`,{type:`string`,description:"Filter by tag key:value pairs. Multiple `tag` params are AND'd.\nFormat: `tag=key:value` (e.g., `tag=environment:production`).\nKey and value must both be non-empty; `tag=:value` and `tag=key:` return 400."}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`order`,{type:`string`,description:`The field to sort by.`,choices:[`hostname`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ci={command:`list`,describe:`List all targets`,builder:Si,handler:async e=>u({command:`zero-trust access targets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={hostname:e.hostname,hostname_contains:e[`hostname-contains`],virtual_network_id:e[`virtual-network-id`],ip_v4:e[`ip-v4`],ip_v6:e[`ip-v6`],created_before:e[`created-before`],created_after:e[`created-after`],modified_before:e[`modified-before`],modified_after:e[`modified-after`],ips:e.ips,target_ids:e[`target-ids`],ip_like:e[`ip-like`],ipv4_start:e[`ipv4-start`],ipv4_end:e[`ipv4-end`],ipv6_start:e[`ipv6-start`],ipv6_end:e[`ipv6-end`],tag:e.tag,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust access targets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/infrastructure/targets`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(xi,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var R={method:`PUT`,path:t=>e`/accounts/${t.account_id}/infrastructure/targets/${t.target_id}`,body:`json`};function wi(e){return e.usage(`$0 zero-trust access targets update <target-id>
172
+
173
+ Updates an existing infrastructure access target by its ID.`).positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
174
+ length of 255 characters, supports the use of special characters dash
175
+ and period, does not support spaces, and must start and end with an
176
+ alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ti={command:`update <target-id>`,describe:`Update target`,builder:wi,handler:async e=>u({command:`zero-trust access targets update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access targets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/infrastructure/targets/${e[`target-id`]==null?`<target-id>`:encodeURIComponent(String(e[`target-id`]))}`,pathParams:{"target-id":String(e[`target-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({hostname:h(e.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:h(e[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:h(e[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(R,{body:t,account_id:a,target_id:e[`target-id`]}));s(r,{successLabel:`Updated`});return}e.hostname===void 0&&(e.hostname=await _(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let u=m({hostname:h(e.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:h(e[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:h(e[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:h(e[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}),d=await l(`Updating`,async()=>n.send(R,{body:u,account_id:a,target_id:e[`target-id`]}));s(d,{successLabel:`Updated`})})},Ei={command:`targets`,describe:`Operations for access.targets`,builder:e=>e.command(mi).command(_i).command(bi).command(Ci).command(Ti).command(fi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/user_populations`,body:`json`};function Di(e){return e.usage(`$0 zero-trust access user-populations create
177
+
178
+ Creates a user population in an account.`).option(`name`,{type:`string`,description:`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes.
179
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oi={command:`create`,describe:`Create a user population`,builder:Di,handler:async e=>u({command:`zero-trust access user-populations create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access user-populations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/user_populations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(z,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes. `));let u=m({name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(z,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var ki={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/user_populations/${t.user_population_id}`};function Ai(e){return e.usage(`$0 zero-trust access user-populations delete <user-population-id>
180
+
181
+ Deletes a user population that is not attached to an application.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ji={command:`delete <user-population-id>`,describe:`Delete a user population`,builder:Ai,handler:async e=>u({command:`zero-trust access user-populations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access user-populations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/user_populations/${e[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(e[`user-population-id`]))}`,pathParams:{"user-population-id":String(e[`user-population-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
182
+ `);return}let u=await l(`Deleting`,async()=>n.send(ki,{account_id:a,user_population_id:e[`user-population-id`]}));s(u,{successLabel:`Deleted`})})};var Mi={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/user_populations/${t.user_population_id}`};function Ni(e){return e.usage(`$0 zero-trust access user-populations get <user-population-id>
183
+
184
+ Fetches a user population.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pi={command:`get <user-population-id>`,describe:`Get a user population`,builder:Ni,handler:async e=>u({command:`zero-trust access user-populations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access user-populations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/user_populations/${e[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(e[`user-population-id`]))}`,pathParams:{"user-population-id":String(e[`user-population-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Mi,{account_id:a,user_population_id:e[`user-population-id`]}));s(u,{successLabel:`Loaded`})})};var Fi={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/user_populations`,query:[`page`,`per_page`]};function Ii(e){return e.usage(`$0 zero-trust access user-populations list
185
+
186
+ Lists the user populations in an account.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Li={command:`list`,describe:`List user populations`,builder:Ii,handler:async e=>u({command:`zero-trust access user-populations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access user-populations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/user_populations`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Fi,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var B={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/user_populations/${t.user_population_id}`,body:`json`};function Ri(e){return e.usage(`$0 zero-trust access user-populations update <user-population-id>
187
+
188
+ Updates a user population's name.`).positional(`user-population-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes.
189
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const zi={command:`update <user-population-id>`,describe:`Update a user population`,builder:Ri,handler:async e=>u({command:`zero-trust access user-populations update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access user-populations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/user_populations/${e[`user-population-id`]==null?`<user-population-id>`:encodeURIComponent(String(e[`user-population-id`]))}`,pathParams:{"user-population-id":String(e[`user-population-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(B,{body:t,account_id:a,user_population_id:e[`user-population-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the user population. Leading and trailing whitespace is trimmed before validation. After trimming, the name must contain at least one non-whitespace character and must not exceed 128 UTF-8 bytes. `));let u=m({name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(B,{body:u,account_id:a,user_population_id:e[`user-population-id`]}));s(d,{successLabel:`Updated`})})},Bi={command:`user-populations`,describe:`Operations for access.user-populations`,builder:e=>e.command(Oi).command(ji).command(Pi).command(Li).command(zi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Vi={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/active_sessions/${t.nonce}`};function Hi(e){return e.usage(`$0 zero-trust access users active-sessions get <nonce>
190
+
191
+ Get an active session for a single user.`).positional(`nonce`,{type:`string`,description:`Nonce`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ui={command:`get <nonce>`,describe:`Get single active session`,builder:Hi,handler:async e=>u({command:`zero-trust access users active-sessions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users active-sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/active_sessions/${e.nonce==null?`<nonce>`:encodeURIComponent(String(e.nonce))}`,pathParams:{"user-id":String(e[`user-id`]??``),nonce:String(e.nonce??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Vi,{account_id:a,user_id:e[`user-id`],nonce:e.nonce}));s(u,{successLabel:`Loaded`})})};var Wi={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/active_sessions`};function Gi(e){return e.usage(`$0 zero-trust access users active-sessions list
192
+
193
+ Get active sessions for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ki={command:`list`,describe:`Get active sessions`,builder:Gi,handler:async e=>u({command:`zero-trust access users active-sessions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users active-sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/active_sessions`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Wi,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})},qi={command:`active-sessions`,describe:`Operations for access.users.active-sessions`,builder:e=>e.command(Ui).command(Ki).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/users`,body:`json`};function Ji(e){return e.usage(`$0 zero-trust access users create
194
+
195
+ Creates a new user.`).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yi={command:`create`,describe:`Create a user`,builder:Ji,handler:async e=>u({command:`zero-trust access users create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({email:h(e.email,`email`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(V,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.email===void 0&&(e.email=await _(`email`,`The email of the user.`));let u=m({email:h(e.email,`email`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(V,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Xi={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}`};function Zi(e){return e.usage(`$0 zero-trust access users delete <user-id>
196
+
197
+ Deletes a specific user for an account. This will also revoke any active seats and tokens for the user.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qi={command:`delete <user-id>`,describe:`Delete a user`,builder:Zi,handler:async e=>u({command:`zero-trust access users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
198
+ `);return}let u=await l(`Deleting`,async()=>n.send(Xi,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Deleted`})})};var $i={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/failed_logins`};function ea(e){return e.usage(`$0 zero-trust access users failed-logins list
199
+
200
+ Get all failed login attempts for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ta={command:`list`,describe:`Get failed logins`,builder:ea,handler:async e=>u({command:`zero-trust access users failed-logins list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users failed-logins list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/failed_logins`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send($i,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})},na={command:`failed-logins`,describe:`Operations for access.users.failed-logins`,builder:e=>e.command(ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ra={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}`};function ia(e){return e.usage(`$0 zero-trust access users get <user-id>
201
+
202
+ Gets a specific user for an account.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const aa={command:`get <user-id>`,describe:`Get a user`,builder:ia,handler:async e=>u({command:`zero-trust access users get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ra,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})};var oa={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/last_seen_identity`};function sa(e){return e.usage(`$0 zero-trust access users last-seen-identity get <user-id>
203
+
204
+ Get last seen identity for a single user.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ca={command:`get <user-id>`,describe:`Get last seen identity`,builder:sa,handler:async e=>u({command:`zero-trust access users last-seen-identity get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users last-seen-identity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/last_seen_identity`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(oa,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})},la={command:`last-seen-identity`,describe:`Operations for access.users.last-seen-identity`,builder:e=>e.command(ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ua={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/users`,query:[`name`,`email`,`search`,`page`,`per_page`]};function da(e){return e.usage(`$0 zero-trust access users list
205
+
206
+ Gets a list of users for an account.`).option(`name`,{type:`string`,description:`The name of the user.`}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`search`,{type:`string`,description:`Search for users by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fa={command:`list`,describe:`Get users`,builder:da,handler:async e=>u({command:`zero-trust access users list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={name:e.name,email:e.email,search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust access users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/users`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ua,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var H={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/organizations/revoke_user`,body:`json`};function pa(e){return e.usage(`$0 zero-trust access users revoke
207
+
208
+ Revokes a user's access across all applications.`).option(`devices`,{type:`boolean`,description:"When set to `true`, all devices associated with the user will be revoked."}).option(`email`,{type:`string`,description:`The email of the user to revoke.`}).option(`user-uid`,{type:`string`,description:`The uuid of the user to revoke.`}).option(`warp-session-reauth`,{type:`boolean`,description:"When set to `true`, the user will be required to re-authenticate to WARP for all Gateway policies that enforce a WARP client session duration. When `false`, the user’s WARP session will remain active"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ma={command:`revoke`,describe:`Revoke all Access tokens for a user`,builder:pa,handler:async e=>u({command:`zero-trust access users revoke`,classification:{safeFlags:[`devices`,`warp-session-reauth`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust access users revoke`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations/revoke_user`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({devices:e.devices,email:h(e.email,`email`,`text`),user_uid:h(e[`user-uid`],`user-uid`,`text`),warp_session_reauth:e[`warp-session-reauth`]}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force,message:`This operation revokes all access tokens for a user destructively.`})){process.stderr.write(`Aborted.
209
+ `);return}if(e.body){let t=f(e.body),r=await l(`Deleting`,async()=>n.send(H,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Deleted`});return}e.email===void 0&&(e.email=await _(`email`,`The email of the user to revoke.`));let p=m({devices:e.devices,email:h(e.email,`email`,`text`),user_uid:h(e[`user-uid`],`user-uid`,`text`),warp_session_reauth:e[`warp-session-reauth`]}),g=await l(`Deleting`,async()=>n.send(H,{body:p,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Deleted`})})};var U={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}`,body:`json`};function ha(e){return e.usage(`$0 zero-trust access users update <user-id>
210
+
211
+ Updates a specific user's name for an account. Requires the user's current email as confirmation (email cannot be changed).`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ga={command:`update <user-id>`,describe:`Update a user`,builder:ha,handler:async e=>u({command:`zero-trust access users update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust access users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({email:h(e.email,`email`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(U,{body:t,account_id:a,user_id:e[`user-id`]}));s(r,{successLabel:`Updated`});return}e.email===void 0&&(e.email=await _(`email`,`The email of the user.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the user.`));let u=m({email:h(e.email,`email`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(U,{body:u,account_id:a,user_id:e[`user-id`]}));s(d,{successLabel:`Updated`})})},_a={command:`users`,describe:`Operations for access.users`,builder:e=>e.command(Yi).command(Qi).command(aa).command(fa).command(ma).command(ga).command(qi).command(na).command(la).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},va={command:`access`,describe:`Operations for access`,builder:e=>e.command(nt).command(bt).command(Bt).command(rn).command(ln).command(kn).command(Un).command(rr).command(gr).command(Fr).command(Wr).command(ii).command(Ei).command(Bi).command(_a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ya={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/apps/review_status`};function ba(e){return e.usage(`$0 zero-trust apps review status list
212
+
213
+ Retrieve the statuses of your applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xa={command:`list`,describe:`List applications review statuses`,builder:ba,handler:async e=>u({command:`zero-trust apps review status list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust apps review status list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ya,{account_id:a}));s(u,{successLabel:`Loaded`})})};var W={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/apps/review_status`,body:`json`};function Sa(e){return e.usage(`$0 zero-trust apps review status update
214
+
215
+ Update the statuses of your applications.`).option(`approved-apps`,{type:`string`,array:!0,description:`Contains the ids of the approved applications.`}).option(`in-review-apps`,{type:`string`,array:!0,description:`Contains the ids of the applications in review.`}).option(`unapproved-apps`,{type:`string`,array:!0,description:`Contains the ids of the unapproved applications.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ca={command:`update`,describe:`Update applications review statuses`,builder:Sa,handler:async e=>u({command:`zero-trust apps review status update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust apps review status update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({approved_apps:e[`approved-apps`],in_review_apps:e[`in-review-apps`],unapproved_apps:e[`unapproved-apps`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(W,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e[`approved-apps`]===void 0)throw Error(`--approved-apps is required (or pass --body with this field set).`);if(e[`in-review-apps`]===void 0)throw Error(`--in-review-apps is required (or pass --body with this field set).`);if(e[`unapproved-apps`]===void 0)throw Error(`--unapproved-apps is required (or pass --body with this field set).`);let u=m({approved_apps:e[`approved-apps`],in_review_apps:e[`in-review-apps`],unapproved_apps:e[`unapproved-apps`]}),d=await l(`Updating`,async()=>n.send(W,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},wa={command:`status`,describe:`Operations for apps.review.status`,builder:e=>e.command(xa).command(Ca).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ta={command:`review`,describe:`Operations for apps.review`,builder:e=>e.command(wa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ea={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(Ta).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Da={method:`GET`,path:t=>e`/accounts/${t.account_id}/one/applications/${t.application_id}/auth-methods`,query:[`page`,`page_size`],errors:{404:`NotFoundError`}};function Oa(e){return e.usage(`$0 zero-trust casb applications auth-methods list
216
+
217
+ Returns available auth methods for the specified vendor, including credential schema, instructions, and example payloads. Use this to understand what credentials are required before calling POST /v2/integrations.`).option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ka={command:`list`,describe:`Get auth methods`,builder:Oa,handler:async e=>u({command:`zero-trust casb applications auth-methods list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,page_size:e[`page-size`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust casb applications auth-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/auth-methods`,pathParams:{"application-id":String(e[`application-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Da,{account_id:u,application_id:e[`application-id`],...n}));s(d,{successLabel:`Loaded`})})},Aa={command:`auth-methods`,describe:`Operations for casb.applications.auth-methods`,builder:e=>e.command(ka).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ja={method:`GET`,path:t=>e`/accounts/${t.account_id}/one/applications/${t.application_id}`,errors:{404:`NotFoundError`}};function Ma(e){return e.usage(`$0 zero-trust casb applications get <application-id>
218
+
219
+ Returns full application details including auth methods, use cases, and permissions.`).positional(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Na={command:`get <application-id>`,describe:`Get application details`,builder:Ma,handler:async e=>u({command:`zero-trust casb applications get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ja,{account_id:a,application_id:e[`application-id`]}));s(u,{successLabel:`Loaded`})})};var Pa={method:`GET`,path:t=>e`/accounts/${t.account_id}/one/applications`,query:[`environment`,`page`,`page_size`],errors:{400:`BadRequestError`}};function Fa(e){return e.usage(`$0 zero-trust casb applications list
220
+
221
+ Returns a list of available applications with use cases and permissions.`).option(`environment`,{type:`string`,description:`Filter by supported environment (standard, fedramp).`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ia={command:`list`,describe:`List applications`,builder:Fa,handler:async e=>u({command:`zero-trust casb applications list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={environment:e.environment,page:e.page,page_size:e[`page-size`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/applications`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Pa,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},La={command:`applications`,describe:`Operations for casb.applications`,builder:e=>e.command(Na).command(Ia).command(Aa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/content/export`,body:`json`,errors:{400:`BadRequestError`}};function Ra(e){return e.usage(`$0 zero-trust casb content export
222
+
223
+ Creates a CSV export for content and accepts optional filters in the payload.`).option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`dlp-profile-information`,{type:`string`,description:`DLP profile metadata for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating content exports.`})}const za={command:`export`,describe:`Create a content export`,builder:Ra,handler:async e=>u({command:`zero-trust casb content export`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb content export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({dlp_profile_id:e[`dlp-profile-id`],dlp_profile_information:p(e[`dlp-profile-information`],`dlp-profile-information`),integration_id:e[`integration-id`],max_affliction_date:h(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:h(e[`min-affliction-date`],`min-affliction-date`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),vendors:e.vendors}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Loading`,async()=>n.send(G,{body:t,account_id:a}));s(r,{successLabel:`Loaded`});return}if(e[`dlp-profile-information`]===void 0)throw Error(`--dlp-profile-information is required (or pass --body with this field set).`);let u=m({dlp_profile_id:e[`dlp-profile-id`],dlp_profile_information:p(e[`dlp-profile-information`],`dlp-profile-information`),integration_id:e[`integration-id`],max_affliction_date:h(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:h(e[`min-affliction-date`],`min-affliction-date`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),vendors:e.vendors}),d=await l(`Loading`,async()=>n.send(G,{body:u,account_id:a}));s(d,{successLabel:`Loaded`})})};var Ba={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/content`,query:[`direction`,`dlp_profile_id`,`integration_id`,`max_affliction_date`,`min_affliction_date`,`order`,`page`,`per_page`,`search`,`vendor`],errors:{400:`BadRequestError`,429:`TooManyRequestsError`}};function Va(e){return e.usage(`$0 zero-trust casb content list
224
+
225
+ List DLP content findings`).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-profile-id`,{type:`string`,description:`Filter by an DLP profile ID`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering content assets.`,choices:[`asset_name`,`dlp_profile_count`,`integration_name`,`latest_affliction_date`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ha={command:`list`,describe:`List DLP content findings`,builder:Va,handler:async e=>u({command:`zero-trust casb content list`,classification:{safeFlags:[`direction`,`order`,`vendor`,`dry-run`]}},e,async()=>{let n={direction:e.direction,dlp_profile_id:e[`dlp-profile-id`],integration_id:e[`integration-id`],max_affliction_date:e[`max-affliction-date`],min_affliction_date:e[`min-affliction-date`],order:e.order,page:e.page,per_page:e[`per-page`],search:e.search,vendor:e.vendor};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb content list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/content`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Ba,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Ua={command:`content`,describe:`Operations for casb.content`,builder:e=>e.command(za).command(Ha).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Wa={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/exports/${t.id}`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function Ga(e){return e.usage(`$0 zero-trust casb exports get <id>
226
+
227
+ Retrieves a single export job by its unique identifier`).positional(`id`,{type:`string`,description:`Unique identifier for the export job`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ka={command:`get <id>`,describe:`Get a single export job`,builder:Ga,handler:async e=>u({command:`zero-trust casb exports get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb exports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/exports/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Wa,{account_id:a,id:e.id}));s(u,{successLabel:`Loaded`})})};var qa={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/exports`,query:[`page`,`per_page`,`status`],errors:{400:`BadRequestError`}};function Ja(e){return e.usage(`$0 zero-trust casb exports list
228
+
229
+ List all export jobs for a given requestor's organization`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`status`,{type:`string`,description:`Filter on export job's status`,choices:[`Pending`,`Success`,`Failure`,`Rescheduled`,`In-Progress`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ya={command:`list`,describe:`List all export jobs`,builder:Ja,handler:async e=>u({command:`zero-trust casb exports list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb exports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(qa,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Xa={command:`exports`,describe:`Operations for casb.exports`,builder:e=>e.command(Ka).command(Ya).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Za={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/finding_types/${t.finding_type_id}`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function Qa(e){return e.usage(`$0 zero-trust casb finding-types get <finding-type-id>
230
+
231
+ Retrieve a specific finding type by its unique identifier.`).positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $a={command:`get <finding-type-id>`,describe:`Get finding by ID`,builder:Qa,handler:async e=>u({command:`zero-trust casb finding-types get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb finding-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/finding_types/${e[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(e[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(e[`finding-type-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Za,{account_id:a,finding_type_id:e[`finding-type-id`]}));s(u,{successLabel:`Loaded`})})};var eo={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/finding_types`,query:[`page`,`per_page`,`vendors`,`search`],joined:[`vendors`],errors:{400:`BadRequestError`}};function to(e){return e.usage(`$0 zero-trust casb finding-types list
232
+
233
+ List all available finding types with pagination support.`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`vendors`,{type:`string`,description:`Filter finding types by vendor. Supports multiple comma-separated values. Each value may be either the vendor enum (GOOGLE_WORKSPACE) or the friendly name returned by the read routes (Google Workspace).`}).option(`search`,{type:`string`,description:`Filter finding types by name or ID (case-insensitive substring match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const no={command:`list`,describe:`List all finding types`,builder:to,handler:async e=>u({command:`zero-trust casb finding-types list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],vendors:e.vendors,search:e.search};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb finding-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(eo,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var ro={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/finding_types/${t.finding_type_id}/remediation_types`,query:[`integration_id`,`cursor`,`page`,`per_page`],errors:{400:`BadRequestError`,404:`NotFoundError`}};function io(e){return e.usage("$0 zero-trust casb finding-types remediation-types list\n\nList all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.").option(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ao={command:`list`,describe:`List remediation types for a finding type`,builder:io,handler:async e=>u({command:`zero-trust casb finding-types remediation-types list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={integration_id:e[`integration-id`],cursor:e.cursor,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust casb finding-types remediation-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/finding_types/${e[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(e[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(e[`finding-type-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ro,{account_id:u,finding_type_id:e[`finding-type-id`],...n}));s(d,{successLabel:`Loaded`})})},oo={command:`remediation-types`,describe:`Operations for casb.finding-types.remediation-types`,builder:e=>e.command(ao).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},so={command:`finding-types`,describe:`Operations for casb.finding-types`,builder:e=>e.command($a).command(no).command(oo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/export`,body:`json`,errors:{400:`BadRequestError`}};function co(e){return e.usage(`$0 zero-trust casb findings export
234
+
235
+ Creates a CSV export for findings and accepts optional filters in the payload.`).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Which fields to use when ordering the findings. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const lo={command:`export`,describe:`Create new findings export request`,builder:co,handler:async e=>u({command:`zero-trust casb findings export`,classification:{safeFlags:[`ignored`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({ignored:e.ignored,integration_id:e[`integration-id`],max_affliction_date:h(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:h(e[`min-affliction-date`],`min-affliction-date`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),severities:e.severities,vendors:e.vendors}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Loading`,async()=>n.send(K,{body:t,account_id:a}));s(r,{successLabel:`Loaded`});return}let u=m({ignored:e.ignored,integration_id:e[`integration-id`],max_affliction_date:h(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:h(e[`min-affliction-date`],`min-affliction-date`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),severities:e.severities,vendors:e.vendors}),d=await l(`Loading`,async()=>n.send(K,{body:u,account_id:a}));s(d,{successLabel:`Loaded`})})};var uo={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function fo(e){return e.usage(`$0 zero-trust casb findings get <finding-id>
236
+
237
+ Gets a security Finding that has been identified as being problematic.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const po={command:`get <finding-id>`,describe:`Get a posture finding`,builder:fo,handler:async e=>u({command:`zero-trust casb findings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(uo,{account_id:a,finding_id:e[`finding-id`]}));s(u,{successLabel:`Loaded`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/ignore`,body:`json`,errors:{400:`BadRequestError`}};function mo(e){return e.usage(`$0 zero-trust casb findings ignore
238
+
239
+ Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ho={command:`ignore`,describe:`Mark a finding as ignored`,builder:mo,handler:async e=>u({command:`zero-trust casb findings ignore`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings ignore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({checks:e.checks}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(q,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let u=m({checks:e.checks}),d=await l(`Creating`,async()=>n.send(q,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/instances/archive`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function go(e){return e.usage(`$0 zero-trust casb findings instances archive <finding-id>
240
+
241
+ Archive one or more finding instances.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const _o={command:`archive <finding-id>`,describe:`Archive a finding`,builder:go,handler:async e=>u({command:`zero-trust casb findings instances archive`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings instances archive`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({check_instances:e[`check-instances`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(J,{body:t,account_id:a,finding_id:e[`finding-id`]}));s(r,{successLabel:`Created`});return}if(e[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let u=m({check_instances:e[`check-instances`]}),d=await l(`Creating`,async()=>n.send(J,{body:u,account_id:a,finding_id:e[`finding-id`]}));s(d,{successLabel:`Created`})})};function vo(e){return e.usage("$0 zero-trust casb findings instances export <finding-namespace-id>\n\nCreates a CSV export for Finding instances and accepts optional filters in the payload. Identify the finding as `<integration_id>-<finding_type_id>`: join the `integration.id` and `finding.id` of the finding (from the List posture findings response) with a hyphen.").positional(`finding-namespace-id`,{type:`string`,description:"Identifies the finding whose instances to export, in the form `<integration_id>-<finding_type_id>`. Take `integration.id` and `finding.id` from the finding in the List posture findings response and join them with a hyphen.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const yo={command:`export <finding-namespace-id>`,describe:`Create a finding instances export`,builder:vo,handler:async e=>u({command:`zero-trust casb findings instances export`,classification:{safeFlags:[`archived`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings instances export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-namespace-id`]==null?`<finding-namespace-id>`:encodeURIComponent(String(e[`finding-namespace-id`]))}/instances/export`,pathParams:{"finding-namespace-id":String(e[`finding-namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({archived:e.archived,max_affliction_date:h(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:h(e[`min-affliction-date`],`min-affliction-date`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`)}):f(e.body)});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.body){let t=f(e.body),r=await l(`Loading`,async()=>n(a,`POST`,`/accounts/${u}/data-security/posture/findings/${encodeURIComponent(String(e[`finding-namespace-id`]))}/instances/export`,{body:t}));s(r,{successLabel:`Loaded`});return}let g={};e.archived!==void 0&&d(g,[`archived`],e.archived),e[`max-affliction-date`]!==void 0&&d(g,[`max_affliction_date`],h(e[`max-affliction-date`],`max-affliction-date`,`text`)),e[`min-affliction-date`]!==void 0&&d(g,[`min_affliction_date`],h(e[`min-affliction-date`],`min-affliction-date`,`text`)),e.orders!==void 0&&d(g,[`orders`],p(e.orders,`orders`)),e.search!==void 0&&d(g,[`search`],h(e.search,`search`,`text`));let _=await l(`Loading`,async()=>n(a,`POST`,`/accounts/${u}/data-security/posture/findings/${encodeURIComponent(String(e[`finding-namespace-id`]))}/instances/export`,{body:g}));s(_,{successLabel:`Loaded`})})};var bo={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/instances/${t.instance_id}`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function xo(e){return e.usage(`$0 zero-trust casb findings instances get <instance-id>
242
+
243
+ Gets a security Finding instance by id.`).positional(`instance-id`,{type:`string`,description:`A uuid ID identifying this Finding instance.`,demandOption:!0}).option(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response.\nIt is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const So={command:`get <instance-id>`,describe:`Get a finding instance using an instance ID`,builder:xo,handler:async e=>u({command:`zero-trust casb findings instances get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings instances get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{"finding-id":String(e[`finding-id`]??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(bo,{account_id:a,finding_id:e[`finding-id`],instance_id:e[`instance-id`]}));s(u,{successLabel:`Loaded`})})};var Co={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/instances`,query:[`archived`,`cursor`,`direction`,`max_affliction_date`,`min_affliction_date`,`order`,`page`,`per_page`,`search`,`remediation_statuses`,`finding_instance_ids`,`asset_ids`],joined:[`remediation_statuses`],errors:{400:`BadRequestError`,404:`NotFoundError`}};function wo(e){return e.usage(`$0 zero-trust casb findings instances list
244
+
245
+ Lists all security finding instances for a given security finding.`).option(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response.\nIt is a base64-encoded identifier.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Archived`}).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering the Finding's instances.
246
+ When ordering by 'remediation.status', only the most recent non-stale remediation job is considered. Stale jobs (created before the instance's affliction_date) are treated as having no status for ordering purposes.`,choices:[`affliction_date`,`asset.name`,`remediation.status`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`remediation-statuses`,{type:`string`,description:`Filter finding instances by most recent remediation job status. Supports multiple comma-separated values.
247
+ Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
248
+ Note: Stale jobs (created before the instance's affliction_date) are ignored for filtering purposes, but are still included in the 'remediations' array with stale=true.`}).option(`finding-instance-ids`,{type:`string`,description:`Filter finding instances by an array of finding instance IDs. Supports multiple comma-separated values.`}).option(`asset-ids`,{type:`string`,description:`Filter finding instances by an array of asset IDs. Supports multiple comma-separated values.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const To={command:`list`,describe:`List instances of a finding`,builder:wo,handler:async e=>u({command:`zero-trust casb findings instances list`,classification:{safeFlags:[`archived`,`direction`,`order`,`dry-run`]}},e,async()=>{let n={archived:e.archived,cursor:e.cursor,direction:e.direction,max_affliction_date:e[`max-affliction-date`],min_affliction_date:e[`min-affliction-date`],order:e.order,page:e.page,per_page:e[`per-page`],search:e.search,remediation_statuses:e[`remediation-statuses`],finding_instance_ids:e[`finding-instance-ids`],asset_ids:e[`asset-ids`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings instances list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances`,pathParams:{"finding-id":String(e[`finding-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Co,{account_id:u,finding_id:e[`finding-id`],...n}));s(d,{successLabel:`Loaded`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/instances/unarchive`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function Eo(e){return e.usage(`$0 zero-trust casb findings instances unarchive <finding-id>
249
+
250
+ Remove the archive marking from one or more finding instances.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const Do={command:`unarchive <finding-id>`,describe:`Remove the archive marking from a finding instance`,builder:Eo,handler:async e=>u({command:`zero-trust casb findings instances unarchive`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings instances unarchive`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({check_instances:e[`check-instances`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Y,{body:t,account_id:a,finding_id:e[`finding-id`]}));s(r,{successLabel:`Created`});return}if(e[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let u=m({check_instances:e[`check-instances`]}),d=await l(`Creating`,async()=>n.send(Y,{body:u,account_id:a,finding_id:e[`finding-id`]}));s(d,{successLabel:`Created`})})},Oo={command:`instances`,describe:`Operations for casb.findings.instances`,builder:e=>e.command(_o).command(yo).command(So).command(To).command(Do).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ko={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings`,query:[`cursor`,`direction`,`ignored`,`integration_id`,`max_affliction_date`,`min_affliction_date`,`observation`,`order`,`page`,`per_page`,`product`,`search`,`severity`,`type`,`vendor`,`finding_type_ids`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function Ao(e){return e.usage(`$0 zero-trust casb findings list
251
+
252
+ List all security findings that have been identified as being problematic. This will return a list of findings regardless if they have been ignored or not.`).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see "active" items`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`observation`,{type:`string`,description:`Filter by observation type of the finding`,choices:[`Activity`,`Insight`,`Issue`]}).option(`order`,{type:`string`,description:`Which field to use when ordering the findings.`,choices:[`finding.name`,`instance_count`,`integration.name`,`latest_affliction_date`,`severity`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`product`,{type:`string`,description:`Filter by product category of the finding`,choices:[`Cloud`,`Saas`]}).option(`search`,{type:`string`,description:`A search term.`}).option(`severity`,{type:`string`,description:`Filter by severity`,choices:[`Critical`,`High`,`Medium`,`Low`]}).option(`type`,{type:`string`,description:`Filter by type of the finding`,choices:[`Content`,`Posture`]}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`finding-type-ids`,{type:`string`,description:`A comma separated list of UUIDs identifying the finding type(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jo={command:`list`,describe:`List posture findings`,builder:Ao,handler:async e=>u({command:`zero-trust casb findings list`,classification:{safeFlags:[`direction`,`ignored`,`observation`,`order`,`product`,`severity`,`type`,`vendor`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,direction:e.direction,ignored:e.ignored,integration_id:e[`integration-id`],max_affliction_date:e[`max-affliction-date`],min_affliction_date:e[`min-affliction-date`],observation:e.observation,order:e.order,page:e.page,per_page:e[`per-page`],product:e.product,search:e.search,severity:e.severity,type:e.type,vendor:e.vendor,finding_type_ids:e[`finding-type-ids`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb findings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/findings`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ko,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Mo={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/reset_finding_severity`,errors:{400:`BadRequestError`,404:`NotFoundError`,500:`InternalServerError`}};function No(e){return e.usage(`$0 zero-trust casb findings reset-severity <finding-id>
253
+
254
+ If a Finding's severity has been changed, reset it back to default value. Does nothing if no override exists.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Po={command:`reset-severity <finding-id>`,describe:`Reset severity for a finding back to the default`,builder:No,handler:async e=>u({command:`zero-trust casb findings reset-severity`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings reset-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Mo,{account_id:a,finding_id:e[`finding-id`]}));s(u,{successLabel:`Created`})})};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/${t.finding_id}/tune_finding_severity`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`,500:`InternalServerError`}};function Fo(e){return e.usage(`$0 zero-trust casb findings tune-severity <finding-id>
255
+
256
+ Update the severity of a Finding. This will update the \`severity_override\` field on the Finding payload with the new severity value.`).positional(`finding-id`,{type:`string`,description:"The `id` of a finding, as returned in each item of the List posture findings response. It is a base64-encoded identifier.",demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const Io={command:`tune-severity <finding-id>`,describe:`Update the severity for a finding`,builder:Fo,handler:async e=>u({command:`zero-trust casb findings tune-severity`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings tune-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_severity:e[`new-severity`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(X,{body:t,account_id:a,finding_id:e[`finding-id`]}));s(r,{successLabel:`Created`});return}if(e[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let u=m({new_severity:e[`new-severity`]}),d=await l(`Creating`,async()=>n.send(X,{body:u,account_id:a,finding_id:e[`finding-id`]}));s(d,{successLabel:`Created`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/findings/unignore`,body:`json`,errors:{400:`BadRequestError`}};function Lo(e){return e.usage(`$0 zero-trust casb findings unignore
257
+
258
+ Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const Ro={command:`unignore`,describe:`Remove ignore marker from a finding`,builder:Lo,handler:async e=>u({command:`zero-trust casb findings unignore`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb findings unignore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({checks:e.checks}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Z,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let u=m({checks:e.checks}),d=await l(`Creating`,async()=>n.send(Z,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},zo={command:`findings`,describe:`Operations for casb.findings`,builder:e=>e.command(lo).command(po).command(ho).command(jo).command(Po).command(Io).command(Ro).command(Oo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bo(e){return e.usage(`$0 zero-trust casb integrations create
259
+
260
+ Creates a new integration for the specified application. Integration creation with OAuth is not supported by API at the moment. For other auth methods, use \`GET /v2/applications/{application_id}/credential-guide\` to see the required credential structure and example payloads for each vendor.`).option(`application`,{type:`string`,description:"Vendor/application slug (e.g., GOOGLE_WORKSPACE).\n\n* `ANTHROPIC` - ANTHROPIC\n* `AWS` - AWS\n* `BITBUCKET` - BITBUCKET\n* `BOX` - BOX\n* `CONFLUENCE` - CONFLUENCE\n* `DROPBOX` - DROPBOX\n* `GITHUB` - GITHUB\n* `GOOGLE_CLOUD_PLATFORM` - GOOGLE_CLOUD_PLATFORM\n* `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE\n* `JIRA` - JIRA\n* `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL\n* `OPENAI` - OPENAI\n* `SALESFORCE` - SALESFORCE\n* `SERVICENOW` - SERVICENOW\n* `SLACK` - SLACK",choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).coerce(`application`,e=>h(e,`application`,`text`)).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 Vo={command:`create`,describe:`Create integration`,builder:Bo,handler:async e=>u({command:`zero-trust casb integrations create`,classification:{safeFlags:[`application`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?m({application:e.application,auth_method:h(e[`auth-method`],`auth-method`,`text`),dlp_profiles:e[`dlp-profiles`],name:h(e.name,`name`,`text`),permissions:e.permissions,use_cases:e[`use-cases`]}):f(e.body):{file:e.file}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file){let t=g(e.file),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/one/integrations`,{body:t,headers:{"Content-Type":`text/plain;charset=UTF-8`}}));s(r,{successLabel:`Created`});return}if(e.body){let t=f(e.body),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/one/integrations`,{body:t}));s(r,{successLabel:`Created`});return}e.application===void 0&&(e.application=await v(`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`])),e.name===void 0&&(e.name=await _(`name`,`Name of the integration.`));let p={};e.application!==void 0&&d(p,[`application`],e.application),e[`auth-method`]!==void 0&&d(p,[`auth_method`],h(e[`auth-method`],`auth-method`,`text`)),e[`dlp-profiles`]!==void 0&&d(p,[`dlp_profiles`],e[`dlp-profiles`]),e.name!==void 0&&d(p,[`name`],h(e.name,`name`,`text`)),e.permissions!==void 0&&d(p,[`permissions`],e.permissions),e[`use-cases`]!==void 0&&d(p,[`use_cases`],e[`use-cases`]);let y=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/one/integrations`,{body:p}));s(y,{successLabel:`Created`})})};var Ho={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/one/integrations/${t.id}`,response:!1,errors:{400:`BadRequestError`}};function Uo(e){return e.usage(`$0 zero-trust casb integrations delete <id>
261
+
262
+ Delete an integration by soft-deleting it.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Wo={command:`delete <id>`,describe:`Delete integration`,builder:Uo,handler:async e=>u({command:`zero-trust casb integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
263
+ `);return}let u=await l(`Deleting`,async()=>n.send(Ho,{account_id:a,id:e.id}));s(u,{successLabel:`Deleted`})})};var Go={method:`GET`,path:t=>e`/accounts/${t.account_id}/one/integrations/${t.id}`,errors:{404:`NotFoundError`}};function Ko(e){return e.usage(`$0 zero-trust casb integrations get <id>
264
+
265
+ Returns full integration details including use cases and permissions.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qo={command:`get <id>`,describe:`Get integration details`,builder:Ko,handler:async e=>u({command:`zero-trust casb integrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Go,{account_id:a,id:e.id}));s(u,{successLabel:`Loaded`})})};var Jo={method:`GET`,path:t=>e`/accounts/${t.account_id}/one/integrations`,query:[`application`,`direction`,`dlp_enabled`,`order`,`page`,`page_size`,`search`,`status`,`use_cases`],errors:{400:`BadRequestError`}};function Yo(e){return e.usage(`$0 zero-trust casb integrations list
266
+
267
+ Returns a paginated list of integrations for the account.`).option(`application`,{type:`string`,description:`Filter by application/vendor (e.g., GOOGLE_WORKSPACE, MICROSOFT_INTERNAL).`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-enabled`,{type:`boolean`,description:`Filter by DLP enabled status (true/false).`}).option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`application`,`created`,`name`,`status`]}).option(`page`,{type:`number`,description:`Page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results per page.`}).option(`search`,{type:`string`,description:`Search integrations by name or application.`}).option(`status`,{type:`string`,description:`Filter by integration status.`,choices:[`Healthy`,`Initializing`,`Offline`,`Unhealthy`]}).option(`use-cases`,{type:`string`,description:`Filter by enabled use cases (e.g., casb, ces). Matches integrations enrolled in any of the specified values. Can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xo={command:`list`,describe:`List integrations`,builder:Yo,handler:async e=>u({command:`zero-trust casb integrations list`,classification:{safeFlags:[`direction`,`dlp-enabled`,`order`,`status`,`dry-run`]}},e,async()=>{let n={application:e.application,direction:e.direction,dlp_enabled:e[`dlp-enabled`],order:e.order,page:e.page,page_size:e[`page-size`],search:e.search,status:e.status,use_cases:e[`use-cases`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/one/integrations`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Jo,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Zo={method:`POST`,path:t=>e`/accounts/${t.account_id}/one/integrations/${t.id}/pause`,errors:{400:`BadRequestError`}};function Qo(e){return e.usage(`$0 zero-trust casb integrations pause <id>
268
+
269
+ Pauses an integration, stopping all crawlers.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $o={command:`pause <id>`,describe:`Pause integration`,builder:Qo,handler:async e=>u({command:`zero-trust casb integrations pause`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/pause`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Zo,{account_id:a,id:e.id}));s(u,{successLabel:`Created`})})};var es={method:`POST`,path:t=>e`/accounts/${t.account_id}/one/integrations/${t.id}/resume`,errors:{400:`BadRequestError`}};function ts(e){return e.usage(`$0 zero-trust casb integrations resume <id>
270
+
271
+ Resumes a paused integration, restarting crawlers.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ns={command:`resume <id>`,describe:`Resume integration`,builder:ts,handler:async e=>u({command:`zero-trust casb integrations resume`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/resume`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(es,{account_id:a,id:e.id}));s(u,{successLabel:`Created`})})};function rs(e){return e.usage(`$0 zero-trust casb integrations update <id>
272
+
273
+ Updates an integration's name, permissions, DLP profiles, use cases, or credentials.`).positional(`id`,{type:`string`,description:`Integration ID.`,demandOption:!0}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate with the integration.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes granted to the integration.`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration PATCH requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const is={command:`update <id>`,describe:`Update integration`,builder:rs,handler:async e=>u({command:`zero-trust casb integrations update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/one/integrations/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?m({dlp_profiles:e[`dlp-profiles`],name:h(e.name,`name`,`text`),permissions:e.permissions,use_cases:e[`use-cases`]}):f(e.body):{file:e.file}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file){let t=g(e.file),r=await l(`Updating`,async()=>n(a,`PATCH`,`/accounts/${u}/one/integrations/${encodeURIComponent(String(e.id))}`,{body:t,headers:{"Content-Type":`text/plain;charset=UTF-8`}}));s(r,{successLabel:`Updated`});return}if(e.body){let t=f(e.body),r=await l(`Updating`,async()=>n(a,`PATCH`,`/accounts/${u}/one/integrations/${encodeURIComponent(String(e.id))}`,{body:t}));s(r,{successLabel:`Updated`});return}let p={};e[`dlp-profiles`]!==void 0&&d(p,[`dlp_profiles`],e[`dlp-profiles`]),e.name!==void 0&&d(p,[`name`],h(e.name,`name`,`text`)),e.permissions!==void 0&&d(p,[`permissions`],e.permissions),e[`use-cases`]!==void 0&&d(p,[`use_cases`],e[`use-cases`]);let _=await l(`Updating`,async()=>n(a,`PATCH`,`/accounts/${u}/one/integrations/${encodeURIComponent(String(e.id))}`,{body:p}));s(_,{successLabel:`Updated`})})},as={command:`integrations`,describe:`Operations for casb.integrations`,builder:e=>e.command(Vo).command(Wo).command(qo).command(Xo).command($o).command(ns).command(is).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Q={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/policies`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function os(e){return e.usage(`$0 zero-trust casb policies create
274
+
275
+ Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new policy configuration.`})}const ss={command:`create`,describe:`Create a new policy configuration`,builder:os,handler:async e=>u({command:`zero-trust casb policies create`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({applies_to_all_integrations:e[`applies-to-all-integrations`],description:h(e.description,`description`,`text`),display_name:h(e[`display-name`],`display-name`,`text`),enabled:e.enabled,finding_type_id:h(e[`finding-type-id`],`finding-type-id`,`text`),integration_ids:e[`integration-ids`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Q,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(e[`display-name`]===void 0&&(e[`display-name`]=await _(`display-name`,`Display name for the policy configuration.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e[`finding-type-id`]===void 0&&(e[`finding-type-id`]=await _(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let u=m({applies_to_all_integrations:e[`applies-to-all-integrations`],description:h(e.description,`description`,`text`),display_name:h(e[`display-name`],`display-name`,`text`),enabled:e.enabled,finding_type_id:h(e[`finding-type-id`],`finding-type-id`,`text`),integration_ids:e[`integration-ids`]}),d=await l(`Creating`,async()=>n.send(Q,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var cs={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/data-security/posture/policies/${t.policy_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function ls(e){return e.usage(`$0 zero-trust casb policies delete <policy-id>
276
+
277
+ Deletes a policy configuration.`).positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const us={command:`delete <policy-id>`,describe:`Delete a policy configuration`,builder:ls,handler:async e=>u({command:`zero-trust casb policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
278
+ `);return}let u=await l(`Deleting`,async()=>n.send(cs,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Deleted`})})};var ds={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/policies/${t.policy_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function fs(e){return e.usage(`$0 zero-trust casb policies get <policy-id>
279
+
280
+ Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy configuration to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ps={command:`get <policy-id>`,describe:`Get a policy configuration by ID`,builder:fs,handler:async e=>u({command:`zero-trust casb policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ds,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Loaded`})})};var ms={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/policies`,query:[`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function hs(e){return e.usage(`$0 zero-trust casb policies list
281
+
282
+ Returns a list of integration-scoped policy configurations for the given account. This endpoint supports cursor based pagination. By default, results are returned in sorted order based on created_at.`).option(`cursor`,{type:`string`,description:"Cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gs={command:`list`,describe:`List policy configurations`,builder:hs,handler:async e=>u({command:`zero-trust casb policies list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cursor:e.cursor};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/policies`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ms,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var _s={method:`PUT`,path:t=>e`/accounts/${t.account_id}/data-security/posture/policies/${t.policy_id}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function vs(e){return e.usage(`$0 zero-trust casb policies update <policy-id>
283
+
284
+ Updates an existing policy configuration and replaces its actions.`).positional(`policy-id`,{type:`string`,description:`Policy configuration ID`,demandOption:!0}).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing policy configuration.`})}const ys={command:`update <policy-id>`,describe:`Update a policy configuration`,builder:vs,handler:async e=>u({command:`zero-trust casb policies update`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({applies_to_all_integrations:e[`applies-to-all-integrations`],description:h(e.description,`description`,`text`),display_name:h(e[`display-name`],`display-name`,`text`),enabled:e.enabled,integration_ids:e[`integration-ids`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(_s,{body:t,account_id:a,policy_id:e[`policy-id`]}));s(r,{successLabel:`Updated`});return}if(e[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(e[`display-name`]===void 0&&(e[`display-name`]=await _(`display-name`,`Display name for the policy configuration.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=m({applies_to_all_integrations:e[`applies-to-all-integrations`],description:h(e.description,`description`,`text`),display_name:h(e[`display-name`],`display-name`,`text`),enabled:e.enabled,integration_ids:e[`integration-ids`]}),d=await l(`Updating`,async()=>n.send(_s,{body:u,account_id:a,policy_id:e[`policy-id`]}));s(d,{successLabel:`Updated`})})},bs={command:`policies`,describe:`Operations for casb.policies`,builder:e=>e.command(ss).command(us).command(ps).command(gs).command(ys).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var xs={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/remediations/jobs`,body:`json`,errors:{400:`BadRequestError`,409:`ConflictError`}};function Ss(e){return e.usage(`$0 zero-trust casb remediations jobs create
285
+
286
+ Create one or more remediation jobs tied to a specific Cloudflare Account.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating remediation jobs.`})}const Cs={command:`create`,describe:`Creates remediation jobs`,builder:Ss,handler:async e=>u({command:`zero-trust casb remediations jobs create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb remediations jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({finding_instance_ids:e[`finding-instance-ids`],remediation_type_id:h(e[`remediation-type-id`],`remediation-type-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(xs,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);e[`remediation-type-id`]===void 0&&(e[`remediation-type-id`]=await _(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let u=m({finding_instance_ids:e[`finding-instance-ids`],remediation_type_id:h(e[`remediation-type-id`],`remediation-type-id`,`text`)}),d=await l(`Creating`,async()=>n.send(xs,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var ws={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/remediations/jobs/export`,body:`json`,errors:{400:`BadRequestError`}};function Ts(e){return e.usage(`$0 zero-trust casb remediations jobs export
287
+
288
+ Creates a CSV export for remediation jobs and accepts optional filters in the payload.`).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const Es={command:`export`,describe:`Create a remediation jobs export`,builder:Ts,handler:async e=>u({command:`zero-trust casb remediations jobs export`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb remediations jobs export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({integration_id:e[`integration-id`],max_updated_at:h(e[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:h(e[`min-updated-at`],`min-updated-at`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),status:e.status}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Loading`,async()=>n.send(ws,{body:t,account_id:a}));s(r,{successLabel:`Loaded`});return}let u=m({integration_id:e[`integration-id`],max_updated_at:h(e[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:h(e[`min-updated-at`],`min-updated-at`,`text`),orders:p(e.orders,`orders`),search:h(e.search,`search`,`text`),status:e.status}),d=await l(`Loading`,async()=>n.send(ws,{body:u,account_id:a}));s(d,{successLabel:`Loaded`})})};var Ds={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/remediations/jobs`,query:[`cursor`,`page`,`per_page`,`search`,`min_updated_at`,`max_updated_at`,`status`,`triggered_by_actor`,`integration_id`,`order`,`direction`],joined:[`triggered_by_actor`],errors:{400:`BadRequestError`}};function Os(e){return e.usage("$0 zero-trust casb remediations jobs list\n\nList all remediation jobs tied to a specific Cloudflare Account. Note that `cursor` and `page` are mutually exclusive.").option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediations updated on or after the min updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediations updated on or before the max updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`status`,{type:`string`,description:`Filter to view remediations with the given status.`,choices:[`pending`,`processing`,`completed`,`failed`,`validating`]}).option(`triggered-by-actor`,{type:`string`,description:`Filter remediations by what kind of actor triggered them. Supports multiple comma-separated values.`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`order`,{type:`string`,description:`An optional param to sort the results by the given field.`,choices:[`created_at`,`affliction_date`,`integration_name`,`status`,`last_updated_at`,`asset_name`,`finding_type_name`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ks={command:`list`,describe:`List remediation jobs`,builder:Os,handler:async e=>u({command:`zero-trust casb remediations jobs list`,classification:{safeFlags:[`status`,`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,page:e.page,per_page:e[`per-page`],search:e.search,min_updated_at:e[`min-updated-at`],max_updated_at:e[`max-updated-at`],status:e.status,triggered_by_actor:e[`triggered-by-actor`],integration_id:e[`integration-id`],order:e.order,direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust casb remediations jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Ds,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},As={command:`jobs`,describe:`Operations for casb.remediations.jobs`,builder:e=>e.command(Cs).command(Es).command(ks).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},js={command:`remediations`,describe:`Operations for casb.remediations`,builder:e=>e.command(As).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ms={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,422:`UnprocessableEntityError`}};function Ns(e){return e.usage(`$0 zero-trust casb webhooks create
289
+
290
+ Creates a new webhook configuration for sending finding notifications to external endpoints.`).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).coerce(`authentication-type`,e=>h(e,`authentication-type`,`text`)).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration. Defaults to enabled when omitted.`,choices:[`enabled`,`disabled`],default:`enabled`}).coerce(`status`,e=>h(e,`status`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new webhook configuration.`})}const Ps={command:`create`,describe:`Create a new webhook configuration`,builder:Ns,handler:async e=>u({command:`zero-trust casb webhooks create`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),label:h(e.label,`label`,`text`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`),status:e.status}):f(e.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Ms,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`authentication-type`]===void 0&&(e[`authentication-type`]=await v(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),e[`destination-url`]===void 0&&(e[`destination-url`]=await _(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),e.label===void 0&&(e.label=await _(`label`,`Account-specified display label for the webhook configuration.`));let u=m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),label:h(e.label,`label`,`text`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`),status:e.status}),d=await l(`Creating`,async()=>n.send(Ms,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Fs={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/${t.webhook_id}`,errors:{400:`BadRequestError`,409:`ConflictError`}};function Is(e){return e.usage(`$0 zero-trust casb webhooks delete <webhook-id>
291
+
292
+ Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ls={command:`delete <webhook-id>`,describe:`Delete a webhook configuration`,builder:Is,handler:async e=>u({command:`zero-trust casb webhooks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
293
+ `);return}let u=await l(`Deleting`,async()=>n.send(Fs,{account_id:a,webhook_id:e[`webhook-id`]}));s(u,{successLabel:`Deleted`})})};var Rs={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/${t.webhook_id}/evaluate`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function zs(e){return e.usage(`$0 zero-trust casb webhooks evaluate-existing <webhook-id>
294
+
295
+ Sends a test webhook event using an existing webhook configuration. This allows customers to verify their webhook endpoint is still reachable and properly configured after creating the webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bs={command:`evaluate-existing <webhook-id>`,describe:`Test an existing webhook configuration`,builder:zs,handler:async e=>u({command:`zero-trust casb webhooks evaluate-existing`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks evaluate-existing`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Rs,{account_id:a,webhook_id:e[`webhook-id`]}));s(u,{successLabel:`Created`})})};var Vs={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/evaluate`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`}};function Hs(e){return e.usage(`$0 zero-trust casb webhooks evaluate
296
+
297
+ Sends a test webhook event to the specified destination URL to verify the webhook endpoint is reachable and properly configured. This allows customers to validate their webhook configuration before creating the actual webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).option(`authentication-type`,{type:`string`,description:`Type of authentication to use for the test webhook request.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).coerce(`authentication-type`,e=>h(e,`authentication-type`,`text`)).option(`destination-url`,{type:`string`,description:`Target URL to send the test webhook event to.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in the test webhook request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for testing a webhook configuration before creating it.`})}const Us={command:`evaluate`,describe:`Test a webhook configuration before creating it`,builder:Hs,handler:async e=>u({command:`zero-trust casb webhooks evaluate`,classification:{safeFlags:[`authentication-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks evaluate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`)}):f(e.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Vs,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`authentication-type`]===void 0&&(e[`authentication-type`]=await v(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),e[`destination-url`]===void 0&&(e[`destination-url`]=await _(`destination-url`,`Target URL to send the test webhook event to.`));let u=m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`)}),d=await l(`Creating`,async()=>n.send(Vs,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Ws={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/${t.webhook_id}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function Gs(e){return e.usage(`$0 zero-trust casb webhooks get <webhook-id>
298
+
299
+ Retrieves a specific webhook configuration by its unique identifier.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ks={command:`get <webhook-id>`,describe:`Get webhook configuration by ID`,builder:Gs,handler:async e=>u({command:`zero-trust casb webhooks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ws,{account_id:a,webhook_id:e[`webhook-id`]}));s(u,{successLabel:`Loaded`})})};var qs={method:`POST`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/jobs`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function Js(e){return e.usage(`$0 zero-trust casb webhooks jobs create
300
+
301
+ Creates webhook jobs to send a finding instance to one or more configured webhooks.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const Ys={command:`create`,describe:`Create webhook jobs`,builder:Js,handler:async e=>u({command:`zero-trust casb webhooks jobs create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({finding_instance_ids:e[`finding-instance-ids`],webhook_ids:e[`webhook-ids`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(qs,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(e[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let u=m({finding_instance_ids:e[`finding-instance-ids`],webhook_ids:e[`webhook-ids`]}),d=await l(`Creating`,async()=>n.send(qs,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},Xs={command:`jobs`,describe:`Operations for casb.webhooks.jobs`,builder:e=>e.command(Ys).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Zs={method:`GET`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`}};function Qs(e){return e.usage(`$0 zero-trust casb webhooks list
302
+
303
+ Retrieves all webhook configurations for the authenticated account. Returns an array of webhook configurations that can be used to send finding notifications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $s={command:`list`,describe:`List webhook configurations`,builder:Qs,handler:async e=>u({command:`zero-trust casb webhooks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust casb webhooks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Zs,{account_id:a}));s(u,{successLabel:`Loaded`})})};var ec={method:`PUT`,path:t=>e`/accounts/${t.account_id}/data-security/posture/webhooks/${t.webhook_id}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`}};function tc(e){return e.usage(`$0 zero-trust casb webhooks update <webhook-id>
304
+
305
+ Updates an existing webhook configuration with new settings.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).coerce(`authentication-type`,e=>h(e,`authentication-type`,`text`)).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration.`,choices:[`enabled`,`disabled`]}).coerce(`status`,e=>h(e,`status`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing webhook configuration.`})}const nc={command:`update <webhook-id>`,describe:`Update an existing webhook configuration`,builder:tc,handler:async e=>u({command:`zero-trust casb webhooks update`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust casb webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),label:h(e.label,`label`,`text`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`),status:e.status}):f(e.body),sensitiveBodyPaths:[[`signing_secret`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ec,{body:t,account_id:a,webhook_id:e[`webhook-id`]}));s(r,{successLabel:`Updated`});return}e[`authentication-type`]===void 0&&(e[`authentication-type`]=await v(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),e[`destination-url`]===void 0&&(e[`destination-url`]=await _(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),e.label===void 0&&(e.label=await _(`label`,`Account-specified display label for the webhook configuration.`)),e.status===void 0&&(e.status=await v(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let u=m({authentication_type:e[`authentication-type`],destination_url:h(e[`destination-url`],`destination-url`,`text`),headers:p(e.headers,`headers`),label:h(e.label,`label`,`text`),signing_secret:h(e[`signing-secret`],`signing-secret`,`text`),status:e.status}),d=await l(`Updating`,async()=>n.send(ec,{body:u,account_id:a,webhook_id:e[`webhook-id`]}));s(d,{successLabel:`Updated`})})},rc={command:`webhooks`,describe:`Operations for casb.webhooks`,builder:e=>e.command(Ps).command(Ls).command(Us).command(Bs).command(Ks).command($s).command(nc).command(Xs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ic={command:`casb`,describe:`Operations for casb`,builder:e=>e.command(La).command(Ua).command(Xa).command(so).command(zo).command(as).command(bs).command(js).command(rc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ac={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/zerotrust/connectivity_settings`,body:`json`};function oc(e){return e.usage(`$0 zero-trust connectivity-settings edit
306
+
307
+ Updates the Zero Trust Connectivity Settings for the given account.`).option(`icmp-proxy-enabled`,{type:`boolean`,description:`A flag to enable the ICMP proxy for the account network.`}).option(`offramp-warp-enabled`,{type:`boolean`,description:`A flag to enable WARP to WARP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const sc={command:`edit`,describe:`Updates the Zero Trust Connectivity Settings`,builder:oc,handler:async e=>u({command:`zero-trust connectivity-settings edit`,classification:{safeFlags:[`icmp-proxy-enabled`,`offramp-warp-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust connectivity-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({icmp_proxy_enabled:e[`icmp-proxy-enabled`],offramp_warp_enabled:e[`offramp-warp-enabled`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ac,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({icmp_proxy_enabled:e[`icmp-proxy-enabled`],offramp_warp_enabled:e[`offramp-warp-enabled`]}),d=await l(`Updating`,async()=>n.send(ac,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})};var cc={method:`GET`,path:t=>e`/accounts/${t.account_id}/zerotrust/connectivity_settings`};function lc(e){return e.usage(`$0 zero-trust connectivity-settings get
308
+
309
+ Gets the Zero Trust Connectivity Settings for the given account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uc={command:`get`,describe:`Get Zero Trust Connectivity Settings`,builder:lc,handler:async e=>u({command:`zero-trust connectivity-settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust connectivity-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(cc,{account_id:a}));s(u,{successLabel:`Loaded`})})},dc={command:`connectivity-settings`,describe:`Operations for connectivity-settings`,builder:e=>e.command(sc).command(uc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var fc={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials`,body:`json`};function pc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials create
310
+
311
+ Creates a basic-auth credential with the specified username.`).option(`username`,{type:`string`,description:`Login presented by the client. Printable ASCII only, excluding space and colon.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const mc={command:`create`,describe:`Create a basic-auth credential`,builder:pc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({username:h(e.username,`username`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(fc,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.username===void 0&&(e.username=await _(`username`,`Login presented by the client. Printable ASCII only, excluding space and colon.`));let u=m({username:h(e.username,`username`,`text`)}),d=await l(`Creating`,async()=>n.send(fc,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var hc={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}`};function gc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials delete <credential-id>
312
+
313
+ Deletes the credential and its secrets if it is not attached to a deployment.`).positional(`credential-id`,{type:`string`,description:`ID of the credential 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 _c={command:`delete <credential-id>`,describe:`Delete a basic-auth credential`,builder:gc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}`,pathParams:{"credential-id":String(e[`credential-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this basic-auth credential?`})){process.stderr.write(`Aborted.
314
+ `);return}let u=await l(`Deleting`,async()=>n.send(hc,{account_id:a,credential_id:e[`credential-id`]}));s(u,{successLabel:`Deleted`})})};var vc={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}`};function yc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials get <credential-id>
315
+
316
+ Returns the basic-auth credential with the specified ID.`).positional(`credential-id`,{type:`string`,description:`ID of the credential to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bc={command:`get <credential-id>`,describe:`Get a basic-auth credential by ID`,builder:yc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}`,pathParams:{"credential-id":String(e[`credential-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(vc,{account_id:a,credential_id:e[`credential-id`]}));s(u,{successLabel:`Loaded`})})};var xc={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials`,query:[`cursor`,`per_page`,`order`,`direction`,`username`,`deployment_id`],joined:[`cursor`,`per_page`,`order`,`direction`,`username`,`deployment_id`]};function Sc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials list
317
+
318
+ Returns a paginated list of basic-auth credentials in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`username`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`username`,{type:`string`,description:`Filter by username (case-insensitive substring match)`}).option(`deployment-id`,{type:`string`,description:`Filter to credentials attached to this deployment`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cc={command:`list`,describe:`List basic-auth credentials for an account`,builder:Sc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,username:e.username,deployment_id:e[`deployment-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws basic-auth-credentials list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/basic-auth-credentials`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(xc,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var wc={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}/secrets`,body:`json`,errors:{503:`ServiceUnavailableError`}};function Tc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials secrets create <credential-id>
319
+
320
+ Adds a password secret to the credential.`).positional(`credential-id`,{type:`string`,description:`ID of the parent credential`,demandOption:!0}).option(`expires-at`,{type:`string`,description:`Optional deactivation deadline (RFC 3339). Omit or null for no expiry.`}).option(`password`,{type:`string`,description:`Password stored only as a one-way hash and never returned. Maximum 72 UTF-8 bytes.`}).option(`dry-run`,{type:`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 Ec={command:`create <credential-id>`,describe:`Add a secret to a basic-auth credential`,builder:Tc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials secrets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials secrets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}/secrets`,pathParams:{"credential-id":String(e[`credential-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({expires_at:h(e[`expires-at`],`expires-at`,`text`),password:h(e.password,`password`,`text`)}):f(e.body),sensitiveBodyPaths:[[`password`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(wc,{body:t,account_id:a,credential_id:e[`credential-id`]}));s(r,{successLabel:`Created`});return}e.password===void 0&&(e.password=await _(`password`,`Password stored only as a one-way hash and never returned. Maximum 72 UTF-8 bytes.`,{kind:`secret`}));let u=m({expires_at:h(e[`expires-at`],`expires-at`,`text`),password:h(e.password,`password`,`text`)}),d=await l(`Creating`,async()=>n.send(wc,{body:u,account_id:a,credential_id:e[`credential-id`]}));s(d,{successLabel:`Created`})})};var Dc={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}/secrets/${t.secret_id}`};function Oc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials secrets delete <secret-id>
321
+
322
+ Deletes the specified secret from the credential.`).positional(`secret-id`,{type:`string`,description:`ID of the secret to delete`,demandOption:!0}).option(`credential-id`,{type:`string`,description:`ID of the parent credential`,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 kc={command:`delete <secret-id>`,describe:`Delete a basic-auth secret`,builder:Oc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials secrets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"credential-id":String(e[`credential-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this basic-auth secret?`})){process.stderr.write(`Aborted.
323
+ `);return}let u=await l(`Deleting`,async()=>n.send(Dc,{account_id:a,credential_id:e[`credential-id`],secret_id:e[`secret-id`]}));s(u,{successLabel:`Deleted`})})};var Ac={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}/secrets/${t.secret_id}`};function jc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials secrets get <secret-id>
324
+
325
+ Returns the specified secret's metadata without exposing its password or hash.`).positional(`secret-id`,{type:`string`,description:`ID of the secret to retrieve`,demandOption:!0}).option(`credential-id`,{type:`string`,description:`ID of the parent credential`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mc={command:`get <secret-id>`,describe:`Get a basic-auth secret by ID`,builder:jc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials secrets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}/secrets/${e[`secret-id`]==null?`<secret-id>`:encodeURIComponent(String(e[`secret-id`]))}`,pathParams:{"credential-id":String(e[`credential-id`]??``),"secret-id":String(e[`secret-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ac,{account_id:a,credential_id:e[`credential-id`],secret_id:e[`secret-id`]}));s(u,{successLabel:`Loaded`})})};var Nc={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/basic-auth-credentials/${t.credential_id}/secrets`,query:[`cursor`,`per_page`,`order`,`direction`],joined:[`cursor`,`per_page`,`order`,`direction`]};function Pc(e){return e.usage(`$0 zero-trust cws basic-auth-credentials secrets list
326
+
327
+ Returns a paginated list of secrets belonging to the credential.`).option(`credential-id`,{type:`string`,description:`ID of the parent credential`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`created_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fc={command:`list`,describe:`List secrets for a basic-auth credential`,builder:Pc,handler:async e=>u({command:`zero-trust cws basic-auth-credentials secrets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let t=await i();c({command:`cf zero-trust cws basic-auth-credentials secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/basic-auth-credentials/${e[`credential-id`]==null?`<credential-id>`:encodeURIComponent(String(e[`credential-id`]))}/secrets`,pathParams:{"credential-id":String(e[`credential-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Nc,{account_id:u,credential_id:e[`credential-id`],...n}));s(d,{successLabel:`Loaded`})})},Ic={command:`secrets`,describe:`Operations for cws.basic-auth-credentials.secrets`,builder:e=>e.command(Ec).command(kc).command(Mc).command(Fc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Lc={command:`basic-auth-credentials`,describe:`Operations for cws.basic-auth-credentials`,builder:e=>e.command(mc).command(_c).command(bc).command(Cc).command(Ic).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Rc={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/deployments`,body:`json`};function zc(e){return e.usage(`$0 zero-trust cws deployments create
328
+
329
+ Creates a deployment with the specified policy sets, domain ACL, and basic-auth credentials.`).option(`basic-auth-credential-ids`,{type:`string`,array:!0,description:`IDs of basic-auth credentials to attach`}).option(`default-mode`,{type:`string`,description:`Default traffic mode: ALLOW or BLOCK`,choices:[`ALLOW`,`BLOCK`]}).coerce(`default-mode`,e=>h(e,`default-mode`,`text`)).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`domain-acl-id`,{type:`string`,description:`ID of the domain ACL to attach (omit or null for none)`}).option(`name`,{type:`string`,description:`Name of the deployment`}).option(`on-error-action`,{type:`string`,description:`Action for runtime Rego errors. Omit to use BLOCK.`,choices:[`BLOCK`,`SKIP`],default:`BLOCK`}).coerce(`on-error-action`,e=>h(e,`on-error-action`,`text`)).option(`policy-set-ids`,{type:`string`,array:!0,description:`IDs of policy sets to attach`}).option(`rego-raise-error`,{type:`boolean`,description:`Whether OPA builtin failures are raised as runtime evaluation errors. Omit to use the default true value.`,default:!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 Bc={command:`create`,describe:`Create a new deployment`,builder:zc,handler:async e=>u({command:`zero-trust cws deployments create`,classification:{safeFlags:[`default-mode`,`on-error-action`,`rego-raise-error`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/deployments`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({basic_auth_credential_ids:e[`basic-auth-credential-ids`],default_mode:e[`default-mode`],description:h(e.description,`description`,`text`),domain_acl_id:h(e[`domain-acl-id`],`domain-acl-id`,`text`),name:h(e.name,`name`,`text`),on_error_action:e[`on-error-action`],policy_set_ids:e[`policy-set-ids`],rego_raise_error:e[`rego-raise-error`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Rc,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`basic-auth-credential-ids`]===void 0)throw Error(`--basic-auth-credential-ids is required (or pass --body with this field set).`);if(e[`default-mode`]===void 0&&(e[`default-mode`]=await v(`default-mode`,`Default traffic mode: ALLOW or BLOCK`,[`ALLOW`,`BLOCK`])),e.name===void 0&&(e.name=await _(`name`,`Name of the deployment`)),e[`policy-set-ids`]===void 0)throw Error(`--policy-set-ids is required (or pass --body with this field set).`);let u=m({basic_auth_credential_ids:e[`basic-auth-credential-ids`],default_mode:e[`default-mode`],description:h(e.description,`description`,`text`),domain_acl_id:h(e[`domain-acl-id`],`domain-acl-id`,`text`),name:h(e.name,`name`,`text`),on_error_action:e[`on-error-action`],policy_set_ids:e[`policy-set-ids`],rego_raise_error:e[`rego-raise-error`]}),d=await l(`Creating`,async()=>n.send(Rc,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Vc={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/deployments/${t.deployment_id}`};function Hc(e){return e.usage(`$0 zero-trust cws deployments delete <deployment-id>
330
+
331
+ Deletes the deployment and detaches its associated resources. The resources are not deleted.`).positional(`deployment-id`,{type:`string`,description:`ID of the deployment 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 Uc={command:`delete <deployment-id>`,describe:`Delete a deployment`,builder:Hc,handler:async e=>u({command:`zero-trust cws deployments delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this deployment?`})){process.stderr.write(`Aborted.
332
+ `);return}let u=await l(`Deleting`,async()=>n.send(Vc,{account_id:a,deployment_id:e[`deployment-id`]}));s(u,{successLabel:`Deleted`})})};var Wc={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/deployments/${t.deployment_id}`};function Gc(e){return e.usage(`$0 zero-trust cws deployments get <deployment-id>
333
+
334
+ Returns the deployment with the specified ID.`).positional(`deployment-id`,{type:`string`,description:`ID of the deployment to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kc={command:`get <deployment-id>`,describe:`Get a deployment by ID`,builder:Gc,handler:async e=>u({command:`zero-trust cws deployments get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Wc,{account_id:a,deployment_id:e[`deployment-id`]}));s(u,{successLabel:`Loaded`})})};var qc={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/deployments`,query:[`cursor`,`per_page`,`order`,`direction`,`name`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`]};function Jc(e){return e.usage(`$0 zero-trust cws deployments list
335
+
336
+ Returns a paginated list of deployments in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by deployment name (case-insensitive substring match)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yc={command:`list`,describe:`List deployments`,builder:Jc,handler:async e=>u({command:`zero-trust cws deployments list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/deployments`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(qc,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Xc={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/deployments/${t.deployment_id}`,body:`json`};function Zc(e){return e.usage(`$0 zero-trust cws deployments update <deployment-id>
337
+
338
+ Replaces the deployment's mutable configuration and resource attachments.`).positional(`deployment-id`,{type:`string`,description:`ID of the deployment to update`,demandOption:!0}).option(`basic-auth-credential-ids`,{type:`string`,array:!0,description:`Replacement set of basic-auth credential IDs`}).option(`default-mode`,{type:`string`,description:`Default traffic mode: ALLOW or BLOCK`,choices:[`ALLOW`,`BLOCK`]}).coerce(`default-mode`,e=>h(e,`default-mode`,`text`)).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`domain-acl-id`,{type:`string`,description:`ID of the domain ACL to attach (omit or null to clear)`}).option(`name`,{type:`string`,description:`Name of the deployment`}).option(`on-error-action`,{type:`string`,description:`Action for runtime Rego errors. Omit to preserve the current value.`,choices:[`BLOCK`,`SKIP`]}).coerce(`on-error-action`,e=>h(e,`on-error-action`,`text`)).option(`policy-set-ids`,{type:`string`,array:!0,description:`Replacement set of policy set IDs`}).option(`rego-raise-error`,{type:`boolean`,description:`Whether OPA builtin failures are raised as runtime evaluation errors. Omit to preserve the current value.`}).option(`dry-run`,{type:`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 Qc={command:`update <deployment-id>`,describe:`Update a deployment`,builder:Zc,handler:async e=>u({command:`zero-trust cws deployments update`,classification:{safeFlags:[`default-mode`,`on-error-action`,`rego-raise-error`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws deployments update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({basic_auth_credential_ids:e[`basic-auth-credential-ids`],default_mode:e[`default-mode`],description:h(e.description,`description`,`text`),domain_acl_id:h(e[`domain-acl-id`],`domain-acl-id`,`text`),name:h(e.name,`name`,`text`),on_error_action:e[`on-error-action`],policy_set_ids:e[`policy-set-ids`],rego_raise_error:e[`rego-raise-error`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Xc,{body:t,account_id:a,deployment_id:e[`deployment-id`]}));s(r,{successLabel:`Updated`});return}if(e[`basic-auth-credential-ids`]===void 0)throw Error(`--basic-auth-credential-ids is required (or pass --body with this field set).`);if(e[`default-mode`]===void 0&&(e[`default-mode`]=await v(`default-mode`,`Default traffic mode: ALLOW or BLOCK`,[`ALLOW`,`BLOCK`])),e.name===void 0&&(e.name=await _(`name`,`Name of the deployment`)),e[`policy-set-ids`]===void 0)throw Error(`--policy-set-ids is required (or pass --body with this field set).`);let u=m({basic_auth_credential_ids:e[`basic-auth-credential-ids`],default_mode:e[`default-mode`],description:h(e.description,`description`,`text`),domain_acl_id:h(e[`domain-acl-id`],`domain-acl-id`,`text`),name:h(e.name,`name`,`text`),on_error_action:e[`on-error-action`],policy_set_ids:e[`policy-set-ids`],rego_raise_error:e[`rego-raise-error`]}),d=await l(`Updating`,async()=>n.send(Xc,{body:u,account_id:a,deployment_id:e[`deployment-id`]}));s(d,{successLabel:`Updated`})})},$c={command:`deployments`,describe:`Operations for cws.deployments`,builder:e=>e.command(Bc).command(Uc).command(Kc).command(Yc).command(Qc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var el={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/domain-acls`,body:`json`};function tl(e){return e.usage(`$0 zero-trust cws domain-acls create
339
+
340
+ Creates a domain access control list with its default action and entries.`).option(`default-action`,{type:`string`,description:`Default action when no entry matches`,choices:[`ALLOW`,`BLOCK`]}).coerce(`default-action`,e=>h(e,`default-action`,`text`)).option(`entries`,{type:`string`,description:`Domain entries for this ACL. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Name of the domain ACL`}).option(`dry-run`,{type:`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 nl={command:`create`,describe:`Create a new domain ACL`,builder:tl,handler:async e=>u({command:`zero-trust cws domain-acls create`,classification:{safeFlags:[`default-action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws domain-acls create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/domain-acls`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({default_action:e[`default-action`],entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(el,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`default-action`]===void 0&&(e[`default-action`]=await v(`default-action`,`Default action when no entry matches`,[`ALLOW`,`BLOCK`])),e.entries===void 0)throw Error(`--entries is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`Name of the domain ACL`));let u=m({default_action:e[`default-action`],entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(el,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var rl={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/domain-acls/${t.domain_acl_id}`};function il(e){return e.usage(`$0 zero-trust cws domain-acls delete <domain-acl-id>
341
+
342
+ Deletes the domain ACL if it is not attached to a deployment.`).positional(`domain-acl-id`,{type:`string`,description:`ID of the domain ACL 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 al={command:`delete <domain-acl-id>`,describe:`Delete a domain ACL`,builder:il,handler:async e=>u({command:`zero-trust cws domain-acls delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws domain-acls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/domain-acls/${e[`domain-acl-id`]==null?`<domain-acl-id>`:encodeURIComponent(String(e[`domain-acl-id`]))}`,pathParams:{"domain-acl-id":String(e[`domain-acl-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this domain ACL?`})){process.stderr.write(`Aborted.
343
+ `);return}let u=await l(`Deleting`,async()=>n.send(rl,{account_id:a,domain_acl_id:e[`domain-acl-id`]}));s(u,{successLabel:`Deleted`})})};var ol={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/domain-acls/${t.domain_acl_id}`};function sl(e){return e.usage(`$0 zero-trust cws domain-acls get <domain-acl-id>
344
+
345
+ Returns the domain access control list with the specified ID.`).positional(`domain-acl-id`,{type:`string`,description:`ID of the domain ACL to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cl={command:`get <domain-acl-id>`,describe:`Get a domain ACL by ID`,builder:sl,handler:async e=>u({command:`zero-trust cws domain-acls get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws domain-acls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/domain-acls/${e[`domain-acl-id`]==null?`<domain-acl-id>`:encodeURIComponent(String(e[`domain-acl-id`]))}`,pathParams:{"domain-acl-id":String(e[`domain-acl-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ol,{account_id:a,domain_acl_id:e[`domain-acl-id`]}));s(u,{successLabel:`Loaded`})})};var ll={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/domain-acls`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`deployment_id`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`deployment_id`]};function ul(e){return e.usage(`$0 zero-trust cws domain-acls list
346
+
347
+ Returns a paginated list of domain access control lists in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by domain ACL name (case-insensitive substring match)`}).option(`deployment-id`,{type:`string`,description:`Filter to domain ACLs attached to this deployment`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dl={command:`list`,describe:`List domain ACLs`,builder:ul,handler:async e=>u({command:`zero-trust cws domain-acls list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,deployment_id:e[`deployment-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws domain-acls list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/domain-acls`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ll,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var fl={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/domain-acls/${t.domain_acl_id}`,body:`json`};function pl(e){return e.usage(`$0 zero-trust cws domain-acls update <domain-acl-id>
348
+
349
+ Replaces the domain access control list's name, default action, and entries.`).positional(`domain-acl-id`,{type:`string`,description:`ID of the domain ACL to update`,demandOption:!0}).option(`default-action`,{type:`string`,description:`Default action when no entry matches`,choices:[`ALLOW`,`BLOCK`]}).coerce(`default-action`,e=>h(e,`default-action`,`text`)).option(`entries`,{type:`string`,description:`Replacement set of domain entries. Each domain must appear at most once. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Name of the domain ACL`}).option(`dry-run`,{type:`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 ml={command:`update <domain-acl-id>`,describe:`Update a domain ACL and replace its entries`,builder:pl,handler:async e=>u({command:`zero-trust cws domain-acls update`,classification:{safeFlags:[`default-action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws domain-acls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/domain-acls/${e[`domain-acl-id`]==null?`<domain-acl-id>`:encodeURIComponent(String(e[`domain-acl-id`]))}`,pathParams:{"domain-acl-id":String(e[`domain-acl-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({default_action:e[`default-action`],entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(fl,{body:t,account_id:a,domain_acl_id:e[`domain-acl-id`]}));s(r,{successLabel:`Updated`});return}if(e[`default-action`]===void 0&&(e[`default-action`]=await v(`default-action`,`Default action when no entry matches`,[`ALLOW`,`BLOCK`])),e.entries===void 0)throw Error(`--entries is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`Name of the domain ACL`));let u=m({default_action:e[`default-action`],entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(fl,{body:u,account_id:a,domain_acl_id:e[`domain-acl-id`]}));s(d,{successLabel:`Updated`})})},hl={command:`domain-acls`,describe:`Operations for cws.domain-acls`,builder:e=>e.command(nl).command(al).command(cl).command(dl).command(ml).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var gl={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/policies`,body:`json`,errors:{503:`ServiceUnavailableError`}};function _l(e){return e.usage(`$0 zero-trust cws policies create
350
+
351
+ Creates a policy from inline Rego source and an entrypoint. Omit filter to apply the policy to every request.`).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`entrypoint`,{type:`string`,description:`Non-function rule declared in rego_source. Evaluation uses data.<package_path>.<entrypoint>.`}).option(`filter`,{type:`string`,description:`Optional filter expression that determines whether this policy applies. Omit or set null to apply the policy to every request. Maximum 4096 UTF-8 bytes.`}).option(`name`,{type:`string`,description:`Name of the policy`}).option(`rego-source`,{type:`string`,description:`Inline Rego source with a package beginning with "policy." Maximum 16384 UTF-8 bytes.`}).option(`dry-run`,{type:`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 vl={command:`create`,describe:`Create a new policy`,builder:_l,handler:async e=>u({command:`zero-trust cws policies create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policies`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),entrypoint:h(e.entrypoint,`entrypoint`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(gl,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.entrypoint===void 0&&(e.entrypoint=await _(`entrypoint`,`Non-function rule declared in rego_source. Evaluation uses data.<package_path>.<entrypoint>.`)),e.name===void 0&&(e.name=await _(`name`,`Name of the policy`)),e[`rego-source`]===void 0&&(e[`rego-source`]=await _(`rego-source`,`Inline Rego source with a package beginning with "policy." Maximum 16384 UTF-8 bytes.`));let u=m({description:h(e.description,`description`,`text`),entrypoint:h(e.entrypoint,`entrypoint`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}),d=await l(`Creating`,async()=>n.send(gl,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var yl={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/policies/${t.policy_id}`};function bl(e){return e.usage(`$0 zero-trust cws policies delete <policy-id>
352
+
353
+ Deletes the policy and cascades its policy-set membership rows. The policy sets remain.`).positional(`policy-id`,{type:`string`,description:`ID of the policy 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 xl={command:`delete <policy-id>`,describe:`Delete a policy`,builder:bl,handler:async e=>u({command:`zero-trust cws policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this policy?`})){process.stderr.write(`Aborted.
354
+ `);return}let u=await l(`Deleting`,async()=>n.send(yl,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Deleted`})})};var Sl={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/policies/${t.policy_id}`};function Cl(e){return e.usage(`$0 zero-trust cws policies get <policy-id>
355
+
356
+ Returns the policy with the specified ID.`).positional(`policy-id`,{type:`string`,description:`ID of the policy to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wl={command:`get <policy-id>`,describe:`Get a policy by ID`,builder:Cl,handler:async e=>u({command:`zero-trust cws policies get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Sl,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Loaded`})})};var Tl={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/policies`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`policy_set_id`,`package_path`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`policy_set_id`,`package_path`]};function El(e){return e.usage(`$0 zero-trust cws policies list
357
+
358
+ Returns a paginated list of policies in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by policy name (case-insensitive substring match)`}).option(`policy-set-id`,{type:`string`,description:`Filter to policies attached to (members of) this policy set`}).option(`package-path`,{type:`string`,description:`Filter by package path (case-sensitive literal substring match)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Dl={command:`list`,describe:`List policies`,builder:El,handler:async e=>u({command:`zero-trust cws policies list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,policy_set_id:e[`policy-set-id`],package_path:e[`package-path`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/policies`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Tl,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Ol={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/policies/${t.policy_id}`,body:`json`,errors:{503:`ServiceUnavailableError`}};function kl(e){return e.usage(`$0 zero-trust cws policies update <policy-id>
359
+
360
+ Replaces the policy's configuration. Omit filter to apply the policy to every request. Omit tags to preserve them; use {} to clear them.`).positional(`policy-id`,{type:`string`,description:`ID of the policy to update`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`entrypoint`,{type:`string`,description:`Non-function rule declared in rego_source. Evaluation uses data.<package_path>.<entrypoint>.`}).option(`filter`,{type:`string`,description:`Optional filter expression that determines whether this policy applies. Omit or set null to apply the policy to every request. Maximum 4096 UTF-8 bytes.`}).option(`name`,{type:`string`,description:`Name of the policy`}).option(`rego-source`,{type:`string`,description:`Inline Rego source with a package beginning with "policy." Maximum 16384 UTF-8 bytes.`}).option(`dry-run`,{type:`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 Al={command:`update <policy-id>`,describe:`Update a policy`,builder:kl,handler:async e=>u({command:`zero-trust cws policies update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policies/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),entrypoint:h(e.entrypoint,`entrypoint`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Ol,{body:t,account_id:a,policy_id:e[`policy-id`]}));s(r,{successLabel:`Updated`});return}e.entrypoint===void 0&&(e.entrypoint=await _(`entrypoint`,`Non-function rule declared in rego_source. Evaluation uses data.<package_path>.<entrypoint>.`)),e.name===void 0&&(e.name=await _(`name`,`Name of the policy`)),e[`rego-source`]===void 0&&(e[`rego-source`]=await _(`rego-source`,`Inline Rego source with a package beginning with "policy." Maximum 16384 UTF-8 bytes.`));let u=m({description:h(e.description,`description`,`text`),entrypoint:h(e.entrypoint,`entrypoint`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}),d=await l(`Updating`,async()=>n.send(Ol,{body:u,account_id:a,policy_id:e[`policy-id`]}));s(d,{successLabel:`Updated`})})},jl={command:`policies`,describe:`Operations for cws.policies`,builder:e=>e.command(vl).command(xl).command(wl).command(Dl).command(Al).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ml={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/policy-sets`,body:`json`};function Nl(e){return e.usage(`$0 zero-trust cws policy-sets create
361
+
362
+ Creates a policy set containing the specified policies and workload targets.`).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`exclude-workload-ids`,{type:`string`,array:!0,description:`Workload IDs that exclude matching requests. Exclusions take precedence.`}).option(`include-workload-ids`,{type:`string`,array:!0,description:`Workload IDs that include matching requests. Empty or omitted includes all requests before exclusions.`}).option(`name`,{type:`string`,description:`Name of the policy set`}).option(`policies`,{type:`string`,description:`Policies to include with per-membership enforcement mode. 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 Pl={command:`create`,describe:`Create a new policy set`,builder:Nl,handler:async e=>u({command:`zero-trust cws policy-sets create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policy-sets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policy-sets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),exclude_workload_ids:e[`exclude-workload-ids`],include_workload_ids:e[`include-workload-ids`],name:h(e.name,`name`,`text`),policies:p(e.policies,`policies`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Ml,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await _(`name`,`Name of the policy set`)),e.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let u=m({description:h(e.description,`description`,`text`),exclude_workload_ids:e[`exclude-workload-ids`],include_workload_ids:e[`include-workload-ids`],name:h(e.name,`name`,`text`),policies:p(e.policies,`policies`)}),d=await l(`Creating`,async()=>n.send(Ml,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Fl={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/policy-sets/${t.policy_set_id}`};function Il(e){return e.usage(`$0 zero-trust cws policy-sets delete <policy-set-id>
363
+
364
+ Deletes the policy set and cascades its deployment attachment and policy and workload membership rows. The referenced deployments, policies, and workloads remain.`).positional(`policy-set-id`,{type:`string`,description:`ID of the policy set 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 Ll={command:`delete <policy-set-id>`,describe:`Delete a policy set`,builder:Il,handler:async e=>u({command:`zero-trust cws policy-sets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policy-sets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policy-sets/${e[`policy-set-id`]==null?`<policy-set-id>`:encodeURIComponent(String(e[`policy-set-id`]))}`,pathParams:{"policy-set-id":String(e[`policy-set-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this policy set?`})){process.stderr.write(`Aborted.
365
+ `);return}let u=await l(`Deleting`,async()=>n.send(Fl,{account_id:a,policy_set_id:e[`policy-set-id`]}));s(u,{successLabel:`Deleted`})})};var Rl={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/policy-sets/${t.policy_set_id}`};function zl(e){return e.usage(`$0 zero-trust cws policy-sets get <policy-set-id>
366
+
367
+ Returns the policy set with the specified ID.`).positional(`policy-set-id`,{type:`string`,description:`ID of the policy set to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bl={command:`get <policy-set-id>`,describe:`Get a policy set by ID`,builder:zl,handler:async e=>u({command:`zero-trust cws policy-sets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policy-sets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policy-sets/${e[`policy-set-id`]==null?`<policy-set-id>`:encodeURIComponent(String(e[`policy-set-id`]))}`,pathParams:{"policy-set-id":String(e[`policy-set-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Rl,{account_id:a,policy_set_id:e[`policy-set-id`]}));s(u,{successLabel:`Loaded`})})};var Vl={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/policy-sets`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`deployment_id`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`deployment_id`]};function Hl(e){return e.usage(`$0 zero-trust cws policy-sets list
368
+
369
+ Returns a paginated list of policy sets in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by policy set name (case-insensitive substring match)`}).option(`deployment-id`,{type:`string`,description:`Filter to policy sets attached to this deployment`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ul={command:`list`,describe:`List policy sets`,builder:Hl,handler:async e=>u({command:`zero-trust cws policy-sets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,deployment_id:e[`deployment-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws policy-sets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/policy-sets`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Vl,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Wl={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/policy-sets/${t.policy_set_id}`,body:`json`};function Gl(e){return e.usage(`$0 zero-trust cws policy-sets update <policy-set-id>
370
+
371
+ Replaces the policy set's configuration. Omit tags to preserve them; use {} to clear them.`).positional(`policy-set-id`,{type:`string`,description:`ID of the policy set to update`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`exclude-workload-ids`,{type:`string`,array:!0,description:`Replacement set of excluded workload IDs. Exclusions take precedence.`}).option(`include-workload-ids`,{type:`string`,array:!0,description:`Replacement set of included workload IDs. Empty or omitted includes all requests before exclusions.`}).option(`name`,{type:`string`,description:`Name of the policy set`}).option(`policies`,{type:`string`,description:`Replacement set of policies with per-membership enforcement mode. 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 Kl={command:`update <policy-set-id>`,describe:`Update a policy set`,builder:Gl,handler:async e=>u({command:`zero-trust cws policy-sets update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws policy-sets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/policy-sets/${e[`policy-set-id`]==null?`<policy-set-id>`:encodeURIComponent(String(e[`policy-set-id`]))}`,pathParams:{"policy-set-id":String(e[`policy-set-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),exclude_workload_ids:e[`exclude-workload-ids`],include_workload_ids:e[`include-workload-ids`],name:h(e.name,`name`,`text`),policies:p(e.policies,`policies`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Wl,{body:t,account_id:a,policy_set_id:e[`policy-set-id`]}));s(r,{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await _(`name`,`Name of the policy set`)),e.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let u=m({description:h(e.description,`description`,`text`),exclude_workload_ids:e[`exclude-workload-ids`],include_workload_ids:e[`include-workload-ids`],name:h(e.name,`name`,`text`),policies:p(e.policies,`policies`)}),d=await l(`Updating`,async()=>n.send(Wl,{body:u,account_id:a,policy_set_id:e[`policy-set-id`]}));s(d,{successLabel:`Updated`})})},ql={command:`policy-sets`,describe:`Operations for cws.policy-sets`,builder:e=>e.command(Pl).command(Ll).command(Bl).command(Ul).command(Kl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Jl={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/rego-metadata`,body:`json`};function Yl(e){return e.usage(`$0 zero-trust cws rego-metadata create
372
+
373
+ Creates a JSON document that Rego can access through its import path.`).option(`import-path`,{type:`string`,description:`Unique Rego import path in the form metadata.<segment>, with one alphanumeric or underscore segment. Reference it as data.<import_path>.`}).option(`name`,{type:`string`,description:`Name of the rego metadata document (unique per account)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Xl={command:`create`,describe:`Create a new rego metadata document`,builder:Yl,handler:async e=>u({command:`zero-trust cws rego-metadata create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-metadata create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-metadata`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Jl,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`import-path`]===void 0&&(e[`import-path`]=await _(`import-path`,`Unique Rego import path in the form metadata.<segment>, with one alphanumeric or underscore segment. Reference it as data.<import_path>.`)),e.name===void 0&&(e.name=await _(`name`,`Name of the rego metadata document (unique per account)`));let u=m({import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(Jl,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Zl={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/rego-metadata/${t.rego_metadata_id}`};function Ql(e){return e.usage(`$0 zero-trust cws rego-metadata delete <rego-metadata-id>
374
+
375
+ Deletes the specified Rego metadata document.`).positional(`rego-metadata-id`,{type:`string`,description:`ID of the rego metadata document 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 $l={command:`delete <rego-metadata-id>`,describe:`Delete a rego metadata document`,builder:Ql,handler:async e=>u({command:`zero-trust cws rego-metadata delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-metadata delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-metadata/${e[`rego-metadata-id`]==null?`<rego-metadata-id>`:encodeURIComponent(String(e[`rego-metadata-id`]))}`,pathParams:{"rego-metadata-id":String(e[`rego-metadata-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this Rego metadata document?`})){process.stderr.write(`Aborted.
376
+ `);return}let u=await l(`Deleting`,async()=>n.send(Zl,{account_id:a,rego_metadata_id:e[`rego-metadata-id`]}));s(u,{successLabel:`Deleted`})})};var eu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/rego-metadata/${t.rego_metadata_id}`};function tu(e){return e.usage(`$0 zero-trust cws rego-metadata get <rego-metadata-id>
377
+
378
+ Returns the Rego metadata document with the specified ID.`).positional(`rego-metadata-id`,{type:`string`,description:`ID of the rego metadata document to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nu={command:`get <rego-metadata-id>`,describe:`Get a rego metadata document by ID`,builder:tu,handler:async e=>u({command:`zero-trust cws rego-metadata get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-metadata/${e[`rego-metadata-id`]==null?`<rego-metadata-id>`:encodeURIComponent(String(e[`rego-metadata-id`]))}`,pathParams:{"rego-metadata-id":String(e[`rego-metadata-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(eu,{account_id:a,rego_metadata_id:e[`rego-metadata-id`]}));s(u,{successLabel:`Loaded`})})};var ru={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/rego-metadata`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`import_path`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`import_path`]};function iu(e){return e.usage(`$0 zero-trust cws rego-metadata list
379
+
380
+ Returns a paginated list of Rego metadata documents in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by rego metadata name (case-insensitive substring match)`}).option(`import-path`,{type:`string`,description:`Filter by import path (case-sensitive literal substring match)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const au={command:`list`,describe:`List Rego metadata documents`,builder:iu,handler:async e=>u({command:`zero-trust cws rego-metadata list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,import_path:e[`import-path`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws rego-metadata list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/rego-metadata`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ru,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var ou={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/rego-metadata/${t.rego_metadata_id}`,body:`json`};function su(e){return e.usage(`$0 zero-trust cws rego-metadata update <rego-metadata-id>
381
+
382
+ Replaces the metadata document's name, import path, and JSON data.`).positional(`rego-metadata-id`,{type:`string`,description:`ID of the rego metadata document to update`,demandOption:!0}).option(`import-path`,{type:`string`,description:`Unique Rego import path in the form metadata.<segment>, with one alphanumeric or underscore segment. Reference it as data.<import_path>.`}).option(`name`,{type:`string`,description:`Name of the rego metadata document (unique per account)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const cu={command:`update <rego-metadata-id>`,describe:`Update a rego metadata document`,builder:su,handler:async e=>u({command:`zero-trust cws rego-metadata update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-metadata update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-metadata/${e[`rego-metadata-id`]==null?`<rego-metadata-id>`:encodeURIComponent(String(e[`rego-metadata-id`]))}`,pathParams:{"rego-metadata-id":String(e[`rego-metadata-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ou,{body:t,account_id:a,rego_metadata_id:e[`rego-metadata-id`]}));s(r,{successLabel:`Updated`});return}e[`import-path`]===void 0&&(e[`import-path`]=await _(`import-path`,`Unique Rego import path in the form metadata.<segment>, with one alphanumeric or underscore segment. Reference it as data.<import_path>.`)),e.name===void 0&&(e.name=await _(`name`,`Name of the rego metadata document (unique per account)`));let u=m({import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(ou,{body:u,account_id:a,rego_metadata_id:e[`rego-metadata-id`]}));s(d,{successLabel:`Updated`})})},lu={command:`rego-metadata`,describe:`Operations for cws.rego-metadata`,builder:e=>e.command(Xl).command($l).command(nu).command(au).command(cu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var uu={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/rego-modules`,body:`json`,errors:{503:`ServiceUnavailableError`}};function du(e){return e.usage(`$0 zero-trust cws rego-modules create
383
+
384
+ Creates a library Rego module and derives its package path from the source.`).option(`name`,{type:`string`,description:`Name of the Rego module (unique per account)`}).option(`rego-source`,{type:`string`,description:`Library Rego source with a package beginning with "lib." Maximum 16384 UTF-8 bytes.`}).option(`dry-run`,{type:`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 fu={command:`create`,describe:`Create a new Rego module`,builder:du,handler:async e=>u({command:`zero-trust cws rego-modules create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-modules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-modules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(uu,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`Name of the Rego module (unique per account)`)),e[`rego-source`]===void 0&&(e[`rego-source`]=await _(`rego-source`,`Library Rego source with a package beginning with "lib." Maximum 16384 UTF-8 bytes.`));let u=m({name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}),d=await l(`Creating`,async()=>n.send(uu,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var pu={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/rego-modules/${t.rego_module_id}`};function mu(e){return e.usage(`$0 zero-trust cws rego-modules delete <rego-module-id>
385
+
386
+ Deletes the module if no policy or library references its rules.`).positional(`rego-module-id`,{type:`string`,description:`ID of the Rego module 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 hu={command:`delete <rego-module-id>`,describe:`Delete a Rego module`,builder:mu,handler:async e=>u({command:`zero-trust cws rego-modules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-modules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-modules/${e[`rego-module-id`]==null?`<rego-module-id>`:encodeURIComponent(String(e[`rego-module-id`]))}`,pathParams:{"rego-module-id":String(e[`rego-module-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this Rego module?`})){process.stderr.write(`Aborted.
387
+ `);return}let u=await l(`Deleting`,async()=>n.send(pu,{account_id:a,rego_module_id:e[`rego-module-id`]}));s(u,{successLabel:`Deleted`})})};var gu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/rego-modules/${t.rego_module_id}`};function _u(e){return e.usage(`$0 zero-trust cws rego-modules get <rego-module-id>
388
+
389
+ Returns the library Rego module with the specified ID.`).positional(`rego-module-id`,{type:`string`,description:`ID of the Rego module to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vu={command:`get <rego-module-id>`,describe:`Get a Rego module by ID`,builder:_u,handler:async e=>u({command:`zero-trust cws rego-modules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-modules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-modules/${e[`rego-module-id`]==null?`<rego-module-id>`:encodeURIComponent(String(e[`rego-module-id`]))}`,pathParams:{"rego-module-id":String(e[`rego-module-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(gu,{account_id:a,rego_module_id:e[`rego-module-id`]}));s(u,{successLabel:`Loaded`})})};var yu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/rego-modules`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`package_path`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`package_path`]};function bu(e){return e.usage(`$0 zero-trust cws rego-modules list
390
+
391
+ Returns a paginated list of library Rego modules in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by Rego module name (case-insensitive substring match)`}).option(`package-path`,{type:`string`,description:`Filter by package path (case-sensitive literal substring match)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xu={command:`list`,describe:`List Rego modules`,builder:bu,handler:async e=>u({command:`zero-trust cws rego-modules list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,package_path:e[`package-path`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws rego-modules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/rego-modules`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(yu,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Su={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/rego-modules/${t.rego_module_id}`,body:`json`,errors:{503:`ServiceUnavailableError`}};function Cu(e){return e.usage(`$0 zero-trust cws rego-modules update <rego-module-id>
392
+
393
+ Replaces the module and validates policies and libraries that depend on it.`).positional(`rego-module-id`,{type:`string`,description:`ID of the Rego module to update`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the Rego module (unique per account)`}).option(`rego-source`,{type:`string`,description:`Library Rego source with a package beginning with "lib." Maximum 16384 UTF-8 bytes.`}).option(`dry-run`,{type:`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 wu={command:`update <rego-module-id>`,describe:`Update a Rego module`,builder:Cu,handler:async e=>u({command:`zero-trust cws rego-modules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws rego-modules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/rego-modules/${e[`rego-module-id`]==null?`<rego-module-id>`:encodeURIComponent(String(e[`rego-module-id`]))}`,pathParams:{"rego-module-id":String(e[`rego-module-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Su,{body:t,account_id:a,rego_module_id:e[`rego-module-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`Name of the Rego module (unique per account)`)),e[`rego-source`]===void 0&&(e[`rego-source`]=await _(`rego-source`,`Library Rego source with a package beginning with "lib." Maximum 16384 UTF-8 bytes.`));let u=m({name:h(e.name,`name`,`text`),rego_source:h(e[`rego-source`],`rego-source`,`text`)}),d=await l(`Updating`,async()=>n.send(Su,{body:u,account_id:a,rego_module_id:e[`rego-module-id`]}));s(d,{successLabel:`Updated`})})},Tu={command:`rego-modules`,describe:`Operations for cws.rego-modules`,builder:e=>e.command(fu).command(hu).command(vu).command(xu).command(wu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Eu={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures`,body:`json`};function Du(e){return e.usage(`$0 zero-trust cws tenant-structures create
394
+
395
+ Creates an empty tenant hierarchy for the selected cloud application.`).option(`application`,{type:`string`,description:`Platform this structure models. Immutable after creation.`,choices:[`aws`,`cloudflare`]}).coerce(`application`,e=>h(e,`application`,`text`)).option(`import-path`,{type:`string`,description:`Optional unique Rego mount path in the form tenant.<application>.<name>; application must match. Omit to leave unmounted.`}).option(`name`,{type:`string`,description:`Human-readable name; unique per account`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ou={command:`create`,describe:`Create a tenant structure`,builder:Du,handler:async e=>u({command:`zero-trust cws tenant-structures create`,classification:{safeFlags:[`application`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({application:e.application,import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Eu,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.application===void 0&&(e.application=await v(`application`,`Platform this structure models. Immutable after creation.`,[`aws`,`cloudflare`])),e.name===void 0&&(e.name=await _(`name`,`Human-readable name; unique per account`));let u=m({application:e.application,import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(Eu,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var ku={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}`};function Au(e){return e.usage(`$0 zero-trust cws tenant-structures delete <structure-id>
396
+
397
+ Deletes the tenant structure and all nodes in its hierarchy.`).positional(`structure-id`,{type:`string`,description:`ID of the tenant structure 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 ju={command:`delete <structure-id>`,describe:`Delete a tenant structure`,builder:Au,handler:async e=>u({command:`zero-trust cws tenant-structures delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this tenant structure?`})){process.stderr.write(`Aborted.
398
+ `);return}let u=await l(`Deleting`,async()=>n.send(ku,{account_id:a,structure_id:e[`structure-id`]}));s(u,{successLabel:`Deleted`})})};var Mu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}`};function Nu(e){return e.usage(`$0 zero-trust cws tenant-structures get <structure-id>
399
+
400
+ Returns the tenant structure with the specified ID.`).positional(`structure-id`,{type:`string`,description:`ID of the tenant structure to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pu={command:`get <structure-id>`,describe:`Get a tenant structure by ID`,builder:Nu,handler:async e=>u({command:`zero-trust cws tenant-structures get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Mu,{account_id:a,structure_id:e[`structure-id`]}));s(u,{successLabel:`Loaded`})})};var Fu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`import_path`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`import_path`]};function Iu(e){return e.usage(`$0 zero-trust cws tenant-structures list
401
+
402
+ Returns a paginated list of tenant structures in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by tenant structure name (case-insensitive substring match)`}).option(`import-path`,{type:`string`,description:`Filter by import path (case-sensitive literal substring match)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lu={command:`list`,describe:`List tenant structures for an account`,builder:Iu,handler:async e=>u({command:`zero-trust cws tenant-structures list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,import_path:e[`import-path`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws tenant-structures list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/tenant-structures`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Fu,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Ru={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes/batch`,body:`json`,errors:{503:`ServiceUnavailableError`}};function zu(e){return e.usage(`$0 zero-trust cws tenant-structures nodes batch <structure-id>
403
+
404
+ Atomically validates and applies 1 to 500 unordered node operations. Creates may reference new parents but cannot reuse a native_id deleted in the same batch. Maximum body size: 1 MiB.`).positional(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`creates`,{type:`string`,description:`Nodes to create; parents may be created elsewhere in this request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`deletes`,{type:`string`,description:`Nodes to delete; every descendant that will not be reparented must also be deleted. Provide as a JSON array of objects or @path/to/file.json.`}).option(`updates`,{type:`string`,description:`Nodes whose mutable fields should be fully replaced. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Bu={command:`batch <structure-id>`,describe:`Apply a batch of tenant node mutations`,builder:zu,handler:async e=>u({command:`zero-trust cws tenant-structures nodes batch`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes batch`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes/batch`,pathParams:{"structure-id":String(e[`structure-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({creates:p(e.creates,`creates`),deletes:p(e.deletes,`deletes`),updates:p(e.updates,`updates`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Apply this tenant node batch?`})){process.stderr.write(`Aborted.
405
+ `);return}if(e.body){let t=f(e.body),r=await l(`Deleting`,async()=>n.send(Ru,{body:t,account_id:a,structure_id:e[`structure-id`]}));s(r,{successLabel:`Deleted`});return}if(e.creates===void 0)throw Error(`--creates is required (or pass --body with this field set).`);if(e.deletes===void 0)throw Error(`--deletes is required (or pass --body with this field set).`);if(e.updates===void 0)throw Error(`--updates is required (or pass --body with this field set).`);let u=m({creates:p(e.creates,`creates`),deletes:p(e.deletes,`deletes`),updates:p(e.updates,`updates`)}),d=await l(`Deleting`,async()=>n.send(Ru,{body:u,account_id:a,structure_id:e[`structure-id`]}));s(d,{successLabel:`Deleted`})})};var Vu={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes`,body:`json`};function Hu(e){return e.usage(`$0 zero-trust cws tenant-structures nodes create <structure-id>
406
+
407
+ Adds a validated cloud-native node to the tenant hierarchy.`).positional(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`name`,{type:`string`,description:`Display name (e.g. an OU or account name), mutable. Optional; empty by default.`}).option(`native-id`,{type:`string`,description:`Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure's application. Immutable after create.`}).option(`node-kind`,{type:`string`,description:`Position in the tree. Legal values depend on the structure's application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.`}).option(`parent`,{type:`string`,description:`Native ID of this node's parent. Required for non-root nodes and omitted for the root. The parent must be in the same structure and able to contain this node kind.`}).option(`dry-run`,{type:`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 Uu={command:`create <structure-id>`,describe:`Add a node to a tenant structure`,builder:Hu,handler:async e=>u({command:`zero-trust cws tenant-structures nodes create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes`,pathParams:{"structure-id":String(e[`structure-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),native_id:h(e[`native-id`],`native-id`,`text`),node_kind:h(e[`node-kind`],`node-kind`,`text`),parent:h(e.parent,`parent`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Vu,{body:t,account_id:a,structure_id:e[`structure-id`]}));s(r,{successLabel:`Created`});return}e[`native-id`]===void 0&&(e[`native-id`]=await _(`native-id`,`Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure's application. Immutable after create.`)),e[`node-kind`]===void 0&&(e[`node-kind`]=await _(`node-kind`,`Position in the tree. Legal values depend on the structure's application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.`));let u=m({name:h(e.name,`name`,`text`),native_id:h(e[`native-id`],`native-id`,`text`),node_kind:h(e[`node-kind`],`node-kind`,`text`),parent:h(e.parent,`parent`,`text`)}),d=await l(`Creating`,async()=>n.send(Vu,{body:u,account_id:a,structure_id:e[`structure-id`]}));s(d,{successLabel:`Created`})})};var Wu={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes/${t.node_id}`};function Gu(e){return e.usage(`$0 zero-trust cws tenant-structures nodes delete <node-id>
408
+
409
+ Deletes a childless node from the tenant hierarchy.`).positional(`node-id`,{type:`string`,description:`ID of the node to delete`,demandOption:!0}).option(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ku={command:`delete <node-id>`,describe:`Delete a tenant node`,builder:Gu,handler:async e=>u({command:`zero-trust cws tenant-structures nodes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes/${e[`node-id`]==null?`<node-id>`:encodeURIComponent(String(e[`node-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``),"node-id":String(e[`node-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this tenant node?`})){process.stderr.write(`Aborted.
410
+ `);return}let u=await l(`Deleting`,async()=>n.send(Wu,{account_id:a,structure_id:e[`structure-id`],node_id:e[`node-id`]}));s(u,{successLabel:`Deleted`})})};var qu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes/${t.node_id}`};function Ju(e){return e.usage(`$0 zero-trust cws tenant-structures nodes get <node-id>
411
+
412
+ Returns the tenant node with the specified ID.`).positional(`node-id`,{type:`string`,description:`ID of the node to retrieve`,demandOption:!0}).option(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yu={command:`get <node-id>`,describe:`Get a tenant node by ID`,builder:Ju,handler:async e=>u({command:`zero-trust cws tenant-structures nodes get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes/${e[`node-id`]==null?`<node-id>`:encodeURIComponent(String(e[`node-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``),"node-id":String(e[`node-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(qu,{account_id:a,structure_id:e[`structure-id`],node_id:e[`node-id`]}));s(u,{successLabel:`Loaded`})})};var Xu={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes`,query:[`cursor`,`per_page`,`order`,`direction`,`node_kind`,`native_id`,`name`,`parent`],joined:[`cursor`,`per_page`,`order`,`direction`,`node_kind`,`native_id`,`name`,`parent`]};function Zu(e){return e.usage(`$0 zero-trust cws tenant-structures nodes list
413
+
414
+ Returns a paginated list of nodes in the tenant structure.`).option(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`node-kind`,{type:`string`,description:`Filter by exact node kind`}).option(`native-id`,{type:`string`,description:`Filter by exact cloud-native identifier`}).option(`name`,{type:`string`,description:`Filter by node name (case-insensitive substring match)`}).option(`parent`,{type:`string`,description:`Filter by exact parent native ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qu={command:`list`,describe:`List nodes for a tenant structure`,builder:Zu,handler:async e=>u({command:`zero-trust cws tenant-structures nodes list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,node_kind:e[`node-kind`],native_id:e[`native-id`],name:e.name,parent:e.parent};if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes`,pathParams:{"structure-id":String(e[`structure-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Xu,{account_id:u,structure_id:e[`structure-id`],...n}));s(d,{successLabel:`Loaded`})})};var $u={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}/nodes/${t.node_id}`,body:`json`};function ed(e){return e.usage(`$0 zero-trust cws tenant-structures nodes update <node-id>
415
+
416
+ Updates the node's display name or parent while preserving its immutable identity fields.`).positional(`node-id`,{type:`string`,description:`ID of the node to update`,demandOption:!0}).option(`structure-id`,{type:`string`,description:`ID of the parent tenant structure`,demandOption:!0}).option(`name`,{type:`string`,description:`Display name (e.g. an OU or account name), mutable. Optional; empty by default.`}).option(`native-id`,{type:`string`,description:`Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure's application. Immutable after create.`}).option(`node-kind`,{type:`string`,description:`Position in the tree. Legal values depend on the structure's application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.`}).option(`parent`,{type:`string`,description:`Native ID of this node's parent. Required for non-root nodes and omitted for the root. The parent must be in the same structure and able to contain this node kind.`}).option(`dry-run`,{type:`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 td={command:`update <node-id>`,describe:`Update a tenant node`,builder:ed,handler:async e=>u({command:`zero-trust cws tenant-structures nodes update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures nodes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}/nodes/${e[`node-id`]==null?`<node-id>`:encodeURIComponent(String(e[`node-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``),"node-id":String(e[`node-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),native_id:h(e[`native-id`],`native-id`,`text`),node_kind:h(e[`node-kind`],`node-kind`,`text`),parent:h(e.parent,`parent`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send($u,{body:t,account_id:a,structure_id:e[`structure-id`],node_id:e[`node-id`]}));s(r,{successLabel:`Updated`});return}e[`native-id`]===void 0&&(e[`native-id`]=await _(`native-id`,`Cloud-native identifier of this node, unique within the structure; the parent-reference target. Shape depends on the structure's application. Immutable after create.`)),e[`node-kind`]===void 0&&(e[`node-kind`]=await _(`node-kind`,`Position in the tree. Legal values depend on the structure's application (aws: root/ou/account; cloudflare: org/account/zone). At most one root per structure. Immutable after create.`));let u=m({name:h(e.name,`name`,`text`),native_id:h(e[`native-id`],`native-id`,`text`),node_kind:h(e[`node-kind`],`node-kind`,`text`),parent:h(e.parent,`parent`,`text`)}),d=await l(`Updating`,async()=>n.send($u,{body:u,account_id:a,structure_id:e[`structure-id`],node_id:e[`node-id`]}));s(d,{successLabel:`Updated`})})},nd={command:`nodes`,describe:`Operations for cws.tenant-structures.nodes`,builder:e=>e.command(Bu).command(Uu).command(Ku).command(Yu).command(Qu).command(td).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var rd={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/tenant-structures/${t.structure_id}`,body:`json`};function id(e){return e.usage(`$0 zero-trust cws tenant-structures update <structure-id>
417
+
418
+ Updates the tenant structure's name and import path; its application remains immutable.`).positional(`structure-id`,{type:`string`,description:`ID of the tenant structure to update`,demandOption:!0}).option(`application`,{type:`string`,description:`Platform this structure models. Must match the existing value.`,choices:[`aws`,`cloudflare`]}).coerce(`application`,e=>h(e,`application`,`text`)).option(`import-path`,{type:`string`,description:`Optional unique Rego mount path in the form tenant.<application>.<name>; application must match. Omit to clear.`}).option(`name`,{type:`string`,description:`Human-readable name; unique per account`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ad={command:`update <structure-id>`,describe:`Update a tenant structure`,builder:id,handler:async e=>u({command:`zero-trust cws tenant-structures update`,classification:{safeFlags:[`application`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws tenant-structures update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/tenant-structures/${e[`structure-id`]==null?`<structure-id>`:encodeURIComponent(String(e[`structure-id`]))}`,pathParams:{"structure-id":String(e[`structure-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({application:e.application,import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(rd,{body:t,account_id:a,structure_id:e[`structure-id`]}));s(r,{successLabel:`Updated`});return}e.application===void 0&&(e.application=await v(`application`,`Platform this structure models. Must match the existing value.`,[`aws`,`cloudflare`])),e.name===void 0&&(e.name=await _(`name`,`Human-readable name; unique per account`));let u=m({application:e.application,import_path:h(e[`import-path`],`import-path`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(rd,{body:u,account_id:a,structure_id:e[`structure-id`]}));s(d,{successLabel:`Updated`})})},od={command:`tenant-structures`,describe:`Operations for cws.tenant-structures`,builder:e=>e.command(Ou).command(ju).command(Pu).command(Lu).command(ad).command(nd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var sd={method:`POST`,path:t=>e`/accounts/${t.account_id}/cws/workloads`,body:`json`};function cd(e){return e.usage(`$0 zero-trust cws workloads create
419
+
420
+ Creates a reusable workload selector from a filter expression.`).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`filter`,{type:`string`,description:`Filter expression selecting the requests this workload matches. Maximum 4096 UTF-8 bytes.`}).option(`name`,{type:`string`,description:`Human-readable handle; unique per account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ld={command:`create`,describe:`Create a new workload`,builder:cd,handler:async e=>u({command:`zero-trust cws workloads create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws workloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/workloads`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(sd,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.filter===void 0&&(e.filter=await _(`filter`,`Filter expression selecting the requests this workload matches. Maximum 4096 UTF-8 bytes.`)),e.name===void 0&&(e.name=await _(`name`,`Human-readable handle; unique per account.`));let u=m({description:h(e.description,`description`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(sd,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var ud={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cws/workloads/${t.workload_id}`};function dd(e){return e.usage(`$0 zero-trust cws workloads delete <workload-id>
421
+
422
+ Deletes the workload if it is not targeted by a policy set.`).positional(`workload-id`,{type:`string`,description:`ID of the workload 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 fd={command:`delete <workload-id>`,describe:`Delete a workload`,builder:dd,handler:async e=>u({command:`zero-trust cws workloads delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws workloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/workloads/${e[`workload-id`]==null?`<workload-id>`:encodeURIComponent(String(e[`workload-id`]))}`,pathParams:{"workload-id":String(e[`workload-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`Delete this workload?`})){process.stderr.write(`Aborted.
423
+ `);return}let u=await l(`Deleting`,async()=>n.send(ud,{account_id:a,workload_id:e[`workload-id`]}));s(u,{successLabel:`Deleted`})})};var pd={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/workloads/${t.workload_id}`};function md(e){return e.usage(`$0 zero-trust cws workloads get <workload-id>
424
+
425
+ Returns the workload with the specified ID.`).positional(`workload-id`,{type:`string`,description:`ID of the workload to retrieve`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hd={command:`get <workload-id>`,describe:`Get a workload by ID`,builder:md,handler:async e=>u({command:`zero-trust cws workloads get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws workloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/workloads/${e[`workload-id`]==null?`<workload-id>`:encodeURIComponent(String(e[`workload-id`]))}`,pathParams:{"workload-id":String(e[`workload-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(pd,{account_id:a,workload_id:e[`workload-id`]}));s(u,{successLabel:`Loaded`})})};var gd={method:`GET`,path:t=>e`/accounts/${t.account_id}/cws/workloads`,query:[`cursor`,`per_page`,`order`,`direction`,`name`,`policy_set_id`],joined:[`cursor`,`per_page`,`order`,`direction`,`name`,`policy_set_id`]};function _d(e){return e.usage(`$0 zero-trust cws workloads list
426
+
427
+ Returns a paginated list of workloads in the account.`).option(`cursor`,{type:`string`,description:`Pagination cursor from previous response`}).option(`per-page`,{type:`number`,description:`Number of items per page (1-100, default 20)`}).option(`order`,{type:`string`,description:`Field to order results by (default: created_at)`,choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:`Sort direction (default: asc)`,choices:[`asc`,`desc`]}).option(`name`,{type:`string`,description:`Filter by workload name (case-insensitive substring match)`}).option(`policy-set-id`,{type:`string`,description:`Filter to workloads attached to this policy set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vd={command:`list`,describe:`List workloads`,builder:_d,handler:async e=>u({command:`zero-trust cws workloads list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`],order:e.order,direction:e.direction,name:e.name,policy_set_id:e[`policy-set-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust cws workloads list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cws/workloads`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(gd,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var yd={method:`PUT`,path:t=>e`/accounts/${t.account_id}/cws/workloads/${t.workload_id}`,body:`json`};function bd(e){return e.usage(`$0 zero-trust cws workloads update <workload-id>
428
+
429
+ Replaces the workload's configuration. Omit tags to preserve them; use {} to clear them.`).positional(`workload-id`,{type:`string`,description:`ID of the workload to update`,demandOption:!0}).option(`description`,{type:`string`,description:`Optional free-form description.`}).option(`filter`,{type:`string`,description:`Filter expression selecting the requests this workload matches. Maximum 4096 UTF-8 bytes.`}).option(`name`,{type:`string`,description:`Human-readable handle; unique per account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xd={command:`update <workload-id>`,describe:`Update a workload`,builder:bd,handler:async e=>u({command:`zero-trust cws workloads update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust cws workloads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cws/workloads/${e[`workload-id`]==null?`<workload-id>`:encodeURIComponent(String(e[`workload-id`]))}`,pathParams:{"workload-id":String(e[`workload-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(yd,{body:t,account_id:a,workload_id:e[`workload-id`]}));s(r,{successLabel:`Updated`});return}e.filter===void 0&&(e.filter=await _(`filter`,`Filter expression selecting the requests this workload matches. Maximum 4096 UTF-8 bytes.`)),e.name===void 0&&(e.name=await _(`name`,`Human-readable handle; unique per account.`));let u=m({description:h(e.description,`description`,`text`),filter:h(e.filter,`filter`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(yd,{body:u,account_id:a,workload_id:e[`workload-id`]}));s(d,{successLabel:`Updated`})})},Sd={command:`workloads`,describe:`Operations for cws.workloads`,builder:e=>e.command(ld).command(fd).command(hd).command(vd).command(xd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Cd={command:`cws`,describe:`Operations for cws`,builder:e=>e.command(Lc).command($c).command(hl).command(jl).command(ql).command(lu).command(Tu).command(od).command(Sd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var wd={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/client-versions`,query:[`target_environment`,`release_track`,`page`,`per_page`]};function Td(e){return e.usage(`$0 zero-trust devices client-versions list
430
+
431
+ Lists available WARP client versions for a specific target environment and release track. This endpoint is in Beta.`).option(`target-environment`,{type:`string`,description:`The target environment for the client version (e.g., windows, macos).`,demandOption:!0}).option(`release-track`,{type:`string`,description:`The release track (ga for General Availability, beta for Beta releases).`,choices:[`ga`,`beta`],demandOption:!0}).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The maximum number of versions to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ed={command:`list`,describe:`List client versions`,builder:Td,handler:async e=>u({command:`zero-trust devices client-versions list`,classification:{safeFlags:[`release-track`,`dry-run`]}},e,async()=>{let n={target_environment:e[`target-environment`],release_track:e[`release-track`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices client-versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/client-versions`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(wd,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Dd={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/client-versions/target-environments`};function Od(e){return e.usage(`$0 zero-trust devices client-versions target-environments list
432
+
433
+ Retrieves a list of all available target environments with their display names. This endpoint is in Beta.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kd={command:`list`,describe:`List available target environments`,builder:Od,handler:async e=>u({command:`zero-trust devices client-versions target-environments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices client-versions target-environments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/client-versions/target-environments`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Dd,{account_id:a}));s(u,{successLabel:`Loaded`})})},Ad={command:`target-environments`,describe:`Operations for devices.client-versions.target-environments`,builder:e=>e.command(kd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},jd={command:`client-versions`,describe:`Operations for devices.client-versions`,builder:e=>e.command(Ed).command(Ad).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Md={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/physical-devices/${t.device_id}`};function Nd(e){return e.usage(`$0 zero-trust devices delete <device-id>
434
+
435
+ Deletes a WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pd={command:`delete <device-id>`,describe:`Delete device`,builder:Nd,handler:async e=>u({command:`zero-trust devices delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/physical-devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}`,pathParams:{"device-id":String(e[`device-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
436
+ `);return}let u=await l(`Deleting`,async()=>n.send(Md,{account_id:a,device_id:e[`device-id`]}));s(u,{successLabel:`Deleted`})})};var Fd={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/deployment-groups`,body:`json`};function Id(e){return e.usage(`$0 zero-trust devices deployment-groups create
437
+
438
+ Creates a new deployment group. Policy IDs must be unique across all deployment groups. This endpoint is in Beta.`).option(`name`,{type:`string`,description:`A user-friendly name for the deployment group.`}).option(`policy-ids`,{type:`string`,array:!0,description:`Contains an optional list of policy IDs assigned to a group.`}).option(`version-config`,{type:`string`,description:`Contains at least one version configuration. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ld={command:`create`,describe:`Create deployment group`,builder:Id,handler:async e=>u({command:`zero-trust devices deployment-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices deployment-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/deployment-groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),policy_ids:e[`policy-ids`],version_config:p(e[`version-config`],`version-config`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Fd,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.name===void 0&&(e.name=await _(`name`,`A user-friendly name for the deployment group.`)),e[`version-config`]===void 0)throw Error(`--version-config is required (or pass --body with this field set).`);let u=m({name:h(e.name,`name`,`text`),policy_ids:e[`policy-ids`],version_config:p(e[`version-config`],`version-config`)}),d=await l(`Creating`,async()=>n.send(Fd,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Rd={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/deployment-groups/${t.group_id}`};function zd(e){return e.usage(`$0 zero-trust devices deployment-groups delete <group-id>
439
+
440
+ Deletes a deployment group. Associated policies no longer apply and devices stop receiving version targets. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Bd={command:`delete <group-id>`,describe:`Delete deployment group`,builder:zd,handler:async e=>u({command:`zero-trust devices deployment-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices deployment-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/deployment-groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
441
+ `);return}let u=await l(`Deleting`,async()=>n.send(Rd,{account_id:a,group_id:e[`group-id`]}));s(u,{successLabel:`Deleted`})})};var Vd={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/deployment-groups/${t.group_id}`};function Hd(e){return e.usage(`$0 zero-trust devices deployment-groups get <group-id>
442
+
443
+ Fetches a single deployment group by its ID. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ud={command:`get <group-id>`,describe:`Get deployment group`,builder:Hd,handler:async e=>u({command:`zero-trust devices deployment-groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices deployment-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/deployment-groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Vd,{account_id:a,group_id:e[`group-id`]}));s(u,{successLabel:`Loaded`})})};var Wd={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/deployment-groups`,query:[`page`,`per_page`]};function Gd(e){return e.usage(`$0 zero-trust devices deployment-groups list
444
+
445
+ Lists all deployment groups for an account. Use deployment groups to assign target WARP client versions to specific devices. This endpoint is in Beta.`).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The maximum number of deployment groups to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kd={command:`list`,describe:`List deployment groups`,builder:Gd,handler:async e=>u({command:`zero-trust devices deployment-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices deployment-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/deployment-groups`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Wd,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var qd={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/deployment-groups/${t.group_id}`,body:`json`};function Jd(e){return e.usage(`$0 zero-trust devices deployment-groups update <group-id>
446
+
447
+ Updates a deployment group. Returns 409 if any newly added policy IDs already belong to another deployment group. This endpoint is in Beta.`).positional(`group-id`,{type:`string`,description:`Group ID`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for the deployment group.`}).option(`policy-ids`,{type:`string`,array:!0,description:`Replaces the entire list of policy IDs.`}).option(`version-config`,{type:`string`,description:`Replaces the entire version_config array. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yd={command:`update <group-id>`,describe:`Update deployment group`,builder:Jd,handler:async e=>u({command:`zero-trust devices deployment-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices deployment-groups update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/deployment-groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`),policy_ids:e[`policy-ids`],version_config:p(e[`version-config`],`version-config`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(qd,{body:t,account_id:a,group_id:e[`group-id`]}));s(r,{successLabel:`Updated`});return}let u=m({name:h(e.name,`name`,`text`),policy_ids:e[`policy-ids`],version_config:p(e[`version-config`],`version-config`)}),d=await l(`Updating`,async()=>n.send(qd,{body:u,account_id:a,group_id:e[`group-id`]}));s(d,{successLabel:`Updated`})})},Xd={command:`deployment-groups`,describe:`Operations for devices.deployment-groups`,builder:e=>e.command(Ld).command(Bd).command(Ud).command(Kd).command(Yd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Zd={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/resilience/disconnect`};function Qd(e){return e.usage(`$0 zero-trust devices emergency-disconnect get
448
+
449
+ Fetch the Global WARP disconnect state.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $d={command:`get`,describe:`Get Global Disconnect`,builder:Qd,handler:async e=>u({command:`zero-trust devices emergency-disconnect get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices emergency-disconnect get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Zd,{account_id:a}));s(u,{successLabel:`Loaded`})})};var ef={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/resilience/disconnect`,body:`json`};function tf(e){return e.usage(`$0 zero-trust devices emergency-disconnect set
450
+
451
+ Sets the Global WARP disconnect state.`).option(`disconnect`,{type:`boolean`,description:`Disconnects all devices on the account using Global WARP override.`}).option(`justification`,{type:`string`,description:`Reasoning for setting the Global WARP override state. This will be surfaced in the audit log.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const nf={command:`set`,describe:`Set Global Disconnect`,builder:tf,handler:async e=>u({command:`zero-trust devices emergency-disconnect set`,classification:{safeFlags:[`disconnect`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices emergency-disconnect set`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/resilience/disconnect`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({disconnect:e.disconnect,justification:h(e.justification,`justification`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(ef,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.disconnect===void 0)throw Error(`--disconnect is required (or pass --body with this field set).`);let u=m({disconnect:e.disconnect,justification:h(e.justification,`justification`,`text`)}),d=await l(`Creating`,async()=>n.send(ef,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},rf={command:`emergency-disconnect`,describe:`Operations for devices.emergency-disconnect`,builder:e=>e.command($d).command(nf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var af={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/physical-devices/${t.device_id}`,query:[`include`]};function of(e){return e.usage(`$0 zero-trust devices get <device-id>
452
+
453
+ Fetches a single WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,demandOption:!0}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the device response. Supported values are: "last_seen_registration.policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sf={command:`get <device-id>`,describe:`Get device`,builder:of,handler:async e=>u({command:`zero-trust devices get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={include:e.include};if(e.dryRun){let t=await i();c({command:`cf zero-trust devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/physical-devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}`,pathParams:{"device-id":String(e[`device-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(af,{account_id:u,device_id:e[`device-id`],...n}));s(d,{successLabel:`Loaded`})})};var cf={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/ip-profiles`,body:`json`};function lf(e){return e.usage(`$0 zero-trust devices ip-profiles create
454
+
455
+ Creates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`).option(`description`,{type:`string`,description:`An optional description of the Device IP profile.`}).option(`enabled`,{type:`boolean`,description:`Whether the Device IP profile will be applied to matching devices.`,default:!0}).option(`match`,{type:`string`,description:`The wirefilter expression to match registrations. Available values: "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.saml_attributes".`}).option(`name`,{type:`string`,description:`A user-friendly name for the Device IP profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the Device IP profile. Lower values indicate higher precedence. Device IP profile will be evaluated in ascending order of this field.`}).option(`subnet-id`,{type:`string`,description:`The ID of the Subnet.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const uf={command:`create`,describe:`Create IP profile`,builder:lf,handler:async e=>u({command:`zero-trust devices ip-profiles create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices ip-profiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/ip-profiles`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,subnet_id:h(e[`subnet-id`],`subnet-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(cf,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.match===void 0&&(e.match=await _(`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".`)),e.name===void 0&&(e.name=await _(`name`,`A user-friendly name for the Device IP profile.`)),e.precedence===void 0)throw Error(`--precedence is required (or pass --body with this field set).`);e[`subnet-id`]===void 0&&(e[`subnet-id`]=await _(`subnet-id`,`The ID of the Subnet.`));let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,subnet_id:h(e[`subnet-id`],`subnet-id`,`text`)}),d=await l(`Creating`,async()=>n.send(cf,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var df={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/ip-profiles/${t.profile_id}`};function ff(e){return e.usage(`$0 zero-trust devices ip-profiles delete <profile-id>
456
+
457
+ Delete a WARP Device IP profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const pf={command:`delete <profile-id>`,describe:`Delete IP profile`,builder:ff,handler:async e=>u({command:`zero-trust devices ip-profiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices ip-profiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/ip-profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
458
+ `);return}let u=await l(`Deleting`,async()=>n.send(df,{account_id:a,profile_id:e[`profile-id`]}));s(u,{successLabel:`Deleted`})})};var mf={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/ip-profiles/${t.profile_id}`};function hf(e){return e.usage(`$0 zero-trust devices ip-profiles get <profile-id>
459
+
460
+ Fetches a single WARP Device IP profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gf={command:`get <profile-id>`,describe:`Get IP profile`,builder:hf,handler:async e=>u({command:`zero-trust devices ip-profiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices ip-profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/ip-profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(mf,{account_id:a,profile_id:e[`profile-id`]}));s(u,{successLabel:`Loaded`})})};var _f={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/ip-profiles`,query:[`page`,`per_page`]};function vf(e){return e.usage(`$0 zero-trust devices ip-profiles list
461
+
462
+ Lists WARP Device IP profiles.`).option(`page`,{type:`number`,description:`The page number to return.`}).option(`per-page`,{type:`number`,description:`The number of IP profiles to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yf={command:`list`,describe:`List IP profiles`,builder:vf,handler:async e=>u({command:`zero-trust devices ip-profiles list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices ip-profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/ip-profiles`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(_f,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var bf={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/ip-profiles/${t.profile_id}`,body:`json`};function xf(e){return e.usage(`$0 zero-trust devices ip-profiles update <profile-id>
463
+
464
+ Updates a WARP Device IP profile. Currently, only IPv4 Device subnets can be associated.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`description`,{type:`string`,description:`An optional description of the Device IP profile.`}).option(`enabled`,{type:`boolean`,description:`Whether the Device IP profile is enabled.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match registrations. Available values: "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.saml_attributes".`}).option(`name`,{type:`string`,description:`A user-friendly name for the Device IP profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the Device IP profile. Lower values indicate higher precedence. Device IP profile will be evaluated in ascending order of this field.`}).option(`subnet-id`,{type:`string`,description:`The ID of the Subnet.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Sf={command:`update <profile-id>`,describe:`Update IP profile`,builder:xf,handler:async e=>u({command:`zero-trust devices ip-profiles update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices ip-profiles update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/ip-profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,subnet_id:h(e[`subnet-id`],`subnet-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(bf,{body:t,account_id:a,profile_id:e[`profile-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,subnet_id:h(e[`subnet-id`],`subnet-id`,`text`)}),d=await l(`Updating`,async()=>n.send(bf,{body:u,account_id:a,profile_id:e[`profile-id`]}));s(d,{successLabel:`Updated`})})},Cf={command:`ip-profiles`,describe:`Operations for devices.ip-profiles`,builder:e=>e.command(uf).command(pf).command(gf).command(yf).command(Sf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var wf={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/physical-devices`,query:[`cursor`,`sort_by`,`sort_order`,`last_seen_user.email`,`seen_after`,`seen_before`,`per_page`,`search`,`active_registrations`,`has_registration_type`,`id`,`tag`,`last_seen_registration.policy.id`,`include`],joined:[`cursor`,`sort_by`,`sort_order`,`last_seen_user.email`,`seen_after`,`seen_before`,`per_page`,`search`,`active_registrations`,`has_registration_type`,`last_seen_registration.policy.id`]};function Tf(e){return e.usage(`$0 zero-trust devices list
465
+
466
+ Lists WARP devices.`).option(`cursor`,{type:`string`,description:`Opaque token indicating the starting position when requesting the next set of records. A cursor value can be obtained from the result_info.cursor field in the response.`}).option(`sort-by`,{type:`string`,description:`The device field to order results by.`,choices:[`name`,`id`,`client_version`,`last_seen_user.email`,`last_seen_at`,`active_registrations`,`created_at`]}).option(`sort-order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`last-seen-user-email`,{type:`string`,description:`Filter by the last seen user's email.`}).option(`seen-after`,{type:`string`,description:`Filter by the last_seen timestamp - returns only devices last seen after this timestamp.`}).option(`seen-before`,{type:`string`,description:`Filter by the last_seen timestamp - returns only devices last seen before this timestamp.`}).option(`per-page`,{type:`number`,description:`The maximum number of devices to return in a single response.`}).option(`search`,{type:`string`,description:`Search by device details.`}).option(`active-registrations`,{type:`string`,description:`Include or exclude devices with active registrations. The default is "only" - return only devices with active registrations.`,choices:[`include`,`only`,`exclude`]}).option(`has-registration-type`,{type:`string`,description:`Filter by the type of active registration associated with the device.`,choices:[`warp`,`browser_extension`]}).option(`id`,{type:`string`,description:`Filter by a one or more device IDs.`}).option(`tag`,{type:`string`,description:`Filter by one or more device tags in key:value format. Devices must match all provided tags.`}).option(`last-seen-registration-policy-id`,{type:`string`,description:`Filter by the ID of the device settings profile assigned to the device registration.`}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the device response. Supported values are: "last_seen_registration.policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ef={command:`list`,describe:`List devices`,builder:Tf,handler:async e=>u({command:`zero-trust devices list`,classification:{safeFlags:[`sort-by`,`sort-order`,`active-registrations`,`has-registration-type`,`dry-run`]}},e,async()=>{let n={cursor:e.cursor,sort_by:e[`sort-by`],sort_order:e[`sort-order`],"last_seen_user.email":e[`last-seen-user-email`],seen_after:e[`seen-after`],seen_before:e[`seen-before`],per_page:e[`per-page`],search:e.search,active_registrations:e[`active-registrations`],has_registration_type:e[`has-registration-type`],id:e.id,tag:e.tag,"last_seen_registration.policy.id":e[`last-seen-registration-policy-id`],include:e.include};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/physical-devices`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(wf,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Df={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/networks`,body:`json`,constants:{type:`tls`}};function Of(e){return e.usage(`$0 zero-trust devices networks create
467
+
468
+ Creates a new device managed network.`).option(`config-sha256`,{type:`string`,description:`The SHA-256 hash of the TLS certificate presented by the host found at tls_sockaddr. If absent, regular certificate verification (trusted roots, valid timestamp, etc) will be used to validate the certificate.`}).option(`config-tls-sockaddr`,{type:`string`,description:`A network address of the form "host:port" that the WARP client will use to detect the presence of a TLS host.`}).option(`name`,{type:`string`,description:`The name of the device managed network. This name must be unique.`}).option(`type`,{type:`string`,description:`The type of device managed network.`,choices:[`tls`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const kf={command:`create`,describe:`Create a device managed network`,builder:Of,handler:async e=>u({command:`zero-trust devices networks create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({config:{sha256:h(e[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:h(e[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:h(e.name,`name`,`text`),type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Df,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`config-tls-sockaddr`]===void 0&&(e[`config-tls-sockaddr`]=await _(`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.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the device managed network. This name must be unique.`)),e.type===void 0&&(e.type=await v(`type`,`The type of device managed network.`,[`tls`]));let u=m({config:{sha256:h(e[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:h(e[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:h(e.name,`name`,`text`),type:e.type}),d=await l(`Creating`,async()=>n.send(Df,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Af={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/networks/${t.network_id}`};function jf(e){return e.usage(`$0 zero-trust devices networks delete <network-id>
469
+
470
+ Deletes a device managed network and fetches a list of the remaining device managed networks for an account.`).positional(`network-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Mf={command:`delete <network-id>`,describe:`Delete a device managed network`,builder:jf,handler:async e=>u({command:`zero-trust devices networks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/networks/${e[`network-id`]==null?`<network-id>`:encodeURIComponent(String(e[`network-id`]))}`,pathParams:{"network-id":String(e[`network-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
471
+ `);return}let u=await l(`Deleting`,async()=>n.send(Af,{account_id:a,network_id:e[`network-id`]}));s(u,{successLabel:`Deleted`})})};var Nf={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/networks/${t.network_id}`};function Pf(e){return e.usage(`$0 zero-trust devices networks get <network-id>
472
+
473
+ Fetches details for a single managed network.`).positional(`network-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ff={command:`get <network-id>`,describe:`Get device managed network details`,builder:Pf,handler:async e=>u({command:`zero-trust devices networks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices networks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/networks/${e[`network-id`]==null?`<network-id>`:encodeURIComponent(String(e[`network-id`]))}`,pathParams:{"network-id":String(e[`network-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Nf,{account_id:a,network_id:e[`network-id`]}));s(u,{successLabel:`Loaded`})})};var If={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/networks`};function Lf(e){return e.usage(`$0 zero-trust devices networks list
474
+
475
+ Fetches a list of managed networks for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rf={command:`list`,describe:`List your device managed networks`,builder:Lf,handler:async e=>u({command:`zero-trust devices networks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices networks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/networks`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(If,{account_id:a}));s(u,{successLabel:`Loaded`})})};var zf={method:`PUT`,path:t=>e`/accounts/${t.account_id}/devices/networks/${t.network_id}`,body:`json`};function Bf(e){return e.usage(`$0 zero-trust devices networks update <network-id>
476
+
477
+ Updates a configured device managed network.`).positional(`network-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`config-sha256`,{type:`string`,description:`The SHA-256 hash of the TLS certificate presented by the host found at tls_sockaddr. If absent, regular certificate verification (trusted roots, valid timestamp, etc) will be used to validate the certificate.`}).option(`config-tls-sockaddr`,{type:`string`,description:`A network address of the form "host:port" that the WARP client will use to detect the presence of a TLS host.`}).option(`name`,{type:`string`,description:`The name of the device managed network. This name must be unique.`}).option(`type`,{type:`string`,description:`The type of device managed network.`,choices:[`tls`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).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 Vf={command:`update <network-id>`,describe:`Update a device managed network`,builder:Bf,handler:async e=>u({command:`zero-trust devices networks update`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices networks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/networks/${e[`network-id`]==null?`<network-id>`:encodeURIComponent(String(e[`network-id`]))}`,pathParams:{"network-id":String(e[`network-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({config:{sha256:h(e[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:h(e[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:h(e.name,`name`,`text`),type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(zf,{body:t,account_id:a,network_id:e[`network-id`]}));s(r,{successLabel:`Updated`});return}let u=m({config:{sha256:h(e[`config-sha256`],`config-sha256`,`text`),tls_sockaddr:h(e[`config-tls-sockaddr`],`config-tls-sockaddr`,`text`)},name:h(e.name,`name`,`text`),type:e.type}),d=await l(`Updating`,async()=>n.send(zf,{body:u,account_id:a,network_id:e[`network-id`]}));s(d,{successLabel:`Updated`})})},Hf={command:`networks`,describe:`Operations for devices.networks`,builder:e=>e.command(kf).command(Mf).command(Ff).command(Rf).command(Vf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Uf={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/override_codes`,body:`json`,constants:{type:`uninstall_protection`}};function Wf(e){return e.usage(`$0 zero-trust devices override-codes create
478
+
479
+ Generates an account-wide or device-specific uninstall protection override code.`).option(`device-id`,{type:`string`,description:`Physical device ID. Required when scope is device and forbidden when scope is account.`}).option(`duration-hours`,{type:`number`,description:`Number of hours for which the override code should remain valid.`}).option(`scope`,{type:`string`,description:`Whether the code applies to every device in the account or one physical device.`,choices:[`account`,`device`]}).coerce(`scope`,e=>h(e,`scope`,`text`)).option(`type`,{type:`string`,description:`The feature that the override code applies to.`,choices:[`uninstall_protection`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Gf={command:`create`,describe:`Generate an uninstall protection override code`,builder:Wf,handler:async e=>u({command:`zero-trust devices override-codes create`,classification:{safeFlags:[`scope`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices override-codes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/override_codes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({device_id:h(e[`device-id`],`device-id`,`text`),duration_hours:e[`duration-hours`],scope:e.scope,type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Uf,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`duration-hours`]===void 0)throw Error(`--duration-hours is required (or pass --body with this field set).`);e.scope===void 0&&(e.scope=await v(`scope`,`Whether the code applies to every device in the account or one physical device.`,[`account`,`device`])),e.type===void 0&&(e.type=await v(`type`,`The feature that the override code applies to.`,[`uninstall_protection`]));let u=m({device_id:h(e[`device-id`],`device-id`,`text`),duration_hours:e[`duration-hours`],scope:e.scope,type:e.type}),d=await l(`Creating`,async()=>n.send(Uf,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},Kf={command:`override-codes`,describe:`Operations for devices.override-codes`,builder:e=>e.command(Gf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var qf={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/posture/integration`,body:`json`};function Jf(e){return e.usage(`$0 zero-trust devices posture integrations create
480
+
481
+ Create a new device posture integration.`).option(`config-api-url`,{type:`string`,description:`The Workspace One API URL provided in the Workspace One Admin Dashboard.`}).option(`config-auth-url`,{type:`string`,description:`The Workspace One Authorization URL depending on your region.`}).option(`config-client-id`,{type:`string`,description:`The Workspace One client ID provided in the Workspace One Admin Dashboard.`}).option(`config-client-secret`,{type:`string`,description:`The Workspace One client secret provided in the Workspace One Admin Dashboard.`}).option(`config-customer-id`,{type:`string`,description:`The Crowdstrike customer ID.`}).option(`config-client-key`,{type:`string`,description:`The Uptycs client secret.`}).option(`config-access-client-id`,{type:`string`,description:"If present, this id will be passed in the `CF-Access-Client-ID` header when hitting the `api_url`."}).option(`config-access-client-secret`,{type:`string`,description:"If present, this secret will be passed in the `CF-Access-Client-Secret` header when hitting the `api_url`."}).option(`interval`,{type:`string`,description:"The interval between each posture check with the third-party API. Use `m` for minutes (e.g. `5m`) and `h` for hours (e.g. `12h`)."}).option(`name`,{type:`string`,description:`The name of the device posture integration.`}).option(`type`,{type:`string`,description:`The type of device posture integration.`,choices:[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).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-client-secret`,`config-customer-id`]).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-access-client-secret`,`config-api-url`]).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-access-client-id`,`config-api-url`])}const Yf={command:`create`,describe:`Create posture integration`,builder:Jf,handler:async e=>u({command:`zero-trust devices posture integrations create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({config:{api_url:h(e[`config-api-url`],`config-api-url`,`text`),auth_url:h(e[`config-auth-url`],`config-auth-url`,`text`),client_id:h(e[`config-client-id`],`config-client-id`,`text`),client_secret:h(e[`config-client-secret`],`config-client-secret`,`text`),customer_id:h(e[`config-customer-id`],`config-customer-id`,`text`),client_key:h(e[`config-client-key`],`config-client-key`,`text`),access_client_id:h(e[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:h(e[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),type:e.type}):f(e.body),sensitiveBodyPaths:[[`config`,`client_secret`],[`config`,`client_key`],[`config`,`access_client_secret`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(qf,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.interval===void 0&&(e.interval=await _(`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`).")),e.name===void 0&&(e.name=await _(`name`,`The name of the device posture integration.`)),e.type===void 0&&(e.type=await v(`type`,`The type of device posture integration.`,[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]));let u=m({config:{api_url:h(e[`config-api-url`],`config-api-url`,`text`),auth_url:h(e[`config-auth-url`],`config-auth-url`,`text`),client_id:h(e[`config-client-id`],`config-client-id`,`text`),client_secret:h(e[`config-client-secret`],`config-client-secret`,`text`),customer_id:h(e[`config-customer-id`],`config-customer-id`,`text`),client_key:h(e[`config-client-key`],`config-client-key`,`text`),access_client_id:h(e[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:h(e[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),type:e.type}),d=await l(`Creating`,async()=>n.send(qf,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Xf={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/posture/integration/${t.integration_id}`};function Zf(e){return e.usage(`$0 zero-trust devices posture integrations delete <integration-id>
482
+
483
+ Delete a configured device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qf={command:`delete <integration-id>`,describe:`Delete posture integration`,builder:Zf,handler:async e=>u({command:`zero-trust devices posture integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/integration/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
484
+ `);return}let u=await l(`Deleting`,async()=>n.send(Xf,{account_id:a,integration_id:e[`integration-id`]}));s(u,{successLabel:`Deleted`})})};var $f={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/posture/integration/${t.integration_id}`};function ep(e){return e.usage(`$0 zero-trust devices posture integrations get <integration-id>
485
+
486
+ Fetches details for a single device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tp={command:`get <integration-id>`,describe:`Get posture integration`,builder:ep,handler:async e=>u({command:`zero-trust devices posture integrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/integration/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send($f,{account_id:a,integration_id:e[`integration-id`]}));s(u,{successLabel:`Loaded`})})};var np={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/posture/integration`};function rp(e){return e.usage(`$0 zero-trust devices posture integrations list
487
+
488
+ Fetches the list of device posture integrations for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ip={command:`list`,describe:`List posture integrations`,builder:rp,handler:async e=>u({command:`zero-trust devices posture integrations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices posture integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture/integration`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(np,{account_id:a}));s(u,{successLabel:`Loaded`})})};var ap={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/posture/integration/${t.integration_id}`,body:`json`};function op(e){return e.usage(`$0 zero-trust devices posture integrations update <integration-id>
489
+
490
+ Updates a configured device posture integration.`).positional(`integration-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`config-api-url`,{type:`string`,description:`The Workspace One API URL provided in the Workspace One Admin Dashboard.`}).option(`config-auth-url`,{type:`string`,description:`The Workspace One Authorization URL depending on your region.`}).option(`config-client-id`,{type:`string`,description:`The Workspace One client ID provided in the Workspace One Admin Dashboard.`}).option(`config-client-secret`,{type:`string`,description:`The Workspace One client secret provided in the Workspace One Admin Dashboard.`}).option(`config-customer-id`,{type:`string`,description:`The Crowdstrike customer ID.`}).option(`config-client-key`,{type:`string`,description:`The Uptycs client secret.`}).option(`config-access-client-id`,{type:`string`,description:"If present, this id will be passed in the `CF-Access-Client-ID` header when hitting the `api_url`."}).option(`config-access-client-secret`,{type:`string`,description:"If present, this secret will be passed in the `CF-Access-Client-Secret` header when hitting the `api_url`."}).option(`interval`,{type:`string`,description:"The interval between each posture check with the third-party API. Use `m` for minutes (e.g. `5m`) and `h` for hours (e.g. `12h`)."}).option(`name`,{type:`string`,description:`The name of the device posture integration.`}).option(`type`,{type:`string`,description:`The type of device posture integration.`,choices:[`workspace_one`,`crowdstrike_s2s`,`uptycs`,`intune`,`kolide`,`tanium_s2s`,`sentinelone_s2s`,`custom_s2s`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).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-client-secret`,`config-customer-id`]).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-access-client-secret`,`config-api-url`]).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-access-client-id`,`config-api-url`])}const sp={command:`update <integration-id>`,describe:`Update posture integration`,builder:op,handler:async e=>u({command:`zero-trust devices posture integrations update`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/integration/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({config:{api_url:h(e[`config-api-url`],`config-api-url`,`text`),auth_url:h(e[`config-auth-url`],`config-auth-url`,`text`),client_id:h(e[`config-client-id`],`config-client-id`,`text`),client_secret:h(e[`config-client-secret`],`config-client-secret`,`text`),customer_id:h(e[`config-customer-id`],`config-customer-id`,`text`),client_key:h(e[`config-client-key`],`config-client-key`,`text`),access_client_id:h(e[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:h(e[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),type:e.type}):f(e.body),sensitiveBodyPaths:[[`config`,`client_secret`],[`config`,`client_key`],[`config`,`access_client_secret`]]});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ap,{body:t,account_id:a,integration_id:e[`integration-id`]}));s(r,{successLabel:`Updated`});return}let u=m({config:{api_url:h(e[`config-api-url`],`config-api-url`,`text`),auth_url:h(e[`config-auth-url`],`config-auth-url`,`text`),client_id:h(e[`config-client-id`],`config-client-id`,`text`),client_secret:h(e[`config-client-secret`],`config-client-secret`,`text`),customer_id:h(e[`config-customer-id`],`config-customer-id`,`text`),client_key:h(e[`config-client-key`],`config-client-key`,`text`),access_client_id:h(e[`config-access-client-id`],`config-access-client-id`,`text`),access_client_secret:h(e[`config-access-client-secret`],`config-access-client-secret`,`text`)},interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),type:e.type}),d=await l(`Updating`,async()=>n.send(ap,{body:u,account_id:a,integration_id:e[`integration-id`]}));s(d,{successLabel:`Updated`})})},cp={command:`integrations`,describe:`Operations for devices.posture.integrations`,builder:e=>e.command(Yf).command(Qf).command(tp).command(ip).command(sp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var lp={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/posture`,body:`json`};function up(e){return e.usage(`$0 zero-trust devices posture rules create
491
+
492
+ Creates a new device posture rule.`).option(`description`,{type:`string`,description:`The description of the device posture rule.`}).option(`expiration`,{type:`string`,description:`Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.`}).option(`input-exists`,{type:`boolean`,description:`Whether or not file exists.`}).option(`input-operating-system`,{type:`string`,description:`Operating system.`,choices:[`windows`,`linux`,`mac`,`android`,`ios`,`chromeos`]}).coerce(`input-operating-system`,e=>h(e,`input-operating-system`,`text`)).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:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-operator`,e=>h(e,`input-operator`,`text`)).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`]}).coerce(`input-compliance-status`,e=>h(e,`input-compliance-status`,`text`)).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`]}).coerce(`input-state`,e=>h(e,`input-state`,`text`)).option(`input-version-operator`,{type:`string`,description:`Version Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-version-operator`,e=>h(e,`input-version-operator`,`text`)).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:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-count-operator`,e=>h(e,`input-count-operator`,`text`)).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`]}).coerce(`input-risk-level`,e=>h(e,`input-risk-level`,`text`)).option(`input-score-operator`,{type:`string`,description:`Score Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-score-operator`,e=>h(e,`input-score-operator`,`text`)).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`]}).coerce(`input-network-status`,e=>h(e,`input-network-status`,`text`)).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`]}).coerce(`input-operational-state`,e=>h(e,`input-operational-state`,`text`)).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`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`input-exists`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operating-system`,/* @__PURE__ */ `input-id.input-check-disks.input-require-all.input-certificate-id.input-cn.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-operator.input-os.input-overall.input-sensor-config.input-state.input-version.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-path`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sha256`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-thumbprint`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-id`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-domain`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operator`,[`input-exists`,`input-path`,`input-sha256`,`input-thumbprint`,`input-operating-system`,`input-id`,`input-domain`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`,`input-compliance-status`,`input-connection-id`,`input-auth-state`,`input-count-operator`,`input-issue-count`]).conflicts(`input-os-distro-name`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-distro-revision`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-version-extra`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-version`,[`input-operating-system`,`input-operator`]).conflicts(`input-enabled`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-enabled`,[`input-operating-system`]).conflicts(`input-check-disks`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-require-all`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-certificate-id`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-cn`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-cn`,[`input-certificate-id`]).conflicts(`input-check-private-key`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-check-private-key`,[`input-certificate-id`,`input-operating-system`]).conflicts(`input-extended-key-usage`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-paths`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-trust-stores`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-subject-alternative-names`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-update-window-days`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-compliance-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-connection-id`,[`input-exists`,`input-operating-system`,`input-path`,`input-sha256`,`input-thumbprint`,`input-id`,`input-domain`,`input-operator`,`input-os-distro-name`,`input-os-distro-revision`,`input-os-version-extra`,`input-version`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`]).conflicts(`input-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-overall`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sensor-config`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-auth-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-count-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-issue-count`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-eid-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-risk-level`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-score-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-total-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-active-threats`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-infected`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-is-active`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-network-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-operational-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state`.split(`.`)).implies(`input-score`,[`input-connection-id`,`input-operator`])}const dp={command:`create`,describe:`Create posture rule`,builder:up,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),expiration:h(e.expiration,`expiration`,`text`),input:{exists:e[`input-exists`],operating_system:e[`input-operating-system`],path:h(e[`input-path`],`input-path`,`text`),sha256:h(e[`input-sha256`],`input-sha256`,`text`),thumbprint:h(e[`input-thumbprint`],`input-thumbprint`,`text`),id:h(e[`input-id`],`input-id`,`text`),domain:h(e[`input-domain`],`input-domain`,`text`),operator:e[`input-operator`],os_distro_name:h(e[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:h(e[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:h(e[`input-os-version-extra`],`input-os-version-extra`,`text`),version:h(e[`input-version`],`input-version`,`text`),enabled:e[`input-enabled`],checkDisks:e[`input-check-disks`],requireAll:e[`input-require-all`],certificate_id:h(e[`input-certificate-id`],`input-certificate-id`,`text`),cn:h(e[`input-cn`],`input-cn`,`text`),check_private_key:e[`input-check-private-key`],extended_key_usage:e[`input-extended-key-usage`],locations:{paths:e[`input-locations-paths`],trust_stores:e[`input-locations-trust-stores`]},subject_alternative_names:e[`input-subject-alternative-names`],update_window_days:e[`input-update-window-days`],compliance_status:e[`input-compliance-status`],connection_id:h(e[`input-connection-id`],`input-connection-id`,`text`),last_seen:h(e[`input-last-seen`],`input-last-seen`,`text`),os:h(e[`input-os`],`input-os`,`text`),overall:h(e[`input-overall`],`input-overall`,`text`),sensor_config:h(e[`input-sensor-config`],`input-sensor-config`,`text`),state:e[`input-state`],versionOperator:e[`input-version-operator`],auth_state:e[`input-auth-state`],countOperator:e[`input-count-operator`],issue_count:h(e[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:h(e[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:e[`input-risk-level`],scoreOperator:e[`input-score-operator`],total_score:e[`input-total-score`],active_threats:e[`input-active-threats`],infected:e[`input-infected`],is_active:e[`input-is-active`],network_status:e[`input-network-status`],operational_state:e[`input-operational-state`],score:e[`input-score`]},match:p(e.match,`match`),name:h(e.name,`name`,`text`),schedule:h(e.schedule,`schedule`,`text`),type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(lp,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the device posture rule.`)),e.type===void 0&&(e.type=await v(`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=m({description:h(e.description,`description`,`text`),expiration:h(e.expiration,`expiration`,`text`),input:{exists:e[`input-exists`],operating_system:e[`input-operating-system`],path:h(e[`input-path`],`input-path`,`text`),sha256:h(e[`input-sha256`],`input-sha256`,`text`),thumbprint:h(e[`input-thumbprint`],`input-thumbprint`,`text`),id:h(e[`input-id`],`input-id`,`text`),domain:h(e[`input-domain`],`input-domain`,`text`),operator:e[`input-operator`],os_distro_name:h(e[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:h(e[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:h(e[`input-os-version-extra`],`input-os-version-extra`,`text`),version:h(e[`input-version`],`input-version`,`text`),enabled:e[`input-enabled`],checkDisks:e[`input-check-disks`],requireAll:e[`input-require-all`],certificate_id:h(e[`input-certificate-id`],`input-certificate-id`,`text`),cn:h(e[`input-cn`],`input-cn`,`text`),check_private_key:e[`input-check-private-key`],extended_key_usage:e[`input-extended-key-usage`],locations:{paths:e[`input-locations-paths`],trust_stores:e[`input-locations-trust-stores`]},subject_alternative_names:e[`input-subject-alternative-names`],update_window_days:e[`input-update-window-days`],compliance_status:e[`input-compliance-status`],connection_id:h(e[`input-connection-id`],`input-connection-id`,`text`),last_seen:h(e[`input-last-seen`],`input-last-seen`,`text`),os:h(e[`input-os`],`input-os`,`text`),overall:h(e[`input-overall`],`input-overall`,`text`),sensor_config:h(e[`input-sensor-config`],`input-sensor-config`,`text`),state:e[`input-state`],versionOperator:e[`input-version-operator`],auth_state:e[`input-auth-state`],countOperator:e[`input-count-operator`],issue_count:h(e[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:h(e[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:e[`input-risk-level`],scoreOperator:e[`input-score-operator`],total_score:e[`input-total-score`],active_threats:e[`input-active-threats`],infected:e[`input-infected`],is_active:e[`input-is-active`],network_status:e[`input-network-status`],operational_state:e[`input-operational-state`],score:e[`input-score`]},match:p(e.match,`match`),name:h(e.name,`name`,`text`),schedule:h(e.schedule,`schedule`,`text`),type:e.type}),d=await l(`Creating`,async()=>n.send(lp,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var fp={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/posture/${t.rule_id}`};function pp(e){return e.usage(`$0 zero-trust devices posture rules delete <rule-id>
493
+
494
+ Deletes a device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const mp={command:`delete <rule-id>`,describe:`Delete posture rule`,builder:pp,handler:async e=>u({command:`zero-trust devices posture rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
495
+ `);return}let u=await l(`Deleting`,async()=>n.send(fp,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Deleted`})})};var hp={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/posture/${t.rule_id}`};function gp(e){return e.usage(`$0 zero-trust devices posture rules get <rule-id>
496
+
497
+ Fetches a single device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _p={command:`get <rule-id>`,describe:`Get posture rule`,builder:gp,handler:async e=>u({command:`zero-trust devices posture rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(hp,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Loaded`})})};var vp={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/posture`};function yp(e){return e.usage(`$0 zero-trust devices posture rules list
498
+
499
+ Fetches device posture rules for a Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bp={command:`list`,describe:`List posture rules`,builder:yp,handler:async e=>u({command:`zero-trust devices posture rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices posture rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/posture`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(vp,{account_id:a}));s(u,{successLabel:`Loaded`})})};var xp={method:`PUT`,path:t=>e`/accounts/${t.account_id}/devices/posture/${t.rule_id}`,body:`json`};function Sp(e){return e.usage(`$0 zero-trust devices posture rules update <rule-id>
500
+
501
+ Updates a device posture rule.`).positional(`rule-id`,{type:`string`,description:`API UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`The description of the device posture rule.`}).option(`expiration`,{type:`string`,description:`Sets the expiration time for a posture check result. If empty, the result remains valid until it is overwritten by new data from the WARP client.`}).option(`input-exists`,{type:`boolean`,description:`Whether or not file exists.`}).option(`input-operating-system`,{type:`string`,description:`Operating system.`,choices:[`windows`,`linux`,`mac`,`android`,`ios`,`chromeos`]}).coerce(`input-operating-system`,e=>h(e,`input-operating-system`,`text`)).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:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-operator`,e=>h(e,`input-operator`,`text`)).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`]}).coerce(`input-compliance-status`,e=>h(e,`input-compliance-status`,`text`)).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`]}).coerce(`input-state`,e=>h(e,`input-state`,`text`)).option(`input-version-operator`,{type:`string`,description:`Version Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-version-operator`,e=>h(e,`input-version-operator`,`text`)).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:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-count-operator`,e=>h(e,`input-count-operator`,`text`)).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`]}).coerce(`input-risk-level`,e=>h(e,`input-risk-level`,`text`)).option(`input-score-operator`,{type:`string`,description:`Score Operator.`,choices:[`<`,`<=`,`>`,`>=`,`==`]}).coerce(`input-score-operator`,e=>h(e,`input-score-operator`,`text`)).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`]}).coerce(`input-network-status`,e=>h(e,`input-network-status`,`text`)).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`]}).coerce(`input-operational-state`,e=>h(e,`input-operational-state`,`text`)).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`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`input-exists`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operating-system`,/* @__PURE__ */ `input-id.input-check-disks.input-require-all.input-certificate-id.input-cn.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-operator.input-os.input-overall.input-sensor-config.input-state.input-version.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-path`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sha256`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-thumbprint`,/* @__PURE__ */ `input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-id`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-domain`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-operator`,[`input-exists`,`input-path`,`input-sha256`,`input-thumbprint`,`input-operating-system`,`input-id`,`input-domain`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`,`input-compliance-status`,`input-connection-id`,`input-auth-state`,`input-count-operator`,`input-issue-count`]).conflicts(`input-os-distro-name`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-distro-revision`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os-version-extra`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-operating-system.input-id.input-domain.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-version`,[`input-operating-system`,`input-operator`]).conflicts(`input-enabled`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-enabled`,[`input-operating-system`]).conflicts(`input-check-disks`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-require-all`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-certificate-id`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-cn`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-cn`,[`input-certificate-id`]).conflicts(`input-check-private-key`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).implies(`input-check-private-key`,[`input-certificate-id`,`input-operating-system`]).conflicts(`input-extended-key-usage`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-paths`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-locations-trust-stores`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-subject-alternative-names`,/* @__PURE__ */ `input-exists.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-update-window-days.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-update-window-days`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-compliance-status.input-connection-id.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-compliance-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-connection-id`,[`input-exists`,`input-operating-system`,`input-path`,`input-sha256`,`input-thumbprint`,`input-id`,`input-domain`,`input-operator`,`input-os-distro-name`,`input-os-distro-revision`,`input-os-version-extra`,`input-version`,`input-enabled`,`input-check-disks`,`input-require-all`,`input-certificate-id`,`input-cn`,`input-check-private-key`,`input-extended-key-usage`,`input-locations-paths`,`input-locations-trust-stores`,`input-subject-alternative-names`,`input-update-window-days`]).conflicts(`input-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-os`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-overall`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-sensor-config`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-version-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-auth-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-count-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-issue-count`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-operator.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-eid-last-seen`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-risk-level`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-score-operator`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-total-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state.input-score`.split(`.`)).conflicts(`input-active-threats`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-infected`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-is-active`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-network-status`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-operational-state`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-score`.split(`.`)).conflicts(`input-score`,/* @__PURE__ */ `input-exists.input-operating-system.input-path.input-sha256.input-thumbprint.input-id.input-domain.input-os-distro-name.input-os-distro-revision.input-os-version-extra.input-version.input-enabled.input-check-disks.input-require-all.input-certificate-id.input-cn.input-check-private-key.input-extended-key-usage.input-locations-paths.input-locations-trust-stores.input-subject-alternative-names.input-update-window-days.input-compliance-status.input-last-seen.input-os.input-overall.input-sensor-config.input-state.input-version-operator.input-auth-state.input-count-operator.input-issue-count.input-eid-last-seen.input-risk-level.input-score-operator.input-total-score.input-active-threats.input-infected.input-is-active.input-network-status.input-operational-state`.split(`.`)).implies(`input-score`,[`input-connection-id`,`input-operator`])}const Cp={command:`update <rule-id>`,describe:`Update posture rule`,builder:Sp,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices posture rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/posture/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),expiration:h(e.expiration,`expiration`,`text`),input:{exists:e[`input-exists`],operating_system:e[`input-operating-system`],path:h(e[`input-path`],`input-path`,`text`),sha256:h(e[`input-sha256`],`input-sha256`,`text`),thumbprint:h(e[`input-thumbprint`],`input-thumbprint`,`text`),id:h(e[`input-id`],`input-id`,`text`),domain:h(e[`input-domain`],`input-domain`,`text`),operator:e[`input-operator`],os_distro_name:h(e[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:h(e[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:h(e[`input-os-version-extra`],`input-os-version-extra`,`text`),version:h(e[`input-version`],`input-version`,`text`),enabled:e[`input-enabled`],checkDisks:e[`input-check-disks`],requireAll:e[`input-require-all`],certificate_id:h(e[`input-certificate-id`],`input-certificate-id`,`text`),cn:h(e[`input-cn`],`input-cn`,`text`),check_private_key:e[`input-check-private-key`],extended_key_usage:e[`input-extended-key-usage`],locations:{paths:e[`input-locations-paths`],trust_stores:e[`input-locations-trust-stores`]},subject_alternative_names:e[`input-subject-alternative-names`],update_window_days:e[`input-update-window-days`],compliance_status:e[`input-compliance-status`],connection_id:h(e[`input-connection-id`],`input-connection-id`,`text`),last_seen:h(e[`input-last-seen`],`input-last-seen`,`text`),os:h(e[`input-os`],`input-os`,`text`),overall:h(e[`input-overall`],`input-overall`,`text`),sensor_config:h(e[`input-sensor-config`],`input-sensor-config`,`text`),state:e[`input-state`],versionOperator:e[`input-version-operator`],auth_state:e[`input-auth-state`],countOperator:e[`input-count-operator`],issue_count:h(e[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:h(e[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:e[`input-risk-level`],scoreOperator:e[`input-score-operator`],total_score:e[`input-total-score`],active_threats:e[`input-active-threats`],infected:e[`input-infected`],is_active:e[`input-is-active`],network_status:e[`input-network-status`],operational_state:e[`input-operational-state`],score:e[`input-score`]},match:p(e.match,`match`),name:h(e.name,`name`,`text`),schedule:h(e.schedule,`schedule`,`text`),type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(xp,{body:t,account_id:a,rule_id:e[`rule-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the device posture rule.`)),e.type===void 0&&(e.type=await v(`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=m({description:h(e.description,`description`,`text`),expiration:h(e.expiration,`expiration`,`text`),input:{exists:e[`input-exists`],operating_system:e[`input-operating-system`],path:h(e[`input-path`],`input-path`,`text`),sha256:h(e[`input-sha256`],`input-sha256`,`text`),thumbprint:h(e[`input-thumbprint`],`input-thumbprint`,`text`),id:h(e[`input-id`],`input-id`,`text`),domain:h(e[`input-domain`],`input-domain`,`text`),operator:e[`input-operator`],os_distro_name:h(e[`input-os-distro-name`],`input-os-distro-name`,`text`),os_distro_revision:h(e[`input-os-distro-revision`],`input-os-distro-revision`,`text`),os_version_extra:h(e[`input-os-version-extra`],`input-os-version-extra`,`text`),version:h(e[`input-version`],`input-version`,`text`),enabled:e[`input-enabled`],checkDisks:e[`input-check-disks`],requireAll:e[`input-require-all`],certificate_id:h(e[`input-certificate-id`],`input-certificate-id`,`text`),cn:h(e[`input-cn`],`input-cn`,`text`),check_private_key:e[`input-check-private-key`],extended_key_usage:e[`input-extended-key-usage`],locations:{paths:e[`input-locations-paths`],trust_stores:e[`input-locations-trust-stores`]},subject_alternative_names:e[`input-subject-alternative-names`],update_window_days:e[`input-update-window-days`],compliance_status:e[`input-compliance-status`],connection_id:h(e[`input-connection-id`],`input-connection-id`,`text`),last_seen:h(e[`input-last-seen`],`input-last-seen`,`text`),os:h(e[`input-os`],`input-os`,`text`),overall:h(e[`input-overall`],`input-overall`,`text`),sensor_config:h(e[`input-sensor-config`],`input-sensor-config`,`text`),state:e[`input-state`],versionOperator:e[`input-version-operator`],auth_state:e[`input-auth-state`],countOperator:e[`input-count-operator`],issue_count:h(e[`input-issue-count`],`input-issue-count`,`text`),eid_last_seen:h(e[`input-eid-last-seen`],`input-eid-last-seen`,`text`),risk_level:e[`input-risk-level`],scoreOperator:e[`input-score-operator`],total_score:e[`input-total-score`],active_threats:e[`input-active-threats`],infected:e[`input-infected`],is_active:e[`input-is-active`],network_status:e[`input-network-status`],operational_state:e[`input-operational-state`],score:e[`input-score`]},match:p(e.match,`match`),name:h(e.name,`name`,`text`),schedule:h(e.schedule,`schedule`,`text`),type:e.type}),d=await l(`Updating`,async()=>n.send(xp,{body:u,account_id:a,rule_id:e[`rule-id`]}));s(d,{successLabel:`Updated`})})},wp={command:`rules`,describe:`Operations for devices.posture.rules`,builder:e=>e.command(dp).command(mp).command(_p).command(bp).command(Cp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tp={command:`posture`,describe:`Operations for devices.posture`,builder:e=>e.command(cp).command(wp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ep={method:`POST`,path:t=>e`/accounts/${t.account_id}/devices/policy`,body:`json`};function Dp(e){return e.usage(`$0 zero-trust devices profiles custom create
502
+
503
+ Creates a device settings profile to be applied to certain devices matching the criteria.`).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`,default:!1}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`,default:!1}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`,default:!0}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`,default:0}).option(`browser-extension-config-proxy-control`,{type:`string`,description:`Whether the user may disable the browser extension proxy.`,choices:[`unlocked`,`locked`]}).coerce(`browser-extension-config-proxy-control`,e=>h(e,`browser-extension-config-proxy-control`,`text`)).option(`browser-extension-config-proxy-enabled`,{type:`boolean`,description:`Whether the browser extension proxy is active.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`,default:180}).option(`default`,{type:`boolean`,description:`Whether the policy is the account default. WARP group profiles cannot set this field.`,default:!1}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`.",default:!1}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Whether the policy will be applied to matching devices.`,default:!0}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`,default:!1}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match devices. Available values: "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.service_token_uuid", "identity.saml_attributes", "network", "os.name", "os.version", "device.tags".`}).option(`name`,{type:`string`,description:`The name of the device settings profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.`}).option(`profile-type`,{type:`string`,description:`The client type to which the device settings profile applies. This field is set when the profile is created and cannot be changed.`,choices:[`warp`,`browser_extension`],default:`warp`}).coerce(`profile-type`,e=>h(e,`profile-type`,`text`)).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 Op={command:`create`,describe:`Create a device settings profile`,builder:Dp,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],browser_extension_config:{proxy_control:e[`browser-extension-config-proxy-control`],proxy_enabled:e[`browser-extension-config-proxy-enabled`]},captive_portal:e[`captive-portal`],default:e.default,disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),enabled:e.enabled,exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,profile_type:e[`profile-type`],register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Ep,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name of the device settings profile.`));let u=m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],browser_extension_config:{proxy_control:e[`browser-extension-config-proxy-control`],proxy_enabled:e[`browser-extension-config-proxy-enabled`]},captive_portal:e[`captive-portal`],default:e.default,disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),enabled:e.enabled,exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,profile_type:e[`profile-type`],register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),d=await l(`Creating`,async()=>n.send(Ep,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var kp={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/policy/${t.policy_id}`};function Ap(e){return e.usage(`$0 zero-trust devices profiles custom delete <policy-id>
504
+
505
+ Deletes a device settings profile and fetches a list of the remaining profiles for an account.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const jp={command:`delete <policy-id>`,describe:`Delete a device settings profile`,builder:Ap,handler:async e=>u({command:`zero-trust devices profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/policy/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
506
+ `);return}let u=await l(`Deleting`,async()=>n.send(kp,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Deleted`})})};var Mp={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/policy/${t.policy_id}`};function Np(e){return e.usage(`$0 zero-trust devices profiles custom get <policy-id>
507
+
508
+ Fetches a device settings profile by ID.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pp={command:`get <policy-id>`,describe:`Get device settings profile by ID`,builder:Np,handler:async e=>u({command:`zero-trust devices profiles custom get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/policy/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Mp,{account_id:a,policy_id:e[`policy-id`]}));s(u,{successLabel:`Loaded`})})};var Fp={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/policies`,query:[`profile_type`]};function Ip(e){return e.usage(`$0 zero-trust devices profiles custom list
509
+
510
+ Fetches a list of the device settings profiles for an account.`).option(`profile-type`,{type:`string`,description:`Filter profiles by client type. When omitted, only WARP profiles are returned.`,choices:[`warp`,`browser_extension`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lp={command:`list`,describe:`List device settings profiles`,builder:Ip,handler:async e=>u({command:`zero-trust devices profiles custom list`,classification:{safeFlags:[`profile-type`,`dry-run`]}},e,async()=>{let n={profile_type:e[`profile-type`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policies`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Fp,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Rp={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/policy/${t.policy_id}`,body:`json`};function zp(e){return e.usage(`$0 zero-trust devices profiles custom update <policy-id>
511
+
512
+ Updates a configured device settings profile.`).positional(`policy-id`,{type:`string`,description:`Policy ID`,demandOption:!0}).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`}).option(`browser-extension-config-proxy-control`,{type:`string`,description:`Whether the user may disable the browser extension proxy.`,choices:[`unlocked`,`locked`]}).coerce(`browser-extension-config-proxy-control`,e=>h(e,`browser-extension-config-proxy-control`,`text`)).option(`browser-extension-config-proxy-enabled`,{type:`boolean`,description:`Whether the browser extension proxy is active.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`}).option(`default`,{type:`boolean`,description:`Whether the policy is the account default. WARP group profiles cannot set this field.`}).option(`description`,{type:`string`,description:`A description of the policy.`}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`."}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`enabled`,{type:`boolean`,description:`Whether the policy will be applied to matching devices.`}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`match`,{type:`string`,description:`The wirefilter expression to match devices. Available values: "identity.email", "identity.groups.id", "identity.groups.name", "identity.groups.email", "identity.service_token_uuid", "identity.saml_attributes", "network", "os.name", "os.version", "device.tags".`}).option(`name`,{type:`string`,description:`The name of the device settings profile.`}).option(`precedence`,{type:`number`,description:`The precedence of the policy. Lower values indicate higher precedence. Policies will be evaluated in ascending order of this field.`}).option(`register-interface-ip-with-dns`,{type:`boolean`,description:`Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.`}).option(`sccm-vpn-boundary-support`,{type:`boolean`,description:`Determines whether the WARP client indicates to SCCM that it is inside a VPN boundary. (Windows only).`}).option(`service-mode-v2-mode`,{type:`string`,description:`The mode to run the WARP client under.`}).option(`service-mode-v2-port`,{type:`number`,description:`The port number when used with proxy mode.`}).option(`support-url`,{type:`string`,description:`The URL to launch when the Send Feedback button is clicked.`}).option(`switch-locked`,{type:`boolean`,description:`Whether to allow the user to turn off the WARP switch and disconnect the client.`}).option(`tunnel-protocol`,{type:`string`,description:`Determines which tunnel protocol to use.`}).option(`uninstall-protection`,{type:`boolean`,description:`Determines whether uninstalling the WARP client requires an override code. (Windows only).`}).option(`virtual-networks-allowed`,{type:`string`,array:!0,description:`List of virtual network IDs the device is allowed to access. When virtual_networks is set, at least one entry is required.`}).option(`virtual-networks-default`,{type:`string`,description:"The default virtual network ID. Must be included in the `allowed` list."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].some(t=>e[t]!==void 0)){let t=[`browser-extension-config-proxy-control`,`browser-extension-config-proxy-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --browser_extension_config-* flag is set`)}return!0}).check(e=>{if([`global-acceleration-api-endpoints`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].some(t=>e[t]!==void 0)){let t=[`global-acceleration-api-endpoints`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --global_acceleration-* flag is set`)}return!0}).check(e=>{if([`virtual-networks-allowed`,`virtual-networks-default`].some(t=>e[t]!==void 0)){let t=[`virtual-networks-allowed`,`virtual-networks-default`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --virtual_networks-* flag is set`)}return!0})}const Bp={command:`update <policy-id>`,describe:`Update a device settings profile`,builder:zp,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices profiles custom update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/policy/${e[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(e[`policy-id`]))}`,pathParams:{"policy-id":String(e[`policy-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],browser_extension_config:{proxy_control:e[`browser-extension-config-proxy-control`],proxy_enabled:e[`browser-extension-config-proxy-enabled`]},captive_portal:e[`captive-portal`],default:e.default,description:h(e.description,`description`,`text`),disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),enabled:e.enabled,exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Rp,{body:t,account_id:a,policy_id:e[`policy-id`]}));s(r,{successLabel:`Updated`});return}let u=m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],browser_extension_config:{proxy_control:e[`browser-extension-config-proxy-control`],proxy_enabled:e[`browser-extension-config-proxy-enabled`]},captive_portal:e[`captive-portal`],default:e.default,description:h(e.description,`description`,`text`),disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),enabled:e.enabled,exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),d=await l(`Updating`,async()=>n.send(Rp,{body:u,account_id:a,policy_id:e[`policy-id`]}));s(d,{successLabel:`Updated`})})},Vp={command:`custom`,describe:`Operations for devices.profiles.custom`,builder:e=>e.command(Op).command(jp).command(Pp).command(Lp).command(Bp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Hp={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/policy`};function Up(e){return e.usage(`$0 zero-trust devices profiles default get
513
+
514
+ Fetches the default device settings profile for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wp={command:`get`,describe:`Get the default device settings profile`,builder:Up,handler:async e=>u({command:`zero-trust devices profiles default get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices profiles default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Hp,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Gp={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/policy`,body:`json`};function Kp(e){return e.usage(`$0 zero-trust devices profiles default update
515
+
516
+ Updates the default device settings profile for an account.`).option(`allow-mode-switch`,{type:`boolean`,description:`Whether to allow the user to switch WARP between modes.`}).option(`allow-updates`,{type:`boolean`,description:`Whether to receive update notifications when a new version of the client is available.`}).option(`allowed-to-leave`,{type:`boolean`,description:`Whether to allow devices to leave the organization.`}).option(`auto-connect`,{type:`number`,description:`The amount of time in seconds to reconnect after having been disabled.`}).option(`captive-portal`,{type:`number`,description:`Turn on the captive portal after the specified amount of time.`}).option(`disable-auto-fallback`,{type:`boolean`,description:"If the `dns_server` field of a fallback domain is not present, the client will fall back to a best guess of the default/system DNS resolvers unless this policy option is set to `true`."}).option(`dns-search-suffixes`,{type:`string`,description:`List of DNS search suffixes to apply to clients. Suffixes are evaluated in order. Use an empty array to clear. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude`,{type:`string`,description:`List of routes excluded in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`exclude-office-ips`,{type:`boolean`,description:`Whether to add Microsoft IPs to Split Tunnel exclusions.`}).option(`global-acceleration-api-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the API endpoints.`}).option(`global-acceleration-autoswitch`,{type:`boolean`,description:`Automatically switch Global Acceleration regions based on device location. Defaults to false when not provided.`}).option(`global-acceleration-enabled`,{type:`boolean`,description:`Global acceleration settings are used only when "enabled".`}).option(`global-acceleration-masque-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the MASQUE tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`global-acceleration-wireguard-endpoints`,{type:`string`,array:!0,description:`IP:port entries for the WireGuard tunnel endpoints. Either wireguard_endpoints or masque_endpoints must be provided.`}).option(`include`,{type:`string`,description:`List of routes included in the WARP client's tunnel. Both 'exclude' and 'include' cannot be set in the same request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`lan-allow-minutes`,{type:`number`,description:`The amount of time in minutes a user is allowed access to their LAN. A value of 0 will allow LAN access until the next WARP reconnection, such as a reboot or a laptop waking from sleep. Note that this field is omitted from the response if null or unset.`}).option(`lan-allow-subnet-size`,{type:`number`,description:`The size of the subnet for the local access network. Note that this field is omitted from the response if null or unset.`}).option(`register-interface-ip-with-dns`,{type:`boolean`,description:`Determines if the operating system will register WARP's local interface IP with your on-premises DNS server.`}).option(`sccm-vpn-boundary-support`,{type:`boolean`,description:`Determines whether the WARP client indicates to SCCM that it is inside a VPN boundary. (Windows only).`}).option(`service-mode-v2-mode`,{type:`string`,description:`The mode to run the WARP client under.`}).option(`service-mode-v2-port`,{type:`number`,description:`The port number when used with proxy mode.`}).option(`support-url`,{type:`string`,description:`The URL to launch when the Send Feedback button is clicked.`}).option(`switch-locked`,{type:`boolean`,description:`Whether to allow the user to turn off the WARP switch and disconnect the client.`}).option(`tunnel-protocol`,{type:`string`,description:`Determines which tunnel protocol to use.`}).option(`uninstall-protection`,{type:`boolean`,description:`Determines whether uninstalling the WARP client requires an override code. (Windows only).`}).option(`virtual-networks-allowed`,{type:`string`,array:!0,description:`List of virtual network IDs the device is allowed to access. When virtual_networks is set, at least one entry is required.`}).option(`virtual-networks-default`,{type:`string`,description:"The default virtual network ID. Must be included in the `allowed` list."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`global-acceleration-api-endpoints`,`global-acceleration-autoswitch`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].some(t=>e[t]!==void 0)){let t=[`global-acceleration-api-endpoints`,`global-acceleration-enabled`,`global-acceleration-masque-endpoints`,`global-acceleration-wireguard-endpoints`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --global_acceleration-* flag is set`)}return!0}).check(e=>{if([`virtual-networks-allowed`,`virtual-networks-default`].some(t=>e[t]!==void 0)){let t=[`virtual-networks-allowed`,`virtual-networks-default`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --virtual_networks-* flag is set`)}return!0})}const qp={command:`update`,describe:`Update the default device settings profile`,builder:Kp,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices profiles default update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/policy`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],captive_portal:e[`captive-portal`],disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Gp,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({allow_mode_switch:e[`allow-mode-switch`],allow_updates:e[`allow-updates`],allowed_to_leave:e[`allowed-to-leave`],auto_connect:e[`auto-connect`],captive_portal:e[`captive-portal`],disable_auto_fallback:e[`disable-auto-fallback`],dns_search_suffixes:p(e[`dns-search-suffixes`],`dns-search-suffixes`),exclude:p(e.exclude,`exclude`),exclude_office_ips:e[`exclude-office-ips`],global_acceleration:{api_endpoints:e[`global-acceleration-api-endpoints`],autoswitch:e[`global-acceleration-autoswitch`],enabled:e[`global-acceleration-enabled`],masque_endpoints:e[`global-acceleration-masque-endpoints`],wireguard_endpoints:e[`global-acceleration-wireguard-endpoints`]},include:p(e.include,`include`),lan_allow_minutes:e[`lan-allow-minutes`],lan_allow_subnet_size:e[`lan-allow-subnet-size`],register_interface_ip_with_dns:e[`register-interface-ip-with-dns`],sccm_vpn_boundary_support:e[`sccm-vpn-boundary-support`],service_mode_v2:{mode:h(e[`service-mode-v2-mode`],`service-mode-v2-mode`,`text`),port:e[`service-mode-v2-port`]},support_url:h(e[`support-url`],`support-url`,`text`),switch_locked:e[`switch-locked`],tunnel_protocol:h(e[`tunnel-protocol`],`tunnel-protocol`,`text`),uninstall_protection:e[`uninstall-protection`],virtual_networks:{allowed:e[`virtual-networks-allowed`],default:h(e[`virtual-networks-default`],`virtual-networks-default`,`text`)}}),d=await l(`Updating`,async()=>n.send(Gp,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},Jp={command:`default`,describe:`Operations for devices.profiles.default`,builder:e=>e.command(Wp).command(qp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Yp={command:`profiles`,describe:`Operations for devices.profiles`,builder:e=>e.command(Vp).command(Jp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Xp={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/registrations`,query:[`id`]};function Zp(e){return e.usage(`$0 zero-trust devices registrations bulk-delete
517
+
518
+ Deletes a list of WARP registrations.`).option(`id`,{type:`string`,description:`A list of registration IDs to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qp={command:`bulk-delete`,describe:`Delete registrations`,builder:Zp,handler:async e=>u({command:`zero-trust devices registrations bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={id:e.id};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices registrations bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,!await y({force:!!e.force})){process.stderr.write(`Aborted.
519
+ `);return}let d=await l(`Deleting`,async()=>a.send(Xp,{account_id:u,...n}));s(d,{successLabel:`Deleted`})})};var $p={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/registrations/${t.registration_id}`};function em(e){return e.usage(`$0 zero-trust devices registrations delete <registration-id>
520
+
521
+ Deletes a WARP registration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tm={command:`delete <registration-id>`,describe:`Delete registration`,builder:em,handler:async e=>u({command:`zero-trust devices registrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices registrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/registrations/${e[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(e[`registration-id`]))}`,pathParams:{"registration-id":String(e[`registration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
522
+ `);return}let u=await l(`Deleting`,async()=>n.send($p,{account_id:a,registration_id:e[`registration-id`]}));s(u,{successLabel:`Deleted`})})};var nm={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/registrations/${t.registration_id}`,query:[`include`]};function rm(e){return e.usage(`$0 zero-trust devices registrations get <registration-id>
523
+
524
+ Fetches a single WARP registration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the registration response. Supported values are: "policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const im={command:`get <registration-id>`,describe:`Get registration`,builder:rm,handler:async e=>u({command:`zero-trust devices registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={include:e.include};if(e.dryRun){let t=await i();c({command:`cf zero-trust devices registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/registrations/${e[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(e[`registration-id`]))}`,pathParams:{"registration-id":String(e[`registration-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(nm,{account_id:u,registration_id:e[`registration-id`],...n}));s(d,{successLabel:`Loaded`})})};var am={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/registrations`,query:[`user.id`,`seen_after`,`seen_before`,`status`,`registration_type`,`per_page`,`search`,`sort_by`,`sort_order`,`cursor`,`id`,`device.id`,`policy.id`,`include`],joined:[`seen_after`,`seen_before`,`status`,`registration_type`,`per_page`,`search`,`sort_by`,`sort_order`,`cursor`,`device.id`,`policy.id`]};function om(e){return e.usage(`$0 zero-trust devices registrations list
525
+
526
+ Lists WARP registrations.`).option(`user-id`,{type:`string`,description:`Filter by user ID.`}).option(`seen-after`,{type:`string`,description:`Filter by the last_seen timestamp - returns only registrations last seen after this timestamp.`}).option(`seen-before`,{type:`string`,description:`Filter by the last_seen timestamp - returns only registrations last seen before this timestamp.`}).option(`status`,{type:`string`,description:`Filter by registration status. Defaults to 'active'.`,choices:[`active`,`all`,`revoked`]}).option(`registration-type`,{type:`string`,description:`Filter by registration client type.`,choices:[`warp`,`browser_extension`]}).option(`per-page`,{type:`number`,description:`The maximum number of devices to return in a single response.`}).option(`search`,{type:`string`,description:`Filter by registration details.`}).option(`sort-by`,{type:`string`,description:`The registration field to order results by.`,choices:[`id`,`user.name`,`user.email`,`last_seen_at`,`created_at`]}).option(`sort-order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Opaque token indicating the starting position when requesting the next set of records. A cursor value can be obtained from the result_info.cursor field in the response.`}).option(`id`,{type:`string`,description:`Filter by registration ID.`}).option(`device-id`,{type:`string`,description:`Filter by WARP device ID.`}).option(`policy-id`,{type:`string`,description:`Filter by the ID of the device settings profile assigned to the registration.`}).option(`include`,{type:`string`,description:`Comma-separated list of additional information that should be included in the registration response. Supported values are: "policy".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sm={command:`list`,describe:`List registrations`,builder:om,handler:async e=>u({command:`zero-trust devices registrations list`,classification:{safeFlags:[`status`,`registration-type`,`sort-by`,`sort-order`,`dry-run`]}},e,async()=>{let n={"user.id":e[`user-id`],seen_after:e[`seen-after`],seen_before:e[`seen-before`],status:e.status,registration_type:e[`registration-type`],per_page:e[`per-page`],search:e.search,sort_by:e[`sort-by`],sort_order:e[`sort-order`],cursor:e.cursor,id:e.id,"device.id":e[`device-id`],"policy.id":e[`policy-id`],include:e.include};if(e.dryRun){let e=await i();c({command:`cf zero-trust devices registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/registrations`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(am,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var cm={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/registrations/${t.registration_id}/override_codes`};function lm(e){return e.usage(`$0 zero-trust devices registrations override-codes get <registration-id>
527
+
528
+ Fetches one-time use admin override codes for a registration. This relies on the **Admin Override** setting being enabled in your device configuration.`).positional(`registration-id`,{type:`string`,description:`Registration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const um={command:`get <registration-id>`,describe:`Get override codes`,builder:lm,handler:async e=>u({command:`zero-trust devices registrations override-codes get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices registrations override-codes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/registrations/${e[`registration-id`]==null?`<registration-id>`:encodeURIComponent(String(e[`registration-id`]))}/override_codes`,pathParams:{"registration-id":String(e[`registration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(cm,{account_id:a,registration_id:e[`registration-id`]}));s(u,{successLabel:`Loaded`})})},dm={command:`override-codes`,describe:`Operations for devices.registrations.override-codes`,builder:e=>e.command(um).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fm={command:`registrations`,describe:`Operations for devices.registrations`,builder:e=>e.command(Qp).command(tm).command(im).command(sm).command(dm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var pm={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/devices/settings`};function mm(e){return e.usage(`$0 zero-trust devices settings delete
529
+
530
+ Resets the current device settings for a Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const hm={command:`delete`,describe:`Reset device settings`,builder:mm,handler:async e=>u({command:`zero-trust devices settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
531
+ `);return}let u=await l(`Deleting`,async()=>n.send(pm,{account_id:a}));s(u,{successLabel:`Deleted`})})};var gm={method:`GET`,path:t=>e`/accounts/${t.account_id}/devices/settings`};function _m(e){return e.usage(`$0 zero-trust devices settings get
532
+
533
+ Describes the current device settings for a Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vm={command:`get`,describe:`Get device settings`,builder:_m,handler:async e=>u({command:`zero-trust devices settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust devices settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(gm,{account_id:a}));s(u,{successLabel:`Loaded`})})};var ym={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/settings`,body:`json`};function bm(e){return e.usage(`$0 zero-trust devices settings update
534
+
535
+ Updates the device settings for a Zero Trust account.`).option(`disable-for-time`,{type:`number`,description:`Sets the time limit, in seconds, that a user can use an override code to bypass WARP.`}).option(`external-emergency-signal-enabled`,{type:`boolean`,description:`Controls whether the external emergency disconnect feature is enabled.`}).option(`external-emergency-signal-fingerprint`,{type:`string`,description:`The SHA256 fingerprint (64 hexadecimal characters) of the HTTPS server certificate for the external_emergency_signal_url. If provided, the WARP client will use this value to verify the server's identity. The device will ignore any response if the server's certificate fingerprint does not exactly match this value.`}).option(`external-emergency-signal-interval`,{type:`string`,description:`The interval at which the WARP client fetches the emergency disconnect signal, formatted as a duration string (e.g., "5m", "2m30s", "1h"). Minimum 30 seconds.`}).option(`external-emergency-signal-url`,{type:`string`,description:`The HTTPS URL from which to fetch the emergency disconnect signal. Must use HTTPS and have an IPv4 or IPv6 address as the host.`}).option(`gateway-proxy-enabled`,{type:`boolean`,description:`Enable gateway proxy filtering on TCP.`}).option(`gateway-udp-proxy-enabled`,{type:`boolean`,description:`Enable gateway proxy filtering on UDP.`}).option(`root-certificate-installation-enabled`,{type:`boolean`,description:`Enable installation of cloudflare managed root certificate.`}).option(`use-zt-virtual-ip`,{type:`boolean`,description:`Enable using CGNAT virtual IPv4.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xm={command:`update`,describe:`Update device settings`,builder:bm,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({disable_for_time:e[`disable-for-time`],external_emergency_signal_enabled:e[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:h(e[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:h(e[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:h(e[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:e[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:e[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:e[`root-certificate-installation-enabled`],use_zt_virtual_ip:e[`use-zt-virtual-ip`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ym,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({disable_for_time:e[`disable-for-time`],external_emergency_signal_enabled:e[`external-emergency-signal-enabled`],external_emergency_signal_fingerprint:h(e[`external-emergency-signal-fingerprint`],`external-emergency-signal-fingerprint`,`text`),external_emergency_signal_interval:h(e[`external-emergency-signal-interval`],`external-emergency-signal-interval`,`text`),external_emergency_signal_url:h(e[`external-emergency-signal-url`],`external-emergency-signal-url`,`text`),gateway_proxy_enabled:e[`gateway-proxy-enabled`],gateway_udp_proxy_enabled:e[`gateway-udp-proxy-enabled`],root_certificate_installation_enabled:e[`root-certificate-installation-enabled`],use_zt_virtual_ip:e[`use-zt-virtual-ip`]}),d=await l(`Updating`,async()=>n.send(ym,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},Sm={command:`settings`,describe:`Operations for devices.settings`,builder:e=>e.command(hm).command(vm).command(xm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Cm={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/devices/physical-devices/${t.device_id}`,body:`json`};function wm(e){return e.usage(`$0 zero-trust devices update <device-id>
536
+
537
+ Updates properties of a WARP device.`).positional(`device-id`,{type:`string`,description:`Device ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tm={command:`update <device-id>`,describe:`Update device`,builder:wm,handler:async e=>u({command:`zero-trust devices update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust devices update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/devices/physical-devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}`,pathParams:{"device-id":String(e[`device-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Cm,{body:t,account_id:a,device_id:e[`device-id`]}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Em={command:`devices`,describe:`Operations for devices`,builder:e=>e.command(Pd).command(sf).command(Ef).command(Tm).command(jd).command(Xd).command(rf).command(Cf).command(Hf).command(Kf).command(Tp).command(Yp).command(fm).command(Sm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Dm={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/colos`,query:[`from`,`to`,`sortBy`]};function Om(e){return e.usage(`$0 zero-trust dex colos list
538
+
539
+ List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically.`).option(`from`,{type:`string`,description:`Start time for connection period in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for connection period in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`sort-by`,{type:`string`,description:`Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically.`,choices:[`fleet-status-usage`,`application-tests-usage`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const km={command:`list`,describe:`List Cloudflare colos`,builder:Om,handler:async e=>u({command:`zero-trust dex colos list`,classification:{safeFlags:[`sort-by`,`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to,sortBy:e[`sort-by`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex colos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/colos`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Dm,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Am={command:`colos`,describe:`Operations for dex.colos`,builder:e=>e.command(km).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var jm={method:`POST`,path:t=>e`/accounts/${t.account_id}/dex/commands`,body:`json`};function Mm(e){return e.usage(`$0 zero-trust dex commands create
540
+
541
+ Initiate commands for up to 10 devices per account.`).option(`commands`,{type:`string`,description:`List of device-level commands to execute. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Nm={command:`create`,describe:`Create account commands`,builder:Mm,handler:async e=>u({command:`zero-trust dex commands create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex commands create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/commands`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({commands:p(e.commands,`commands`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(jm,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.commands===void 0)throw Error(`--commands is required (or pass --body with this field set).`);let u=m({commands:p(e.commands,`commands`)}),d=await l(`Creating`,async()=>n.send(jm,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Pm={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/commands/devices`,query:[`page`,`per_page`,`search`]};function Fm(e){return e.usage(`$0 zero-trust dex commands eligible-devices list
542
+
543
+ List devices with WARP client support for remote captures which have been connected in the last 1 hour.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`search`,{type:`string`,description:`Filter devices by name or email.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Im={command:`list`,describe:`List devices eligible for remote captures`,builder:Fm,handler:async e=>u({command:`zero-trust dex commands eligible-devices list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex commands eligible-devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands/devices`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Pm,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Lm={command:`eligible-devices`,describe:`Operations for dex.commands.eligible-devices`,builder:e=>e.command(Im).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Rm={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/commands`,query:[`page`,`per_page`,`from`,`to`,`device_id`,`user_email`,`command_type`,`status`]};function zm(e){return e.usage(`$0 zero-trust dex commands list
544
+
545
+ Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`}).option(`device-id`,{type:`string`,description:`Unique identifier for a device.`}).option(`user-email`,{type:`string`,description:`Email tied to the device.`}).option(`command-type`,{type:`string`,description:`Optionally filter executed commands by command type.`,choices:[`pcap`,`speed-test`,`warp-diag`]}).option(`status`,{type:`string`,description:`Optionally filter executed commands by status.`,choices:[`PENDING_EXEC`,`PENDING_UPLOAD`,`SUCCESS`,`FAILED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bm={command:`list`,describe:`List account commands`,builder:zm,handler:async e=>u({command:`zero-trust dex commands list`,classification:{safeFlags:[`command-type`,`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],from:e.from,to:e.to,device_id:e[`device-id`],user_email:e[`user-email`],command_type:e[`command-type`],status:e.status};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex commands list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Rm,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Vm={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/commands/quota`};function Hm(e){return e.usage(`$0 zero-trust dex commands quota get
546
+
547
+ Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Um={command:`get`,describe:`Returns account commands usage, quota, and reset time`,builder:Hm,handler:async e=>u({command:`zero-trust dex commands quota get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dex commands quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/commands/quota`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Vm,{account_id:a}));s(u,{successLabel:`Loaded`})})},Wm={command:`quota`,describe:`Operations for dex.commands.quota`,builder:e=>e.command(Um).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gm(e){return e.usage(`$0 zero-trust dex commands results get <filename>
548
+
549
+ Downloads artifacts for an executed command. Bulk downloads are not supported`).positional(`filename`,{type:`string`,description:"The name of the file to be downloaded, including the `.zip` extension.",demandOption:!0}).option(`command-id`,{type:`string`,description:`Unique identifier for command.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Km={command:`get <filename>`,describe:`Download command output file`,builder:Gm,handler:async e=>u({command:`zero-trust dex commands results get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex commands results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/commands/${e[`command-id`]==null?`<command-id>`:encodeURIComponent(String(e[`command-id`]))}/downloads/${e.filename==null?`<filename>`:encodeURIComponent(String(e.filename))}`,pathParams:{"command-id":String(e[`command-id`]??``),filename:String(e.filename??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await o();e.accountId=n;let a=await l(`Loading`,async()=>te(`/accounts/${n}/dex/commands/${encodeURIComponent(String(e[`command-id`]))}/downloads/${encodeURIComponent(String(e.filename))}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));ee(e.text===!0?a.toString(`utf-8`):a)})},qm={command:`results`,describe:`Operations for dex.commands.results`,builder:e=>e.command(Km).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Jm={command:`commands`,describe:`Operations for dex.commands`,builder:e=>e.command(Nm).command(Bm).command(Lm).command(Wm).command(qm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ym={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/fleet-status/live`,query:[`since_minutes`]};function Xm(e){return e.usage(`$0 zero-trust dex devices aggregates live get
550
+
551
+ Get details for live (up to 60 minutes) devices using WARP.`).option(`since-minutes`,{type:`number`,description:`Number of minutes before current time.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zm={command:`get`,describe:`Get live aggregate device details by dimension`,builder:Xm,handler:async e=>u({command:`zero-trust dex devices aggregates live get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={since_minutes:e[`since-minutes`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex devices aggregates live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/live`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Ym,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Qm={command:`live`,describe:`Operations for dex.devices.aggregates.live`,builder:e=>e.command(Zm).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $m={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/fleet-status/over-time`,query:[`to`,`from`,`colo`,`device_id`]};function eh(e){return e.usage(`$0 zero-trust dex devices aggregates over-time get
552
+
553
+ Get aggregate details for devices using WARP, up to 7 days.`).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Cloudflare colo airport code.`}).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const th={command:`get`,describe:`Get over time aggregate details for devices by dimension`,builder:eh,handler:async e=>u({command:`zero-trust dex devices aggregates over-time get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={to:e.to,from:e.from,colo:e.colo,device_id:e[`device-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex devices aggregates over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/over-time`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send($m,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},nh={command:`over-time`,describe:`Operations for dex.devices.aggregates.over-time`,builder:e=>e.command(th).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rh={command:`aggregates`,describe:`Operations for dex.devices.aggregates`,builder:e=>e.command(Qm).command(nh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ih={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/devices/${t.device_id}/fleet-status/live`,query:[`since_minutes`,`time_now`,`colo`]};function ah(e){return e.usage(`$0 zero-trust dex devices get <device-id>
554
+
555
+ Get the latest status of a device given device_id from the device_state table.`).positional(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`since-minutes`,{type:`number`,description:`Number of minutes before current time.`,demandOption:!0}).option(`time-now`,{type:`string`,description:`Current time in ISO format.`}).option(`colo`,{type:`string`,description:`List of data centers to filter results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oh={command:`get <device-id>`,describe:`Get the latest status of a device.`,builder:ah,handler:async e=>u({command:`zero-trust dex devices get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={since_minutes:e[`since-minutes`],time_now:e[`time-now`],colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}/fleet-status/live`,pathParams:{"device-id":String(e[`device-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ih,{account_id:u,device_id:e[`device-id`],...n}));s(d,{successLabel:`Loaded`})})};var sh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/fleet-status/devices`,query:[`to`,`from`,`page`,`per_page`,`sort_by`,`colo`,`device_id`,`mode`,`status`,`platform`,`version`,`source`]};function ch(e){return e.usage(`$0 zero-trust dex devices list
556
+
557
+ List details of devices using WARP.`).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`sort-by`,{type:`string`,description:`Dimension to sort results by.`,choices:[`colo`,`device_id`,`mode`,`platform`,`status`,`timestamp`,`version`]}).option(`colo`,{type:`string`,description:`Cloudflare colo airport code.`}).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`}).option(`device-mode`,{type:`string`,description:`The mode under which the WARP client is run.`}).option(`status`,{type:`string`,description:`Network status.`}).option(`platform`,{type:`string`,description:`Operating system.`}).option(`warp-version`,{type:`string`,description:`WARP client version.`}).option(`source`,{type:`string`,description:"Source:\n * `hourly` - device details aggregated hourly, up to 7 days prior\n * `last_seen` - device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges.\n * `raw` - device details, up to 7 days prior",choices:[`last_seen`,`hourly`,`raw`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lh={command:`list`,describe:`List details of devices using WARP.`,builder:ch,handler:async e=>u({command:`zero-trust dex devices list`,classification:{safeFlags:[`sort-by`,`source`,`dry-run`]}},e,async()=>{let n={to:e.to,from:e.from,page:e.page,per_page:e[`per-page`],sort_by:e[`sort-by`],colo:e.colo,device_id:e[`device-id`],mode:e[`device-mode`],status:e.status,platform:e.platform,version:e[`warp-version`],source:e.source};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/fleet-status/devices`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(sh,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var uh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/devices/${t.device_id}/fleet-status/over-time`,query:[`from`,`to`,`interval`,`colo`]};function dh(e){return e.usage(`$0 zero-trust dex devices over-time get <device-id>
558
+
559
+ Get time-bucketed status metrics for a specific device.`).positional(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`List of data centers to filter results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fh={command:`get <device-id>`,describe:`Get the status over time for a device`,builder:dh,handler:async e=>u({command:`zero-trust dex devices over-time get`,classification:{safeFlags:[`interval`,`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to,interval:e.interval,colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex devices over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}/fleet-status/over-time`,pathParams:{"device-id":String(e[`device-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(uh,{account_id:u,device_id:e[`device-id`],...n}));s(d,{successLabel:`Loaded`})})},ph={command:`over-time`,describe:`Operations for dex.devices.over-time`,builder:e=>e.command(fh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},mh={command:`devices`,describe:`Operations for dex.devices`,builder:e=>e.command(oh).command(lh).command(rh).command(ph).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var hh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/devices/${t.device_id}/isps`,query:[`page`,`per_page`,`cursor`,`sort_by`,`sort_order`,`from`,`to`]};function gh(e){return e.usage(`$0 zero-trust dex isps list
560
+
561
+ List ISP information observed for a specific device during traceroute tests.`).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results. Mutually exclusive with cursor.`}).option(`per-page`,{type:`number`,description:`Number of items per page`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Cursor for cursor-based pagination. Mutually exclusive with page.`}).option(`sort-by`,{type:`string`,description:`The field to sort results by.`,choices:[`time_start`]}).option(`sort-order`,{type:`string`,description:`The order to sort results.`,choices:[`ASC`,`DESC`]}).option(`from`,{type:`string`,description:`Start time for the query in ISO 8601 format.`}).option(`to`,{type:`string`,description:`End time for the query in ISO 8601 format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _h={command:`list`,describe:`List device ISPs`,builder:gh,handler:async e=>u({command:`zero-trust dex isps list`,classification:{safeFlags:[`sort-by`,`sort-order`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],cursor:e.cursor,sort_by:e[`sort-by`],sort_order:e[`sort-order`],from:e.from,to:e.to};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex isps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/${e[`device-id`]==null?`<device-id>`:encodeURIComponent(String(e[`device-id`]))}/isps`,pathParams:{"device-id":String(e[`device-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(hh,{account_id:u,device_id:e[`device-id`],...n}));s(d,{successLabel:`Loaded`})})},vh={command:`isps`,describe:`Operations for dex.isps`,builder:e=>e.command(_h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var yh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/tests/overview`,query:[`colo`,`testName`,`deviceId`,`registration_id`,`page`,`per_page`,`kind`]};function bh(e){return e.usage(`$0 zero-trust dex overview tests list
562
+
563
+ List DEX tests with overview metrics.`).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`test-name`,{type:`string`,description:`Optionally filter results by test name.`}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`registration-id`,{type:`string`,description:`Optionally filter results to a specific device registration. Must be used in combination with a single deviceId.`}).option(`page`,{type:`number`,description:`Page number of paginated results`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`kind`,{type:`string`,description:`Filter by test type.`,choices:[`http`,`traceroute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xh={command:`list`,describe:`List DEX test analytics`,builder:bh,handler:async e=>u({command:`zero-trust dex overview tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{let n={colo:e.colo,testName:e[`test-name`],deviceId:e[`device-id`],registration_id:e[`registration-id`],page:e.page,per_page:e[`per-page`],kind:e.kind};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex overview tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/tests/overview`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(yh,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Sh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/tests/unique-devices`,query:[`testName`,`deviceId`]};function Ch(e){return e.usage(`$0 zero-trust dex overview tests unique-devices get
564
+
565
+ Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days.`).option(`test-name`,{type:`string`,description:`Optionally filter results by test name.`}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const wh={command:`get`,describe:`Get count of devices targeted`,builder:Ch,handler:async e=>u({command:`zero-trust dex overview tests unique-devices get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={testName:e[`test-name`],deviceId:e[`device-id`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex overview tests unique-devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/tests/unique-devices`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Sh,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Th={command:`unique-devices`,describe:`Operations for dex.overview.tests.unique-devices`,builder:e=>e.command(wh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Eh={command:`tests`,describe:`Operations for dex.overview.tests`,builder:e=>e.command(xh).command(Th).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dh={command:`overview`,describe:`Operations for dex.overview`,builder:e=>e.command(Eh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Oh={method:`POST`,path:t=>e`/accounts/${t.account_id}/dex/rules`,body:`json`};function kh(e){return e.usage(`$0 zero-trust dex rules create
566
+
567
+ Create a DEX Rule.`).option(`description`,{type:`string`,description:`The description field`}).option(`match`,{type:`string`,description:`The wirefilter expression to match.`}).option(`name`,{type:`string`,description:`The name of the Rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ah={command:`create`,describe:`Create a DEX Rule`,builder:kh,handler:async e=>u({command:`zero-trust dex rules create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Oh,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.match===void 0&&(e.match=await _(`match`,`The wirefilter expression to match.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the Rule.`));let u=m({description:h(e.description,`description`,`text`),match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(Oh,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var jh={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dex/rules/${t.rule_id}`};function Mh(e){return e.usage(`$0 zero-trust dex rules delete <rule-id>
568
+
569
+ Delete a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Nh={command:`delete <rule-id>`,describe:`Delete a DEX Rule`,builder:Mh,handler:async e=>u({command:`zero-trust dex rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
570
+ `);return}let u=await l(`Deleting`,async()=>n.send(jh,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Deleted`})})};var Ph={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/rules/${t.rule_id}`};function Fh(e){return e.usage(`$0 zero-trust dex rules get <rule-id>
571
+
572
+ Get details for a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ih={command:`get <rule-id>`,describe:`Get DEX Rule`,builder:Fh,handler:async e=>u({command:`zero-trust dex rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ph,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Loaded`})})};var Lh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/rules`,query:[`page`,`per_page`,`sort_order`,`sort_by`,`name`]};function Rh(e){return e.usage(`$0 zero-trust dex rules list
573
+
574
+ List DEX Rules.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`sort-order`,{type:`string`,description:`Sort direction for sort_by property.`,choices:[`ASC`,`DESC`]}).option(`sort-by`,{type:`string`,description:`Which property to sort results by.`,choices:[`name`,`created_at`,`updated_at`]}).option(`name`,{type:`string`,description:`Filter results by rule name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zh={command:`list`,describe:`List DEX Rules`,builder:Rh,handler:async e=>u({command:`zero-trust dex rules list`,classification:{safeFlags:[`sort-order`,`sort-by`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],sort_order:e[`sort-order`],sort_by:e[`sort-by`],name:e.name};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/rules`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Lh,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Bh={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/dex/rules/${t.rule_id}`,body:`json`};function Vh(e){return e.usage(`$0 zero-trust dex rules update <rule-id>
575
+
576
+ Update a DEX Rule.`).positional(`rule-id`,{type:`string`,description:`Unique identifier of the rule.`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`match`,{type:`string`,description:`The wirefilter expression to match.`}).option(`name`,{type:`string`,description:`The name of the Rule.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Hh={command:`update <rule-id>`,describe:`Update a DEX Rule`,builder:Vh,handler:async e=>u({command:`zero-trust dex rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Bh,{body:t,account_id:a,rule_id:e[`rule-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),match:h(e.match,`match`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(Bh,{body:u,account_id:a,rule_id:e[`rule-id`]}));s(d,{successLabel:`Updated`})})},Uh={command:`rules`,describe:`Operations for dex.rules`,builder:e=>e.command(Ah).command(Nh).command(Ih).command(zh).command(Hh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Wh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/http-tests/${t.test_id}`,query:[`deviceId`,`from`,`to`,`interval`,`colo`]};function Gh(e){return e.usage(`$0 zero-trust dex test-results http get <test-id>
577
+
578
+ Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kh={command:`get <test-id>`,describe:`Get details and aggregate metrics for an http test`,builder:Gh,handler:async e=>u({command:`zero-trust dex test-results http get`,classification:{safeFlags:[`interval`,`dry-run`]}},e,async()=>{let n={deviceId:e[`device-id`],from:e.from,to:e.to,interval:e.interval,colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex test-results http get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/http-tests/${e[`test-id`]==null?`<test-id>`:encodeURIComponent(String(e[`test-id`]))}`,pathParams:{"test-id":String(e[`test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Wh,{account_id:u,test_id:e[`test-id`],...n}));s(d,{successLabel:`Loaded`})})};var qh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/http-tests/${t.test_id}/percentiles`,query:[`deviceId`,`from`,`to`,`colo`]};function Jh(e){return e.usage(`$0 zero-trust dex test-results http percentiles get <test-id>
579
+
580
+ Get percentiles for an http test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yh={command:`get <test-id>`,describe:`Get percentiles for an http test`,builder:Jh,handler:async e=>u({command:`zero-trust dex test-results http percentiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={deviceId:e[`device-id`],from:e.from,to:e.to,colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex test-results http percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/http-tests/${e[`test-id`]==null?`<test-id>`:encodeURIComponent(String(e[`test-id`]))}/percentiles`,pathParams:{"test-id":String(e[`test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(qh,{account_id:u,test_id:e[`test-id`],...n}));s(d,{successLabel:`Loaded`})})},Xh={command:`percentiles`,describe:`Operations for dex.test-results.http.percentiles`,builder:e=>e.command(Yh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Zh={command:`http`,describe:`Operations for dex.test-results.http`,builder:e=>e.command(Kh).command(Xh).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Qh={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/traceroute-tests/${t.test_id}`,query:[`deviceId`,`from`,`to`,`interval`,`colo`]};function $h(e){return e.usage(`$0 zero-trust dex test-results traceroute get <test-id>
581
+
582
+ Get test details and aggregate performance metrics for a traceroute test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eg={command:`get <test-id>`,describe:`Get details and aggregate metrics for a traceroute test`,builder:$h,handler:async e=>u({command:`zero-trust dex test-results traceroute get`,classification:{safeFlags:[`interval`,`dry-run`]}},e,async()=>{let n={deviceId:e[`device-id`],from:e.from,to:e.to,interval:e.interval,colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex test-results traceroute get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/traceroute-tests/${e[`test-id`]==null?`<test-id>`:encodeURIComponent(String(e[`test-id`]))}`,pathParams:{"test-id":String(e[`test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Qh,{account_id:u,test_id:e[`test-id`],...n}));s(d,{successLabel:`Loaded`})})};var tg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/traceroute-test-results/${t.test_result_id}/network-path`};function ng(e){return e.usage(`$0 zero-trust dex test-results traceroute network-path get <test-result-id>
583
+
584
+ Get a breakdown of hops and performance metrics for a specific traceroute test run`).positional(`test-result-id`,{type:`string`,description:`Unique identifier for a specific traceroute test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rg={command:`get <test-result-id>`,describe:`Get details for a specific traceroute test run`,builder:ng,handler:async e=>u({command:`zero-trust dex test-results traceroute network-path get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex test-results traceroute network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/traceroute-test-results/${e[`test-result-id`]==null?`<test-result-id>`:encodeURIComponent(String(e[`test-result-id`]))}/network-path`,pathParams:{"test-result-id":String(e[`test-result-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(tg,{account_id:a,test_result_id:e[`test-result-id`]}));s(u,{successLabel:`Loaded`})})},ig={command:`network-path`,describe:`Operations for dex.test-results.traceroute.network-path`,builder:e=>e.command(rg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ag={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/traceroute-tests/${t.test_id}/percentiles`,query:[`deviceId`,`from`,`to`,`colo`]};function og(e){return e.usage(`$0 zero-trust dex test-results traceroute percentiles get <test-id>
585
+
586
+ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param.`}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`colo`,{type:`string`,description:`Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sg={command:`get <test-id>`,describe:`Get percentiles for a traceroute test`,builder:og,handler:async e=>u({command:`zero-trust dex test-results traceroute percentiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={deviceId:e[`device-id`],from:e.from,to:e.to,colo:e.colo};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex test-results traceroute percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/traceroute-tests/${e[`test-id`]==null?`<test-id>`:encodeURIComponent(String(e[`test-id`]))}/percentiles`,pathParams:{"test-id":String(e[`test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ag,{account_id:u,test_id:e[`test-id`],...n}));s(d,{successLabel:`Loaded`})})},cg={command:`percentiles`,describe:`Operations for dex.test-results.traceroute.percentiles`,builder:e=>e.command(sg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},lg={command:`traceroute`,describe:`Operations for dex.test-results.traceroute`,builder:e=>e.command(eg).command(ig).command(cg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ug={command:`test-results`,describe:`Operations for dex.test-results`,builder:e=>e.command(Zh).command(lg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var dg={method:`POST`,path:t=>e`/accounts/${t.account_id}/dex/devices/dex_tests`,body:`json`};function fg(e){return e.usage(`$0 zero-trust dex tests create
587
+
588
+ Create a DEX test.`).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).coerce(`data-kind`,e=>h(e,`data-kind`,`text`)).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).coerce(`data-method`,e=>h(e,`data-method`,`text`)).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`target-policies`,{type:`string`,description:`DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json.`}).option(`targeted`,{type:`boolean`,description:`The targeted field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pg={command:`create`,describe:`Create Device DEX test`,builder:fg,handler:async e=>u({command:`zero-trust dex tests create`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({data:{host:h(e[`data-host`],`data-host`,`text`),kind:e[`data-kind`],method:e[`data-method`]},description:h(e.description,`description`,`text`),enabled:e.enabled,interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),target_policies:p(e[`target-policies`],`target-policies`),targeted:e.targeted}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(dg,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`data-host`]===void 0&&(e[`data-host`]=await _(`data-host`,`The desired endpoint to test.`)),e[`data-kind`]===void 0&&(e[`data-kind`]=await v(`data-kind`,`The type of test.`,[`http`,`traceroute`])),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.interval===void 0&&(e.interval=await _(`interval`,`How often the test will run.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the DEX test. Must be unique.`));let u=m({data:{host:h(e[`data-host`],`data-host`,`text`),kind:e[`data-kind`],method:e[`data-method`]},description:h(e.description,`description`,`text`),enabled:e.enabled,interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),target_policies:p(e[`target-policies`],`target-policies`),targeted:e.targeted}),d=await l(`Creating`,async()=>n.send(dg,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var mg={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dex/devices/dex_tests/${t.dex_test_id}`};function hg(e){return e.usage(`$0 zero-trust dex tests delete <dex-test-id>
589
+
590
+ Delete a Device DEX test. Returns the remaining device dex tests for the account.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const gg={command:`delete <dex-test-id>`,describe:`Delete Device DEX test`,builder:hg,handler:async e=>u({command:`zero-trust dex tests delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/dex_tests/${e[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(e[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(e[`dex-test-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
591
+ `);return}let u=await l(`Deleting`,async()=>n.send(mg,{account_id:a,dex_test_id:e[`dex-test-id`]}));s(u,{successLabel:`Deleted`})})};var _g={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/devices/dex_tests/${t.dex_test_id}`};function vg(e){return e.usage(`$0 zero-trust dex tests get <dex-test-id>
592
+
593
+ Fetch a single DEX test.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yg={command:`get <dex-test-id>`,describe:`Get Device DEX test`,builder:vg,handler:async e=>u({command:`zero-trust dex tests get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/dex_tests/${e[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(e[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(e[`dex-test-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(_g,{account_id:a,dex_test_id:e[`dex-test-id`]}));s(u,{successLabel:`Loaded`})})};var bg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/devices/dex_tests`,query:[`page`,`per_page`,`testName`,`kind`]};function xg(e){return e.usage(`$0 zero-trust dex tests list
594
+
595
+ Fetch all DEX tests.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`test-name`,{type:`string`,description:`Filter by test name.`}).option(`kind`,{type:`string`,description:`Filter by test type.`,choices:[`http`,`traceroute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sg={command:`list`,describe:`List Device DEX tests`,builder:xg,handler:async e=>u({command:`zero-trust dex tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],testName:e[`test-name`],kind:e.kind};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(bg,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Cg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/traceroute-tests/${t.test_id}/network-path`,query:[`deviceId`,`from`,`to`,`interval`]};function wg(e){return e.usage(`$0 zero-trust dex tests network-path get <test-id>
596
+
597
+ Get a breakdown of metrics by hop for individual traceroute test runs.`).positional(`test-id`,{type:`string`,description:`Unique identifier for a specific test.`,demandOption:!0}).option(`device-id`,{type:`string`,description:`Device to filter traceroute result runs to.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for aggregate metrics in ISO ms.`,demandOption:!0}).option(`interval`,{type:`string`,description:`Time interval for aggregate time slots.`,choices:[`minute`,`hour`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tg={command:`get <test-id>`,describe:`Get network path breakdown for a traceroute test`,builder:wg,handler:async e=>u({command:`zero-trust dex tests network-path get`,classification:{safeFlags:[`interval`,`dry-run`]}},e,async()=>{let n={deviceId:e[`device-id`],from:e.from,to:e.to,interval:e.interval};if(e.dryRun){let t=await i();c({command:`cf zero-trust dex tests network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/traceroute-tests/${e[`test-id`]==null?`<test-id>`:encodeURIComponent(String(e[`test-id`]))}/network-path`,pathParams:{"test-id":String(e[`test-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Cg,{account_id:u,test_id:e[`test-id`],...n}));s(d,{successLabel:`Loaded`})})},Eg={command:`network-path`,describe:`Operations for dex.tests.network-path`,builder:e=>e.command(Tg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Dg={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dex/devices/dex_tests/${t.dex_test_id}`,body:`json`};function Og(e){return e.usage(`$0 zero-trust dex tests update <dex-test-id>
598
+
599
+ Update a DEX test.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).coerce(`data-kind`,e=>h(e,`data-kind`,`text`)).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).coerce(`data-method`,e=>h(e,`data-method`,`text`)).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`target-policies`,{type:`string`,description:`DEX rules targeted by this test. Provide as a JSON array of objects or @path/to/file.json.`}).option(`targeted`,{type:`boolean`,description:`The targeted field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const kg={command:`update <dex-test-id>`,describe:`Update Device DEX test`,builder:Og,handler:async e=>u({command:`zero-trust dex tests update`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dex tests update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dex/devices/dex_tests/${e[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(e[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(e[`dex-test-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({data:{host:h(e[`data-host`],`data-host`,`text`),kind:e[`data-kind`],method:e[`data-method`]},description:h(e.description,`description`,`text`),enabled:e.enabled,interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),target_policies:p(e[`target-policies`],`target-policies`),targeted:e.targeted}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Dg,{body:t,account_id:a,dex_test_id:e[`dex-test-id`]}));s(r,{successLabel:`Updated`});return}if(e[`data-host`]===void 0&&(e[`data-host`]=await _(`data-host`,`The desired endpoint to test.`)),e[`data-kind`]===void 0&&(e[`data-kind`]=await v(`data-kind`,`The type of test.`,[`http`,`traceroute`])),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.interval===void 0&&(e.interval=await _(`interval`,`How often the test will run.`)),e.name===void 0&&(e.name=await _(`name`,`The name of the DEX test. Must be unique.`));let u=m({data:{host:h(e[`data-host`],`data-host`,`text`),kind:e[`data-kind`],method:e[`data-method`]},description:h(e.description,`description`,`text`),enabled:e.enabled,interval:h(e.interval,`interval`,`text`),name:h(e.name,`name`,`text`),target_policies:p(e[`target-policies`],`target-policies`),targeted:e.targeted}),d=await l(`Updating`,async()=>n.send(Dg,{body:u,account_id:a,dex_test_id:e[`dex-test-id`]}));s(d,{successLabel:`Updated`})})},Ag={command:`tests`,describe:`Operations for dex.tests`,builder:e=>e.command(pg).command(gg).command(yg).command(Sg).command(kg).command(Eg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var jg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dex/warp-change-events`,query:[`page`,`per_page`,`from`,`to`,`type`,`toggle`,`config_name`,`account_name`,`sort_order`]};function Mg(e){return e.usage(`$0 zero-trust dex warp-change-events list
600
+
601
+ List WARP configuration and enablement toggle change events by device.`).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`to`,{type:`string`,description:`End time for the query in ISO (RFC3339 - ISO 8601) format.`,demandOption:!0}).option(`type`,{type:`string`,description:`Filter events by type 'config' or 'toggle'.`,choices:[`config`,`toggle`]}).option(`toggle`,{type:`string`,description:`Filter events by type toggle value. Applicable to type='toggle' events only.`,choices:[`on`,`off`]}).option(`config-name`,{type:`string`,description:`Filter events by WARP configuration name changed from or to. Applicable to type='config' events only.`}).option(`account-name`,{type:`string`,description:`Filter events by account name.`}).option(`sort-order`,{type:`string`,description:`Sort response by event timestamp.`,choices:[`ASC`,`DESC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ng={command:`list`,describe:`List WARP change events.`,builder:Mg,handler:async e=>u({command:`zero-trust dex warp-change-events list`,classification:{safeFlags:[`type`,`toggle`,`sort-order`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],from:e.from,to:e.to,type:e.type,toggle:e.toggle,config_name:e[`config-name`],account_name:e[`account-name`],sort_order:e[`sort-order`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust dex warp-change-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dex/warp-change-events`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(jg,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},Pg={command:`warp-change-events`,describe:`Operations for dex.warp-change-events`,builder:e=>e.command(Ng).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fg={command:`dex`,describe:`Digital Experience Monitoring — synthetic tests, fleet-wide device metrics, and network path diagnostics`,builder:e=>e.command(Am).command(Jm).command(mh).command(vh).command(Dh).command(Uh).command(ug).command(Ag).command(Pg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ig={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/custom_prompt_topics`,body:`json`};function Lg(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics create
602
+
603
+ Creates a DLP custom prompt topic entry.`).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`profile-id`,{type:`string`,description:`The profile_id field`}).option(`topic`,{type:`string`,description:`The topic field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A new custom prompt topic to create.`})}const Rg={command:`create`,describe:`Create custom prompt topic`,builder:Lg,handler:async e=>u({command:`zero-trust dlp custom-prompt-topics create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp custom-prompt-topics create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),profile_id:h(e[`profile-id`],`profile-id`,`text`),topic:h(e.topic,`topic`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Ig,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`)),e.topic===void 0&&(e.topic=await _(`topic`,`The topic field`));let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),profile_id:h(e[`profile-id`],`profile-id`,`text`),topic:h(e.topic,`topic`,`text`)}),d=await l(`Creating`,async()=>n.send(Ig,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var zg={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/custom_prompt_topics/${t.entry_id}`};function Bg(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics delete <entry-id>
604
+
605
+ Deletes a DLP custom prompt topic entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Vg={command:`delete <entry-id>`,describe:`Delete custom prompt topic`,builder:Bg,handler:async e=>u({command:`zero-trust dlp custom-prompt-topics delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp custom-prompt-topics delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/custom_prompt_topics/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
606
+ `);return}let u=await l(`Deleting`,async()=>n.send(zg,{account_id:a,entry_id:e[`entry-id`]}));s(u,{successLabel:`Deleted`})})};var Hg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/custom_prompt_topics/${t.entry_id}`};function Ug(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics get <entry-id>
607
+
608
+ Fetches a DLP custom prompt topic entry by ID.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wg={command:`get <entry-id>`,describe:`Get custom prompt topic`,builder:Ug,handler:async e=>u({command:`zero-trust dlp custom-prompt-topics get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp custom-prompt-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/custom_prompt_topics/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Hg,{account_id:a,entry_id:e[`entry-id`]}));s(u,{successLabel:`Loaded`})})};var Gg={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/custom_prompt_topics`};function Kg(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics list
609
+
610
+ Lists all DLP custom prompt topic entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qg={command:`list`,describe:`List custom prompt topics`,builder:Kg,handler:async e=>u({command:`zero-trust dlp custom-prompt-topics list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp custom-prompt-topics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Gg,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Jg={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/custom_prompt_topics/${t.entry_id}`,body:`json`};function Yg(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics update <entry-id>
611
+
612
+ Updates a DLP custom prompt topic entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`topic`,{type:`string`,description:`The topic field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update to be applied to the custom prompt topic.`})}const Xg={command:`update <entry-id>`,describe:`Update custom prompt topic`,builder:Yg,handler:async e=>u({command:`zero-trust dlp custom-prompt-topics update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp custom-prompt-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/custom_prompt_topics/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),topic:h(e.topic,`topic`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Jg,{body:t,account_id:a,entry_id:e[`entry-id`]}));s(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`)),e.topic===void 0&&(e.topic=await _(`topic`,`The topic field`));let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),topic:h(e.topic,`topic`,`text`)}),d=await l(`Updating`,async()=>n.send(Jg,{body:u,account_id:a,entry_id:e[`entry-id`]}));s(d,{successLabel:`Updated`})})},Zg={command:`custom-prompt-topics`,describe:`Data Loss Prevention - manage custom prompt topics for AI-based content detection`,builder:e=>e.command(Rg).command(Vg).command(Wg).command(qg).command(Xg).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Qg={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/data_classes`,body:`json`};function $g(e){return e.usage(`$0 zero-trust dlp data-classes create
613
+
614
+ Creates a data class for use in DLP profiles.`).option(`data-tags`,{type:`string`,array:!0,description:`The data_tags field`}).option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`The expression field`}).option(`name`,{type:`string`,description:`The name field`}).option(`sensitivity-levels`,{type:`string`,description:`The sensitivity_levels field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data class.`})}const e_={command:`create`,describe:`Creates a new data class`,builder:$g,handler:async e=>u({command:`zero-trust dlp data-classes create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-classes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),expression:h(e.expression,`expression`,`text`),name:h(e.name,`name`,`text`),sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Qg,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`data-tags`]===void 0)throw Error(`--data-tags is required (or pass --body with this field set).`);if(e.expression===void 0&&(e.expression=await _(`expression`,`The expression field`)),e.name===void 0&&(e.name=await _(`name`,`The name field`)),e[`sensitivity-levels`]===void 0)throw Error(`--sensitivity-levels is required (or pass --body with this field set).`);let u=m({data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),expression:h(e.expression,`expression`,`text`),name:h(e.name,`name`,`text`),sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`)}),d=await l(`Creating`,async()=>n.send(Qg,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var t_={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/data_classes/${t.data_class_id}`};function n_(e){return e.usage(`$0 zero-trust dlp data-classes delete <data-class-id>
615
+
616
+ Deletes a data class from the account.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const r_={command:`delete <data-class-id>`,describe:`Delete a single data class`,builder:n_,handler:async e=>u({command:`zero-trust dlp data-classes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-classes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_classes/${e[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(e[`data-class-id`]))}`,pathParams:{"data-class-id":String(e[`data-class-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
617
+ `);return}let u=await l(`Deleting`,async()=>n.send(t_,{account_id:a,data_class_id:e[`data-class-id`]}));s(u,{successLabel:`Deleted`})})};var i_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_classes/${t.data_class_id}`};function a_(e){return e.usage(`$0 zero-trust dlp data-classes get <data-class-id>
618
+
619
+ Gets the configuration for a data class.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o_={command:`get <data-class-id>`,describe:`Retrieve a specific data class`,builder:a_,handler:async e=>u({command:`zero-trust dlp data-classes get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-classes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_classes/${e[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(e[`data-class-id`]))}`,pathParams:{"data-class-id":String(e[`data-class-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(i_,{account_id:a,data_class_id:e[`data-class-id`]}));s(u,{successLabel:`Loaded`})})};var s_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_classes`};function c_(e){return e.usage(`$0 zero-trust dlp data-classes list
620
+
621
+ Lists data classes configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l_={command:`list`,describe:`Retrieve all data classes in an account`,builder:c_,handler:async e=>u({command:`zero-trust dlp data-classes list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp data-classes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(s_,{account_id:a}));s(u,{successLabel:`Loaded`})})};var u_={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/data_classes/${t.data_class_id}`,body:`json`};function d_(e){return e.usage(`$0 zero-trust dlp data-classes update <data-class-id>
622
+
623
+ Updates the configuration for a data class.`).positional(`data-class-id`,{type:`string`,description:`Data class ID`,demandOption:!0}).option(`data-tags`,{type:`string`,array:!0,description:`The data_tags field`}).option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`The expression field`}).option(`name`,{type:`string`,description:`The name field`}).option(`sensitivity-levels`,{type:`string`,description:`The sensitivity_levels field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the data class to update.`})}const f_={command:`update <data-class-id>`,describe:`Update the attributes of a single data class`,builder:d_,handler:async e=>u({command:`zero-trust dlp data-classes update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-classes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_classes/${e[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(e[`data-class-id`]))}`,pathParams:{"data-class-id":String(e[`data-class-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),expression:h(e.expression,`expression`,`text`),name:h(e.name,`name`,`text`),sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(u_,{body:t,account_id:a,data_class_id:e[`data-class-id`]}));s(r,{successLabel:`Updated`});return}let u=m({data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),expression:h(e.expression,`expression`,`text`),name:h(e.name,`name`,`text`),sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`)}),d=await l(`Updating`,async()=>n.send(u_,{body:u,account_id:a,data_class_id:e[`data-class-id`]}));s(d,{successLabel:`Updated`})})},p_={command:`data-classes`,describe:`Data Loss Prevention - manage data classes used to classify sensitive information`,builder:e=>e.command(e_).command(r_).command(o_).command(l_).command(f_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var m_={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories`,body:`json`};function h_(e){return e.usage(`$0 zero-trust dlp data-tag-categories create
624
+
625
+ Creates a data tag category, optionally from a template.`).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tags`,{type:`string`,description:"Tags to create with the category. Mutually exclusive with `template_id`. Provide as a JSON array of objects or @path/to/file.json."}).option(`template-id`,{type:`string`,description:`The template_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data tag category.`})}const g_={command:`create`,describe:`Creates a new data tag category.`,builder:h_,handler:async e=>u({command:`zero-trust dlp data-tag-categories create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tag-categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),tags:p(e.tags,`tags`),template_id:h(e[`template-id`],`template-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(m_,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),tags:p(e.tags,`tags`),template_id:h(e[`template-id`],`template-id`,`text`)}),d=await l(`Creating`,async()=>n.send(m_,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var __={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}`};function v_(e){return e.usage(`$0 zero-trust dlp data-tag-categories delete <category-id>
626
+
627
+ Deletes a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y_={command:`delete <category-id>`,describe:`Delete a single data tag category.`,builder:v_,handler:async e=>u({command:`zero-trust dlp data-tag-categories delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tag-categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
628
+ `);return}let u=await l(`Deleting`,async()=>n.send(__,{account_id:a,category_id:e[`category-id`]}));s(u,{successLabel:`Deleted`})})};var b_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}`};function x_(e){return e.usage(`$0 zero-trust dlp data-tag-categories get <category-id>
629
+
630
+ Gets a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S_={command:`get <category-id>`,describe:`Retrieve a specific data tag category.`,builder:x_,handler:async e=>u({command:`zero-trust dlp data-tag-categories get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tag-categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(b_,{account_id:a,category_id:e[`category-id`]}));s(u,{successLabel:`Loaded`})})};var C_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories`};function w_(e){return e.usage(`$0 zero-trust dlp data-tag-categories list
631
+
632
+ Lists data tag categories configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T_={command:`list`,describe:`Retrieve all data tag categories in an account`,builder:w_,handler:async e=>u({command:`zero-trust dlp data-tag-categories list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp data-tag-categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(C_,{account_id:a}));s(u,{successLabel:`Loaded`})})};var E_={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}`,body:`json`};function D_(e){return e.usage(`$0 zero-trust dlp data-tag-categories update <category-id>
633
+
634
+ Updates a data tag category and its tags.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tags`,{type:`string`,description:"The desired final state of tags.\n- `None` (omitted): no tag changes.\n- `Some([])`: delete all tags.\n- `Some([...])`: desired final set + order. Provide as a JSON array of objects or @path/to/file.json."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the data tag category to update.`})}const O_={command:`update <category-id>`,describe:`Update the attributes of a single data tag category.`,builder:D_,handler:async e=>u({command:`zero-trust dlp data-tag-categories update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tag-categories update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),tags:p(e.tags,`tags`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(E_,{body:t,account_id:a,category_id:e[`category-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),tags:p(e.tags,`tags`)}),d=await l(`Updating`,async()=>n.send(E_,{body:u,account_id:a,category_id:e[`category-id`]}));s(d,{successLabel:`Updated`})})},k_={command:`data-tag-categories`,describe:`Data Loss Prevention - manage categories that organize data tags`,builder:e=>e.command(g_).command(y_).command(S_).command(T_).command(O_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_category_templates/${t.template_id}`};function j_(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates get <template-id>
635
+
636
+ Gets an available data tag category template.`).positional(`template-id`,{type:`string`,description:`Template ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M_={command:`get <template-id>`,describe:`Retrieve a specific data tag category template.`,builder:j_,handler:async e=>u({command:`zero-trust dlp data-tag-category-templates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tag-category-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_category_templates/${e[`template-id`]==null?`<template-id>`:encodeURIComponent(String(e[`template-id`]))}`,pathParams:{"template-id":String(e[`template-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(A_,{account_id:a,template_id:e[`template-id`]}));s(u,{successLabel:`Loaded`})})};var N_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_category_templates`};function P_(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates list
637
+
638
+ Lists available data tag category templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F_={command:`list`,describe:`Retrieve all data tag category templates in an account`,builder:P_,handler:async e=>u({command:`zero-trust dlp data-tag-category-templates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp data-tag-category-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/data_tag_category_templates`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(N_,{account_id:a}));s(u,{successLabel:`Loaded`})})},I_={command:`data-tag-category-templates`,describe:`Data Loss Prevention - browse templates for creating data tag categories`,builder:e=>e.command(M_).command(F_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var L_={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}/data_tags`,body:`json`};function R_(e){return e.usage(`$0 zero-trust dlp data-tags create <category-id>
639
+
640
+ Creates a data tag in a category.`).positional(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new data tag.`})}const z_={command:`create <category-id>`,describe:`Creates a new data tag.`,builder:R_,handler:async e=>u({command:`zero-trust dlp data-tags create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}/data_tags`,pathParams:{"category-id":String(e[`category-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(L_,{body:t,account_id:a,category_id:e[`category-id`]}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(L_,{body:u,account_id:a,category_id:e[`category-id`]}));s(d,{successLabel:`Created`})})};var B_={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}/data_tags/${t.tag_id}`};function V_(e){return e.usage(`$0 zero-trust dlp data-tags delete <tag-id>
641
+
642
+ Deletes a data tag from a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H_={command:`delete <tag-id>`,describe:`Delete a single data tag.`,builder:V_,handler:async e=>u({command:`zero-trust dlp data-tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}/data_tags/${e[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(e[`tag-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``),"tag-id":String(e[`tag-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
643
+ `);return}let u=await l(`Deleting`,async()=>n.send(B_,{account_id:a,category_id:e[`category-id`],tag_id:e[`tag-id`]}));s(u,{successLabel:`Deleted`})})};var U_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}/data_tags/${t.tag_id}`};function W_(e){return e.usage(`$0 zero-trust dlp data-tags get <tag-id>
644
+
645
+ Gets a data tag from a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G_={command:`get <tag-id>`,describe:`Retrieve a specific data tag.`,builder:W_,handler:async e=>u({command:`zero-trust dlp data-tags get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}/data_tags/${e[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(e[`tag-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``),"tag-id":String(e[`tag-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(U_,{account_id:a,category_id:e[`category-id`],tag_id:e[`tag-id`]}));s(u,{successLabel:`Loaded`})})};var K_={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}/data_tags`};function q_(e){return e.usage(`$0 zero-trust dlp data-tags list
646
+
647
+ Lists data tags in a category.`).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J_={command:`list`,describe:`Retrieve all data tags in a data tag category`,builder:q_,handler:async e=>u({command:`zero-trust dlp data-tags list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}/data_tags`,pathParams:{"category-id":String(e[`category-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(K_,{account_id:a,category_id:e[`category-id`]}));s(u,{successLabel:`Loaded`})})};var Y_={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/data_tag_categories/${t.category_id}/data_tags/${t.tag_id}`,body:`json`};function X_(e){return e.usage(`$0 zero-trust dlp data-tags update <tag-id>
648
+
649
+ Updates a data tag in a category.`).positional(`tag-id`,{type:`string`,description:`Tag ID`,demandOption:!0}).option(`category-id`,{type:`string`,description:`Category ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the data tag to update.`})}const Z_={command:`update <tag-id>`,describe:`Update the attributes of a single data tag.`,builder:X_,handler:async e=>u({command:`zero-trust dlp data-tags update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp data-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/data_tag_categories/${e[`category-id`]==null?`<category-id>`:encodeURIComponent(String(e[`category-id`]))}/data_tags/${e[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(e[`tag-id`]))}`,pathParams:{"category-id":String(e[`category-id`]??``),"tag-id":String(e[`tag-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Y_,{body:t,account_id:a,category_id:e[`category-id`],tag_id:e[`tag-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(Y_,{body:u,account_id:a,category_id:e[`category-id`],tag_id:e[`tag-id`]}));s(d,{successLabel:`Updated`})})},Q_={command:`data-tags`,describe:`Data Loss Prevention - manage tags used to classify and organize sensitive data`,builder:e=>e.command(z_).command(H_).command(G_).command(J_).command(Z_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $_={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/datasets`,body:`json`};function ev(e){return e.usage(`$0 zero-trust dlp datasets create
650
+
651
+ Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations.`).option(`case-sensitive`,{type:`boolean`,description:`Only applies to custom word lists.
652
+ Determines if the words should be matched in a case-sensitive manner
653
+ 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
654
+
655
+ Non-secret custom word lists with no header are always version 1.
656
+ Secret EDM lists with no header are version 1.
657
+ Multicolumn CSV with headers are version 2.
658
+ Omitting this field provides the default value 0, which is interpreted
659
+ the same as 1.`}).option(`name`,{type:`string`,description:`The name field`}).option(`secret`,{type:`boolean`,description:`Generate a secret dataset.
660
+
661
+ If true, the response will include a secret to use with the EDM encoder.
662
+ 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 tv={command:`create`,describe:`Create a new dataset`,builder:ev,handler:async e=>u({command:`zero-trust dlp datasets create`,classification:{safeFlags:[`case-sensitive`,`secret`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({case_sensitive:e[`case-sensitive`],description:h(e.description,`description`,`text`),encoding_version:e[`encoding-version`],name:h(e.name,`name`,`text`),secret:e.secret}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send($_,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({case_sensitive:e[`case-sensitive`],description:h(e.description,`description`,`text`),encoding_version:e[`encoding-version`],name:h(e.name,`name`,`text`),secret:e.secret}),d=await l(`Creating`,async()=>n.send($_,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var nv={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/datasets/${t.dataset_id}`,response:!1};function rv(e){return e.usage(`$0 zero-trust dlp datasets delete <dataset-id>
663
+
664
+ This deletes all versions of the dataset.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const iv={command:`delete <dataset-id>`,describe:`Delete a dataset`,builder:rv,handler:async e=>u({command:`zero-trust dlp datasets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
665
+ `);return}let u=await l(`Deleting`,async()=>n.send(nv,{account_id:a,dataset_id:e[`dataset-id`]}));s(u,{successLabel:`Deleted`})})};var av={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/datasets/${t.dataset_id}`};function ov(e){return e.usage(`$0 zero-trust dlp datasets get <dataset-id>
666
+
667
+ Gets a dataset and its latest upload status.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sv={command:`get <dataset-id>`,describe:`Fetch a specific dataset`,builder:ov,handler:async e=>u({command:`zero-trust dlp datasets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(av,{account_id:a,dataset_id:e[`dataset-id`]}));s(u,{successLabel:`Loaded`})})};var cv={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/datasets`};function lv(e){return e.usage(`$0 zero-trust dlp datasets list
668
+
669
+ Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const uv={command:`list`,describe:`Fetch all datasets`,builder:lv,handler:async e=>u({command:`zero-trust dlp datasets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(cv,{account_id:a}));s(u,{successLabel:`Loaded`})})};var dv={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/datasets/${t.dataset_id}/upload`};function fv(e){return e.usage(`$0 zero-trust dlp datasets prepare-upload <dataset-id>
670
+
671
+ Creates a new version of a DLP dataset, allowing you to stage changes before activation. Used for single-column EDM and custom word lists.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pv={command:`prepare-upload <dataset-id>`,describe:`Prepare to upload a new version of a dataset`,builder:fv,handler:async e=>u({command:`zero-trust dlp datasets prepare-upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets prepare-upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/upload`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(dv,{account_id:a,dataset_id:e[`dataset-id`]}));s(u,{successLabel:`Created`})})};var mv={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/datasets/${t.dataset_id}`,body:`json`};function hv(e){return e.usage(`$0 zero-trust dlp datasets update <dataset-id>
672
+
673
+ Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.`).positional(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`case-sensitive`,{type:`boolean`,description:`Determines if the words should be matched in a case-sensitive manner.
674
+
675
+ 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 gv={command:`update <dataset-id>`,describe:`Update details about a dataset`,builder:hv,handler:async e=>u({command:`zero-trust dlp datasets update`,classification:{safeFlags:[`case-sensitive`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({case_sensitive:e[`case-sensitive`],description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(mv,{body:t,account_id:a,dataset_id:e[`dataset-id`]}));s(r,{successLabel:`Updated`});return}let u=m({case_sensitive:e[`case-sensitive`],description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(mv,{body:u,account_id:a,dataset_id:e[`dataset-id`]}));s(d,{successLabel:`Updated`})})};function _v(e){return e.usage(`$0 zero-trust dlp datasets upload <version>
676
+
677
+ This is used for single-column EDMv1 and Custom Word Lists. The EDM format can only be created in the Cloudflare dashboard. For other clients, this operation can only be used for non-secret Custom Word Lists. The body must be a UTF-8 encoded, newline (NL or CRNL) separated list of words to be matched.`).positional(`version`,{type:`string`,description:`Version`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset. For custom wordlists this contains UTF-8 patterns separated by newline characters.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const vv={command:`upload <version>`,describe:`Upload a new version of a dataset`,builder:_v,handler:async e=>u({command:`zero-trust dlp datasets upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp datasets upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/upload/${e.version==null?`<version>`:encodeURIComponent(String(e.version))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),version:String(e.version??``)},bodyKind:`octet-stream`,body:e.body});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file){let t=g(e.file),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(e[`dataset-id`]))}/upload/${encodeURIComponent(String(e.version))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}}));s(r,{successLabel:`Created`});return}if(e.body){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(e[`dataset-id`]))}/upload/${encodeURIComponent(String(e.version))}`,{body:t,headers:{"Content-Type":`application/octet-stream`}}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},yv={command:`datasets`,describe:`Data Loss Prevention - manage datasets, versions, and uploads`,builder:e=>e.command(tv).command(iv).command(sv).command(uv).command(pv).command(gv).command(vv).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var bv={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/document_fingerprints`,body:`json`};function xv(e){return e.usage(`$0 zero-trust dlp document-fingerprints create
678
+
679
+ Creates a new document fingerprint for DLP scanning. Document fingerprints detect documents that are structurally similar to the uploaded sample.`).option(`description`,{type:`string`,description:`The description field`,default:``}).option(`match-percent`,{type:`number`,description:`The match_percent field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new document fingerprint.`})}const Sv={command:`create`,describe:`Creates a new document fingerprint.`,builder:xv,handler:async e=>u({command:`zero-trust dlp document-fingerprints create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp document-fingerprints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),match_percent:e[`match-percent`],name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(bv,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`match-percent`]===void 0)throw Error(`--match-percent is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({description:h(e.description,`description`,`text`),match_percent:e[`match-percent`],name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(bv,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Cv={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/document_fingerprints/${t.document_fingerprint_id}`,response:!1};function wv(e){return e.usage(`$0 zero-trust dlp document-fingerprints delete <document-fingerprint-id>
680
+
681
+ Removes a document fingerprint from DLP configuration. Documents matching this fingerprint will no longer be detected.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Tv={command:`delete <document-fingerprint-id>`,describe:`Delete a single document fingerprint.`,builder:wv,handler:async e=>u({command:`zero-trust dlp document-fingerprints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp document-fingerprints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/document_fingerprints/${e[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(e[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(e[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
682
+ `);return}let u=await l(`Deleting`,async()=>n.send(Cv,{account_id:a,document_fingerprint_id:e[`document-fingerprint-id`]}));s(u,{successLabel:`Deleted`})})};var Ev={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/document_fingerprints/${t.document_fingerprint_id}`};function Dv(e){return e.usage(`$0 zero-trust dlp document-fingerprints get <document-fingerprint-id>
683
+
684
+ Gets a document fingerprint and its latest upload status.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ov={command:`get <document-fingerprint-id>`,describe:`Retrieve data about a specific document fingerprint.`,builder:Dv,handler:async e=>u({command:`zero-trust dlp document-fingerprints get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp document-fingerprints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/document_fingerprints/${e[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(e[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(e[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ev,{account_id:a,document_fingerprint_id:e[`document-fingerprint-id`]}));s(u,{successLabel:`Loaded`})})};var kv={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/document_fingerprints`};function Av(e){return e.usage(`$0 zero-trust dlp document-fingerprints list
685
+
686
+ Lists all document fingerprints configured for DLP scanning in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jv={command:`list`,describe:`Retrieve data about all document fingerprints.`,builder:Av,handler:async e=>u({command:`zero-trust dlp document-fingerprints list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp document-fingerprints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(kv,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Mv={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/document_fingerprints/${t.document_fingerprint_id}`,body:`json`};function Nv(e){return e.usage(`$0 zero-trust dlp document-fingerprints update <document-fingerprint-id>
687
+
688
+ Updates metadata for an existing document fingerprint, such as its name or description.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`match-percent`,{type:`number`,description:`The match_percent field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the document fingerprint to update.`})}const Pv={command:`update <document-fingerprint-id>`,describe:`Update the attributes of a single document fingerprint.`,builder:Nv,handler:async e=>u({command:`zero-trust dlp document-fingerprints update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp document-fingerprints update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/document_fingerprints/${e[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(e[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(e[`document-fingerprint-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),match_percent:e[`match-percent`],name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Mv,{body:t,account_id:a,document_fingerprint_id:e[`document-fingerprint-id`]}));s(r,{successLabel:`Created`});return}let u=m({description:h(e.description,`description`,`text`),match_percent:e[`match-percent`],name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(Mv,{body:u,account_id:a,document_fingerprint_id:e[`document-fingerprint-id`]}));s(d,{successLabel:`Created`})})};function Fv(e){return e.usage(`$0 zero-trust dlp document-fingerprints upload <document-fingerprint-id>
689
+
690
+ Uploads a new document to create or update a fingerprint. The document structure is analyzed to enable detection of similar documents.`).positional(`document-fingerprint-id`,{type:`string`,description:`Document fingerprint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`File used for document fingerprinting.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Iv={command:`upload <document-fingerprint-id>`,describe:`Uploads a new version for a document fingerprint.`,builder:Fv,handler:async e=>u({command:`zero-trust dlp document-fingerprints upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp document-fingerprints upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/document_fingerprints/${e[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(e[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(e[`document-fingerprint-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0){let t=new FormData;if(e.file){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);let r=await l(`Updating`,async()=>n(a,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(e[`document-fingerprint-id`]))}`,{body:t}));s(r,{successLabel:`Updated`});return}if(e.body){let t=h(e.body,`body`,`binary`),r=await l(`Updating`,async()=>n(a,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(e[`document-fingerprint-id`]))}`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Lv={command:`document-fingerprints`,describe:`Data Loss Prevention - manage document fingerprints for detecting matching documents`,builder:e=>e.command(Sv).command(Tv).command(Ov).command(jv).command(Pv).command(Iv).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Rv={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/email/account_mapping`,body:`json`};function zv(e){return e.usage(`$0 zero-trust dlp email account-mapping create
691
+
692
+ Creates a mapping between a Cloudflare account and an email provider for DLP email scanning integration.`).option(`auth-requirements-allowed-microsoft-organizations`,{type:`string`,array:!0,description:`The auth_requirements.allowed_microsoft_organizations field`}).option(`auth-requirements-type`,{type:`string`,description:`The auth_requirements.type field`,choices:[`Org`,`NoAuth`]}).coerce(`auth-requirements-type`,e=>h(e,`auth-requirements-type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Account mapping.`})}const Bv={command:`create`,describe:`Create mapping`,builder:zv,handler:async e=>u({command:`zero-trust dlp email account-mapping create`,classification:{safeFlags:[`auth-requirements-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email account-mapping create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({auth_requirements:{allowed_microsoft_organizations:e[`auth-requirements-allowed-microsoft-organizations`],type:e[`auth-requirements-type`]}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Rv,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`auth-requirements-type`]===void 0&&(e[`auth-requirements-type`]=await v(`auth-requirements-type`,`The auth_requirements.type field`,[`Org`,`NoAuth`]));let u=m({auth_requirements:{allowed_microsoft_organizations:e[`auth-requirements-allowed-microsoft-organizations`],type:e[`auth-requirements-type`]}}),d=await l(`Creating`,async()=>n.send(Rv,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Vv={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/email/account_mapping`};function Hv(e){return e.usage(`$0 zero-trust dlp email account-mapping get
693
+
694
+ Retrieves the email provider mapping configuration for DLP email scanning.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Uv={command:`get`,describe:`Get mapping`,builder:Hv,handler:async e=>u({command:`zero-trust dlp email account-mapping get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp email account-mapping get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Vv,{account_id:a}));s(u,{successLabel:`Loaded`})})},Wv={command:`account-mapping`,describe:`Data Loss Prevention - configure account mappings for outbound email scanning`,builder:e=>e.command(Bv).command(Uv).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Gv={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules`,body:`json`};function Kv(e){return e.usage(`$0 zero-trust dlp email rules bulk-edit
695
+
696
+ Reorders DLP email scanning rules by updating their priority values. Higher priority rules are evaluated first.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule priorities.`})}const qv={command:`bulk-edit`,describe:`Update email scanner rule priorities`,builder:Kv,handler:async e=>u({command:`zero-trust dlp email rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Gv,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var Jv={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules`,body:`json`};function Yv(e){return e.usage(`$0 zero-trust dlp email rules create
697
+
698
+ Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.`).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).coerce(`action-action`,e=>h(e,`action-action`,`text`)).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 Xv={command:`create`,describe:`Create email scanner rule`,builder:Yv,handler:async e=>u({command:`zero-trust dlp email rules create`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({action:{action:e[`action-action`],message:h(e[`action-message`],`action-message`,`text`)},conditions:p(e.conditions,`conditions`),description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Jv,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e[`action-action`]===void 0&&(e[`action-action`]=await v(`action-action`,`The action.action field`,[`Block`])),e.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({action:{action:e[`action-action`],message:h(e[`action-message`],`action-message`,`text`)},conditions:p(e.conditions,`conditions`),description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(Jv,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Zv={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules/${t.rule_id}`};function Qv(e){return e.usage(`$0 zero-trust dlp email rules delete <rule-id>
699
+
700
+ Removes a DLP email scanning rule. The rule will no longer be applied to email messages.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $v={command:`delete <rule-id>`,describe:`Delete email scanner rule`,builder:Qv,handler:async e=>u({command:`zero-trust dlp email rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
701
+ `);return}let u=await l(`Deleting`,async()=>n.send(Zv,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Deleted`})})};var ey={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules/${t.rule_id}`};function ty(e){return e.usage(`$0 zero-trust dlp email rules get <rule-id>
702
+
703
+ Gets detailed configuration for a specific DLP email scanning rule, including detection patterns and actions.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ny={command:`get <rule-id>`,describe:`Get an email scanner rule`,builder:ty,handler:async e=>u({command:`zero-trust dlp email rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ey,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Loaded`})})};var ry={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules`};function iy(e){return e.usage(`$0 zero-trust dlp email rules list
704
+
705
+ Lists all email scanner rules for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ay={command:`list`,describe:`List all email scanner rules`,builder:iy,handler:async e=>u({command:`zero-trust dlp email rules list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp email rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ry,{account_id:a}));s(u,{successLabel:`Loaded`})})};var oy={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/email/rules/${t.rule_id}`,body:`json`};function sy(e){return e.usage(`$0 zero-trust dlp email rules update <rule-id>
706
+
707
+ Updates a DLP email scanning rule.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).coerce(`action-action`,e=>h(e,`action-action`,`text`)).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 cy={command:`update <rule-id>`,describe:`Update email scanner rule`,builder:sy,handler:async e=>u({command:`zero-trust dlp email rules update`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp email rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/email/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({action:{action:e[`action-action`],message:h(e[`action-message`],`action-message`,`text`)},conditions:p(e.conditions,`conditions`),description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(oy,{body:t,account_id:a,rule_id:e[`rule-id`]}));s(r,{successLabel:`Updated`});return}if(e[`action-action`]===void 0&&(e[`action-action`]=await v(`action-action`,`The action.action field`,[`Block`])),e.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({action:{action:e[`action-action`],message:h(e[`action-message`],`action-message`,`text`)},conditions:p(e.conditions,`conditions`),description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(oy,{body:u,account_id:a,rule_id:e[`rule-id`]}));s(d,{successLabel:`Updated`})})},ly={command:`rules`,describe:`Data Loss Prevention - manage outbound email scanning rules and their priorities`,builder:e=>e.command(qv).command(Xv).command($v).command(ny).command(ay).command(cy).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},uy={command:`email`,describe:`Operations for dlp.email`,builder:e=>e.command(Wv).command(ly).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var dy={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/entries`,body:`json`};function fy(e){return e.usage(`$0 zero-trust dlp entries create
708
+
709
+ Creates a DLP custom entry.`).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).coerce(`pattern-validation`,e=>h(e,`pattern-validation`,`text`)).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 py={command:`create`,describe:`Create custom entry`,builder:fy,handler:async e=>u({command:`zero-trust dlp entries create`,classification:{safeFlags:[`enabled`,`pattern-validation`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),pattern:{regex:h(e[`pattern-regex`],`pattern-regex`,`text`),validation:e[`pattern-validation`]},profile_id:h(e[`profile-id`],`profile-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(dy,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await _(`name`,`The name field`)),e[`pattern-regex`]===void 0&&(e[`pattern-regex`]=await _(`pattern-regex`,`The pattern.regex field`));let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),pattern:{regex:h(e[`pattern-regex`],`pattern-regex`,`text`),validation:e[`pattern-validation`]},profile_id:h(e[`profile-id`],`profile-id`,`text`)}),d=await l(`Creating`,async()=>n.send(dy,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var my={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/entries/${t.entry_id}`};function hy(e){return e.usage(`$0 zero-trust dlp entries delete <entry-id>
710
+
711
+ Deletes a DLP custom entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const gy={command:`delete <entry-id>`,describe:`Delete custom entry`,builder:hy,handler:async e=>u({command:`zero-trust dlp entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/entries/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
712
+ `);return}let u=await l(`Deleting`,async()=>n.send(my,{account_id:a,entry_id:e[`entry-id`]}));s(u,{successLabel:`Deleted`})})};var _y={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/entries/${t.entry_id}`};function vy(e){return e.usage(`$0 zero-trust dlp entries get <entry-id>
713
+
714
+ Fetches a DLP entry by ID.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yy={command:`get <entry-id>`,describe:`Get DLP Entry`,builder:vy,handler:async e=>u({command:`zero-trust dlp entries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/entries/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(_y,{account_id:a,entry_id:e[`entry-id`]}));s(u,{successLabel:`Loaded`})})};var by={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/entries`};function xy(e){return e.usage(`$0 zero-trust dlp entries list
715
+
716
+ Lists all DLP entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sy={command:`list`,describe:`List all entries`,builder:xy,handler:async e=>u({command:`zero-trust dlp entries list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(by,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Cy={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/entries/${t.entry_id}`,body:`json`};function wy(e){return e.usage(`$0 zero-trust dlp entries update <entry-id>
717
+
718
+ Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).coerce(`pattern-validation`,e=>h(e,`pattern-validation`,`text`)).option(`type`,{type:`string`,description:`The type field`,choices:[`custom`,`predefined`,`integration`]}).coerce(`type`,e=>h(e,`type`,`text`)).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 Ty={command:`update <entry-id>`,describe:`Update entry`,builder:wy,handler:async e=>u({command:`zero-trust dlp entries update`,classification:{safeFlags:[`pattern-validation`,`type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/entries/${e[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(e[`entry-id`]))}`,pathParams:{"entry-id":String(e[`entry-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),pattern:{regex:h(e[`pattern-regex`],`pattern-regex`,`text`),validation:e[`pattern-validation`]},type:e.type,enabled:e.enabled}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Cy,{body:t,account_id:a,entry_id:e[`entry-id`]}));s(r,{successLabel:`Updated`});return}if(e.type===void 0&&(e.type=await v(`type`,`The type field`,[`custom`,`predefined`,`integration`])),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),pattern:{regex:h(e[`pattern-regex`],`pattern-regex`,`text`),validation:e[`pattern-validation`]},type:e.type,enabled:e.enabled}),d=await l(`Updating`,async()=>n.send(Cy,{body:u,account_id:a,entry_id:e[`entry-id`]}));s(d,{successLabel:`Updated`})})},Ey={command:`entries`,describe:`Data Loss Prevention - list and manage detection entries`,builder:e=>e.command(py).command(gy).command(yy).command(Sy).command(Ty).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Dy={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/limits`};function Oy(e){return e.usage(`$0 zero-trust dlp limits list
719
+
720
+ Retrieves current DLP usage limits and quotas for the account, including maximum allowed counts and current usage for custom entries, dataset cells, and document fingerprints.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ky={command:`list`,describe:`Fetch limits associated with DLP for account`,builder:Oy,handler:async e=>u({command:`zero-trust dlp limits list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/limits`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Dy,{account_id:a}));s(u,{successLabel:`Loaded`})})},Ay={command:`limits`,describe:`Data Loss Prevention - view account limits and resource quotas`,builder:e=>e.command(ky).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var jy={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/patterns/validate`,body:`json`};function My(e){return e.usage("$0 zero-trust dlp patterns validate\n\nValidates whether this pattern is a valid regular expression. Rejects it if the regular expression is too complex or can match an unbounded-length string. The regex will be rejected if it uses `*` or `+`. Bound the maximum number of characters that can be matched using a range, e.g. `{1,100}`.").option(`max-match-bytes`,{type:`number`,description:"Maximum number of bytes that the regular expression can match.\n\nIf this is `null` then there is no limit on the length. Patterns can use\n`*` and `+`. Otherwise repeats should use a range `{m,n}` to restrict\npatterns to the length. If this field is missing, then a default length\nlimit is used.\n\nNote that the length is specified in bytes. Since regular expressions\nuse UTF-8 the pattern `.` can match up to 4 bytes. Hence `.{1,256}`\nhas a maximum length of 1024 bytes."}).option(`regex`,{type:`string`,description:`The regex field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Validation query.`})}const Ny={command:`validate`,describe:`Validate a DLP regex pattern`,builder:My,handler:async e=>u({command:`zero-trust dlp patterns validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp patterns validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/patterns/validate`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({max_match_bytes:e[`max-match-bytes`],regex:h(e.regex,`regex`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(jy,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.regex===void 0&&(e.regex=await _(`regex`,`The regex field`));let u=m({max_match_bytes:e[`max-match-bytes`],regex:h(e.regex,`regex`,`text`)}),d=await l(`Creating`,async()=>n.send(jy,{body:u,account_id:a}));s(d,{successLabel:`Created`})})},Py={command:`patterns`,describe:`Data Loss Prevention - validate regular expressions used for content detection`,builder:e=>e.command(Ny).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Fy={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/profiles/custom`,body:`json`};function Iy(e){return e.usage(`$0 zero-trust dlp profiles custom create
721
+
722
+ Creates a DLP custom profile.`).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`Related DLP policies will trigger when the match count exceeds the number set.`,default:0}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`,default:`low`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`data-classes`,{type:`string`,array:!0,description:`Data class IDs to associate with the profile.`}).option(`data-tags`,{type:`string`,array:!0,description:`Data tag IDs to associate with the profile.`}).option(`description`,{type:`string`,description:`The description of the profile.`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`,default:!1}).option(`sensitivity-levels`,{type:`string`,description:`Sensitivity levels to associate with the profile. Provide as a JSON array of objects or @path/to/file.json.`}).option(`shared-entries`,{type:`string`,description:`Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection profiles). Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A new profile to create.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const Ly={command:`create`,describe:`Create custom profile`,builder:Iy,handler:async e=>u({command:`zero-trust dlp profiles custom create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},data_classes:e[`data-classes`],data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`),ocr_enabled:e[`ocr-enabled`],sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`),shared_entries:p(e[`shared-entries`],`shared-entries`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(Fy,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},data_classes:e[`data-classes`],data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`),ocr_enabled:e[`ocr-enabled`],sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`),shared_entries:p(e[`shared-entries`],`shared-entries`)}),d=await l(`Creating`,async()=>n.send(Fy,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var Ry={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/profiles/custom/${t.profile_id}`};function zy(e){return e.usage(`$0 zero-trust dlp profiles custom delete <profile-id>
723
+
724
+ Deletes a DLP custom profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const By={command:`delete <profile-id>`,describe:`Delete custom profile`,builder:zy,handler:async e=>u({command:`zero-trust dlp profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/profiles/custom/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
725
+ `);return}let u=await l(`Deleting`,async()=>n.send(Ry,{account_id:a,profile_id:e[`profile-id`]}));s(u,{successLabel:`Deleted`})})};var Vy={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/profiles/custom/${t.profile_id}`,body:`json`};function Hy(e){return e.usage(`$0 zero-trust dlp profiles custom update <profile-id>
726
+
727
+ Updates a DLP custom profile.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`data-classes`,{type:`string`,array:!0,description:`Data class IDs to associate with the profile. If omitted, existing associations are unchanged.`}).option(`data-tags`,{type:`string`,array:!0,description:`Data tag IDs to associate with the profile. If omitted, existing associations are unchanged.`}).option(`description`,{type:`string`,description:`The description of the profile.`}).option(`entries`,{type:`string`,description:`Custom entries from this profile.
728
+ 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 Uy={command:`update <profile-id>`,describe:`Update custom profile`,builder:Hy,handler:async e=>u({command:`zero-trust dlp profiles custom update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp profiles custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/profiles/custom/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},data_classes:e[`data-classes`],data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`),ocr_enabled:e[`ocr-enabled`],sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`),shared_entries:p(e[`shared-entries`],`shared-entries`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Vy,{body:t,account_id:a,profile_id:e[`profile-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},data_classes:e[`data-classes`],data_tags:e[`data-tags`],description:h(e.description,`description`,`text`),entries:p(e.entries,`entries`),name:h(e.name,`name`,`text`),ocr_enabled:e[`ocr-enabled`],sensitivity_levels:p(e[`sensitivity-levels`],`sensitivity-levels`),shared_entries:p(e[`shared-entries`],`shared-entries`)}),d=await l(`Updating`,async()=>n.send(Vy,{body:u,account_id:a,profile_id:e[`profile-id`]}));s(d,{successLabel:`Updated`})})},Wy={command:`custom`,describe:`Data Loss Prevention - manage custom profiles`,builder:e=>e.command(Ly).command(By).command(Uy).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Gy={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/profiles/${t.profile_id}`};function Ky(e){return e.usage(`$0 zero-trust dlp profiles get <profile-id>
729
+
730
+ Fetches a DLP profile by ID.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qy={command:`get <profile-id>`,describe:`Get DLP Profile`,builder:Ky,handler:async e=>u({command:`zero-trust dlp profiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/profiles/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Gy,{account_id:a,profile_id:e[`profile-id`]}));s(u,{successLabel:`Loaded`})})};var Jy={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/profiles`,query:[`all`]};function Yy(e){return e.usage(`$0 zero-trust dlp profiles list
731
+
732
+ Lists all DLP profiles in an account.`).option(`all`,{type:`boolean`,description:`Return all profiles, including those that current account does not have access to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xy={command:`list`,describe:`List all profiles`,builder:Yy,handler:async e=>u({command:`zero-trust dlp profiles list`,classification:{safeFlags:[`all`,`dry-run`]}},e,async()=>{let n={all:e.all};if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/profiles`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Jy,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var Zy={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/profiles/predefined/${t.profile_id}`,body:`json`};function Qy(e){return e.usage(`$0 zero-trust dlp profiles predefined update <profile-id>
733
+
734
+ Updates a DLP predefined profile. Only supports enabling/disabling entries.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updated parameters for the predefined profile.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const $y={command:`update <profile-id>`,describe:`Update predefined profile`,builder:Qy,handler:async e=>u({command:`zero-trust dlp profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/profiles/predefined/${e[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(e[`profile-id`]))}`,pathParams:{"profile-id":String(e[`profile-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},entries:p(e.entries,`entries`),ocr_enabled:e[`ocr-enabled`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Zy,{body:t,account_id:a,profile_id:e[`profile-id`]}));s(r,{successLabel:`Updated`});return}let u=m({ai_context_enabled:e[`ai-context-enabled`],allowed_match_count:e[`allowed-match-count`],confidence_threshold:h(e[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:e[`context-awareness-enabled`],skip:{files:e[`context-awareness-skip-files`]}},entries:p(e.entries,`entries`),ocr_enabled:e[`ocr-enabled`]}),d=await l(`Updating`,async()=>n.send(Zy,{body:u,account_id:a,profile_id:e[`profile-id`]}));s(d,{successLabel:`Updated`})})},eb={command:`predefined`,describe:`Data Loss Prevention - manage predefined profiles`,builder:e=>e.command($y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tb={command:`profiles`,describe:`Data Loss Prevention - list and retrieve profiles`,builder:e=>e.command(qy).command(Xy).command(Wy).command(eb).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var nb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/templates/${t.template_id}`};function rb(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates get <template-id>
735
+
736
+ Gets an available sensitivity group template.`).positional(`template-id`,{type:`string`,description:`Template ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ib={command:`get <template-id>`,describe:`Retrieve a specific sensitivity group template.`,builder:rb,handler:async e=>u({command:`zero-trust dlp sensitivity-group-templates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-group-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/templates/${e[`template-id`]==null?`<template-id>`:encodeURIComponent(String(e[`template-id`]))}`,pathParams:{"template-id":String(e[`template-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(nb,{account_id:a,template_id:e[`template-id`]}));s(u,{successLabel:`Loaded`})})};var ab={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/templates`};function ob(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates list
737
+
738
+ Lists available sensitivity group templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sb={command:`list`,describe:`Retrieve all sensitivity group templates in an account`,builder:ob,handler:async e=>u({command:`zero-trust dlp sensitivity-group-templates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp sensitivity-group-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups/templates`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ab,{account_id:a}));s(u,{successLabel:`Loaded`})})},cb={command:`sensitivity-group-templates`,describe:`Data Loss Prevention - browse templates for creating sensitivity groups`,builder:e=>e.command(ib).command(sb).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var lb={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups`,body:`json`};function ub(e){return e.usage(`$0 zero-trust dlp sensitivity-groups create
739
+
740
+ Creates a sensitivity group, optionally from a template.`).option(`description`,{type:`string`,description:`The description field`}).option(`levels`,{type:`string`,description:"Levels to create with the group. Mutually exclusive with `template_id`. Provide as a JSON array of objects or @path/to/file.json."}).option(`name`,{type:`string`,description:`The name field`}).option(`template-id`,{type:`string`,description:`The template_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new sensitivity group.`})}const db={command:`create`,describe:`Creates a new sensitivity group.`,builder:ub,handler:async e=>u({command:`zero-trust dlp sensitivity-groups create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),levels:p(e.levels,`levels`),name:h(e.name,`name`,`text`),template_id:h(e[`template-id`],`template-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(lb,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({description:h(e.description,`description`,`text`),levels:p(e.levels,`levels`),name:h(e.name,`name`,`text`),template_id:h(e[`template-id`],`template-id`,`text`)}),d=await l(`Creating`,async()=>n.send(lb,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var fb={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}`};function pb(e){return e.usage(`$0 zero-trust dlp sensitivity-groups delete <sensitivity-group-id>
741
+
742
+ Deletes a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const mb={command:`delete <sensitivity-group-id>`,describe:`Delete a single sensitivity group.`,builder:pb,handler:async e=>u({command:`zero-trust dlp sensitivity-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
743
+ `);return}let u=await l(`Deleting`,async()=>n.send(fb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(u,{successLabel:`Deleted`})})};var hb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/level_order`};function gb(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get-level-order <sensitivity-group-id>
744
+
745
+ Gets the current order of sensitivity levels in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _b={command:`get-level-order <sensitivity-group-id>`,describe:`Retrieve the ordered list of level IDs for a sensitivity group.`,builder:gb,handler:async e=>u({command:`zero-trust dlp sensitivity-groups get-level-order`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups get-level-order`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(hb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(u,{successLabel:`Loaded`})})};var vb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}`};function yb(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get <sensitivity-group-id>
746
+
747
+ Gets a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const bb={command:`get <sensitivity-group-id>`,describe:`Retrieve a specific sensitivity group.`,builder:yb,handler:async e=>u({command:`zero-trust dlp sensitivity-groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(vb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(u,{successLabel:`Loaded`})})};var xb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups`};function Sb(e){return e.usage(`$0 zero-trust dlp sensitivity-groups list
748
+
749
+ Lists sensitivity groups configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cb={command:`list`,describe:`Retrieve all sensitivity groups in an account`,builder:Sb,handler:async e=>u({command:`zero-trust dlp sensitivity-groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp sensitivity-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(xb,{account_id:a}));s(u,{successLabel:`Loaded`})})};var wb={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/level_order`,body:`json`};function Tb(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update-level-order <sensitivity-group-id>
750
+
751
+ Updates the order of sensitivity levels in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`level-ids`,{type:`string`,array:!0,description:`The level_ids field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Desired ordered list of level IDs.`})}const Eb={command:`update-level-order <sensitivity-group-id>`,describe:`Set the ordering of levels within a sensitivity group.`,builder:Tb,handler:async e=>u({command:`zero-trust dlp sensitivity-groups update-level-order`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups update-level-order`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({level_ids:e[`level-ids`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(wb,{body:t,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(r,{successLabel:`Updated`});return}if(e[`level-ids`]===void 0)throw Error(`--level-ids is required (or pass --body with this field set).`);let u=m({level_ids:e[`level-ids`]}),d=await l(`Updating`,async()=>n.send(wb,{body:u,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(d,{successLabel:`Updated`})})};var Db={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}`,body:`json`};function Ob(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update <sensitivity-group-id>
752
+
753
+ Updates a sensitivity group and its levels.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`levels`,{type:`string`,description:"The desired final state of levels.\n- `None` (omitted): no level changes.\n- `Some([])`: delete all levels.\n- `Some([...])`: desired final set + order. Provide as a JSON array of objects or @path/to/file.json."}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the sensitivity group to update.`})}const kb={command:`update <sensitivity-group-id>`,describe:`Update the attributes of a single sensitivity group.`,builder:Ob,handler:async e=>u({command:`zero-trust dlp sensitivity-groups update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),levels:p(e.levels,`levels`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Db,{body:t,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),levels:p(e.levels,`levels`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(Db,{body:u,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(d,{successLabel:`Updated`})})},Ab={command:`sensitivity-groups`,describe:`Data Loss Prevention - manage sensitivity groups and their level ordering`,builder:e=>e.command(db).command(mb).command(bb).command(_b).command(Cb).command(kb).command(Eb).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var jb={method:`POST`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/levels`,body:`json`};function Mb(e){return e.usage(`$0 zero-trust dlp sensitivity-levels create <sensitivity-group-id>
754
+
755
+ Creates a sensitivity level in a group.`).positional(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the new sensitivity level.`})}const Nb={command:`create <sensitivity-group-id>`,describe:`Creates a new sensitivity level.`,builder:Mb,handler:async e=>u({command:`zero-trust dlp sensitivity-levels create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-levels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(jb,{body:t,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`The name field`));let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Creating`,async()=>n.send(jb,{body:u,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(d,{successLabel:`Created`})})};var Pb={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/levels/${t.sensitivity_level_id}`};function Fb(e){return e.usage(`$0 zero-trust dlp sensitivity-levels delete <sensitivity-level-id>
756
+
757
+ Deletes a sensitivity level from a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ib={command:`delete <sensitivity-level-id>`,describe:`Delete a single sensitivity level.`,builder:Fb,handler:async e=>u({command:`zero-trust dlp sensitivity-levels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-levels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/levels/${e[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(e[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``),"sensitivity-level-id":String(e[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
758
+ `);return}let u=await l(`Deleting`,async()=>n.send(Pb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`],sensitivity_level_id:e[`sensitivity-level-id`]}));s(u,{successLabel:`Deleted`})})};var Lb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/levels/${t.sensitivity_level_id}`};function Rb(e){return e.usage(`$0 zero-trust dlp sensitivity-levels get <sensitivity-level-id>
759
+
760
+ Gets a sensitivity level from a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zb={command:`get <sensitivity-level-id>`,describe:`Retrieve a specific sensitivity level.`,builder:Rb,handler:async e=>u({command:`zero-trust dlp sensitivity-levels get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-levels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/levels/${e[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(e[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``),"sensitivity-level-id":String(e[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Lb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`],sensitivity_level_id:e[`sensitivity-level-id`]}));s(u,{successLabel:`Loaded`})})};var Bb={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/levels`};function Vb(e){return e.usage(`$0 zero-trust dlp sensitivity-levels list
761
+
762
+ Lists sensitivity levels in a sensitivity group.`).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Hb={command:`list`,describe:`Retrieve all sensitivity levels in a sensitivity group`,builder:Vb,handler:async e=>u({command:`zero-trust dlp sensitivity-levels list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-levels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Bb,{account_id:a,sensitivity_group_id:e[`sensitivity-group-id`]}));s(u,{successLabel:`Loaded`})})};var Ub={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/sensitivity_groups/${t.sensitivity_group_id}/levels/${t.sensitivity_level_id}`,body:`json`};function Wb(e){return e.usage(`$0 zero-trust dlp sensitivity-levels update <sensitivity-level-id>
763
+
764
+ Updates a sensitivity level in a group.`).positional(`sensitivity-level-id`,{type:`string`,description:`Sensitivity level ID`,demandOption:!0}).option(`sensitivity-group-id`,{type:`string`,description:`Sensitivity group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Attributes of the sensitivity level to update.`})}const Gb={command:`update <sensitivity-level-id>`,describe:`Update the attributes of a single sensitivity level.`,builder:Wb,handler:async e=>u({command:`zero-trust dlp sensitivity-levels update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp sensitivity-levels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/sensitivity_groups/${e[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(e[`sensitivity-group-id`]))}/levels/${e[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(e[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(e[`sensitivity-group-id`]??``),"sensitivity-level-id":String(e[`sensitivity-level-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Ub,{body:t,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`],sensitivity_level_id:e[`sensitivity-level-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(Ub,{body:u,account_id:a,sensitivity_group_id:e[`sensitivity-group-id`],sensitivity_level_id:e[`sensitivity-level-id`]}));s(d,{successLabel:`Updated`})})},Kb={command:`sensitivity-levels`,describe:`Data Loss Prevention - manage sensitivity levels within sensitivity groups`,builder:e=>e.command(Nb).command(Ib).command(zb).command(Hb).command(Gb).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var qb={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/dlp/settings`};function Jb(e){return e.usage(`$0 zero-trust dlp settings delete
765
+
766
+ Deletes account-level DLP settings and returns the initial values.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Yb={command:`delete`,describe:`Delete (reset) DLP account-level settings to initial values.`,builder:Jb,handler:async e=>u({command:`zero-trust dlp settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
767
+ `);return}let u=await l(`Deleting`,async()=>n.send(qb,{account_id:a}));s(u,{successLabel:`Deleted`})})};var Xb={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/dlp/settings`,body:`json`};function Zb(e){return e.usage(`$0 zero-trust dlp settings edit
768
+
769
+ Missing fields keep their existing values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).coerce(`payload-logging-masking-level`,e=>h(e,`payload-logging-masking-level`,`text`)).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
770
+
771
+ - Set to a non-empty base64 string to enable payload logging with the given key.
772
+ - Set to an empty string to disable payload logging.
773
+ - 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 Qb={command:`edit`,describe:`Partially update DLP account-level settings.`,builder:Zb,handler:async e=>u({command:`zero-trust dlp settings edit`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({ai_context_analysis:e[`ai-context-analysis`],ocr:e.ocr,payload_logging:{masking_level:e[`payload-logging-masking-level`],public_key:h(e[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Xb,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({ai_context_analysis:e[`ai-context-analysis`],ocr:e.ocr,payload_logging:{masking_level:e[`payload-logging-masking-level`],public_key:h(e[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}),d=await l(`Updating`,async()=>n.send(Xb,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})};var $b={method:`GET`,path:t=>e`/accounts/${t.account_id}/dlp/settings`};function ex(e){return e.usage(`$0 zero-trust dlp settings get
774
+
775
+ Gets the account-level DLP settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tx={command:`get`,describe:`Get DLP account-level settings.`,builder:ex,handler:async e=>u({command:`zero-trust dlp settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust dlp settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send($b,{account_id:a}));s(u,{successLabel:`Loaded`})})};var nx={method:`PUT`,path:t=>e`/accounts/${t.account_id}/dlp/settings`,body:`json`};function rx(e){return e.usage(`$0 zero-trust dlp settings update
776
+
777
+ Missing fields are reset to initial (unconfigured) values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).coerce(`payload-logging-masking-level`,e=>h(e,`payload-logging-masking-level`,`text`)).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
778
+
779
+ - Set to a non-empty base64 string to enable payload logging with the given key.
780
+ - Set to an empty string to disable payload logging.
781
+ - 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 ix={command:`update`,describe:`Update DLP account-level settings (full replacement).`,builder:rx,handler:async e=>u({command:`zero-trust dlp settings update`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust dlp settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({ai_context_analysis:e[`ai-context-analysis`],ocr:e.ocr,payload_logging:{masking_level:e[`payload-logging-masking-level`],public_key:h(e[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(nx,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({ai_context_analysis:e[`ai-context-analysis`],ocr:e.ocr,payload_logging:{masking_level:e[`payload-logging-masking-level`],public_key:h(e[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}),d=await l(`Updating`,async()=>n.send(nx,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},ax={command:`settings`,describe:`Data Loss Prevention - manage account-level settings`,builder:e=>e.command(Yb).command(Qb).command(tx).command(ix).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ox={command:`dlp`,describe:`Operations for dlp`,builder:e=>e.command(Zg).command(p_).command(k_).command(I_).command(Q_).command(yv).command(Lv).command(uy).command(Ey).command(Ay).command(Py).command(tb).command(cb).command(Ab).command(Kb).command(ax).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var sx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/app_types`};function cx(e){return e.usage(`$0 zero-trust gateway app-types list
782
+
783
+ List all application and application type mappings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lx={command:`list`,describe:`List application and application type mappings`,builder:cx,handler:async e=>u({command:`zero-trust gateway app-types list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway app-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/app_types`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(sx,{account_id:a}));s(u,{successLabel:`Loaded`})})},ux={command:`app-types`,describe:`Operations for gateway.app-types`,builder:e=>e.command(lx).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var dx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/categories`};function fx(e){return e.usage(`$0 zero-trust gateway categories list
784
+
785
+ List all categories.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const px={command:`list`,describe:`List categories`,builder:fx,handler:async e=>u({command:`zero-trust gateway categories list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/categories`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(dx,{account_id:a}));s(u,{successLabel:`Loaded`})})},mx={command:`categories`,describe:`Operations for gateway.categories`,builder:e=>e.command(px).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var hx={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/certificates/${t.certificate_id}/activate`};function gx(e){return e.usage(`$0 zero-trust gateway certificates activate <certificate-id>
786
+
787
+ Bind a single Zero Trust certificate to the edge.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _x={command:`activate <certificate-id>`,describe:`Activate a Zero Trust certificate`,builder:gx,handler:async e=>u({command:`zero-trust gateway certificates activate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway certificates activate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}/activate`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(hx,{account_id:a,certificate_id:e[`certificate-id`]}));s(u,{successLabel:`Created`})})};var vx={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/certificates`,body:`json`};function yx(e){return e.usage(`$0 zero-trust gateway certificates create
788
+
789
+ Create a new Zero Trust certificate.`).option(`validity-period-days`,{type:`number`,description:"Sets the certificate validity period in days (range: 1-10,950 days / ~30 years). Defaults to 1,825 days (5 years). **Important**: This field is only settable during the certificate creation. Certificates becomes immutable after creation - use the `/activate` and `/deactivate` endpoints to manage certificate lifecycle."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const bx={command:`create`,describe:`Create Zero Trust certificate`,builder:yx,handler:async e=>u({command:`zero-trust gateway certificates create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({validity_period_days:e[`validity-period-days`]}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(vx,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}let u=m({validity_period_days:e[`validity-period-days`]}),d=await l(`Creating`,async()=>n.send(vx,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var xx={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/certificates/${t.certificate_id}/deactivate`};function Sx(e){return e.usage(`$0 zero-trust gateway certificates deactivate <certificate-id>
790
+
791
+ Unbind a single Zero Trust certificate from the edge.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cx={command:`deactivate <certificate-id>`,describe:`Deactivate a Zero Trust certificate`,builder:Sx,handler:async e=>u({command:`zero-trust gateway certificates deactivate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway certificates deactivate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}/deactivate`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(xx,{account_id:a,certificate_id:e[`certificate-id`]}));s(u,{successLabel:`Created`})})};var wx={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/certificates/${t.certificate_id}`};function Tx(e){return e.usage(`$0 zero-trust gateway certificates delete <certificate-id>
792
+
793
+ Delete a gateway-managed Zero Trust certificate. You must deactivate the certificate from the edge (inactive) before deleting it.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ex={command:`delete <certificate-id>`,describe:`Delete Zero Trust certificate`,builder:Tx,handler:async e=>u({command:`zero-trust gateway certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
794
+ `);return}let u=await l(`Deleting`,async()=>n.send(wx,{account_id:a,certificate_id:e[`certificate-id`]}));s(u,{successLabel:`Deleted`})})};var Dx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/certificates/${t.certificate_id}`};function Ox(e){return e.usage(`$0 zero-trust gateway certificates get <certificate-id>
795
+
796
+ Get a single Zero Trust certificate.`).positional(`certificate-id`,{type:`string`,description:`Identify the certificate with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kx={command:`get <certificate-id>`,describe:`Get Zero Trust certificate details`,builder:Ox,handler:async e=>u({command:`zero-trust gateway certificates get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Dx,{account_id:a,certificate_id:e[`certificate-id`]}));s(u,{successLabel:`Loaded`})})};var Ax={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/certificates`};function jx(e){return e.usage(`$0 zero-trust gateway certificates list
797
+
798
+ List all Zero Trust certificates for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mx={command:`list`,describe:`List Zero Trust certificates`,builder:jx,handler:async e=>u({command:`zero-trust gateway certificates list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ax,{account_id:a}));s(u,{successLabel:`Loaded`})})},Nx={command:`certificates`,describe:`Operations for gateway.certificates`,builder:e=>e.command(_x).command(bx).command(Cx).command(Ex).command(kx).command(Mx).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Px={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/gateway/configuration`,body:`json`};function Fx(e){return e.usage("$0 zero-trust gateway configurations edit\n\nUpdate (PATCH) a single subcollection of settings such as `antivirus`, `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire configuration object. This endpoint returns an error if any settings collection lacks proper configuration.").option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).coerce(`settings-block-page-mode`,e=>h(e,`settings-block-page-mode`,`text`)).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`]}).coerce(`settings-body-scanning-inspection-mode`,e=>h(e,`settings-body-scanning-inspection-mode`,`text`)).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`]}).coerce(`settings-inspection-mode`,e=>h(e,`settings-inspection-mode`,`text`)).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`]}).coerce(`settings-sandbox-fallback-action`,e=>h(e,`settings-sandbox-fallback-action`,`text`)).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if((/* @__PURE__ */ `settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const Ix={command:`edit`,describe:`Patch Zero Trust account configuration`,builder:Fx,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway configurations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({settings:{activity_log:{enabled:e[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:e[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:e[`settings-antivirus-enabled-upload-phase`],fail_closed:e[`settings-antivirus-fail-closed`],notification_settings:{enabled:e[`settings-antivirus-notification-settings-enabled`],include_context:e[`settings-antivirus-notification-settings-include-context`],msg:h(e[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:h(e[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:h(e[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:e[`settings-block-page-enabled`],footer_text:h(e[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:h(e[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:e[`settings-block-page-include-context`],logo_path:h(e[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:h(e[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:h(e[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:e[`settings-block-page-mode`],name:h(e[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:e[`settings-block-page-suppress-footer`],target_uri:h(e[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:e[`settings-body-scanning-inspection-mode`]},browser_isolation:{non_identity_enabled:e[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:e[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:h(e[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:e[`settings-custom-certificate-enabled`],id:h(e[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:e[`settings-extended-email-matching-enabled`]},fips:{tls:e[`settings-fips-tls`]},host_selector:{enabled:e[`settings-host-selector-enabled`]},inspection:{mode:e[`settings-inspection-mode`]},max_ttl_secs:e[`settings-max-ttl-secs`],protocol_detection:{enabled:e[`settings-protocol-detection-enabled`]},sandbox:{enabled:e[`settings-sandbox-enabled`],fallback_action:e[`settings-sandbox-fallback-action`]},tls_decrypt:{enabled:e[`settings-tls-decrypt-enabled`]}}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Px,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({settings:{activity_log:{enabled:e[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:e[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:e[`settings-antivirus-enabled-upload-phase`],fail_closed:e[`settings-antivirus-fail-closed`],notification_settings:{enabled:e[`settings-antivirus-notification-settings-enabled`],include_context:e[`settings-antivirus-notification-settings-include-context`],msg:h(e[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:h(e[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:h(e[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:e[`settings-block-page-enabled`],footer_text:h(e[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:h(e[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:e[`settings-block-page-include-context`],logo_path:h(e[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:h(e[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:h(e[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:e[`settings-block-page-mode`],name:h(e[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:e[`settings-block-page-suppress-footer`],target_uri:h(e[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:e[`settings-body-scanning-inspection-mode`]},browser_isolation:{non_identity_enabled:e[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:e[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:h(e[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:e[`settings-custom-certificate-enabled`],id:h(e[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:e[`settings-extended-email-matching-enabled`]},fips:{tls:e[`settings-fips-tls`]},host_selector:{enabled:e[`settings-host-selector-enabled`]},inspection:{mode:e[`settings-inspection-mode`]},max_ttl_secs:e[`settings-max-ttl-secs`],protocol_detection:{enabled:e[`settings-protocol-detection-enabled`]},sandbox:{enabled:e[`settings-sandbox-enabled`],fallback_action:e[`settings-sandbox-fallback-action`]},tls_decrypt:{enabled:e[`settings-tls-decrypt-enabled`]}}}),d=await l(`Updating`,async()=>n.send(Px,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})};var Lx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/configuration`};function Rx(e){return e.usage(`$0 zero-trust gateway configurations get
799
+
800
+ Retrieve the current Zero Trust account configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const zx={command:`get`,describe:`Get Zero Trust account configuration`,builder:Rx,handler:async e=>u({command:`zero-trust gateway configurations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Lx,{account_id:a}));s(u,{successLabel:`Loaded`})})};var Bx={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/configuration`,body:`json`};function Vx(e){return e.usage(`$0 zero-trust gateway configurations update
801
+
802
+ Update the current Zero Trust account configuration.`).option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).coerce(`settings-block-page-mode`,e=>h(e,`settings-block-page-mode`,`text`)).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`]}).coerce(`settings-body-scanning-inspection-mode`,e=>h(e,`settings-body-scanning-inspection-mode`,`text`)).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`]}).coerce(`settings-inspection-mode`,e=>h(e,`settings-inspection-mode`,`text`)).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`]}).coerce(`settings-sandbox-fallback-action`,e=>h(e,`settings-sandbox-fallback-action`,`text`)).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if((/* @__PURE__ */ `settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const Hx={command:`update`,describe:`Update Zero Trust account configuration`,builder:Vx,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({settings:{activity_log:{enabled:e[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:e[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:e[`settings-antivirus-enabled-upload-phase`],fail_closed:e[`settings-antivirus-fail-closed`],notification_settings:{enabled:e[`settings-antivirus-notification-settings-enabled`],include_context:e[`settings-antivirus-notification-settings-include-context`],msg:h(e[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:h(e[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:h(e[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:e[`settings-block-page-enabled`],footer_text:h(e[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:h(e[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:e[`settings-block-page-include-context`],logo_path:h(e[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:h(e[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:h(e[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:e[`settings-block-page-mode`],name:h(e[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:e[`settings-block-page-suppress-footer`],target_uri:h(e[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:e[`settings-body-scanning-inspection-mode`]},browser_isolation:{non_identity_enabled:e[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:e[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:h(e[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:e[`settings-custom-certificate-enabled`],id:h(e[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:e[`settings-extended-email-matching-enabled`]},fips:{tls:e[`settings-fips-tls`]},host_selector:{enabled:e[`settings-host-selector-enabled`]},inspection:{mode:e[`settings-inspection-mode`]},max_ttl_secs:e[`settings-max-ttl-secs`],protocol_detection:{enabled:e[`settings-protocol-detection-enabled`]},sandbox:{enabled:e[`settings-sandbox-enabled`],fallback_action:e[`settings-sandbox-fallback-action`]},tls_decrypt:{enabled:e[`settings-tls-decrypt-enabled`]}}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(Bx,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({settings:{activity_log:{enabled:e[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:e[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:e[`settings-antivirus-enabled-upload-phase`],fail_closed:e[`settings-antivirus-fail-closed`],notification_settings:{enabled:e[`settings-antivirus-notification-settings-enabled`],include_context:e[`settings-antivirus-notification-settings-include-context`],msg:h(e[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:h(e[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:h(e[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:e[`settings-block-page-enabled`],footer_text:h(e[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:h(e[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:e[`settings-block-page-include-context`],logo_path:h(e[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:h(e[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:h(e[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:e[`settings-block-page-mode`],name:h(e[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:e[`settings-block-page-suppress-footer`],target_uri:h(e[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:e[`settings-body-scanning-inspection-mode`]},browser_isolation:{non_identity_enabled:e[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:e[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:h(e[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:e[`settings-custom-certificate-enabled`],id:h(e[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:e[`settings-extended-email-matching-enabled`]},fips:{tls:e[`settings-fips-tls`]},host_selector:{enabled:e[`settings-host-selector-enabled`]},inspection:{mode:e[`settings-inspection-mode`]},max_ttl_secs:e[`settings-max-ttl-secs`],protocol_detection:{enabled:e[`settings-protocol-detection-enabled`]},sandbox:{enabled:e[`settings-sandbox-enabled`],fallback_action:e[`settings-sandbox-fallback-action`]},tls_decrypt:{enabled:e[`settings-tls-decrypt-enabled`]}}}),d=await l(`Updating`,async()=>n.send(Bx,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},Ux={command:`configurations`,describe:`Operations for gateway.configurations`,builder:e=>e.command(Ix).command(zx).command(Hx).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Wx={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway`};function Gx(e){return e.usage(`$0 zero-trust gateway create
803
+
804
+ Create a Zero Trust account for an existing Cloudflare account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Kx={command:`create`,describe:`Create Zero Trust account`,builder:Gx,handler:async e=>u({command:`zero-trust gateway create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Wx,{account_id:a}));s(u,{successLabel:`Created`})})};var qx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/dns_destination_ips`};function Jx(e){return e.usage(`$0 zero-trust gateway dns-destination-ips list
805
+
806
+ List Zero Trust Gateway IPv4 address pairs for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Yx={command:`list`,describe:`List Zero Trust Gateway DNS destination IPv4 address pairs`,builder:Jx,handler:async e=>u({command:`zero-trust gateway dns-destination-ips list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway dns-destination-ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/dns_destination_ips`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(qx,{account_id:a}));s(u,{successLabel:`Loaded`})})},Xx={command:`dns-destination-ips`,describe:`Operations for gateway.dns-destination-ips`,builder:e=>e.command(Yx).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Zx={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/egress_cidr_pairs`};function Qx(e){return e.usage(`$0 zero-trust gateway egress-cidr-pairs list
807
+
808
+ Retrieve the list of egress CIDRs allocated to this Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $x={command:`list`,describe:`Get gateway egress CIDRs pairs assigned to this account`,builder:Qx,handler:async e=>u({command:`zero-trust gateway egress-cidr-pairs list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway egress-cidr-pairs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/egress_cidr_pairs`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Zx,{account_id:a}));s(u,{successLabel:`Loaded`})})},eS={command:`egress-cidr-pairs`,describe:`Operations for gateway.egress-cidr-pairs`,builder:e=>e.command($x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var tS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway`};function nS(e){return e.usage(`$0 zero-trust gateway list
809
+
810
+ Retrieve information about the current Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rS={command:`list`,describe:`Get Zero Trust account information`,builder:nS,handler:async e=>u({command:`zero-trust gateway list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(tS,{account_id:a}));s(u,{successLabel:`Loaded`})})};var iS={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/lists`,body:`json`};function aS(e){return e.usage(`$0 zero-trust gateway lists create
811
+
812
+ Creates a new Zero Trust list.`).option(`description`,{type:`string`,description:`Provide the list description.`}).option(`items`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Specify the list name.`}).option(`type`,{type:`string`,description:`Specify the list type.`,choices:[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]}).coerce(`type`,e=>h(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oS={command:`create`,describe:`Create Zero Trust list`,builder:aS,handler:async e=>u({command:`zero-trust gateway lists create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),items:p(e.items,`items`),name:h(e.name,`name`,`text`),type:e.type}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(iS,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`Specify the list name.`)),e.type===void 0&&(e.type=await v(`type`,`Specify the list type.`,[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]));let u=m({description:h(e.description,`description`,`text`),items:p(e.items,`items`),name:h(e.name,`name`,`text`),type:e.type}),d=await l(`Creating`,async()=>n.send(iS,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var sS={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/lists/${t.list_id}`};function cS(e){return e.usage(`$0 zero-trust gateway lists delete <list-id>
813
+
814
+ Deletes a Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const lS={command:`delete <list-id>`,describe:`Delete Zero Trust list`,builder:cS,handler:async e=>u({command:`zero-trust gateway lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
815
+ `);return}let u=await l(`Deleting`,async()=>n.send(sS,{account_id:a,list_id:e[`list-id`]}));s(u,{successLabel:`Deleted`})})};var uS={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/gateway/lists/${t.list_id}`,body:`json`};function dS(e){return e.usage(`$0 zero-trust gateway lists edit <list-id>
816
+
817
+ Appends or removes an item from a configured Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`append`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`remove`,{type:`string`,array:!0,description:`Lists of item values you want to remove.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fS={command:`edit <list-id>`,describe:`Patch Zero Trust list.`,builder:dS,handler:async e=>u({command:`zero-trust gateway lists edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({append:p(e.append,`append`),remove:e.remove}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(uS,{body:t,account_id:a,list_id:e[`list-id`]}));s(r,{successLabel:`Updated`});return}let u=m({append:p(e.append,`append`),remove:e.remove}),d=await l(`Updating`,async()=>n.send(uS,{body:u,account_id:a,list_id:e[`list-id`]}));s(d,{successLabel:`Updated`})})};var pS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/lists/${t.list_id}`};function mS(e){return e.usage(`$0 zero-trust gateway lists get <list-id>
818
+
819
+ Fetch a single Zero Trust list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hS={command:`get <list-id>`,describe:`Get Zero Trust list details`,builder:mS,handler:async e=>u({command:`zero-trust gateway lists get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(pS,{account_id:a,list_id:e[`list-id`]}));s(u,{successLabel:`Loaded`})})};var gS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/lists/${t.list_id}/items`,query:[`page`,`per_page`]};function _S(e){return e.usage(`$0 zero-trust gateway lists items list
820
+
821
+ Fetch all items in a single Zero Trust list.`).option(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vS={command:`list`,describe:`Get Zero Trust list items`,builder:_S,handler:async e=>u({command:`zero-trust gateway lists items list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}/items`,pathParams:{"list-id":String(e[`list-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(gS,{account_id:u,list_id:e[`list-id`],...n}));s(d,{successLabel:`Loaded`})})},yS={command:`items`,describe:`Operations for gateway.lists.items`,builder:e=>e.command(vS).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var bS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/lists`,query:[`type`,`filter`,`search`,`order_by`,`direction`]};function xS(e){return e.usage(`$0 zero-trust gateway lists list
822
+
823
+ Fetch all Zero Trust lists for an account.`).option(`type`,{type:`string`,description:`Specify the list type.`,choices:[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]}).option(`filter`,{type:`string`,description:"Filter the returned lists by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (a list must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the list name.\n * `id` — substring match on the list ID (UUID), with or without dashes.\n * `type` — exact match on the list type. Supersedes the legacy `type` query\n parameter when both are supplied. Must be one of the valid type values.\n * `item_count` — exact integer match on the number of items in the list.\n\nEach entry must match one of the per-field patterns below: the field must be\none of `name`, `id`, `type`, or `item_count`; `name`/`id` accept any value,\n`type` is restricted to the valid list type values, and `item_count` must be\na non-negative integer."}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the list name or description. When\ncombined with `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned lists by. When omitted, results are ordered by\n`created_at` in ascending order (i.e. creation order) for backwards\ncompatibility. Supported values:\n * `name` — sort alphabetically by list name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.\n * `item_count` — sort by number of items in the list.",choices:[`name`,`created_at`,`updated_at`,`item_count`]}).option(`direction`,{type:`string`,description:"Sort direction. Applies to the field named in `order_by`; when `order_by`\nis omitted it applies to the default `created_at` ordering. When\n`direction` is omitted the default is field-specific: explicitly choosing\n`created_at` or `updated_at` defaults to descending (newest first); `name`\nand `item_count` default to ascending; and the default `created_at`\nordering used when `order_by` is omitted is ascending (for backwards\ncompatibility).\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const SS={command:`list`,describe:`List Zero Trust lists`,builder:xS,handler:async e=>u({command:`zero-trust gateway lists list`,classification:{safeFlags:[`type`,`order-by`,`direction`,`dry-run`]}},e,async()=>{let n={type:e.type,filter:e.filter,search:e.search,order_by:e[`order-by`],direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/lists`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(bS,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var CS={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/lists/${t.list_id}`,body:`json`};function wS(e){return e.usage(`$0 zero-trust gateway lists update <list-id>
824
+
825
+ Updates a configured Zero Trust list. Skips updating list items if not included in the payload. A non empty list items will overwrite the existing list.`).positional(`list-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Provide the list description.`}).option(`items`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Specify the list name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const TS={command:`update <list-id>`,describe:`Update Zero Trust list`,builder:wS,handler:async e=>u({command:`zero-trust gateway lists update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/${e[`list-id`]==null?`<list-id>`:encodeURIComponent(String(e[`list-id`]))}`,pathParams:{"list-id":String(e[`list-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),items:p(e.items,`items`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(CS,{body:t,account_id:a,list_id:e[`list-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`Specify the list name.`));let u=m({description:h(e.description,`description`,`text`),items:p(e.items,`items`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(CS,{body:u,account_id:a,list_id:e[`list-id`]}));s(d,{successLabel:`Updated`})})};function ES(e){return e.usage("$0 zero-trust gateway lists upload\n\nCreate a new Zero Trust list by uploading a CSV file. The file must be `text/csv` or `text/plain` and cannot exceed 2 MB. The operation is processed asynchronously. Use the returned operation ID to poll for status.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const DS={command:`upload`,describe:`Create Zero Trust list from CSV`,builder:ES,handler:async e=>u({command:`zero-trust gateway lists upload`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway lists upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/lists/upload`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file}});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file!==void 0||e.body!==void 0){let t=new FormData;if(e.file){let n=g(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);let r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:t}));s(r,{successLabel:`Created`});return}if(e.body){let t=h(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},OS={command:`lists`,describe:`Operations for gateway.lists`,builder:e=>e.command(oS).command(lS).command(fS).command(hS).command(SS).command(TS).command(DS).command(yS).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var kS={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/locations`,body:`json`};function AS(e){return e.usage(`$0 zero-trust gateway locations create
826
+
827
+ Create a new Zero Trust Gateway location.`).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`,default:!1}).option(`dns64-enabled`,{type:`boolean`,description:`Enable DNS64 synthesis for DNS queries matched to this location. When updating a location, omitting this field resets it to false.`,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`]}).coerce(`max-ttl-mode`,e=>h(e,`max-ttl-mode`,`text`)).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 jS={command:`create`,describe:`Create a Zero Trust Gateway location`,builder:AS,handler:async e=>u({command:`zero-trust gateway locations create`,classification:{safeFlags:[`client-default`,`dns64-enabled`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway locations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/locations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({client_default:e[`client-default`],dns64_enabled:e[`dns64-enabled`],dns_destination_ips_id:h(e[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:e[`ecs-support`],endpoints:{doh:{enabled:e[`endpoints-doh-enabled`],require_token:e[`endpoints-doh-require-token`]},dot:{enabled:e[`endpoints-dot-enabled`]},ipv4:{enabled:e[`endpoints-ipv4-enabled`]},ipv6:{enabled:e[`endpoints-ipv6-enabled`]}},max_ttl:{mode:e[`max-ttl-mode`],ttl_secs:e[`max-ttl-ttl-secs`]},name:h(e.name,`name`,`text`),networks:p(e.networks,`networks`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(kS,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await _(`name`,`Specify the location name.`));let u=m({client_default:e[`client-default`],dns64_enabled:e[`dns64-enabled`],dns_destination_ips_id:h(e[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:e[`ecs-support`],endpoints:{doh:{enabled:e[`endpoints-doh-enabled`],require_token:e[`endpoints-doh-require-token`]},dot:{enabled:e[`endpoints-dot-enabled`]},ipv4:{enabled:e[`endpoints-ipv4-enabled`]},ipv6:{enabled:e[`endpoints-ipv6-enabled`]}},max_ttl:{mode:e[`max-ttl-mode`],ttl_secs:e[`max-ttl-ttl-secs`]},name:h(e.name,`name`,`text`),networks:p(e.networks,`networks`)}),d=await l(`Creating`,async()=>n.send(kS,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var MS={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/locations/${t.location_id}`};function NS(e){return e.usage(`$0 zero-trust gateway locations delete <location-id>
828
+
829
+ Delete a configured Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const PS={command:`delete <location-id>`,describe:`Delete a Zero Trust Gateway location`,builder:NS,handler:async e=>u({command:`zero-trust gateway locations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway locations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/locations/${e[`location-id`]==null?`<location-id>`:encodeURIComponent(String(e[`location-id`]))}`,pathParams:{"location-id":String(e[`location-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
830
+ `);return}let u=await l(`Deleting`,async()=>n.send(MS,{account_id:a,location_id:e[`location-id`]}));s(u,{successLabel:`Deleted`})})};var FS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/locations/${t.location_id}`};function IS(e){return e.usage(`$0 zero-trust gateway locations get <location-id>
831
+
832
+ Get a single Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const LS={command:`get <location-id>`,describe:`Get Zero Trust Gateway location details`,builder:IS,handler:async e=>u({command:`zero-trust gateway locations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway locations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/locations/${e[`location-id`]==null?`<location-id>`:encodeURIComponent(String(e[`location-id`]))}`,pathParams:{"location-id":String(e[`location-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(FS,{account_id:a,location_id:e[`location-id`]}));s(u,{successLabel:`Loaded`})})};var RS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/locations`,query:[`filter`,`search`,`order_by`,`direction`]};function zS(e){return e.usage(`$0 zero-trust gateway locations list
833
+
834
+ List Zero Trust Gateway locations for an account.`).option(`filter`,{type:`string`,description:"Filter the returned locations by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (a location must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the location name.\n * `id` — substring match on the location ID (UUID), with or without dashes.\n * `is_default` — whether it is the default for the account.\n\nEach entry must match one of the per-field patterns below:\n * the field must be one of `name`, `id`, or `is_default`;\n * `name`/`id` accept any value;\n * `is_default` only accepts `true` or `false`; any other value returns `400`"}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the location name. When combined\nwith `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned locations by. When omitted, the order of\nresults is unspecified. Supported values:\n * `name` — sort alphabetically by location name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.",choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:"Sort direction. Only takes effect when `order_by` is also provided; it\nis ignored otherwise. When `direction` is omitted the effective\ndirection is field-specific: `created_at` and `updated_at` default to\ndescending (newest first); `name` defaults to ascending.\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const BS={command:`list`,describe:`List Zero Trust Gateway locations`,builder:zS,handler:async e=>u({command:`zero-trust gateway locations list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},e,async()=>{let n={filter:e.filter,search:e.search,order_by:e[`order-by`],direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway locations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/locations`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(RS,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var $={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/locations/${t.location_id}`,body:`json`};function VS(e){return e.usage(`$0 zero-trust gateway locations update <location-id>
835
+
836
+ Update a configured Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`}).option(`dns64-enabled`,{type:`boolean`,description:`Enable DNS64 synthesis for DNS queries matched to this location. When updating a location, omitting this field resets it to false.`}).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`]}).coerce(`max-ttl-mode`,e=>h(e,`max-ttl-mode`,`text`)).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 HS={command:`update <location-id>`,describe:`Update a Zero Trust Gateway location`,builder:VS,handler:async e=>u({command:`zero-trust gateway locations update`,classification:{safeFlags:[`client-default`,`dns64-enabled`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway locations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/locations/${e[`location-id`]==null?`<location-id>`:encodeURIComponent(String(e[`location-id`]))}`,pathParams:{"location-id":String(e[`location-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({client_default:e[`client-default`],dns64_enabled:e[`dns64-enabled`],dns_destination_ips_id:h(e[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:e[`ecs-support`],endpoints:{doh:{enabled:e[`endpoints-doh-enabled`],require_token:e[`endpoints-doh-require-token`]},dot:{enabled:e[`endpoints-dot-enabled`]},ipv4:{enabled:e[`endpoints-ipv4-enabled`]},ipv6:{enabled:e[`endpoints-ipv6-enabled`]}},max_ttl:{mode:e[`max-ttl-mode`],ttl_secs:e[`max-ttl-ttl-secs`]},name:h(e.name,`name`,`text`),networks:p(e.networks,`networks`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send($,{body:t,account_id:a,location_id:e[`location-id`]}));s(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await _(`name`,`Specify the location name.`));let u=m({client_default:e[`client-default`],dns64_enabled:e[`dns64-enabled`],dns_destination_ips_id:h(e[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:e[`ecs-support`],endpoints:{doh:{enabled:e[`endpoints-doh-enabled`],require_token:e[`endpoints-doh-require-token`]},dot:{enabled:e[`endpoints-dot-enabled`]},ipv4:{enabled:e[`endpoints-ipv4-enabled`]},ipv6:{enabled:e[`endpoints-ipv6-enabled`]}},max_ttl:{mode:e[`max-ttl-mode`],ttl_secs:e[`max-ttl-ttl-secs`]},name:h(e.name,`name`,`text`),networks:p(e.networks,`networks`)}),d=await l(`Updating`,async()=>n.send($,{body:u,account_id:a,location_id:e[`location-id`]}));s(d,{successLabel:`Updated`})})},US={command:`locations`,describe:`Operations for gateway.locations`,builder:e=>e.command(jS).command(PS).command(LS).command(BS).command(HS).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var WS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/logging`};function GS(e){return e.usage(`$0 zero-trust gateway logging get
837
+
838
+ Retrieve the current logging settings for the Zero Trust account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const KS={command:`get`,describe:`Get logging settings for the Zero Trust account`,builder:GS,handler:async e=>u({command:`zero-trust gateway logging get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway logging get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(WS,{account_id:a}));s(u,{successLabel:`Loaded`})})};var qS={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/logging`,body:`json`};function JS(e){return e.usage(`$0 zero-trust gateway logging update
839
+
840
+ Update logging settings for the current Zero Trust account.`).option(`redact-pii`,{type:`boolean`,description:`Indicate whether to redact personally identifiable information from activity logging (PII fields include source IP, user email, user ID, device ID, URL, referrer, and user agent).`}).option(`settings-by-rule-type-dns-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-dns-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).option(`settings-by-rule-type-http-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-http-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).option(`settings-by-rule-type-l4-log-all`,{type:`boolean`,description:`Specify whether to log all requests to this service.`}).option(`settings-by-rule-type-l4-log-blocks`,{type:`boolean`,description:`Specify whether to log only blocking requests to this service.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const YS={command:`update`,describe:`Update Zero Trust account logging settings`,builder:JS,handler:async e=>u({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`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway logging update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({redact_pii:e[`redact-pii`],settings_by_rule_type:{dns:{log_all:e[`settings-by-rule-type-dns-log-all`],log_blocks:e[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:e[`settings-by-rule-type-http-log-all`],log_blocks:e[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:e[`settings-by-rule-type-l4-log-all`],log_blocks:e[`settings-by-rule-type-l4-log-blocks`]}}}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(qS,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({redact_pii:e[`redact-pii`],settings_by_rule_type:{dns:{log_all:e[`settings-by-rule-type-dns-log-all`],log_blocks:e[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:e[`settings-by-rule-type-http-log-all`],log_blocks:e[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:e[`settings-by-rule-type-l4-log-all`],log_blocks:e[`settings-by-rule-type-l4-log-blocks`]}}}),d=await l(`Updating`,async()=>n.send(qS,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},XS={command:`logging`,describe:`Operations for gateway.logging`,builder:e=>e.command(KS).command(YS).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ZS={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/operations/${t.operation_id}`};function QS(e){return e.usage(`$0 zero-trust gateway operations get <operation-id>
841
+
842
+ Fetch a single Zero Trust Gateway operation by its ID.`).positional(`operation-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $S={command:`get <operation-id>`,describe:`Zero Trust Gateway operation details`,builder:QS,handler:async e=>u({command:`zero-trust gateway operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/operations/${e[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(e[`operation-id`]))}`,pathParams:{"operation-id":String(e[`operation-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ZS,{account_id:a,operation_id:e[`operation-id`]}));s(u,{successLabel:`Loaded`})})};var eC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/operations`};function tC(e){return e.usage(`$0 zero-trust gateway operations list
843
+
844
+ List all Zero Trust Gateway operations for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nC={command:`list`,describe:`List Zero Trust Gateway operations`,builder:tC,handler:async e=>u({command:`zero-trust gateway operations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/operations`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(eC,{account_id:a}));s(u,{successLabel:`Loaded`})})},rC={command:`operations`,describe:`Operations for gateway.operations`,builder:e=>e.command($S).command(nC).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var iC={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/pacfiles`,body:`json`};function aC(e){return e.usage(`$0 zero-trust gateway pacfiles create
845
+
846
+ Create a new Zero Trust Gateway PAC file.`).option(`contents`,{type:`string`,description:`Actual contents of the PAC file`}).option(`description`,{type:`string`,description:`Detailed description of the PAC file.`}).option(`name`,{type:`string`,description:`Name of the PAC file.`}).option(`slug`,{type:`string`,description:`URL-friendly version of the PAC file name. If not provided, it will be auto-generated`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oC={command:`create`,describe:`Create a PAC file`,builder:aC,handler:async e=>u({command:`zero-trust gateway pacfiles create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway pacfiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/pacfiles`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({contents:h(e.contents,`contents`,`text`),description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),slug:h(e.slug,`slug`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(iC,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.contents===void 0&&(e.contents=await _(`contents`,`Actual contents of the PAC file`)),e.name===void 0&&(e.name=await _(`name`,`Name of the PAC file.`));let u=m({contents:h(e.contents,`contents`,`text`),description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`),slug:h(e.slug,`slug`,`text`)}),d=await l(`Creating`,async()=>n.send(iC,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var sC={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/pacfiles/${t.pacfile_id}`};function cC(e){return e.usage(`$0 zero-trust gateway pacfiles delete <pacfile-id>
847
+
848
+ Delete a configured Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const lC={command:`delete <pacfile-id>`,describe:`Delete a PAC file`,builder:cC,handler:async e=>u({command:`zero-trust gateway pacfiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway pacfiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/pacfiles/${e[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(e[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(e[`pacfile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
849
+ `);return}let u=await l(`Deleting`,async()=>n.send(sC,{account_id:a,pacfile_id:e[`pacfile-id`]}));s(u,{successLabel:`Deleted`})})};var uC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/pacfiles/${t.pacfile_id}`};function dC(e){return e.usage(`$0 zero-trust gateway pacfiles get <pacfile-id>
850
+
851
+ Get a single Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fC={command:`get <pacfile-id>`,describe:`Get a PAC file`,builder:dC,handler:async e=>u({command:`zero-trust gateway pacfiles get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway pacfiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/pacfiles/${e[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(e[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(e[`pacfile-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(uC,{account_id:a,pacfile_id:e[`pacfile-id`]}));s(u,{successLabel:`Loaded`})})};var pC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/pacfiles`,query:[`page`,`per_page`]};function mC(e){return e.usage(`$0 zero-trust gateway pacfiles list
852
+
853
+ List all Zero Trust Gateway PAC files for an account.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hC={command:`list`,describe:`List PAC files`,builder:mC,handler:async e=>u({command:`zero-trust gateway pacfiles list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway pacfiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/pacfiles`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(pC,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var gC={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/pacfiles/${t.pacfile_id}`,body:`json`};function _C(e){return e.usage(`$0 zero-trust gateway pacfiles update <pacfile-id>
854
+
855
+ Update a configured Zero Trust Gateway PAC file.`).positional(`pacfile-id`,{type:`string`,description:`Pacfile ID`,demandOption:!0}).option(`contents`,{type:`string`,description:`Actual contents of the PAC file`}).option(`description`,{type:`string`,description:`Detailed description of the PAC file.`}).option(`name`,{type:`string`,description:`Name of the PAC file.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const vC={command:`update <pacfile-id>`,describe:`Update a Zero Trust Gateway PAC file`,builder:_C,handler:async e=>u({command:`zero-trust gateway pacfiles update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway pacfiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/pacfiles/${e[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(e[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(e[`pacfile-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({contents:h(e.contents,`contents`,`text`),description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(gC,{body:t,account_id:a,pacfile_id:e[`pacfile-id`]}));s(r,{successLabel:`Updated`});return}e.contents===void 0&&(e.contents=await _(`contents`,`Actual contents of the PAC file`)),e.description===void 0&&(e.description=await _(`description`,`Detailed description of the PAC file.`)),e.name===void 0&&(e.name=await _(`name`,`Name of the PAC file.`));let u=m({contents:h(e.contents,`contents`,`text`),description:h(e.description,`description`,`text`),name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(gC,{body:u,account_id:a,pacfile_id:e[`pacfile-id`]}));s(d,{successLabel:`Updated`})})},yC={command:`pacfiles`,describe:`Operations for gateway.pacfiles`,builder:e=>e.command(oC).command(lC).command(fC).command(hC).command(vC).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var bC={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/proxy_endpoints`,body:`json`};function xC(e){return e.usage(`$0 zero-trust gateway proxy-endpoints create
856
+
857
+ Create a new Zero Trust Gateway proxy endpoint.`).option(`kind`,{type:`string`,description:`The proxy endpoint kind.`,choices:[`ip`,`identity`],default:`ip`}).coerce(`kind`,e=>h(e,`kind`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const SC={command:`create`,describe:`Create a proxy endpoint`,builder:xC,handler:async e=>u({command:`zero-trust gateway proxy-endpoints create`,classification:{safeFlags:[`kind`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway proxy-endpoints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({kind:e.kind}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(bC,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}let u=m({kind:e.kind}),d=await l(`Creating`,async()=>n.send(bC,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var CC={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/proxy_endpoints/${t.proxy_endpoint_id}`};function wC(e){return e.usage(`$0 zero-trust gateway proxy-endpoints delete <proxy-endpoint-id>
858
+
859
+ Delete a configured Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const TC={command:`delete <proxy-endpoint-id>`,describe:`Delete a proxy endpoint`,builder:wC,handler:async e=>u({command:`zero-trust gateway proxy-endpoints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway proxy-endpoints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/proxy_endpoints/${e[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(e[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(e[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
860
+ `);return}let u=await l(`Deleting`,async()=>n.send(CC,{account_id:a,proxy_endpoint_id:e[`proxy-endpoint-id`]}));s(u,{successLabel:`Deleted`})})};var EC={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/gateway/proxy_endpoints/${t.proxy_endpoint_id}`,body:`json`};function DC(e){return e.usage(`$0 zero-trust gateway proxy-endpoints edit <proxy-endpoint-id>
861
+
862
+ Update a configured Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`ips`,{type:`string`,array:!0,description:`Specify the list of CIDRs to restrict ingress connections.`}).option(`name`,{type:`string`,description:`Specify the name of the proxy endpoint.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const OC={command:`edit <proxy-endpoint-id>`,describe:`Update a proxy endpoint`,builder:DC,handler:async e=>u({command:`zero-trust gateway proxy-endpoints edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway proxy-endpoints edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/proxy_endpoints/${e[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(e[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(e[`proxy-endpoint-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({ips:e.ips,name:h(e.name,`name`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(EC,{body:t,account_id:a,proxy_endpoint_id:e[`proxy-endpoint-id`]}));s(r,{successLabel:`Updated`});return}let u=m({ips:e.ips,name:h(e.name,`name`,`text`)}),d=await l(`Updating`,async()=>n.send(EC,{body:u,account_id:a,proxy_endpoint_id:e[`proxy-endpoint-id`]}));s(d,{successLabel:`Updated`})})};var kC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/proxy_endpoints/${t.proxy_endpoint_id}`};function AC(e){return e.usage(`$0 zero-trust gateway proxy-endpoints get <proxy-endpoint-id>
863
+
864
+ Get a single Zero Trust Gateway proxy endpoint.`).positional(`proxy-endpoint-id`,{type:`string`,description:`Proxy endpoint ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jC={command:`get <proxy-endpoint-id>`,describe:`Get a proxy endpoint`,builder:AC,handler:async e=>u({command:`zero-trust gateway proxy-endpoints get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway proxy-endpoints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/proxy_endpoints/${e[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(e[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(e[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(kC,{account_id:a,proxy_endpoint_id:e[`proxy-endpoint-id`]}));s(u,{successLabel:`Loaded`})})};var MC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/proxy_endpoints`,query:[`filter`,`search`,`order_by`,`direction`]};function NC(e){return e.usage(`$0 zero-trust gateway proxy-endpoints list
865
+
866
+ List all Zero Trust Gateway proxy endpoints for an account.`).option(`filter`,{type:`string`,description:"Filter the returned proxy endpoints by one or more `field:value` pairs.\nRepeat the parameter to apply multiple filters; they are combined with\nlogical AND (an endpoint must satisfy every filter to be returned).\n\nSupported fields and their matching behaviour:\n * `name` — case-insensitive substring match on the endpoint name.\n * `id` — substring match on the endpoint ID (UUID), with or without dashes.\n * `kind` — exact match on the endpoint kind. The value must be `ip` or `identity`; any other value returns `400`.\n\nEach entry must match one of the per-field patterns below: the field\nmust be one of `name`, `id`, or `kind`; `name`/`id` accept any value,\nwhile `kind` only accepts `ip` or `identity`."}).option(`search`,{type:`string`,description:"Case-insensitive substring match on the endpoint name. When combined\nwith `filter`, both must match (logical AND)."}).option(`order-by`,{type:`string`,description:"Field to sort the returned endpoints by. When omitted, the order of\nresults is unspecified. Supported values:\n * `name` — sort alphabetically by endpoint name.\n * `created_at` — sort by creation time; defaults to descending unless `direction` is set.\n * `updated_at` — sort by last-modified time; defaults to descending unless `direction` is set.",choices:[`name`,`created_at`,`updated_at`]}).option(`direction`,{type:`string`,description:"Sort direction. Only takes effect when `order_by` is also provided; it\nis ignored otherwise. When `direction` is omitted the effective\ndirection is field-specific: `created_at` and `updated_at` default to\ndescending (newest first); `name` defaults to ascending.\n * `asc` — ascending.\n * `desc` — descending.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const PC={command:`list`,describe:`List proxy endpoints`,builder:NC,handler:async e=>u({command:`zero-trust gateway proxy-endpoints list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},e,async()=>{let n={filter:e.filter,search:e.search,order_by:e[`order-by`],direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway proxy-endpoints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(MC,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},FC={command:`proxy-endpoints`,describe:`Operations for gateway.proxy-endpoints`,builder:e=>e.command(SC).command(TC).command(OC).command(jC).command(PC).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var IC={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/gateway/rules`,body:`json`};function LC(e){return e.usage(`$0 zero-trust gateway rules bulk-edit
867
+
868
+ Update select fields of multiple Zero Trust Gateway rules in a single request. This is commonly used to reorder rules by updating their precedence values. Only the fields provided for each rule are updated.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const RC={command:`bulk-edit`,describe:`Patch multiple Zero Trust Gateway rules`,builder:LC,handler:async e=>u({command:`zero-trust gateway rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(IC,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var zC={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/rules`,body:`json`};function BC(e){return e.usage(`$0 zero-trust gateway rules create
869
+
870
+ Create a new Zero Trust Gateway rule.`).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).coerce(`action`,e=>h(e,`action`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-copy`,e=>h(e,`rule-settings-biso-admin-controls-copy`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-download`,e=>h(e,`rule-settings-biso-admin-controls-download`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-keyboard`,e=>h(e,`rule-settings-biso-admin-controls-keyboard`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-paste`,e=>h(e,`rule-settings-biso-admin-controls-paste`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-printing`,e=>h(e,`rule-settings-biso-admin-controls-printing`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-upload`,e=>h(e,`rule-settings-biso-admin-controls-upload`,`text`)).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).coerce(`rule-settings-biso-admin-controls-version`,e=>h(e,`rule-settings-biso-admin-controls-version`,`text`)).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`]}).coerce(`rule-settings-resolve-dns-internally-fallback`,e=>h(e,`rule-settings-resolve-dns-internally-fallback`,`text`)).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`]}).coerce(`rule-settings-untrusted-cert-action`,e=>h(e,`rule-settings-untrusted-cert-action`,`text`)).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if((/* @__PURE__ */ `rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const VC={command:`create`,describe:`Create a Zero Trust Gateway rule`,builder:BC,handler:async e=>u({command:`zero-trust gateway rules create`,classification:{safeFlags:/* @__PURE__ */ `action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({action:e.action,description:h(e.description,`description`,`text`),device_posture:h(e[`device-posture`],`device-posture`,`text`),enabled:e.enabled,expiration:{duration:e[`expiration-duration`]},filters:e.filters,identity:h(e.identity,`identity`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,rule_settings:{allow_child_bypass:e[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:e[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:e[`rule-settings-biso-admin-controls-copy`],dcp:e[`rule-settings-biso-admin-controls-dcp`],dd:e[`rule-settings-biso-admin-controls-dd`],dk:e[`rule-settings-biso-admin-controls-dk`],download:e[`rule-settings-biso-admin-controls-download`],dp:e[`rule-settings-biso-admin-controls-dp`],du:e[`rule-settings-biso-admin-controls-du`],keyboard:e[`rule-settings-biso-admin-controls-keyboard`],paste:e[`rule-settings-biso-admin-controls-paste`],printing:e[`rule-settings-biso-admin-controls-printing`],upload:e[`rule-settings-biso-admin-controls-upload`],version:e[`rule-settings-biso-admin-controls-version`],wm_id:h(e[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:e[`rule-settings-block-page-include-context`],target_uri:h(e[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:e[`rule-settings-block-page-enabled`],block_reason:h(e[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:e[`rule-settings-bypass-parent-rule`],check_session:{duration:h(e[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:e[`rule-settings-check-session-enforce`]},delete_headers:e[`rule-settings-delete-headers`],egress:{ipv4:h(e[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:h(e[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:h(e[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:e[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:e[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:e[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:e[`rule-settings-ip-categories`],ip_indicator_feeds:e[`rule-settings-ip-indicator-feeds`],l4override:{ip:h(e[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:e[`rule-settings-l4override-port`]},notification_settings:{enabled:e[`rule-settings-notification-settings-enabled`],include_context:e[`rule-settings-notification-settings-include-context`],msg:h(e[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:h(e[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:h(e[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:e[`rule-settings-override-ips`],payload_log:{enabled:e[`rule-settings-payload-log-enabled`]},quarantine:{file_types:e[`rule-settings-quarantine-file-types`]},redirect:{include_context:e[`rule-settings-redirect-include-context`],preserve_path_and_query:e[`rule-settings-redirect-preserve-path-and-query`],target_uri:h(e[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:e[`rule-settings-resolve-dns-internally-fallback`],view_id:h(e[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:e[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:e[`rule-settings-untrusted-cert-action`]}},schedule:{fri:h(e[`schedule-fri`],`schedule-fri`,`text`),mon:h(e[`schedule-mon`],`schedule-mon`,`text`),sat:h(e[`schedule-sat`],`schedule-sat`,`text`),sun:h(e[`schedule-sun`],`schedule-sun`,`text`),thu:h(e[`schedule-thu`],`schedule-thu`,`text`),time_zone:h(e[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:h(e[`schedule-tue`],`schedule-tue`,`text`),wed:h(e[`schedule-wed`],`schedule-wed`,`text`)},traffic:h(e.traffic,`traffic`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(zC,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e.action===void 0&&(e.action=await v(`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`])),e.name===void 0&&(e.name=await _(`name`,`Specify the rule name.`));let u=m({action:e.action,description:h(e.description,`description`,`text`),device_posture:h(e[`device-posture`],`device-posture`,`text`),enabled:e.enabled,expiration:{duration:e[`expiration-duration`]},filters:e.filters,identity:h(e.identity,`identity`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,rule_settings:{allow_child_bypass:e[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:e[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:e[`rule-settings-biso-admin-controls-copy`],dcp:e[`rule-settings-biso-admin-controls-dcp`],dd:e[`rule-settings-biso-admin-controls-dd`],dk:e[`rule-settings-biso-admin-controls-dk`],download:e[`rule-settings-biso-admin-controls-download`],dp:e[`rule-settings-biso-admin-controls-dp`],du:e[`rule-settings-biso-admin-controls-du`],keyboard:e[`rule-settings-biso-admin-controls-keyboard`],paste:e[`rule-settings-biso-admin-controls-paste`],printing:e[`rule-settings-biso-admin-controls-printing`],upload:e[`rule-settings-biso-admin-controls-upload`],version:e[`rule-settings-biso-admin-controls-version`],wm_id:h(e[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:e[`rule-settings-block-page-include-context`],target_uri:h(e[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:e[`rule-settings-block-page-enabled`],block_reason:h(e[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:e[`rule-settings-bypass-parent-rule`],check_session:{duration:h(e[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:e[`rule-settings-check-session-enforce`]},delete_headers:e[`rule-settings-delete-headers`],egress:{ipv4:h(e[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:h(e[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:h(e[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:e[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:e[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:e[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:e[`rule-settings-ip-categories`],ip_indicator_feeds:e[`rule-settings-ip-indicator-feeds`],l4override:{ip:h(e[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:e[`rule-settings-l4override-port`]},notification_settings:{enabled:e[`rule-settings-notification-settings-enabled`],include_context:e[`rule-settings-notification-settings-include-context`],msg:h(e[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:h(e[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:h(e[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:e[`rule-settings-override-ips`],payload_log:{enabled:e[`rule-settings-payload-log-enabled`]},quarantine:{file_types:e[`rule-settings-quarantine-file-types`]},redirect:{include_context:e[`rule-settings-redirect-include-context`],preserve_path_and_query:e[`rule-settings-redirect-preserve-path-and-query`],target_uri:h(e[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:e[`rule-settings-resolve-dns-internally-fallback`],view_id:h(e[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:e[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:e[`rule-settings-untrusted-cert-action`]}},schedule:{fri:h(e[`schedule-fri`],`schedule-fri`,`text`),mon:h(e[`schedule-mon`],`schedule-mon`,`text`),sat:h(e[`schedule-sat`],`schedule-sat`,`text`),sun:h(e[`schedule-sun`],`schedule-sun`,`text`),thu:h(e[`schedule-thu`],`schedule-thu`,`text`),time_zone:h(e[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:h(e[`schedule-tue`],`schedule-tue`,`text`),wed:h(e[`schedule-wed`],`schedule-wed`,`text`)},traffic:h(e.traffic,`traffic`,`text`)}),d=await l(`Creating`,async()=>n.send(zC,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var HC={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/gateway/rules/${t.rule_id}`};function UC(e){return e.usage(`$0 zero-trust gateway rules delete <rule-id>
871
+
872
+ Delete a Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const WC={command:`delete <rule-id>`,describe:`Delete a Zero Trust Gateway rule`,builder:UC,handler:async e=>u({command:`zero-trust gateway rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
873
+ `);return}let u=await l(`Deleting`,async()=>n.send(HC,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Deleted`})})};var GC={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/gateway/rules/${t.rule_id}`,body:`json`};function KC(e){return e.usage("$0 zero-trust gateway rules edit <rule-id>\n\nUpdate select fields of an existing Zero Trust Gateway rule. Only the fields provided in the request body are updated. This endpoint supports a limited subset of fields (`name`, `description`, `precedence`, `enabled`). To update other fields such as `action`, `traffic`, `identity`, `device_posture`, `rule_settings`, `schedule`, or `expiration`, use the PUT endpoint for a full rule replacement.").positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qC={command:`edit <rule-id>`,describe:`Patch a Zero Trust Gateway rule`,builder:KC,handler:async e=>u({command:`zero-trust gateway rules edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),precedence:e.precedence}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(GC,{body:t,account_id:a,rule_id:e[`rule-id`]}));s(r,{successLabel:`Updated`});return}let u=m({description:h(e.description,`description`,`text`),enabled:e.enabled,name:h(e.name,`name`,`text`),precedence:e.precedence}),d=await l(`Updating`,async()=>n.send(GC,{body:u,account_id:a,rule_id:e[`rule-id`]}));s(d,{successLabel:`Updated`})})};var JC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/rules/${t.rule_id}`};function YC(e){return e.usage(`$0 zero-trust gateway rules get <rule-id>
874
+
875
+ Get a single Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const XC={command:`get <rule-id>`,describe:`Get Zero Trust Gateway rule details.`,builder:YC,handler:async e=>u({command:`zero-trust gateway rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(JC,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Loaded`})})};var ZC={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/rules/tenant`};function QC(e){return e.usage(`$0 zero-trust gateway rules list-tenant
876
+
877
+ List Zero Trust Gateway rules for the parent account of an account in the MSP configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $C={command:`list-tenant`,describe:`List Zero Trust Gateway rules inherited from the parent account`,builder:QC,handler:async e=>u({command:`zero-trust gateway rules list-tenant`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway rules list-tenant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules/tenant`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(ZC,{account_id:a}));s(u,{successLabel:`Loaded`})})};var ew={method:`GET`,path:t=>e`/accounts/${t.account_id}/gateway/rules`,query:[`filter`,`search`,`order_by`,`direction`]};function tw(e){return e.usage(`$0 zero-trust gateway rules list
878
+
879
+ List Zero Trust Gateway rules for an account.`).option(`filter`,{type:`string`,description:"Filter the returned rules by one or more `field:value` pairs. Repeat the\nparameter to combine filters with logical AND.\n\nSupported fields are `name`, `id`, `action`, `enabled`, `source_account`,\n`is_shared`, `filters`, and `expression` (max 1024 bytes). The `source_account`\nvalue is matched as a normalized UUID substring. The `filters` value must\nbe one of the rule filter names and matches a member of the rule's `filters`\narray. The `expression` filter performs a case-insensitive literal\nsubstring match across traffic, identity, and device posture expressions."}).option(`search`,{type:`string`,description:`Case-insensitive substring search across rule name and description.`}).option(`order-by`,{type:`string`,description:"Field to sort the returned rules by. Supported values are `name`,\n`created_at`, `updated_at`, and `precedence`.",choices:[`name`,`created_at`,`updated_at`,`precedence`]}).option(`direction`,{type:`string`,description:"Sort direction. When `order_by` is omitted, this controls the direction\nof the existing precedence ordering. Shared rules remain first in either\ndirection. Accepted values are `asc` and `desc`.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nw={command:`list`,describe:`List Zero Trust Gateway rules`,builder:tw,handler:async e=>u({command:`zero-trust gateway rules list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},e,async()=>{let n={filter:e.filter,search:e.search,order_by:e[`order-by`],direction:e.direction};if(e.dryRun){let e=await i();c({command:`cf zero-trust gateway rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/gateway/rules`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(ew,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var rw={method:`POST`,path:t=>e`/accounts/${t.account_id}/gateway/rules/${t.rule_id}/reset_expiration`};function iw(e){return e.usage("$0 zero-trust gateway rules reset-expiration <rule-id>\n\nResets the expiration of a Zero Trust Gateway Rule if its duration elapsed and it has a default duration. The Zero Trust Gateway Rule must have values for both `expiration.expires_at` and `expiration.duration`.").positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const aw={command:`reset-expiration <rule-id>`,describe:`Reset the expiration of a Zero Trust Gateway Rule`,builder:iw,handler:async e=>u({command:`zero-trust gateway rules reset-expiration`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules reset-expiration`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}/reset_expiration`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(rw,{account_id:a,rule_id:e[`rule-id`]}));s(u,{successLabel:`Created`})})};var ow={method:`PUT`,path:t=>e`/accounts/${t.account_id}/gateway/rules/${t.rule_id}`,body:`json`};function sw(e){return e.usage(`$0 zero-trust gateway rules update <rule-id>
880
+
881
+ Update a configured Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).coerce(`action`,e=>h(e,`action`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-copy`,e=>h(e,`rule-settings-biso-admin-controls-copy`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-download`,e=>h(e,`rule-settings-biso-admin-controls-download`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-keyboard`,e=>h(e,`rule-settings-biso-admin-controls-keyboard`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-paste`,e=>h(e,`rule-settings-biso-admin-controls-paste`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-printing`,e=>h(e,`rule-settings-biso-admin-controls-printing`,`text`)).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`]}).coerce(`rule-settings-biso-admin-controls-upload`,e=>h(e,`rule-settings-biso-admin-controls-upload`,`text`)).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).coerce(`rule-settings-biso-admin-controls-version`,e=>h(e,`rule-settings-biso-admin-controls-version`,`text`)).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`]}).coerce(`rule-settings-resolve-dns-internally-fallback`,e=>h(e,`rule-settings-resolve-dns-internally-fallback`,`text`)).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`]}).coerce(`rule-settings-untrusted-cert-action`,e=>h(e,`rule-settings-untrusted-cert-action`,`text`)).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if((/* @__PURE__ */ `rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`)).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const cw={command:`update <rule-id>`,describe:`Update a Zero Trust Gateway rule`,builder:sw,handler:async e=>u({command:`zero-trust gateway rules update`,classification:{safeFlags:/* @__PURE__ */ `action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust gateway rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/gateway/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({action:e.action,description:h(e.description,`description`,`text`),device_posture:h(e[`device-posture`],`device-posture`,`text`),enabled:e.enabled,expiration:{duration:e[`expiration-duration`]},filters:e.filters,identity:h(e.identity,`identity`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,rule_settings:{allow_child_bypass:e[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:e[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:e[`rule-settings-biso-admin-controls-copy`],dcp:e[`rule-settings-biso-admin-controls-dcp`],dd:e[`rule-settings-biso-admin-controls-dd`],dk:e[`rule-settings-biso-admin-controls-dk`],download:e[`rule-settings-biso-admin-controls-download`],dp:e[`rule-settings-biso-admin-controls-dp`],du:e[`rule-settings-biso-admin-controls-du`],keyboard:e[`rule-settings-biso-admin-controls-keyboard`],paste:e[`rule-settings-biso-admin-controls-paste`],printing:e[`rule-settings-biso-admin-controls-printing`],upload:e[`rule-settings-biso-admin-controls-upload`],version:e[`rule-settings-biso-admin-controls-version`],wm_id:h(e[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:e[`rule-settings-block-page-include-context`],target_uri:h(e[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:e[`rule-settings-block-page-enabled`],block_reason:h(e[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:e[`rule-settings-bypass-parent-rule`],check_session:{duration:h(e[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:e[`rule-settings-check-session-enforce`]},delete_headers:e[`rule-settings-delete-headers`],egress:{ipv4:h(e[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:h(e[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:h(e[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:e[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:e[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:e[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:e[`rule-settings-ip-categories`],ip_indicator_feeds:e[`rule-settings-ip-indicator-feeds`],l4override:{ip:h(e[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:e[`rule-settings-l4override-port`]},notification_settings:{enabled:e[`rule-settings-notification-settings-enabled`],include_context:e[`rule-settings-notification-settings-include-context`],msg:h(e[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:h(e[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:h(e[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:e[`rule-settings-override-ips`],payload_log:{enabled:e[`rule-settings-payload-log-enabled`]},quarantine:{file_types:e[`rule-settings-quarantine-file-types`]},redirect:{include_context:e[`rule-settings-redirect-include-context`],preserve_path_and_query:e[`rule-settings-redirect-preserve-path-and-query`],target_uri:h(e[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:e[`rule-settings-resolve-dns-internally-fallback`],view_id:h(e[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:e[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:e[`rule-settings-untrusted-cert-action`]}},schedule:{fri:h(e[`schedule-fri`],`schedule-fri`,`text`),mon:h(e[`schedule-mon`],`schedule-mon`,`text`),sat:h(e[`schedule-sat`],`schedule-sat`,`text`),sun:h(e[`schedule-sun`],`schedule-sun`,`text`),thu:h(e[`schedule-thu`],`schedule-thu`,`text`),time_zone:h(e[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:h(e[`schedule-tue`],`schedule-tue`,`text`),wed:h(e[`schedule-wed`],`schedule-wed`,`text`)},traffic:h(e.traffic,`traffic`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(ow,{body:t,account_id:a,rule_id:e[`rule-id`]}));s(r,{successLabel:`Updated`});return}e.action===void 0&&(e.action=await v(`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`])),e.name===void 0&&(e.name=await _(`name`,`Specify the rule name.`));let u=m({action:e.action,description:h(e.description,`description`,`text`),device_posture:h(e[`device-posture`],`device-posture`,`text`),enabled:e.enabled,expiration:{duration:e[`expiration-duration`]},filters:e.filters,identity:h(e.identity,`identity`,`text`),name:h(e.name,`name`,`text`),precedence:e.precedence,rule_settings:{allow_child_bypass:e[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:e[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:e[`rule-settings-biso-admin-controls-copy`],dcp:e[`rule-settings-biso-admin-controls-dcp`],dd:e[`rule-settings-biso-admin-controls-dd`],dk:e[`rule-settings-biso-admin-controls-dk`],download:e[`rule-settings-biso-admin-controls-download`],dp:e[`rule-settings-biso-admin-controls-dp`],du:e[`rule-settings-biso-admin-controls-du`],keyboard:e[`rule-settings-biso-admin-controls-keyboard`],paste:e[`rule-settings-biso-admin-controls-paste`],printing:e[`rule-settings-biso-admin-controls-printing`],upload:e[`rule-settings-biso-admin-controls-upload`],version:e[`rule-settings-biso-admin-controls-version`],wm_id:h(e[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:e[`rule-settings-block-page-include-context`],target_uri:h(e[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:e[`rule-settings-block-page-enabled`],block_reason:h(e[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:e[`rule-settings-bypass-parent-rule`],check_session:{duration:h(e[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:e[`rule-settings-check-session-enforce`]},delete_headers:e[`rule-settings-delete-headers`],egress:{ipv4:h(e[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:h(e[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:h(e[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:e[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:e[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:e[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:e[`rule-settings-ip-categories`],ip_indicator_feeds:e[`rule-settings-ip-indicator-feeds`],l4override:{ip:h(e[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:e[`rule-settings-l4override-port`]},notification_settings:{enabled:e[`rule-settings-notification-settings-enabled`],include_context:e[`rule-settings-notification-settings-include-context`],msg:h(e[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:h(e[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:h(e[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:e[`rule-settings-override-ips`],payload_log:{enabled:e[`rule-settings-payload-log-enabled`]},quarantine:{file_types:e[`rule-settings-quarantine-file-types`]},redirect:{include_context:e[`rule-settings-redirect-include-context`],preserve_path_and_query:e[`rule-settings-redirect-preserve-path-and-query`],target_uri:h(e[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:e[`rule-settings-resolve-dns-internally-fallback`],view_id:h(e[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:e[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:e[`rule-settings-untrusted-cert-action`]}},schedule:{fri:h(e[`schedule-fri`],`schedule-fri`,`text`),mon:h(e[`schedule-mon`],`schedule-mon`,`text`),sat:h(e[`schedule-sat`],`schedule-sat`,`text`),sun:h(e[`schedule-sun`],`schedule-sun`,`text`),thu:h(e[`schedule-thu`],`schedule-thu`,`text`),time_zone:h(e[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:h(e[`schedule-tue`],`schedule-tue`,`text`),wed:h(e[`schedule-wed`],`schedule-wed`,`text`)},traffic:h(e.traffic,`traffic`,`text`)}),d=await l(`Updating`,async()=>n.send(ow,{body:u,account_id:a,rule_id:e[`rule-id`]}));s(d,{successLabel:`Updated`})})},lw={command:`rules`,describe:`Operations for gateway.rules`,builder:e=>e.command(RC).command(VC).command(WC).command(qC).command(XC).command(nw).command($C).command(aw).command(cw).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},uw={command:`gateway`,describe:`Operations for gateway`,builder:e=>e.command(Kx).command(rS).command(ux).command(mx).command(Nx).command(Ux).command(Xx).command(eS).command(OS).command(US).command(XS).command(rC).command(yC).command(FC).command(lw).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var dw={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/identity_providers`,body:`json`};function fw(e){return e.usage(`$0 zero-trust identity-providers create
882
+
883
+ Adds a new identity provider to Access.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pw={command:`create`,describe:`Add an Access identity provider`,builder:fw,handler:async e=>u({command:`zero-trust identity-providers create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust identity-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(dw,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var mw={method:`DELETE`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/identity_providers/${t.identity_provider_id}`};function hw(e){return e.usage(`$0 zero-trust identity-providers delete <identity-provider-id>
884
+
885
+ Deletes an identity provider from Access.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const gw={command:`delete <identity-provider-id>`,describe:`Delete an Access identity provider`,builder:hw,handler:async e=>u({command:`zero-trust identity-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust identity-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"identity-provider-id":String(e[`identity-provider-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,!await y({force:!!e.force})){process.stderr.write(`Aborted.
886
+ `);return}let f=await l(`Deleting`,async()=>n.send(mw,{account_or_zone:u,account_or_zone_id:d,identity_provider_id:e[`identity-provider-id`]}));s(f,{successLabel:`Deleted`})})};var _w={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/idp_federation_grants`,body:`json`};function vw(e){return e.usage(`$0 zero-trust identity-providers federation-grants create
887
+
888
+ Creates an IdP federation grant for the specified identity provider, making it available for federation to other accounts in the same Cloudflare organization. The account must belong to a Cloudflare organization. One-time pin and Cloudflare-managed identity providers cannot be federated. An account can federate at most five identity providers at a time.`).option(`idp-id`,{type:`string`,description:`UID of the identity provider to federate. Must be an existing identity provider in this account. One-time pin and Cloudflare-managed identity providers cannot be federated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const yw={command:`create`,describe:`Create an IdP federation grant`,builder:vw,handler:async e=>u({command:`zero-trust identity-providers federation-grants create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers federation-grants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({idp_id:h(e[`idp-id`],`idp-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(_w,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`idp-id`]===void 0&&(e[`idp-id`]=await _(`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=m({idp_id:h(e[`idp-id`],`idp-id`,`text`)}),d=await l(`Creating`,async()=>n.send(_w,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var bw={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/idp_federation_grants/${t.grant_id}`,errors:{404:`NotFoundError`}};function xw(e){return e.usage(`$0 zero-trust identity-providers federation-grants delete <grant-id>
889
+
890
+ Deletes an IdP federation grant. The identity provider remains in the account, but it is no longer available for federation to other accounts.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Sw={command:`delete <grant-id>`,describe:`Delete an IdP federation grant`,builder:xw,handler:async e=>u({command:`zero-trust identity-providers federation-grants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers federation-grants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/idp_federation_grants/${e[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(e[`grant-id`]))}`,pathParams:{"grant-id":String(e[`grant-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
891
+ `);return}let u=await l(`Deleting`,async()=>n.send(bw,{account_id:a,grant_id:e[`grant-id`]}));s(u,{successLabel:`Deleted`})})};var Cw={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/idp_federation_grants/${t.grant_id}`,errors:{404:`NotFoundError`}};function ww(e){return e.usage(`$0 zero-trust identity-providers federation-grants get <grant-id>
892
+
893
+ Retrieves a single IdP federation grant by its UID.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tw={command:`get <grant-id>`,describe:`Get an IdP federation grant`,builder:ww,handler:async e=>u({command:`zero-trust identity-providers federation-grants get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers federation-grants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/idp_federation_grants/${e[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(e[`grant-id`]))}`,pathParams:{"grant-id":String(e[`grant-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Cw,{account_id:a,grant_id:e[`grant-id`]}));s(u,{successLabel:`Loaded`})})};var Ew={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/idp_federation_grants`};function Dw(e){return e.usage(`$0 zero-trust identity-providers federation-grants list
894
+
895
+ Lists the IdP federation grants owned by the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ow={command:`list`,describe:`List IdP federation grants`,builder:Dw,handler:async e=>u({command:`zero-trust identity-providers federation-grants list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust identity-providers federation-grants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Ew,{account_id:a}));s(u,{successLabel:`Loaded`})})},kw={command:`federation-grants`,describe:`Operations for identity-providers.federation-grants`,builder:e=>e.command(yw).command(Sw).command(Tw).command(Ow).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Aw={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/identity_providers/${t.identity_provider_id}`};function jw(e){return e.usage(`$0 zero-trust identity-providers get <identity-provider-id>
896
+
897
+ Fetches a configured identity provider.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mw={command:`get <identity-provider-id>`,describe:`Get an Access identity provider`,builder:jw,handler:async e=>u({command:`zero-trust identity-providers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust identity-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"identity-provider-id":String(e[`identity-provider-id`]??``)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(Aw,{account_or_zone:u,account_or_zone_id:d,identity_provider_id:e[`identity-provider-id`]}));s(f,{successLabel:`Loaded`})})};var Nw={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/identity_providers`,query:[`scim_enabled`,`page`,`per_page`]};function Pw(e){return e.usage(`$0 zero-trust identity-providers list
898
+
899
+ Lists all configured identity providers.`).option(`scim-enabled`,{type:`string`,description:`Indicates to Access to only retrieve identity providers that have the System for Cross-Domain Identity Management (SCIM) enabled.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fw={command:`list`,describe:`List Access identity providers`,builder:Pw,handler:async e=>u({command:`zero-trust identity-providers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={scim_enabled:e[`scim-enabled`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf zero-trust identity-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/access/identity_providers`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(Nw,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})};var Iw={method:`POST`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/saml_certificate`,errors:{403:`ForbiddenError`,404:`NotFoundError`}};function Lw(e){return e.usage("$0 zero-trust identity-providers saml-certificate create <identity-provider-id>\n\nCreates a new SAML encryption certificate set and assigns it to the specified SAML Identity Provider. This endpoint is idempotent - if the IdP already has a certificate set assigned, the existing certificate set is returned with a 200 status. **Workflow for enabling SAML encryption:** 1. Call this endpoint to create and assign a certificate set to the IdP 2. Update the IdP configuration (PUT `/identity_providers/{id}`) with: - `config.enable_encryption: true` - `saml_certificate_set_id: <uid from step 1>` 3. Configure the certificate's public key in your external SAML Identity Provider").positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rw={command:`create <identity-provider-id>`,describe:`Create SAML encryption certificate for Identity Provider`,builder:Lw,handler:async e=>u({command:`zero-trust identity-providers saml-certificate create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers saml-certificate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/saml_certificate`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Creating`,async()=>n.send(Iw,{account_id:a,identity_provider_id:e[`identity-provider-id`]}));s(u,{successLabel:`Created`})})},zw={command:`saml-certificate`,describe:`Operations for identity-providers.saml-certificate`,builder:e=>e.command(Rw).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Bw={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/groups/${t.group_id}`,response:!1};function Vw(e){return e.usage(`$0 zero-trust identity-providers scim groups delete <group-id>
900
+
901
+ Deletes a SCIM Group resource from the identity provider's SCIM population.`).positional(`group-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Hw={command:`delete <group-id>`,describe:`Delete a SCIM Group resource`,builder:Vw,handler:async e=>u({command:`zero-trust identity-providers scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``),"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
902
+ `);return}let u=await l(`Deleting`,async()=>n.send(Bw,{account_id:a,identity_provider_id:e[`identity-provider-id`],group_id:e[`group-id`]}));s(u,{successLabel:`Deleted`})})};var Uw={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/groups/${t.group_id}`};function Ww(e){return e.usage(`$0 zero-trust identity-providers scim groups get <group-id>
903
+
904
+ Returns a SCIM Group resource, including its direct members, synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).positional(`group-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gw={command:`get <group-id>`,describe:`Get a SCIM Group resource`,builder:Ww,handler:async e=>u({command:`zero-trust identity-providers scim groups get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``),"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(Uw,{account_id:a,identity_provider_id:e[`identity-provider-id`],group_id:e[`group-id`]}));s(u,{successLabel:`Loaded`})})};var Kw={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/groups`,query:[`cf_resource_id`,`idp_resource_id`,`name`,`page`,`per_page`]};function qw(e){return e.usage(`$0 zero-trust identity-providers scim groups list
905
+
906
+ Lists SCIM Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`cf-resource-id`,{type:`string`,description:'The unique Cloudflare-generated Id of the SCIM Group resource; also known as the "Id".\nPass once for a single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to look up multiple groups in one request,\nup to 50 values. Mutually exclusive with `idp_resource_id`, `name`,\n`search_contains`, and `search_starts_with`.'}).option(`idp-resource-id`,{type:`string`,description:'The IdP-generated Id of the SCIM Group resource; also known as the "external Id".\nPass once for a single lookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to look up multiple groups in one request,\nup to 50 values. Mutually exclusive with `cf_resource_id`, `name`,\n`search_contains`, and `search_starts_with`.'}).option(`name`,{type:`string`,description:`The display name of the SCIM Group resource.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jw={command:`list`,describe:`List SCIM Group resources`,builder:qw,handler:async e=>u({command:`zero-trust identity-providers scim groups list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cf_resource_id:e[`cf-resource-id`],idp_resource_id:e[`idp-resource-id`],name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/groups`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(Kw,{account_id:u,identity_provider_id:e[`identity-provider-id`],...n}));s(d,{successLabel:`Loaded`})})},Yw={command:`groups`,describe:`Operations for identity-providers.scim.groups`,builder:e=>e.command(Hw).command(Gw).command(Jw).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Xw={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/users/${t.user_id}`,response:!1};function Zw(e){return e.usage(`$0 zero-trust identity-providers scim users delete <user-id>
907
+
908
+ Deletes a SCIM User resource from the identity provider's SCIM population.`).positional(`user-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Qw={command:`delete <user-id>`,describe:`Delete a SCIM User resource`,builder:Zw,handler:async e=>u({command:`zero-trust identity-providers scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``),"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
909
+ `);return}let u=await l(`Deleting`,async()=>n.send(Xw,{account_id:a,identity_provider_id:e[`identity-provider-id`],user_id:e[`user-id`]}));s(u,{successLabel:`Deleted`})})};var $w={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/users/${t.user_id}`};function eT(e){return e.usage(`$0 zero-trust identity-providers scim users get <user-id>
910
+
911
+ Returns a SCIM User resource synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).positional(`user-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tT={command:`get <user-id>`,describe:`Get a SCIM User resource`,builder:eT,handler:async e=>u({command:`zero-trust identity-providers scim users get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``),"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send($w,{account_id:a,identity_provider_id:e[`identity-provider-id`],user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})};var nT={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/identity_providers/${t.identity_provider_id}/scim/users`,query:[`cf_resource_id`,`idp_resource_id`,`username`,`email`,`name`,`page`,`per_page`]};function rT(e){return e.usage(`$0 zero-trust identity-providers scim users list
912
+
913
+ Lists SCIM User resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`cf-resource-id`,{type:`string`,description:'The unique Cloudflare-generated Id of the SCIM User resource; also known as the "Id".\nPass once for a single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to look up multiple users in one request,\nup to 50 values. Mutually exclusive with `idp_resource_id`, `username`, `email`,\n`name`, `search_contains`, and `search_starts_with`.'}).option(`idp-resource-id`,{type:`string`,description:'The IdP-generated Id of the SCIM User resource; also known as the "external Id".\nPass once for a single lookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to look up multiple users in one request,\nup to 50 values. Mutually exclusive with `cf_resource_id`, `username`, `email`,\n`name`, `search_contains`, and `search_starts_with`.'}).option(`username`,{type:`string`,description:`The username of the SCIM User resource.`}).option(`email`,{type:`string`,description:`The email address of the SCIM User resource.`}).option(`name`,{type:`string`,description:`The name of the SCIM User resource.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const iT={command:`list`,describe:`List SCIM User resources`,builder:rT,handler:async e=>u({command:`zero-trust identity-providers scim users list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cf_resource_id:e[`cf-resource-id`],idp_resource_id:e[`idp-resource-id`],username:e.username,email:e.email,name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();c({command:`cf zero-trust identity-providers scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}/scim/users`,pathParams:{"identity-provider-id":String(e[`identity-provider-id`]??``)},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(nT,{account_id:u,identity_provider_id:e[`identity-provider-id`],...n}));s(d,{successLabel:`Loaded`})})},aT={command:`users`,describe:`Operations for identity-providers.scim.users`,builder:e=>e.command(Qw).command(tT).command(iT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},oT={command:`scim`,describe:`Operations for identity-providers.scim`,builder:e=>e.command(Yw).command(aT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var sT={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/identity_providers/${t.identity_provider_id}`,body:`json`};function cT(e){return e.usage(`$0 zero-trust identity-providers update <identity-provider-id>
914
+
915
+ Updates a configured identity provider.`).positional(`identity-provider-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const lT={command:`update <identity-provider-id>`,describe:`Update an Access identity provider`,builder:cT,handler:async e=>u({command:`zero-trust identity-providers update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust identity-providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${e[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(e[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r),"identity-provider-id":String(e[`identity-provider-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(sT,{body:t,account_or_zone:u,account_or_zone_id:d,identity_provider_id:e[`identity-provider-id`]}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},uT={command:`identity-providers`,describe:`Operations for identity-providers`,builder:e=>e.command(pw).command(gw).command(Mw).command(Fw).command(lT).command(kw).command(zw).command(oT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var dT={method:`POST`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/organizations`,body:`json`};function fT(e){return e.usage(`$0 zero-trust organization create
916
+
917
+ Sets up a Zero Trust organization for your account or zone.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`,default:!1}).option(`auth-domain`,{type:`string`,description:"The unique subdomain assigned to your Zero Trust organization. If omitted on creation, a unique subdomain is auto-generated in the format `adjective-noun-hex4` (e.g. `frosty-moon-7a3b.cloudflareaccess.com`)."}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login.",default:!1}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`,default:!1}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).coerce(`mfa-piv-key-requirements-pin-policy`,e=>h(e,`mfa-piv-key-requirements-pin-policy`,`text`)).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`]}).coerce(`mfa-piv-key-requirements-touch-policy`,e=>h(e,`mfa-piv-key-requirements-touch-policy`,`text`)).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`,default:!1}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization. When omitted on creation, defaults to the provided auth_domain; when both are omitted, defaults to the auto-generated subdomain slug (e.g. frosty-moon-7a3b).`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).coerce(`service-token-inactivity-action`,e=>h(e,`service-token-inactivity-action`,`text`)).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`strict-service-token-auth`,{type:`boolean`,description:`Enables new behaviors for requests made with Access service tokens. Unauthorized requests emit audit logs, and return a 401 or 403 status code in the response instead of redirecting to the login page. Successful requests no longer receive a CF_Authorization cookie in the response. Zero Trust organizations created on or after October 5, 2026 will have this setting enabled by default, and cannot disable it.`}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`,default:!1}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const pT={command:`create`,describe:`Create your Zero Trust organization`,builder:fT,handler:async e=>u({command:`zero-trust organization create`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`strict-service-token-auth`,`warp-auth-non-browser-401`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({allow_authenticate_via_warp:e[`allow-authenticate-via-warp`],auth_domain:h(e[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:e[`auto-redirect-to-identity`],deny_unmatched_requests:e[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:e[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:e[`is-ui-read-only`],login_design:{background_color:h(e[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:h(e[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:h(e[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:h(e[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:h(e[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],amr_matching_session_duration:h(e[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:h(e[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:e[`mfa-piv-key-requirements-pin-policy`],require_fips_device:e[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:e[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:e[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:e[`mfa-piv-key-requirements-touch-policy`]},mfa_required_for_all_apps:e[`mfa-required-for-all-apps`],name:h(e.name,`name`,`text`),service_token_inactivity:{action:e[`service-token-inactivity-action`],enabled:e[`service-token-inactivity-enabled`],inactivity_threshold_days:e[`service-token-inactivity-inactivity-threshold-days`]},session_duration:h(e[`session-duration`],`session-duration`,`text`),strict_service_token_auth:e[`strict-service-token-auth`],ui_read_only_toggle_reason:h(e[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:h(e[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:e[`warp-auth-non-browser-401`],warp_auth_session_duration:h(e[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(dT,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Created`});return}let p=m({allow_authenticate_via_warp:e[`allow-authenticate-via-warp`],auth_domain:h(e[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:e[`auto-redirect-to-identity`],deny_unmatched_requests:e[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:e[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:e[`is-ui-read-only`],login_design:{background_color:h(e[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:h(e[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:h(e[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:h(e[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:h(e[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],amr_matching_session_duration:h(e[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:h(e[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:e[`mfa-piv-key-requirements-pin-policy`],require_fips_device:e[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:e[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:e[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:e[`mfa-piv-key-requirements-touch-policy`]},mfa_required_for_all_apps:e[`mfa-required-for-all-apps`],name:h(e.name,`name`,`text`),service_token_inactivity:{action:e[`service-token-inactivity-action`],enabled:e[`service-token-inactivity-enabled`],inactivity_threshold_days:e[`service-token-inactivity-inactivity-threshold-days`]},session_duration:h(e[`session-duration`],`session-duration`,`text`),strict_service_token_auth:e[`strict-service-token-auth`],ui_read_only_toggle_reason:h(e[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:h(e[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:e[`warp-auth-non-browser-401`],warp_auth_session_duration:h(e[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}),g=await l(`Creating`,async()=>n.send(dT,{body:p,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Created`})})};var mT={method:`GET`,path:t=>e`/accounts/${t.account_id}/access/organizations/doh`};function hT(e){return e.usage(`$0 zero-trust organization doh get
918
+
919
+ Returns the DoH settings for your Zero Trust organization.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gT={command:`get`,describe:`Get your Zero Trust organization DoH settings`,builder:hT,handler:async e=>u({command:`zero-trust organization doh get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust organization doh get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(mT,{account_id:a}));s(u,{successLabel:`Loaded`})})};var _T={method:`PUT`,path:t=>e`/accounts/${t.account_id}/access/organizations/doh`,body:`json`};function vT(e){return e.usage(`$0 zero-trust organization doh update
920
+
921
+ Updates the DoH settings for your Zero Trust organization.`).option(`doh-jwt-duration`,{type:`string`,description:"The duration the DoH JWT is valid for. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. Note that the maximum duration for this setting is the same as the key rotation period on the account. Default expiration is 24h"}).option(`service-token-id`,{type:`string`,description:`The uuid of the service token you want to use for DoH authentication`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const yT={command:`update`,describe:`Update your Zero Trust organization DoH settings`,builder:vT,handler:async e=>u({command:`zero-trust organization doh update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust organization doh update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({doh_jwt_duration:h(e[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:h(e[`service-token-id`],`service-token-id`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(_T,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=m({doh_jwt_duration:h(e[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:h(e[`service-token-id`],`service-token-id`,`text`)}),d=await l(`Updating`,async()=>n.send(_T,{body:u,account_id:a}));s(d,{successLabel:`Updated`})})},bT={command:`doh`,describe:`Operations for organization.doh`,builder:e=>e.command(gT).command(yT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var xT={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/organizations`};function ST(e){return e.usage(`$0 zero-trust organization get
922
+
923
+ Returns the configuration for your Zero Trust organization.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const CT={command:`get`,describe:`Get your Zero Trust organization`,builder:ST,handler:async e=>u({command:`zero-trust organization get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`none`});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();u===`zones`?e.zoneId=d:e.accountId=d;let f=await l(`Loading`,async()=>n.send(xT,{account_or_zone:u,account_or_zone_id:d}));s(f,{successLabel:`Loaded`})})};var wT={method:`PUT`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/access/organizations`,body:`json`};function TT(e){return e.usage(`$0 zero-trust organization update
924
+
925
+ Updates the configuration for your Zero Trust organization.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`}).option(`auth-domain`,{type:`string`,description:"The unique subdomain assigned to your Zero Trust organization. If omitted on creation, a unique subdomain is auto-generated in the format `adjective-noun-hex4` (e.g. `frosty-moon-7a3b.cloudflareaccess.com`)."}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login."}).option(`custom-pages-forbidden`,{type:`string`,description:`The uid of the custom page to use when a user is denied access after failing a non-identity rule.`}).option(`custom-pages-identity-denied`,{type:`string`,description:`The uid of the custom page to use when a user is denied access.`}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).coerce(`mfa-piv-key-requirements-pin-policy`,e=>h(e,`mfa-piv-key-requirements-pin-policy`,`text`)).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`]}).coerce(`mfa-piv-key-requirements-touch-policy`,e=>h(e,`mfa-piv-key-requirements-touch-policy`,`text`)).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization. When omitted on creation, defaults to the provided auth_domain; when both are omitted, defaults to the auto-generated subdomain slug (e.g. frosty-moon-7a3b).`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).coerce(`service-token-inactivity-action`,e=>h(e,`service-token-inactivity-action`,`text`)).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`strict-service-token-auth`,{type:`boolean`,description:`Enables new behaviors for requests made with Access service tokens. Unauthorized requests emit audit logs, and return a 401 or 403 status code in the response instead of redirecting to the login page. Successful requests no longer receive a CF_Authorization cookie in the response. Zero Trust organizations created on or after October 5, 2026 will have this setting enabled by default, and cannot disable it.`}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const ET={command:`update`,describe:`Update your Zero Trust organization`,builder:TT,handler:async e=>u({command:`zero-trust organization update`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`strict-service-token-auth`,`warp-auth-non-browser-401`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=e.zone===void 0?await i():void 0,n=e.zone===void 0?`accounts`:`zones`,r=e.zone??t??`<account-id>`;c({command:`cf zero-trust organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:e.body===void 0?m({allow_authenticate_via_warp:e[`allow-authenticate-via-warp`],auth_domain:h(e[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:e[`auto-redirect-to-identity`],custom_pages:{forbidden:h(e[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:h(e[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:e[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:e[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:e[`is-ui-read-only`],login_design:{background_color:h(e[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:h(e[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:h(e[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:h(e[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:h(e[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],amr_matching_session_duration:h(e[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:h(e[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:e[`mfa-piv-key-requirements-pin-policy`],require_fips_device:e[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:e[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:e[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:e[`mfa-piv-key-requirements-touch-policy`]},mfa_required_for_all_apps:e[`mfa-required-for-all-apps`],name:h(e.name,`name`,`text`),service_token_inactivity:{action:e[`service-token-inactivity-action`],enabled:e[`service-token-inactivity-enabled`],inactivity_threshold_days:e[`service-token-inactivity-inactivity-threshold-days`]},session_duration:h(e[`session-duration`],`session-duration`,`text`),strict_service_token_auth:e[`strict-service-token-auth`],ui_read_only_toggle_reason:h(e[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:h(e[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:e[`warp-auth-non-browser-401`],warp_auth_session_duration:h(e[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):f(e.body)});return}let n=await r(e),u=e.zone===void 0?`accounts`:`zones`,d=u===`zones`?await a({zone:e.zone},n,{quiet:e.quiet}):e.local?t:await o();if(u===`zones`?e.zoneId=d:e.accountId=d,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(wT,{body:t,account_or_zone:u,account_or_zone_id:d}));s(r,{successLabel:`Updated`});return}let p=m({allow_authenticate_via_warp:e[`allow-authenticate-via-warp`],auth_domain:h(e[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:e[`auto-redirect-to-identity`],custom_pages:{forbidden:h(e[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:h(e[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:e[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:e[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:e[`is-ui-read-only`],login_design:{background_color:h(e[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:h(e[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:h(e[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:h(e[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:h(e[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:e[`mfa-config-allowed-authenticators`],amr_matching_session_duration:h(e[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:h(e[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:h(e[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:e[`mfa-piv-key-requirements-pin-policy`],require_fips_device:e[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:e[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:e[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:e[`mfa-piv-key-requirements-touch-policy`]},mfa_required_for_all_apps:e[`mfa-required-for-all-apps`],name:h(e.name,`name`,`text`),service_token_inactivity:{action:e[`service-token-inactivity-action`],enabled:e[`service-token-inactivity-enabled`],inactivity_threshold_days:e[`service-token-inactivity-inactivity-threshold-days`]},session_duration:h(e[`session-duration`],`session-duration`,`text`),strict_service_token_auth:e[`strict-service-token-auth`],ui_read_only_toggle_reason:h(e[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:h(e[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:e[`warp-auth-non-browser-401`],warp_auth_session_duration:h(e[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}),g=await l(`Updating`,async()=>n.send(wT,{body:p,account_or_zone:u,account_or_zone_id:d}));s(g,{successLabel:`Updated`})})},DT={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(pT).command(CT).command(ET).command(bT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var OT={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/behaviors`};function kT(e){return e.usage(`$0 zero-trust risk-scoring behaviours get
926
+
927
+ Retrieves configured risk score behaviors that define how user actions affect their overall risk score.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const AT={command:`get`,describe:`Get all behaviors and associated configuration`,builder:kT,handler:async e=>u({command:`zero-trust risk-scoring behaviours get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust risk-scoring behaviours get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(OT,{account_id:a}));s(u,{successLabel:`Loaded`})})};var jT={method:`PUT`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/behaviors`,body:`json`};function MT(e){return e.usage(`$0 zero-trust risk-scoring behaviours update
928
+
929
+ Updates risk score behavior configurations, defining weights and thresholds for risk calculation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Behaviors.`})}const NT={command:`update`,describe:`Update configuration for risk behaviors`,builder:MT,handler:async e=>u({command:`zero-trust risk-scoring behaviours update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring behaviours update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(jT,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},PT={command:`behaviours`,describe:`User Risk Scoring - manage behaviors used to calculate user risk scores`,builder:e=>e.command(AT).command(NT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var FT={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/${t.user_id}`};function IT(e){return e.usage(`$0 zero-trust risk-scoring get <user-id>
930
+
931
+ Retrieves the detailed risk score breakdown for a specific user, including contributing factors.`).positional(`user-id`,{type:`string`,description:`User ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const LT={command:`get <user-id>`,describe:`Get risk event/score information for a specific user`,builder:IT,handler:async e=>u({command:`zero-trust risk-scoring get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(FT,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Loaded`})})};var RT={method:`POST`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations`,body:`json`,constants:{integration_type:`Okta`}};function zT(e){return e.usage(`$0 zero-trust risk-scoring integrations create
932
+
933
+ Creates a new Zero Trust risk score integration, connecting external risk signals to Cloudflare's risk scoring system.`).option(`integration-type`,{type:`string`,description:`The integration_type field`,choices:[`Okta`]}).coerce(`integration-type`,e=>h(e,`integration-type`,`text`)).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).
934
+ 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 BT={command:`create`,describe:`Create new risk score integration.`,builder:zT,handler:async e=>u({command:`zero-trust risk-scoring integrations create`,classification:{safeFlags:[`integration-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({integration_type:e[`integration-type`],reference_id:h(e[`reference-id`],`reference-id`,`text`),tenant_url:h(e[`tenant-url`],`tenant-url`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Creating`,async()=>n.send(RT,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}e[`integration-type`]===void 0&&(e[`integration-type`]=await v(`integration-type`,`The integration_type field`,[`Okta`])),e[`tenant-url`]===void 0&&(e[`tenant-url`]=await _(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=m({integration_type:e[`integration-type`],reference_id:h(e[`reference-id`],`reference-id`,`text`),tenant_url:h(e[`tenant-url`],`tenant-url`,`text`)}),d=await l(`Creating`,async()=>n.send(RT,{body:u,account_id:a}));s(d,{successLabel:`Created`})})};var VT={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations/${t.integration_id}`};function HT(e){return e.usage(`$0 zero-trust risk-scoring integrations delete <integration-id>
935
+
936
+ Removes a Zero Trust risk score integration, disconnecting the external risk signal source.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const UT={command:`delete <integration-id>`,describe:`Delete a risk score integration.`,builder:HT,handler:async e=>u({command:`zero-trust risk-scoring integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/integrations/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
937
+ `);return}let u=await l(`Deleting`,async()=>n.send(VT,{account_id:a,integration_id:e[`integration-id`]}));s(u,{successLabel:`Deleted`})})};var WT={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations/${t.integration_id}`};function GT(e){return e.usage(`$0 zero-trust risk-scoring integrations get <integration-id>
938
+
939
+ Gets a Zero Trust risk score integration by ID.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const KT={command:`get <integration-id>`,describe:`Get risk score integration by id.`,builder:GT,handler:async e=>u({command:`zero-trust risk-scoring integrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/integrations/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(WT,{account_id:a,integration_id:e[`integration-id`]}));s(u,{successLabel:`Loaded`})})};var qT={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations`};function JT(e){return e.usage(`$0 zero-trust risk-scoring integrations list
940
+
941
+ Lists all configured Zero Trust risk score integrations for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const YT={command:`list`,describe:`List all risk score integrations for the account.`,builder:JT,handler:async e=>u({command:`zero-trust risk-scoring integrations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust risk-scoring integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(qT,{account_id:a}));s(u,{successLabel:`Loaded`})})};var XT={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations/reference_id/${t.reference_id}`};function ZT(e){return e.usage(`$0 zero-trust risk-scoring integrations references get <reference-id>
942
+
943
+ Retrieves a Zero Trust risk score integration using its external reference ID.`).positional(`reference-id`,{type:`string`,description:`Reference ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const QT={command:`get <reference-id>`,describe:`Get risk score integration by reference id.`,builder:ZT,handler:async e=>u({command:`zero-trust risk-scoring integrations references get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring integrations references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/integrations/reference_id/${e[`reference-id`]==null?`<reference-id>`:encodeURIComponent(String(e[`reference-id`]))}`,pathParams:{"reference-id":String(e[`reference-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(XT,{account_id:a,reference_id:e[`reference-id`]}));s(u,{successLabel:`Loaded`})})},$T={command:`references`,describe:`User Risk Scoring - retrieve integrations by external reference`,builder:e=>e.command(QT).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var eE={method:`PUT`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/integrations/${t.integration_id}`,body:`json`};function tE(e){return e.usage(`$0 zero-trust risk-scoring integrations update <integration-id>
944
+
945
+ Overwrite the reference_id, tenant_url, and active values with the ones provided.`).positional(`integration-id`,{type:`string`,description:`Integration ID`,demandOption:!0}).option(`active`,{type:`boolean`,description:`Whether this integration is enabled. If disabled, no risk changes will be exported to the third-party.`}).option(`reference-id`,{type:`string`,description:`A reference id that can be supplied by the client. Currently this should be set to the Access-Okta IDP ID (a UUIDv4).
946
+ 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 nE={command:`update <integration-id>`,describe:`Update a risk score integration.`,builder:tE,handler:async e=>u({command:`zero-trust risk-scoring integrations update`,classification:{safeFlags:[`active`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/integrations/${e[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(e[`integration-id`]))}`,pathParams:{"integration-id":String(e[`integration-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({active:e.active,reference_id:h(e[`reference-id`],`reference-id`,`text`),tenant_url:h(e[`tenant-url`],`tenant-url`,`text`)}):f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(eE,{body:t,account_id:a,integration_id:e[`integration-id`]}));s(r,{successLabel:`Updated`});return}if(e.active===void 0)throw Error(`--active is required (or pass --body with this field set).`);e[`tenant-url`]===void 0&&(e[`tenant-url`]=await _(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=m({active:e.active,reference_id:h(e[`reference-id`],`reference-id`,`text`),tenant_url:h(e[`tenant-url`],`tenant-url`,`text`)}),d=await l(`Updating`,async()=>n.send(eE,{body:u,account_id:a,integration_id:e[`integration-id`]}));s(d,{successLabel:`Updated`})})},rE={command:`integrations`,describe:`User Risk Scoring - manage integrations that provide risk score signals`,builder:e=>e.command(BT).command(UT).command(KT).command(YT).command(nE).command($T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var iE={method:`POST`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/${t.user_id}/reset`};function aE(e){return e.usage(`$0 zero-trust risk-scoring reset <user-id>
947
+
948
+ Resets risk scores for specified users, clearing their accumulated risk history.`).positional(`user-id`,{type:`string`,description:`User ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const oE={command:`reset <user-id>`,describe:`Clear the risk score for a particular user`,builder:aE,handler:async e=>u({command:`zero-trust risk-scoring reset`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust risk-scoring reset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/zt_risk_scoring/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/reset`,pathParams:{"user-id":String(e[`user-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force,message:`This operation wipes risk-scoring history.`})){process.stderr.write(`Aborted.
949
+ `);return}let u=await l(`Deleting`,async()=>n.send(iE,{account_id:a,user_id:e[`user-id`]}));s(u,{successLabel:`Deleted`})})};var sE={method:`GET`,path:t=>e`/accounts/${t.account_id}/zt_risk_scoring/summary`};function cE(e){return e.usage(`$0 zero-trust risk-scoring summary get
950
+
951
+ Gets an aggregate summary of risk scores across the account, including distribution and trends.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lE={command:`get`,describe:`Get risk score info for all users in the account`,builder:cE,handler:async e=>u({command:`zero-trust risk-scoring summary get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf zero-trust risk-scoring summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/zt_risk_scoring/summary`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(sE,{account_id:a}));s(u,{successLabel:`Loaded`})})},uE={command:`summary`,describe:`User Risk Scoring - retrieve account risk score summaries`,builder:e=>e.command(lE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},dE={command:`risk-scoring`,describe:`User Risk Scoring - retrieve and reset user risk scores`,builder:e=>e.command(LT).command(oE).command(PT).command(rE).command(uE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var fE={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/access/seats`,body:`json`};function pE(e){return e.usage("$0 zero-trust seats edit\n\nRemoves a user from a Zero Trust seat when both `access_seat` and `gateway_seat` are set to false.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const mE={command:`edit`,describe:`Update a user seat`,builder:pE,handler:async e=>u({command:`zero-trust seats edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust seats edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/seats`,pathParams:{},bodyKind:`json`,body:e.body===void 0?void 0:f(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=f(e.body),r=await l(`Updating`,async()=>n.send(fE,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},hE={command:`seats`,describe:`Operations for seats`,builder:e=>e.command(mE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var gE={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/mfa_authenticators/${t.authenticator_id}`};function _E(e){return e.usage(`$0 zero-trust users mfa authenticators delete <authenticator-id>
952
+
953
+ Deletes a specific MFA device or passkey, including a PIV key or FIDO2 key enrollment, for a user. Admin deletion remains available when MFA is disabled. Successful deletion revokes the enrollment and returns a null result.`).positional(`authenticator-id`,{type:`string`,description:`The unique identifier for the MFA device.`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vE={command:`delete <authenticator-id>`,describe:`Delete a user's authenticator`,builder:_E,handler:async e=>u({command:`zero-trust users mfa authenticators delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust users mfa authenticators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/mfa_authenticators/${e[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(e[`authenticator-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``),"authenticator-id":String(e[`authenticator-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
954
+ `);return}let u=await l(`Deleting`,async()=>n.send(gE,{account_id:a,user_id:e[`user-id`],authenticator_id:e[`authenticator-id`]}));s(u,{successLabel:`Deleted`})})},yE={command:`authenticators`,describe:`Operations for users.mfa.authenticators`,builder:e=>e.command(vE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bE={command:`mfa`,describe:`Operations for users.mfa`,builder:e=>e.command(yE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var xE={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/access/users/${t.user_id}/passkeys/${t.authenticator_id}`};function SE(e){return e.usage(`$0 zero-trust users passkeys delete <authenticator-id>
955
+
956
+ Alias of the authenticator deletion endpoint for passkey management. The identifier is the passkey's authenticator ID from the last-seen identity response. Successful deletion revokes the enrollment and returns a null result.`).positional(`authenticator-id`,{type:`string`,description:`The unique identifier for the MFA device.`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const CE={command:`delete <authenticator-id>`,describe:`Delete a user's passkey`,builder:SE,handler:async e=>u({command:`zero-trust users passkeys delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf zero-trust users passkeys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/access/users/${e[`user-id`]==null?`<user-id>`:encodeURIComponent(String(e[`user-id`]))}/passkeys/${e[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(e[`authenticator-id`]))}`,pathParams:{"user-id":String(e[`user-id`]??``),"authenticator-id":String(e[`authenticator-id`]??``)},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,!await y({force:!!e.force})){process.stderr.write(`Aborted.
957
+ `);return}let u=await l(`Deleting`,async()=>n.send(xE,{account_id:a,user_id:e[`user-id`],authenticator_id:e[`authenticator-id`]}));s(u,{successLabel:`Deleted`})})},wE={command:`passkeys`,describe:`Operations for users.passkeys`,builder:e=>e.command(CE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},TE={command:`users`,describe:`Operations for users`,builder:e=>e.command(bE).command(wE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},EE={command:`zero-trust`,describe:`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,builder:e=>e.command(va).command(Ea).command(ic).command(dc).command(Cd).command(Em).command(Fg).command(ox).command(uw).command(uT).command(DT).command(dE).command(hE).command(TE).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{EE as default};