cf 1.0.0-beta.0 → 1.0.0-beta.2

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 (351) hide show
  1. package/README.md +11 -0
  2. package/dist/_meta/commands.json +10140 -10626
  3. package/dist/_meta/hand-written-commands.json +546 -1
  4. package/dist/_meta/schemas.json +6391 -7002
  5. package/dist/{abuse-reports-BwsJLiPN.mjs → abuse-reports-JcwSaW-c.mjs} +11 -11
  6. package/dist/access-B3TvAe5h.mjs +27 -0
  7. package/dist/{account-DBLarar2.mjs → account-CLsfIk5j.mjs} +5 -5
  8. package/dist/{account-tags-BNrSShjj.mjs → account-tags-BJdDiyDi.mjs} +4 -4
  9. package/dist/{accounts-CCAnDjFk.mjs → accounts-6eXqIqSW.mjs} +59 -59
  10. package/dist/{acm-ZPYQbZQr.mjs → acm-ChNLnPqM.mjs} +3 -3
  11. package/dist/{addressing-BFpzLfTn.mjs → addressing-z8ei_TCh.mjs} +49 -49
  12. package/dist/agent-context-GRiQ4zRU.mjs +2 -0
  13. package/dist/{agent-memory-DEvy2dLU.mjs → agent-memory-Un0usAVF.mjs} +15 -15
  14. package/dist/{ai-BF0_0NtS.mjs → ai-Bj8kgDf7.mjs} +14 -14
  15. package/dist/{ai-audit-Dn03zntn.mjs → ai-audit-FR6QuDK_.mjs} +1 -1
  16. package/dist/{ai-gateway-CVABbCjv.mjs → ai-gateway-DrQhTvKf.mjs} +68 -68
  17. package/dist/{ai-search-g0tR8Cut.mjs → ai-search-BvMeOKK6.mjs} +37 -37
  18. package/dist/{ai-security-BXXA0Jnk.mjs → ai-security-BHvDKoM1.mjs} +1 -1
  19. package/dist/{alerting-Bst10SOG.mjs → alerting-DmRZCAjg.mjs} +26 -26
  20. package/dist/{analytics-DgEaxta8.mjs → analytics-DqidJ4qc.mjs} +9 -9
  21. package/dist/{analytics_engine-B4DvcYmB.mjs → analytics_engine-I7N0I6yP.mjs} +2 -2
  22. package/dist/{api-security-Dkx1Codr.mjs → api-security-BMNhdDyR.mjs} +61 -61
  23. package/dist/{argo-BvswWPlP.mjs → argo-U5TIBcub.mjs} +1 -1
  24. package/dist/args-CXgkQKK7.mjs +2 -0
  25. package/dist/{artifacts-D8kZKJq0.mjs → artifacts-Byw1W73U.mjs} +20 -20
  26. package/dist/{audit-logs-Bp_yQpXJ.mjs → audit-logs-C6zyFeKM.mjs} +2 -2
  27. package/dist/auth-B5p3SIhO.mjs +8 -0
  28. package/dist/auth-CosaKfuk.mjs +2 -0
  29. package/dist/autoconfig-DED3bWob.mjs +511 -0
  30. package/dist/banner-Xk4xBN8U.mjs +2 -0
  31. package/dist/{billing-Cqj64fqz.mjs → billing-BS1raRJt.mjs} +10 -10
  32. package/dist/{bot-management-CzZx_aml.mjs → bot-management-Cn6xfGzJ.mjs} +1 -1
  33. package/dist/{botnet-feed-Co0c8Xdj.mjs → botnet-feed-DtWOPNfw.mjs} +5 -5
  34. package/dist/{brand-protection-CDsGaPIl.mjs → brand-protection-BcEQ66bT.mjs} +13 -13
  35. package/dist/browser-extension-D_siSsD9.mjs +2 -0
  36. package/dist/{browser-run-DFrohJ1p.mjs → browser-run-RZ7ZPRop.mjs} +23 -23
  37. package/dist/build-DG8NfVjJ.mjs +2 -0
  38. package/dist/build-kgS7iKwi.mjs +2 -0
  39. package/dist/{builds-CamhClyb.mjs → builds-AOCMH4CE.mjs} +31 -31
  40. package/dist/{cache-BiTk4-Zc.mjs → cache-D_EBxDff.mjs} +1 -1
  41. package/dist/{certificate-authorities-Dal9DNjW.mjs → certificate-authorities-B6rtjuaT.mjs} +1 -1
  42. package/dist/cf--3tGe71B.mjs +18 -0
  43. package/dist/chunk-M77HNR46-BqG3fjQz.mjs +2 -0
  44. package/dist/chunk-RV27PEH3-C8_6bMgi.mjs +97 -0
  45. package/dist/chunk-U6NEESU5-CAnOLcsu.mjs +2 -0
  46. package/dist/chunk-WMOON6TZ-D3H84qpM.mjs +2 -0
  47. package/dist/cli-Ct980dyx.mjs +3 -0
  48. package/dist/cli-exit-Dqoo6Jgb.mjs +2 -0
  49. package/dist/client-certificates-uBOjGcgo.mjs +13 -0
  50. package/dist/{client-side-security-CIO_YPtN.mjs → client-side-security-Bm7JwGaG.mjs} +1 -1
  51. package/dist/{cloud-connector-vwdixea0.mjs → cloud-connector-69M2Dx8h.mjs} +1 -1
  52. package/dist/{cloudflared-DhItYrCq.mjs → cloudflared-Ba5LySkU.mjs} +1 -1
  53. package/dist/{cloudforce-one-C1cFVBGK.mjs → cloudforce-one-Xn2mlAPv.mjs} +214 -214
  54. package/dist/command-B7SzqjQM.mjs +2 -0
  55. package/dist/command-BLHcNQ8m.mjs +2 -0
  56. package/dist/command-BxQbIQWT.mjs +2 -0
  57. package/dist/command-C0SMCHZp.mjs +2 -0
  58. package/dist/command-CE8k5TuK.mjs +2 -0
  59. package/dist/command-CPiCDUth.mjs +2 -0
  60. package/dist/command-Cb0pS8T5.mjs +2 -0
  61. package/dist/command-Cz_bKDWf.mjs +2 -0
  62. package/dist/command-DCpX9Cem.mjs +2 -0
  63. package/dist/command-DEC5PwJo.mjs +2 -0
  64. package/dist/command-DHjsstFb.mjs +2 -0
  65. package/dist/command-MTUsmZU5.mjs +2 -0
  66. package/dist/command-Sb9lOxWT.mjs +2 -0
  67. package/dist/command-sQ8yswii.mjs +2 -0
  68. package/dist/{completions-xPLd1cvL.mjs → completions-DZDltM9V.mjs} +3 -3
  69. package/dist/{config-B4vIa0zp.mjs → config-DcppJ5D2.mjs} +1 -1
  70. package/dist/{connector-interrupts-DQ5T-HMN.mjs → connector-interrupts-DTy6laab.mjs} +3 -3
  71. package/dist/{connector-telemetry-events-DWam38_9.mjs → connector-telemetry-events-CJqGGvFJ.mjs} +3 -3
  72. package/dist/{connector-telemetry-snapshots-DX6AJf9Q.mjs → connector-telemetry-snapshots-BPxhPhr6.mjs} +3 -3
  73. package/dist/{connectors-CBhLWVd-.mjs → connectors-CdfCcZuA.mjs} +7 -7
  74. package/dist/{containers-Bx_44bmJ.mjs → containers-C7z53QcY.mjs} +86 -86
  75. package/dist/{containers-C7blN-pe.mjs → containers-VMqcxH5a.mjs} +17 -17
  76. package/dist/{content-scan-CC91dAlv.mjs → content-scan-BirgZrmr.mjs} +1 -1
  77. package/dist/context-Dzzbc9RK.mjs +7 -0
  78. package/dist/{cps-D9a4N_bH.mjs → cps-DzFm3zKp.mjs} +1 -1
  79. package/dist/{csamScanner-T7nbCnep.mjs → csamScanner-D2_OO5-1.mjs} +1 -1
  80. package/dist/{ct-alerting-CkjNJlla.mjs → ct-alerting-B7wQkFVl.mjs} +1 -1
  81. package/dist/{custom-certificates-DnWnt9oJ.mjs → custom-certificates-BKcCfbH8.mjs} +4 -4
  82. package/dist/{custom-csrs-Db2pF9Ib.mjs → custom-csrs-CXoOxir4.mjs} +5 -5
  83. package/dist/{custom-hostnames-B_N-uSIa.mjs → custom-hostnames-CNYfnCOd.mjs} +6 -6
  84. package/dist/{custom-nameservers-DPA_sFY8.mjs → custom-nameservers-BlLM7a4L.mjs} +5 -5
  85. package/dist/{custom-pages-D6fxEBoh.mjs → custom-pages-BcWoypet.mjs} +10 -10
  86. package/dist/{d1-DXs1xVmH.mjs → d1-CvrHsqYY.mjs} +14 -14
  87. package/dist/{data-security-CVZAIzhe.mjs → data-security-BxzLSdGk.mjs} +33 -33
  88. package/dist/{dcv-delegation-as1ue_wx.mjs → dcv-delegation-9_Hl-5v-.mjs} +1 -1
  89. package/dist/{delegate-GctF_lrq.mjs → delegate-CCGgla7X.mjs} +1 -1
  90. package/dist/delegate.mjs +1 -1
  91. package/dist/{deploy-D2XXCkqk.mjs → deploy-BlXYtvTd.mjs} +1 -1
  92. package/dist/{deploy-input-BCYyKXpp.mjs → deploy-input-DTXVZ2QJ.mjs} +1 -1
  93. package/dist/dev-reqdKM28.mjs +4 -0
  94. package/dist/{diagnostics-BKH1Oh-C.mjs → diagnostics-BxHs1EJB.mjs} +7 -7
  95. package/dist/dialog-ClHoC_cG.mjs +2 -0
  96. package/dist/dist-CmyJy57B.mjs +48 -0
  97. package/dist/{dist-BpadEMNY.mjs → dist-Cpb7_h4N.mjs} +35 -35
  98. package/dist/dist-cGGV-p_F.mjs +366 -0
  99. package/dist/{dls-C5kAQsN6.mjs → dls-D7GXW-N3.mjs} +8 -8
  100. package/dist/{dns-CYwXrdJO.mjs → dns-B0mdWJO5.mjs} +63 -63
  101. package/dist/{dns-firewall-BEw4QcXj.mjs → dns-firewall-BG0bzuL3.mjs} +8 -8
  102. package/dist/dot-prop-IITUZ2XW-BO5KJUwL.mjs +2 -0
  103. package/dist/dry-run-BmzTxDtZ.mjs +2 -0
  104. package/dist/{durable-objects-3jvUgzKd.mjs → durable-objects-DW0CsJzR.mjs} +4 -4
  105. package/dist/{email-auth-B3MD8FrJ.mjs → email-auth-Ls-7Yijm.mjs} +1 -1
  106. package/dist/{email-routing-C4YhZGPw.mjs → email-routing-DVaFhg-3.mjs} +24 -24
  107. package/dist/{email-security-BcFyWNby.mjs → email-security-vnwkqlgp.mjs} +77 -79
  108. package/dist/{email-sending-BO1GOAho.mjs → email-sending-CbMUicJz.mjs} +23 -23
  109. package/dist/error-sanitization-TV6O0aCD.mjs +2 -0
  110. package/dist/error-sanitization-cyGBhW1Z.mjs +2 -0
  111. package/dist/{fieldExtractors-BJDnzNCN.mjs → fieldExtractors-2EkDoJg8.mjs} +4 -4
  112. package/dist/firewall-BK4QYqRe.mjs +36 -0
  113. package/dist/{flagship-BJYMb7hb.mjs → flagship--lHQ0H3n.mjs} +13 -13
  114. package/dist/{fraud-C7kS7kP9.mjs → fraud-CaoRrQ8W.mjs} +1 -1
  115. package/dist/generate-CrKNH6ms.mjs +3 -0
  116. package/dist/generate-Djb5Af37.mjs +2 -0
  117. package/dist/{google-tag-gateway-8VR-j0sa.mjs → google-tag-gateway-DDzLPmk5.mjs} +1 -1
  118. package/dist/{healthchecks-BJleItOD.mjs → healthchecks-Q2uXvt4m.mjs} +1 -1
  119. package/dist/{hostnames-CHajvoHa.mjs → hostnames-CsaYnis6.mjs} +1 -1
  120. package/dist/{hyperdrive-DlxQrok-.mjs → hyperdrive-DDr6sAkw.mjs} +9 -9
  121. package/dist/{iam-B7oTr6vW.mjs → iam-CmzocepZ.mjs} +24 -24
  122. package/dist/{images-xLAYe436.mjs → images-Ux0Phsbi.mjs} +38 -38
  123. package/dist/index.mjs +1 -1
  124. package/dist/init-Nx4RRgfT.mjs +39 -0
  125. package/dist/{intel-DwZXY1YE.mjs → intel-bgS4g7nx.mjs} +38 -38
  126. package/dist/interactive-B_dcVghB.mjs +2 -0
  127. package/dist/interactive-D80kbTap.mjs +32 -0
  128. package/dist/{ips-BC_9nKE7.mjs → ips-BDiolgWF.mjs} +1 -1
  129. package/dist/keyless-certificates-C_TwTMql.mjs +13 -0
  130. package/dist/{keys-K-GFzhku.mjs → keys-Cr8AqQDY.mjs} +2 -2
  131. package/dist/{kv-Bfwz_ULu.mjs → kv-DmAQCqXl.mjs} +10 -10
  132. package/dist/lazy-command-B_bwSa2F.mjs +2 -0
  133. package/dist/{leaked-credential-checks-D8UuxztO.mjs → leaked-credential-checks-De7ph4VA.mjs} +1 -1
  134. package/dist/{load-balancers-B0XeGLhT.mjs → load-balancers-DXt4ndF4.mjs} +39 -39
  135. package/dist/local-CFd107fr.mjs +2 -0
  136. package/dist/{local-B6b2OIBW.mjs → local-OKXweFsd.mjs} +1 -1
  137. package/dist/{local-runtime-DD8DAIlm.mjs → local-runtime-tTYpniPS.mjs} +1 -1
  138. package/dist/login-BurQ63Ws.mjs +5 -0
  139. package/dist/login-CmlHvH5k.mjs +2 -0
  140. package/dist/{logo-matches-DWg5ezsM.mjs → logo-matches-CQ60P96J.mjs} +3 -3
  141. package/dist/{logos-6A6gJC5C.mjs → logos-u7UwT8MH.mjs} +3 -3
  142. package/dist/{logpush-DwehajAw.mjs → logpush-IoIe8e80.mjs} +23 -23
  143. package/dist/{logs-BWg7YymF.mjs → logs-ih5tyXEE.mjs} +16 -16
  144. package/dist/{magic-cloud-networking--14hNj2F.mjs → magic-cloud-networking-CWNFnjcY.mjs} +34 -34
  145. package/dist/{magic-network-monitoring-Dzo4L6kd.mjs → magic-network-monitoring-ClfZleF8.mjs} +17 -17
  146. package/dist/{magic-transit-DDO0A5v4.mjs → magic-transit-D69pkEVW.mjs} +139 -139
  147. package/dist/{managed-defense-DQ0iwWdG.mjs → managed-defense-BHdmL0vx.mjs} +9 -9
  148. package/dist/{managed-transforms-DDIdcPG0.mjs → managed-transforms-DbCR4LUg.mjs} +1 -1
  149. package/dist/{matches-D6ahHNaP.mjs → matches-Cou6RVkh.mjs} +3 -3
  150. package/dist/{mcp-BcIrLbRv.mjs → mcp-CQYfM19s.mjs} +15 -15
  151. package/dist/{mesh-wLiPcWyN.mjs → mesh-CXqaAFS4.mjs} +12 -12
  152. package/dist/migrate-CXMbQPyC.mjs +2 -0
  153. package/dist/mtls-certificates-DNeId8xS.mjs +13 -0
  154. package/dist/{network-DZsrs_sw.mjs → network-B7V3JbU7.mjs} +24 -24
  155. package/dist/{network-interconnects-Cjbu4EMv.mjs → network-interconnects-BNon8iUs.mjs} +17 -17
  156. package/dist/oauth-CeXh-ACI.mjs +9 -0
  157. package/dist/{oauth-Cu1twz9z.mjs → oauth-DM8q-TYg.mjs} +1 -1
  158. package/dist/{oauth-clients-DR0hzakz.mjs → oauth-clients-gGmWIWHl.mjs} +7 -7
  159. package/dist/{oauth-scopes-BDNpJJ32.mjs → oauth-scopes-DSEu331u.mjs} +1 -1
  160. package/dist/{observability-BnHy2M6p.mjs → observability-_VJhfwM1.mjs} +44 -44
  161. package/dist/open-PCXX3ZDZ-DobJT1Mj.mjs +4 -0
  162. package/dist/{organization-iasRm69J.mjs → organization-DW4EpwGl.mjs} +1 -1
  163. package/dist/{organizations-CUzCIKXV.mjs → organizations-DE1g2wVq.mjs} +1 -1
  164. package/dist/{origin-ca-certificates-iQXSqBI0.mjs → origin-ca-certificates-D3ULDV__.mjs} +3 -3
  165. package/dist/{origin-post-quantum-encryption-DcMDK6Tz.mjs → origin-post-quantum-encryption-BLropaz7.mjs} +1 -1
  166. package/dist/{origin-tls-client-auth-D1X26X7y.mjs → origin-tls-client-auth-C87TG2i_.mjs} +5 -5
  167. package/dist/output-CZt-berV.mjs +2 -0
  168. package/dist/{page-rules-CXa8EYcP.mjs → page-rules-tlb9P-7V.mjs} +1 -1
  169. package/dist/{pages-Cu0m9GSH.mjs → pages-CjPErYik.mjs} +24 -24
  170. package/dist/{pay-per-crawl-DmF8xlm_.mjs → pay-per-crawl-C50wI-Iz.mjs} +32 -32
  171. package/dist/{pay-per-use-DIp2fwJU.mjs → pay-per-use-DHHIvynU.mjs} +3 -3
  172. package/dist/{pipelines-MmXlsxYO.mjs → pipelines-Y2icOwuf.mjs} +20 -20
  173. package/dist/precursor-DeyurJSC.mjs +4 -0
  174. package/dist/previews-Dj_LcGRd.mjs +4 -0
  175. package/dist/progress-C9dWgc3J.mjs +2 -0
  176. package/dist/prompt-Mh69ni1N.mjs +3 -0
  177. package/dist/{queries-VzdcSR5H.mjs → queries-DyUJefwL.mjs} +4 -4
  178. package/dist/{queues-BZYl2emH.mjs → queues-CdNe4tGY.mjs} +29 -35
  179. package/dist/{r2-omcKF8_A.mjs → r2-C0W2J4sT.mjs} +52 -52
  180. package/dist/{r2-data-catalog-DISnPFPY.mjs → r2-data-catalog-D_zDlmVD.mjs} +16 -16
  181. package/dist/{radar-JzBTD249.mjs → radar-CSguicKC.mjs} +1 -1
  182. package/dist/raw-fetch-1ygCOcT_.mjs +2 -0
  183. package/dist/{realtime-yIdAJ0Yf.mjs → realtime-CvWs5pi3.mjs} +78 -78
  184. package/dist/{registrar-D-Li9gNk.mjs → registrar-DQUxn0FK.mjs} +8 -8
  185. package/dist/{registrar-sandbox-CKSSHAyv.mjs → registrar-sandbox-Q7ZEmg2x.mjs} +6 -6
  186. package/dist/{registry-vreNkX6u.mjs → registry-4Sw95M5_.mjs} +1 -1
  187. package/dist/{reporting-Cf-pnw6h.mjs → reporting-DJShxeDv.mjs} +7 -7
  188. package/dist/request-headers-DFBBErJg.mjs +2 -0
  189. package/dist/{request-tracers-BegIQTzt.mjs → request-tracers-DD8HlG61.mjs} +2 -2
  190. package/dist/resolve-BVxXAYG7.mjs +2 -0
  191. package/dist/{resource-sharing-DEVgiYzM.mjs → resource-sharing-J46JMWQP.mjs} +14 -14
  192. package/dist/{resource-tagging-Cm2yJkU9.mjs → resource-tagging-DLZJLIqy.mjs} +2 -2
  193. package/dist/{rules-DDCa7cYF.mjs → rules-D068LfBR.mjs} +8 -8
  194. package/dist/{rulesets-BhS7Hvtu.mjs → rulesets-Cz6P7Oje.mjs} +17 -17
  195. package/dist/{rum-EIj9ViSn.mjs → rum-C6GQC2vI.mjs} +14 -14
  196. package/dist/run-C_qUgBTs.mjs +2 -0
  197. package/dist/run-DK1d9BJz.mjs +2 -0
  198. package/dist/schema-VZPw_2CY.mjs +2 -0
  199. package/dist/{schema-flags--GosoCMU.mjs → schema-flags-BmY0Nzp0.mjs} +2 -2
  200. package/dist/{scim-DA83eNe-.mjs → scim-DMTp_Zhc.mjs} +10 -10
  201. package/dist/{sdk-CvIO3tWS.mjs → sdk-BuF3fTHr.mjs} +2 -2
  202. package/dist/{secrets-store-BTd3eGIB.mjs → secrets-store-C2epk0sQ.mjs} +11 -11
  203. package/dist/{security-center-DbH_7h-T.mjs → security-center-DwMdQ02Y.mjs} +15 -15
  204. package/dist/{security-txt-DSrHhVEN.mjs → security-txt-CORQfMul.mjs} +1 -1
  205. package/dist/session-BEXskZi2.mjs +2 -0
  206. package/dist/shared--lvrXmXY.mjs +2 -0
  207. package/dist/{smart-shield-DnSTo-OI.mjs → smart-shield-BZ0xjy_6.mjs} +1 -1
  208. package/dist/{snippets-An5kQs33.mjs → snippets-LSkJGDOc.mjs} +1 -1
  209. package/dist/source-38bULAR8.mjs +6 -0
  210. package/dist/spawn-Da3HnlmB.mjs +10 -0
  211. package/dist/{spectrum-Ci79n7fd.mjs → spectrum-zU8_GFTV.mjs} +1 -1
  212. package/dist/{speed-BBL7LrLn.mjs → speed-4XbFmeYM.mjs} +1 -1
  213. package/dist/src-BLLpnbzC.mjs +109 -0
  214. package/dist/{ssl-B2psFIRm.mjs → ssl-DiCsMY_a.mjs} +4 -4
  215. package/dist/startup-profile-6fCkD04r.mjs +17 -0
  216. package/dist/startup-profile-Cw-_akjQ.mjs +2 -0
  217. package/dist/state-CcktNox9.mjs +2 -0
  218. package/dist/{state-BxCejn42.mjs → state-DiHwKWTy.mjs} +1 -1
  219. package/dist/{stream-Du0Q7UOh.mjs → stream-BG3NUAVE.mjs} +45 -45
  220. package/dist/{submit-CU8S2jBT.mjs → submit-CKSaSFS1.mjs} +2 -2
  221. package/dist/{tags-C3l5aZSi.mjs → tags-uT9Mi-bX.mjs} +2 -2
  222. package/dist/telemetry-C0k8vfbq.mjs +2 -0
  223. package/dist/telemetry-Dh-8kdfY.mjs +5 -0
  224. package/dist/{telemetry-PHe8XxA2.mjs → telemetry-IrDBqbQW.mjs} +1 -1
  225. package/dist/{tenant-BZ0ysR9L.mjs → tenant--UrYFHM0.mjs} +1 -1
  226. package/dist/{tenant-custom-nameservers-DtKeyM5J.mjs → tenant-custom-nameservers-8Z4TVJtr.mjs} +1 -1
  227. package/dist/{theme-BiIYWOed.mjs → theme-BIWQFmZ0.mjs} +2 -2
  228. package/dist/tools-DNGD0l7I.mjs +2 -0
  229. package/dist/{tunnels-D1tRWQQi.mjs → tunnels-5lGSXYpl.mjs} +15 -15
  230. package/dist/turnstile-CT3AkMPV.mjs +33 -0
  231. package/dist/ui-D1hhIDIs.mjs +5 -0
  232. package/dist/update-check-BYJnL8J8.mjs +2 -0
  233. package/dist/update-check-DFoSm5GT.mjs +2 -0
  234. package/dist/update-check-worker.mjs +1 -1
  235. package/dist/{url-info-BRA0XGT2.mjs → url-info-DvpNcNl8.mjs} +2 -2
  236. package/dist/{url-normalization-B6N2m5s6.mjs → url-normalization-C9URZnpq.mjs} +1 -1
  237. package/dist/{url-scanner-CeKkzkhe.mjs → url-scanner-CIwK3wB5.mjs} +8 -8
  238. package/dist/{user-CftksgmF.mjs → user-DGA7cqdf.mjs} +1 -1
  239. package/dist/{values-m7w9PX3o.mjs → values-BzS0b25w.mjs} +2 -2
  240. package/dist/{vectorize-BWBEtsgZ.mjs → vectorize-DtDjl2fJ.mjs} +15 -15
  241. package/dist/version-B47pK_PZ.mjs +2 -0
  242. package/dist/{waiting-rooms-BVZSYTNJ.mjs → waiting-rooms-CjTh4F3B.mjs} +25 -25
  243. package/dist/{web-assets-CLU5vAgP.mjs → web-assets-4l1B5V9b.mjs} +1 -1
  244. package/dist/{web3-Dkd4XRNH.mjs → web3-C0Z4AJjC.mjs} +1 -1
  245. package/dist/{workers-BQi4_SBS.mjs → workers-CNBv6GxE.mjs} +20 -20
  246. package/dist/{workers-builds-BgtPSDYJ.mjs → workers-builds-DYGeoxmX.mjs} +7 -7
  247. package/dist/{workers-for-platforms-actLCM6Q.mjs → workers-for-platforms-CSw0K8Nl.mjs} +11 -11
  248. package/dist/{workers-vpc-DjGfJgQn.mjs → workers-vpc-DJ7Couct.mjs} +6 -6
  249. package/dist/{workflows-Cm7WsAgB.mjs → workflows-Dm03QT8U.mjs} +20 -20
  250. package/dist/{zaraz-DurWe32F.mjs → zaraz-DJbWUUe3.mjs} +1 -1
  251. package/dist/zero-trust-DiMY-pN5.mjs +685 -0
  252. package/dist/{zone-B3AEAfcd.mjs → zone-BWjBv1yy.mjs} +1 -1
  253. package/dist/{zones-DiX5LoSU.mjs → zones-zGqcQvcY.mjs} +1 -1
  254. package/dist/zt-Bt4Q6iM1.mjs +110 -0
  255. package/package.json +13 -11
  256. package/dist/access-BVbIajYr.mjs +0 -27
  257. package/dist/auth-B9w55oRg.mjs +0 -2
  258. package/dist/auth-C80y97yu.mjs +0 -8
  259. package/dist/browser-extension-BRHJm3Qf.mjs +0 -15
  260. package/dist/build-BbjcJxKq.mjs +0 -2
  261. package/dist/build-DQh5-KK4.mjs +0 -2
  262. package/dist/cf-oadujOtC.mjs +0 -18
  263. package/dist/chunk-6EUZQHAF-QVTL_mC-.mjs +0 -2
  264. package/dist/chunk-DL5FNmn1.mjs +0 -2
  265. package/dist/chunk-Q72B4Q5Z-Cr1H_iK6.mjs +0 -2
  266. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +0 -2
  267. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +0 -2
  268. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +0 -374
  269. package/dist/client-certificates-DDisXoTE.mjs +0 -13
  270. package/dist/command-BP7ldws1.mjs +0 -2
  271. package/dist/command-BtNRBTP6.mjs +0 -2
  272. package/dist/command-CF0giIIc.mjs +0 -3
  273. package/dist/command-Ck9rbHA4.mjs +0 -2
  274. package/dist/dev-nsNxyg2D.mjs +0 -4
  275. package/dist/dialog-Dx4rRcKM.mjs +0 -2
  276. package/dist/dist-BDOzKthe.mjs +0 -48
  277. package/dist/dist-dc4E1u01.mjs +0 -272
  278. package/dist/dot-prop-6SRZBKHT-Dj7YOlwR.mjs +0 -2
  279. package/dist/dry-run-CLX6Pbtq.mjs +0 -2
  280. package/dist/error-sanitization-BkgUhGVc.mjs +0 -2
  281. package/dist/error-sanitization-DOlqWkNu.mjs +0 -2
  282. package/dist/firewall-BSMa9aH3.mjs +0 -56
  283. package/dist/interactive-B6woOLo-.mjs +0 -32
  284. package/dist/interactive-DnUvQHjc.mjs +0 -2
  285. package/dist/keyless-certificates-CtsCsbZ2.mjs +0 -13
  286. package/dist/local-BrfySqnx.mjs +0 -2
  287. package/dist/login-CAsRUF4c.mjs +0 -2
  288. package/dist/login-DaglE6WA.mjs +0 -5
  289. package/dist/mtls-certificates-AEuNOERQ.mjs +0 -13
  290. package/dist/oauth-C-QCVfWz.mjs +0 -14
  291. package/dist/open-PBXRGS4R-C4CKEADM.mjs +0 -4
  292. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +0 -4
  293. package/dist/output-Bia1u2k5.mjs +0 -2
  294. package/dist/precursor-jqeEG_mJ.mjs +0 -4
  295. package/dist/previews-Cg6lc24N.mjs +0 -4
  296. package/dist/progress-Bpp73hIu.mjs +0 -2
  297. package/dist/prompt-CpZztV8c.mjs +0 -3
  298. package/dist/raw-fetch-DxGs_eRm.mjs +0 -2
  299. package/dist/request-headers-DaXBfmVn.mjs +0 -2
  300. package/dist/resolve-BXemCSyA.mjs +0 -2
  301. package/dist/run-CSFE1qVX.mjs +0 -2
  302. package/dist/run-ChM_YpZ0.mjs +0 -2
  303. package/dist/schema-DCBb3Fcs.mjs +0 -2
  304. package/dist/shared-CtBkOWGN.mjs +0 -2
  305. package/dist/source-BR4_k2ad.mjs +0 -6
  306. package/dist/spawn-7IW1UyoH.mjs +0 -523
  307. package/dist/src-CNHNCZpy.mjs +0 -108
  308. package/dist/startup-profile-CYEokTVe.mjs +0 -2
  309. package/dist/startup-profile-CgWHy4rE.mjs +0 -17
  310. package/dist/state-DSzkxXML.mjs +0 -2
  311. package/dist/telemetry-CNt8H3aA.mjs +0 -2
  312. package/dist/telemetry-Dk1GcQ0u.mjs +0 -5
  313. package/dist/tools-BMKpYraQ.mjs +0 -2
  314. package/dist/turnstile-DBa4_Vyz.mjs +0 -33
  315. package/dist/ui-DH95w1Qk.mjs +0 -5
  316. package/dist/undici-DTSBJHNS.mjs +0 -96
  317. package/dist/update-check-AAn7EXw8.mjs +0 -2
  318. package/dist/update-check-BbIXBq1o.mjs +0 -2
  319. package/dist/version-cPq-WKL8.mjs +0 -2
  320. package/dist/zero-trust-D8SVU8YZ.mjs +0 -795
  321. /package/dist/{Page-C-JHZnIy.mjs → Page-BchtVjAO.mjs} +0 -0
  322. /package/dist/{alerts-CstOk8n0.mjs → alerts-DY_7Nknx.mjs} +0 -0
  323. /package/dist/{autorag-PRTwXGgn.mjs → autorag-K396-M2S.mjs} +0 -0
  324. /package/dist/{body-parser-CUWbw_Tq.mjs → body-parser-BpPZBRMr.mjs} +0 -0
  325. /package/dist/{brands-BHRXlWDm.mjs → brands-Uy0Cmv1w.mjs} +0 -0
  326. /package/dist/{clear-UvKESVx3.mjs → clear-CpcO2ExU.mjs} +0 -0
  327. /package/dist/{cli-types-tt_LZMbn.mjs → cli-types-B6tm-8uL.mjs} +0 -0
  328. /package/dist/{connector-telemetry-events-latest-DwnFeZg0.mjs → connector-telemetry-events-latest-oguk5Zyj.mjs} +0 -0
  329. /package/dist/{connector-telemetry-snapshots-latest-Dv6rZlxs.mjs → connector-telemetry-snapshots-latest-B6zuxkr0.mjs} +0 -0
  330. /package/dist/{domain-info-BqTDXNBo.mjs → domain-info-aiwP60Fo.mjs} +0 -0
  331. /package/dist/{health-CwPzzrV6.mjs → health-Bz33n-_F.mjs} +0 -0
  332. /package/dist/{input-validation-Ch4Vllrm.mjs → input-validation-D3e278L_.mjs} +0 -0
  333. /package/dist/{internal-WLHfxX64.mjs → internal-BHrJbbdA.mjs} +0 -0
  334. /package/dist/{lifecycle-Ichnb2x1.mjs → lifecycle-Cyc3fmyN.mjs} +0 -0
  335. /package/dist/{live-D_k7eHdv.mjs → live-a01OfPf9.mjs} +0 -0
  336. /package/dist/{metadata-APBiectA.mjs → metadata-C33s4rc-.mjs} +0 -0
  337. /package/dist/{project-settings-DSXevRvj.mjs → project-settings-Bf6rReo1.mjs} +0 -0
  338. /package/dist/{rate-limit-analytics-CDTPxSET.mjs → rate-limit-analytics-Bw9qmxMx.mjs} +0 -0
  339. /package/dist/{rate-limits-C3K9smdl.mjs → rate-limits-CDm_xzKt.mjs} +0 -0
  340. /package/dist/{ready-CvwvbdTX.mjs → ready-BXGqY1Wi.mjs} +0 -0
  341. /package/dist/{recent-submissions-CjzcT-iH.mjs → recent-submissions-AhGZD3a3.mjs} +0 -0
  342. /package/dist/{refute-CIAFMj00.mjs → refute-D_w5Gw20.mjs} +0 -0
  343. /package/dist/{resolve-CUDKxUrW.mjs → resolve-qPFfBMrn.mjs} +0 -0
  344. /package/dist/{scan-logo-zFkphtQ3.mjs → scan-logo-BZzFam-Q.mjs} +0 -0
  345. /package/dist/{scan-page-CLl2MAkZ.mjs → scan-page-BPA8nSPM.mjs} +0 -0
  346. /package/dist/{search-12jA1b4l.mjs → search-De0UlXYN.mjs} +0 -0
  347. /package/dist/{signed-url-U0T_PEMR.mjs → signed-url-ziDz9frX.mjs} +0 -0
  348. /package/dist/{submission-info-CZ84a3Nb.mjs → submission-info-83D2DCCG.mjs} +0 -0
  349. /package/dist/{total-queries-CJTc9Pde.mjs → total-queries-Dhol31Kn.mjs} +0 -0
  350. /package/dist/{tracked-domains-BKLxnnSv.mjs → tracked-domains-DoOPs6Vd.mjs} +0 -0
  351. /package/dist/{verify-CZW5Fo1q.mjs → verify-CxpGEnJb.mjs} +0 -0
@@ -0,0 +1,685 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-OKXweFsd.mjs";import{a as t,i as n,t as r}from"./context-Dzzbc9RK.mjs";import{a as i,r as a}from"./auth-B5p3SIhO.mjs";import{t as o}from"./output-CZt-berV.mjs";import{t as s}from"./dry-run-BmzTxDtZ.mjs";import{t as c}from"./progress-C9dWgc3J.mjs";import{t as l}from"./run-DK1d9BJz.mjs";import"./telemetry-C0k8vfbq.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-BpPZBRMr.mjs";import{n as m,t as h}from"./input-validation-D3e278L_.mjs";import{a as g,i as _,n as v}from"./prompt-Mh69ni1N.mjs";import{t as y}from"./cli-types-B6tm-8uL.mjs";import{n as ee,t as te}from"./raw-fetch-1ygCOcT_.mjs";function b(e){return e.usage(`$0 zero-trust access applications cas create <app-id>
3
+
4
+ Generates a new short-lived certificate CA and public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`create <app-id>`,describe:`Create a short-lived certificate CA`,builder:b,handler:async i=>l({command:`zero-trust access applications cas create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Creating`,async()=>l.zeroTrust.access.applications.cas.create({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Created`})})};function S(e){return e.usage(`$0 zero-trust access applications cas delete <app-id>
5
+
6
+ Deletes a short-lived certificate CA.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <app-id>`,describe:`Delete a short-lived certificate CA`,builder:S,handler:async i=>l({command:`zero-trust access applications cas delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
7
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.cas.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function w(e){return e.usage(`$0 zero-trust access applications cas get <app-id>
8
+
9
+ Fetches a short-lived certificate CA and its public key.`).positional(`app-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <app-id>`,describe:`Get a short-lived certificate CA`,builder:w,handler:async i=>l({command:`zero-trust access applications cas get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/ca`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.cas.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})};function E(e){return e.usage(`$0 zero-trust access applications cas list
10
+
11
+ Lists short-lived certificate CAs and their public keys.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List short-lived certificate CAs`,builder:E,handler:async i=>l({command:`zero-trust access applications cas list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications cas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/ca`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.cas.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})},O={command:`cas`,describe:`Operations for access.applications.cas`,builder:e=>e.command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.usage(`$0 zero-trust access applications create
12
+
13
+ Adds a new application to Access.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Add an Access application`,builder:k,handler:async i=>l({command:`zero-trust access applications create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.applications.create({body:e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function j(e){return e.usage(`$0 zero-trust access applications delete <app-id>
14
+
15
+ Deletes an application from Access.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`delete <app-id>`,describe:`Delete an Access application`,builder:j,handler:async i=>l({command:`zero-trust access applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
16
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function N(e){return e.usage(`$0 zero-trust access applications get <app-id>
17
+
18
+ Fetches information about an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <app-id>`,describe:`Get an Access application`,builder:N,handler:async i=>l({command:`zero-trust access applications get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 zero-trust access applications list
19
+
20
+ Lists all Access applications in an account or zone.`).option(`name`,{type:`string`,description:`The name of the app.`}).option(`domain`,{type:`string`,description:`The domain of the app.`}).option(`aud`,{type:`string`,description:`The aud of the app.`}).option(`target-attributes`,{type:`string`,description:`Target Criteria attributes in key=value format.`}).option(`exact`,{type:`boolean`,description:`True for only exact string matches against passed name/domain query parameters.`}).option(`search`,{type:`string`,description:`Search for apps by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List Access applications`,builder:F,handler:async i=>l({command:`zero-trust access applications list`,classification:{safeFlags:[`exact`,`dry-run`]}},i,async()=>{let l={name:i.name,domain:i.domain,aud:i.aud,target_attributes:i[`target-attributes`],exact:i.exact,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 zero-trust access applications policies create <app-id>
21
+
22
+ Creates a policy applying exclusive to a single application that defines the users or groups who can reach it. We recommend creating a reusable policy instead and subsequently referencing its ID in the application's 'policies' array.`).positional(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`create <app-id>`,describe:`Create an Access application policy`,builder:L,handler:async i=>l({command:`zero-trust access applications policies create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.applications.policies.create({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function z(e){return e.usage(`$0 zero-trust access applications policies delete <policy-id>
23
+
24
+ Deletes an Access policy specific to an application. To delete a reusable policy, use the /account or zones/{account or zone_id}/policies/{uid} endpoint.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const B={command:`delete <policy-id>`,describe:`Delete an Access application policy`,builder:z,handler:async i=>l({command:`zero-trust access applications policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
25
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.policies.delete({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{successLabel:`Deleted`})})};function V(e){return e.usage(`$0 zero-trust access applications policies get <policy-id>
26
+
27
+ Fetches a single Access policy configured for an application. Returns both exclusively owned and reusable policies used by the application.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <policy-id>`,describe:`Get an Access application policy`,builder:V,handler:async i=>l({command:`zero-trust access applications policies get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.policies.get({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{successLabel:`Loaded`})})};function U(e){return e.usage(`$0 zero-trust access applications policies list
28
+
29
+ Lists Access policies configured for an application. Returns both exclusively scoped and reusable policies used by the application.`).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`List Access application policies`,builder:U,handler:async i=>l({command:`zero-trust access applications policies list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.applications.policies.list({account_or_zone:d,account_or_zone_id:f,app_id:i[`app-id`],...l})),{successLabel:`Loaded`})})};function G(e){return e.usage(`$0 zero-trust access applications policies update <policy-id>
30
+
31
+ Updates an Access policy specific to an application. To update a reusable policy, use the /account or zones/{account or zone_id}/policies/{uid} endpoint.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <policy-id>`,describe:`Update an Access application policy`,builder:G,handler:async i=>l({command:`zero-trust access applications policies update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"policy-id":String(i[`policy-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.policies.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`],policy_id:i[`policy-id`]})),{successLabel:`Updated`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},q={command:`policies`,describe:`Operations for access.applications.policies`,builder:e=>e.command(R).command(B).command(H).command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.usage(`$0 zero-trust access applications policy-tests create
32
+
33
+ Starts an Access policy test.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`create`,describe:`Start Access policy test`,builder:J,handler:async n=>l({command:`zero-trust access applications policy-tests create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access applications policy-tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policy-tests`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({...e,account_id:l})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>i.zeroTrust.access.applications.policyTests.create({account_id:l})),{successLabel:`Created`})})};function X(e){return e.usage(`$0 zero-trust access applications policy-tests get <policy-test-id>
34
+
35
+ Fetches the current status of a given Access policy test.`).positional(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <policy-test-id>`,describe:`Get the current status of a given Access policy test`,builder:X,handler:async n=>l({command:`zero-trust access applications policy-tests get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access applications policy-tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policy-tests/${n[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(n[`policy-test-id`]))}`,pathParams:{"policy-test-id":String(n[`policy-test-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.applications.policyTests.get({account_id:l,policy_test_id:n[`policy-test-id`]})),{successLabel:`Loaded`})})};function Q(e){return e.usage(`$0 zero-trust access applications policy-tests users list
36
+
37
+ Fetches a single page of user results from an Access policy test.`).option(`policy-test-id`,{type:`string`,description:`The UUID of the policy test.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Filter users by their policy evaluation status.`,choices:[`success`,`fail`,`error`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`Get an Access policy test users page`,builder:y(Q),handler:async n=>l({command:`zero-trust access applications policy-tests users list`,classification:{safeFlags:[`status`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],status:n.status};if(n.dryRun){s({command:`cf zero-trust access applications policy-tests users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policy-tests/${n[`policy-test-id`]==null?`<policy-test-id>`:encodeURIComponent(String(n[`policy-test-id`]))}/users`,pathParams:{"policy-test-id":String(n[`policy-test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.policyTests.users.list({account_id:u,policy_test_id:n[`policy-test-id`],...i})),{successLabel:`Loaded`})})},re={command:`users`,describe:`Operations for access.applications.policy-tests.users`,builder:e=>e.command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`policy-tests`,describe:`Operations for access.applications.policy-tests`,builder:e=>e.command(Y).command(Z).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.usage(`$0 zero-trust access applications revoke-tokens <app-id>
38
+
39
+ Revokes all tokens issued for an application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const oe={command:`revoke-tokens <app-id>`,describe:`Revoke application tokens`,builder:ae,handler:async i=>l({command:`zero-trust access applications revoke-tokens`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications revoke-tokens`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/revoke_tokens`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force,message:`This operation invalidates every service token for the app.`})){process.stderr.write(`Aborted.
40
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.applications.revokeTokens({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Deleted`})})};function se(e){return e.usage(`$0 zero-trust access applications settings edit <app-id>
41
+
42
+ Updates Access application settings.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`allow-iframe`,{type:`boolean`,description:`Enables loading application content in an iFrame.`}).option(`skip-interstitial`,{type:`boolean`,description:`Enables automatic authentication through cloudflared.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`edit <app-id>`,describe:`Update Access application settings`,builder:se,handler:async i=>l({command:`zero-trust access applications settings edit`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.edit({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`});return}let m=p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]});o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.edit({body:m,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`})})};function le(e){return e.usage(`$0 zero-trust access applications settings update <app-id>
43
+
44
+ Updates Access application settings.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`allow-iframe`,{type:`boolean`,description:`Enables loading application content in an iFrame.`}).option(`skip-interstitial`,{type:`boolean`,description:`Enables automatic authentication through cloudflared.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`update <app-id>`,describe:`Update Access application settings`,builder:le,handler:async i=>l({command:`zero-trust access applications settings update`,classification:{safeFlags:[`allow-iframe`,`skip-interstitial`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/settings`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`});return}let m=p({allow_iframe:i[`allow-iframe`],skip_interstitial:i[`skip-interstitial`]});o(await c(`Updating`,async()=>l.zeroTrust.access.applications.settings.update({body:m,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`})})},de={command:`settings`,describe:`Operations for access.applications.settings`,builder:e=>e.command(ce).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.usage(`$0 zero-trust access applications update <app-id>
45
+
46
+ Updates an Access application.`).positional(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pe={command:`update <app-id>`,describe:`Update an Access application`,builder:fe,handler:async i=>l({command:`zero-trust access applications update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.applications.update({body:e,account_or_zone:u,account_or_zone_id:f,app_id:i[`app-id`]})),{successLabel:`Updated`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function me(e){return e.usage(`$0 zero-trust access applications user-policy-checks list
47
+
48
+ Tests if a specific user has permission to access an application.`).option(`app-id`,{type:`string`,description:`App ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`Test Access policies`,builder:me,handler:async i=>l({command:`zero-trust access applications user-policy-checks list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access applications user-policy-checks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/apps/${i[`app-id`]==null?`<app-id>`:encodeURIComponent(String(i[`app-id`]))}/user_policy_checks`,pathParams:{"account-or-zone":String(n),"app-id":String(i[`app-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.applications.userPolicyChecks.list({account_or_zone:u,account_or_zone_id:d,app_id:i[`app-id`]})),{successLabel:`Loaded`})})},ge={command:`user-policy-checks`,describe:`Operations for access.applications.user-policy-checks`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_e={command:`applications`,describe:`Operations for access.applications`,builder:e=>e.command(A).command(M).command(P).command(I).command(oe).command(pe).command(O).command(q).command(ie).command(de).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.usage(`$0 zero-trust access authenticator-device-aaguids list
49
+
50
+ Returns a list of Authenticator Device AAGUIDs for MFA configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`List authenticator device AAGUIDs`,builder:ve,handler:async n=>l({command:`zero-trust access authenticator-device-aaguids list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access authenticator-device-aaguids list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/authenticator_device_aaguids`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.authenticatorDeviceAaguids.list({account_id:l})),{successLabel:`Loaded`})})},be={command:`authenticator-device-aaguids`,describe:`Operations for access.authenticator-device-aaguids`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.usage(`$0 zero-trust access bookmarks create <bookmark-id>
51
+
52
+ Create a new Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`create <bookmark-id>`,describe:`Create a Bookmark application`,builder:xe,handler:async n=>l({command:`zero-trust access bookmarks create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access bookmarks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/bookmarks/${n[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(n[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(n[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.bookmarks.create({account_id:l,bookmark_id:n[`bookmark-id`]})),{successLabel:`Created`})})};function Ce(e){return e.usage(`$0 zero-trust access bookmarks delete <bookmark-id>
53
+
54
+ Deletes a Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const we={command:`delete <bookmark-id>`,describe:`Delete a Bookmark application`,builder:Ce,handler:async n=>l({command:`zero-trust access bookmarks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access bookmarks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/bookmarks/${n[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(n[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(n[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
55
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.bookmarks.delete({account_id:l,bookmark_id:n[`bookmark-id`]})),{successLabel:`Deleted`})})};function Te(e){return e.usage(`$0 zero-trust access bookmarks get <bookmark-id>
56
+
57
+ Fetches a single Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <bookmark-id>`,describe:`Get a Bookmark application`,builder:Te,handler:async n=>l({command:`zero-trust access bookmarks get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access bookmarks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/bookmarks/${n[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(n[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(n[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.get({account_id:l,bookmark_id:n[`bookmark-id`]})),{successLabel:`Loaded`})})};function De(e){return e.usage(`$0 zero-trust access bookmarks list
58
+
59
+ Lists Bookmark applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List Bookmark applications`,builder:De,handler:async n=>l({command:`zero-trust access bookmarks list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access bookmarks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/bookmarks`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.bookmarks.list({account_id:l})),{successLabel:`Loaded`})})};function ke(e){return e.usage(`$0 zero-trust access bookmarks update <bookmark-id>
60
+
61
+ Updates a configured Bookmark application.`).positional(`bookmark-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`update <bookmark-id>`,describe:`Update a Bookmark application`,builder:ke,handler:async n=>l({command:`zero-trust access bookmarks update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access bookmarks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/bookmarks/${n[`bookmark-id`]==null?`<bookmark-id>`:encodeURIComponent(String(n[`bookmark-id`]))}`,pathParams:{"bookmark-id":String(n[`bookmark-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.access.bookmarks.update({account_id:l,bookmark_id:n[`bookmark-id`]})),{successLabel:`Updated`})})},je={command:`bookmarks`,describe:`Operations for access.bookmarks`,builder:e=>e.command(Se).command(we).command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.usage(`$0 zero-trust access certificates create
62
+
63
+ Adds a new mTLS root certificate to Access.`).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`certificate`,{type:`string`,description:`The certificate content.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ne={command:`create`,describe:`Add an mTLS certificate`,builder:Me,handler:async i=>l({command:`zero-trust access certificates create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({associated_hostnames:i[`associated-hostnames`],certificate:m(i.certificate,`certificate`,`text`),name:m(i.name,`name`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.certificates.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i.certificate===void 0&&(i.certificate=await g(`certificate`,`The certificate content.`)),i.name===void 0&&(i.name=await g(`name`,`The name of the certificate.`));let h=p({associated_hostnames:i[`associated-hostnames`],certificate:m(i.certificate,`certificate`,`text`),name:m(i.name,`name`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.access.certificates.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function Pe(e){return e.usage(`$0 zero-trust access certificates delete <certificate-id>
64
+
65
+ Deletes an mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Fe={command:`delete <certificate-id>`,describe:`Delete an mTLS certificate`,builder:Pe,handler:async i=>l({command:`zero-trust access certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
66
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.certificates.delete({account_or_zone:u,account_or_zone_id:d,certificate_id:i[`certificate-id`]})),{successLabel:`Deleted`})})};function Ie(e){return e.usage(`$0 zero-trust access certificates get <certificate-id>
67
+
68
+ Fetches a single mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <certificate-id>`,describe:`Get an mTLS certificate`,builder:Ie,handler:async i=>l({command:`zero-trust access certificates get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.certificates.get({account_or_zone:u,account_or_zone_id:d,certificate_id:i[`certificate-id`]})),{successLabel:`Loaded`})})};function Re(e){return e.usage(`$0 zero-trust access certificates list
69
+
70
+ Lists all mTLS root certificates.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`list`,describe:`List mTLS certificates`,builder:Re,handler:async i=>l({command:`zero-trust access certificates list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.certificates.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function Be(e){return e.usage(`$0 zero-trust access certificates settings get
71
+
72
+ List all mTLS hostname settings for this account or zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`get`,describe:`List all mTLS hostname settings`,builder:Be,handler:async i=>l({command:`zero-trust access certificates settings get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.certificates.settings.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function He(e){return e.usage(`$0 zero-trust access certificates settings update
73
+
74
+ Updates an mTLS certificate's hostname settings.`).option(`settings`,{type:`string`,description:`The settings field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ue={command:`update`,describe:`Update an mTLS certificate's hostname settings`,builder:He,handler:async i=>l({command:`zero-trust access certificates settings update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/settings`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({settings:f(i.settings,`settings`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,m=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.settings.update({...e,account_or_zone:u,account_or_zone_id:m})),{successLabel:`Updated`});return}if(i.settings===void 0)throw Error(`--settings is required (or pass --body with this field set).`);let h=p({settings:f(i.settings,`settings`)});o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.settings.update({...h,account_or_zone:u,account_or_zone_id:m})),{successLabel:`Updated`})})},We={command:`settings`,describe:`Operations for access.certificates.settings`,builder:e=>e.command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.usage(`$0 zero-trust access certificates update <certificate-id>
75
+
76
+ Updates a configured mTLS certificate.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`associated-hostnames`,{type:`string`,array:!0,description:`The hostnames of the applications that will use this certificate.`}).option(`name`,{type:`string`,description:`The name of the certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ke={command:`update <certificate-id>`,describe:`Update an mTLS certificate`,builder:Ge,handler:async i=>l({command:`zero-trust access certificates update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"account-or-zone":String(n),"certificate-id":String(i[`certificate-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({associated_hostnames:i[`associated-hostnames`],name:m(i.name,`name`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.update({...e,account_or_zone:u,account_or_zone_id:f,certificate_id:i[`certificate-id`]})),{successLabel:`Updated`});return}if(i[`associated-hostnames`]===void 0)throw Error(`--associated-hostnames is required (or pass --body with this field set).`);let h=p({associated_hostnames:i[`associated-hostnames`],name:m(i.name,`name`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.access.certificates.update({...h,account_or_zone:u,account_or_zone_id:f,certificate_id:i[`certificate-id`]})),{successLabel:`Updated`})})},qe={command:`certificates`,describe:`Operations for access.certificates`,builder:e=>e.command(Ne).command(Fe).command(Le).command(ze).command(Ke).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.usage(`$0 zero-trust access custom-pages create
77
+
78
+ Create a custom page`).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`uid`,{type:`string`,description:`UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ye={command:`create`,describe:`Create a custom page`,builder:Je,handler:async n=>l({command:`zero-trust access custom-pages create`,classification:{safeFlags:[`type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access custom-pages create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({app_count:n[`app-count`],contract_version:n[`contract-version`],custom_html:m(n[`custom-html`],`custom-html`,`text`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`),uid:m(n.uid,`uid`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:e,account_id:l})),{successLabel:`Created`});return}n[`custom-html`]===void 0&&(n[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),n.name===void 0&&(n.name=await g(`name`,`Custom page name.`)),n.type===void 0&&(n.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:n[`app-count`],contract_version:n[`contract-version`],custom_html:m(n[`custom-html`],`custom-html`,`text`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`),uid:m(n.uid,`uid`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.create({body:u,account_id:l})),{successLabel:`Created`})})};function Xe(e){return e.usage(`$0 zero-trust access custom-pages delete <custom-page-id>
79
+
80
+ Delete a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ze={command:`delete <custom-page-id>`,describe:`Delete a custom page`,builder:Xe,handler:async n=>l({command:`zero-trust access custom-pages delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access custom-pages delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages/${n[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(n[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(n[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
81
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.customPages.delete({account_id:l,custom_page_id:n[`custom-page-id`]})),{successLabel:`Deleted`})})};function Qe(e){return e.usage(`$0 zero-trust access custom-pages get <custom-page-id>
82
+
83
+ Fetches a custom page and also returns its HTML.`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`get <custom-page-id>`,describe:`Get a custom page`,builder:Qe,handler:async n=>l({command:`zero-trust access custom-pages get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages/${n[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(n[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(n[`custom-page-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.customPages.get({account_id:l,custom_page_id:n[`custom-page-id`]})),{successLabel:`Loaded`})})};function et(e){return e.usage(`$0 zero-trust access custom-pages list
84
+
85
+ List custom pages`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`list`,describe:`List custom pages`,builder:et,handler:async n=>l({command:`zero-trust access custom-pages list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust access custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.customPages.list({account_id:u,...i})),{successLabel:`Loaded`})})};function nt(e){return e.usage(`$0 zero-trust access custom-pages update <custom-page-id>
86
+
87
+ Update a custom page`).positional(`custom-page-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`app-count`,{type:`number`,description:`Number of apps the custom page is assigned to.`}).option(`contract-version`,{type:`number`,description:`Contract version of the page's Liquid template. Present (>= 1) marks a sanitized template; absent or 0 marks a legacy page served verbatim.`}).option(`custom-html`,{type:`string`,description:`Custom page HTML.`}).option(`name`,{type:`string`,description:`Custom page name.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`uid`,{type:`string`,description:`UUID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const rt={command:`update <custom-page-id>`,describe:`Update a custom page`,builder:nt,handler:async n=>l({command:`zero-trust access custom-pages update`,classification:{safeFlags:[`type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages/${n[`custom-page-id`]==null?`<custom-page-id>`:encodeURIComponent(String(n[`custom-page-id`]))}`,pathParams:{"custom-page-id":String(n[`custom-page-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({app_count:n[`app-count`],contract_version:n[`contract-version`],custom_html:m(n[`custom-html`],`custom-html`,`text`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`),uid:m(n.uid,`uid`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:e,account_id:l,custom_page_id:n[`custom-page-id`]})),{successLabel:`Updated`});return}n[`custom-html`]===void 0&&(n[`custom-html`]=await g(`custom-html`,`Custom page HTML.`)),n.name===void 0&&(n.name=await g(`name`,`Custom page name.`)),n.type===void 0&&(n.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({app_count:n[`app-count`],contract_version:n[`contract-version`],custom_html:m(n[`custom-html`],`custom-html`,`text`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`),uid:m(n.uid,`uid`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.customPages.update({body:u,account_id:l,custom_page_id:n[`custom-page-id`]})),{successLabel:`Updated`})})};function it(e){return e.usage(`$0 zero-trust access custom-pages validate
88
+
89
+ Validate a Liquid template and return its errors and warnings without persisting it.`).option(`template`,{type:`string`,description:`The Liquid template to validate.`}).option(`type`,{type:`string`,description:`Custom page type.`,choices:[`identity_denied`,`forbidden`,`login`,`interstitial`]}).option(`version`,{type:`number`,description:`Contract version to validate against; omit for the latest.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A template to validate without persisting it.`})}const at={command:`validate`,describe:`Validate a custom page template`,builder:it,handler:async n=>l({command:`zero-trust access custom-pages validate`,classification:{safeFlags:[`type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access custom-pages validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/custom_pages/validate`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({template:m(n.template,`template`,`text`),type:m(n.type,`type`,`text`),version:n.version}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...e,account_id:l})),{successLabel:`Created`});return}n.template===void 0&&(n.template=await g(`template`,`The Liquid template to validate.`)),n.type===void 0&&(n.type=await _(`type`,`Custom page type.`,[`identity_denied`,`forbidden`,`login`,`interstitial`]));let u=p({template:m(n.template,`template`,`text`),type:m(n.type,`type`,`text`),version:n.version});o(await c(`Creating`,async()=>i.zeroTrust.access.customPages.validate({...u,account_id:l})),{successLabel:`Created`})})},ot={command:`custom-pages`,describe:`Operations for access.custom-pages`,builder:e=>e.command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.usage(`$0 zero-trust access gateway-ca create
90
+
91
+ Adds a new SSH Certificate Authority (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`create`,describe:`Add a new SSH Certificate Authority (CA)`,builder:st,handler:async n=>l({command:`zero-trust access gateway-ca create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access gateway-ca create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.gatewayCa.create({account_id:l})),{successLabel:`Created`})})};function lt(e){return e.usage(`$0 zero-trust access gateway-ca delete <certificate-id>
92
+
93
+ Deletes an SSH Certificate Authority.`).positional(`certificate-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`delete <certificate-id>`,describe:`Delete an SSH Certificate Authority (CA)`,builder:lt,handler:async n=>l({command:`zero-trust access gateway-ca delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access gateway-ca delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/gateway_ca/${n[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(n[`certificate-id`]))}`,pathParams:{"certificate-id":String(n[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
94
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.gatewayCa.delete({account_id:l,certificate_id:n[`certificate-id`]})),{successLabel:`Deleted`})})};function dt(e){return e.usage(`$0 zero-trust access gateway-ca list
95
+
96
+ Lists SSH Certificate Authorities (CA).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`list`,describe:`List SSH Certificate Authorities (CA)`,builder:dt,handler:async n=>l({command:`zero-trust access gateway-ca list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access gateway-ca list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/gateway_ca`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.gatewayCa.list({account_id:l})),{successLabel:`Loaded`})})},pt={command:`gateway-ca`,describe:`Operations for access.gateway-ca`,builder:e=>e.command(ct).command(ut).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mt(e){return e.usage(`$0 zero-trust access groups create
97
+
98
+ Creates a new Access group.`).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ht={command:`create`,describe:`Create an Access group`,builder:mt,handler:async i=>l({command:`zero-trust access groups create`,classification:{safeFlags:[`is-default`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,h=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.groups.create({...e,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`});return}if(i.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)});o(await c(`Creating`,async()=>l.zeroTrust.access.groups.create({..._,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`})})};function gt(e){return e.usage(`$0 zero-trust access groups delete <group-id>
99
+
100
+ Deletes an Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _t={command:`delete <group-id>`,describe:`Delete an Access group`,builder:gt,handler:async i=>l({command:`zero-trust access groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
101
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.groups.delete({account_or_zone:u,account_or_zone_id:d,group_id:i[`group-id`]})),{successLabel:`Deleted`})})};function vt(e){return e.usage(`$0 zero-trust access groups get <group-id>
102
+
103
+ Fetches a single Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yt={command:`get <group-id>`,describe:`Get an Access group`,builder:vt,handler:async i=>l({command:`zero-trust access groups get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.groups.get({account_or_zone:u,account_or_zone_id:d,group_id:i[`group-id`]})),{successLabel:`Loaded`})})};function bt(e){return e.usage(`$0 zero-trust access groups list
104
+
105
+ Lists all Access groups.`).option(`name`,{type:`string`,description:`The name of the group.`}).option(`search`,{type:`string`,description:`Search for groups by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xt={command:`list`,describe:`List Access groups`,builder:bt,handler:async i=>l({command:`zero-trust access groups list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={name:i.name,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.groups.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function St(e){return e.usage(`$0 zero-trust access groups update <group-id>
106
+
107
+ Updates a configured Access group.`).positional(`group-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match a policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`is-default`,{type:`boolean`,description:`Whether this is the default group`}).option(`name`,{type:`string`,description:`The name of the Access group.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match a policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ct={command:`update <group-id>`,describe:`Update an Access group`,builder:St,handler:async i=>l({command:`zero-trust access groups update`,classification:{safeFlags:[`is-default`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/groups/${i[`group-id`]==null?`<group-id>`:encodeURIComponent(String(i[`group-id`]))}`,pathParams:{"account-or-zone":String(n),"group-id":String(i[`group-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,h=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.groups.update({...e,account_or_zone:u,account_or_zone_id:h,group_id:i[`group-id`]})),{successLabel:`Updated`});return}if(i.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await g(`name`,`The name of the Access group.`));let _=p({exclude:f(i.exclude,`exclude`),include:f(i.include,`include`),is_default:i[`is-default`],name:m(i.name,`name`,`text`),require:f(i.require,`require`)});o(await c(`Updating`,async()=>l.zeroTrust.access.groups.update({..._,account_or_zone:u,account_or_zone_id:h,group_id:i[`group-id`]})),{successLabel:`Updated`})})},wt={command:`groups`,describe:`Operations for access.groups`,builder:e=>e.command(ht).command(_t).command(yt).command(xt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.usage(`$0 zero-trust access idp-federation-grants create
108
+
109
+ Creates an IdP federation grant for the specified identity provider, making it available for federation to other accounts in the same Cloudflare organization. The account must belong to a Cloudflare organization. One-time pin and Cloudflare-managed identity providers cannot be federated. An account can federate at most five identity providers at a time.`).option(`idp-id`,{type:`string`,description:`UID of the identity provider to federate. Must be an existing identity provider in this account. One-time pin and Cloudflare-managed identity providers cannot be federated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Et={command:`create`,describe:`Create an IdP federation grant`,builder:Tt,handler:async n=>l({command:`zero-trust access idp-federation-grants create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access idp-federation-grants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({idp_id:m(n[`idp-id`],`idp-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.idpFederationGrants.create({...e,account_id:l})),{successLabel:`Created`});return}n[`idp-id`]===void 0&&(n[`idp-id`]=await g(`idp-id`,`UID of the identity provider to federate. Must be an existing identity provider in this account. One-time pin and Cloudflare-managed identity providers cannot be federated.`));let u=p({idp_id:m(n[`idp-id`],`idp-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.idpFederationGrants.create({...u,account_id:l})),{successLabel:`Created`})})};function Dt(e){return e.usage(`$0 zero-trust access idp-federation-grants delete <grant-id>
110
+
111
+ Deletes an IdP federation grant. The identity provider remains in the account, but it is no longer available for federation to other accounts.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ot={command:`delete <grant-id>`,describe:`Delete an IdP federation grant`,builder:Dt,handler:async n=>l({command:`zero-trust access idp-federation-grants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access idp-federation-grants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/idp_federation_grants/${n[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(n[`grant-id`]))}`,pathParams:{"grant-id":String(n[`grant-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
112
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.idpFederationGrants.delete({account_id:l,grant_id:n[`grant-id`]})),{successLabel:`Deleted`})})};function kt(e){return e.usage(`$0 zero-trust access idp-federation-grants get <grant-id>
113
+
114
+ Retrieves a single IdP federation grant by its UID.`).positional(`grant-id`,{type:`string`,description:`UID of the IdP federation grant.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`get <grant-id>`,describe:`Get an IdP federation grant`,builder:kt,handler:async n=>l({command:`zero-trust access idp-federation-grants get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access idp-federation-grants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/idp_federation_grants/${n[`grant-id`]==null?`<grant-id>`:encodeURIComponent(String(n[`grant-id`]))}`,pathParams:{"grant-id":String(n[`grant-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.idpFederationGrants.get({account_id:l,grant_id:n[`grant-id`]})),{successLabel:`Loaded`})})};function jt(e){return e.usage(`$0 zero-trust access idp-federation-grants list
115
+
116
+ Lists the IdP federation grants owned by the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`list`,describe:`List IdP federation grants`,builder:jt,handler:async n=>l({command:`zero-trust access idp-federation-grants list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access idp-federation-grants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/idp_federation_grants`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.idpFederationGrants.list({account_id:l})),{successLabel:`Loaded`})})},Nt={command:`idp-federation-grants`,describe:`Operations for access.idp-federation-grants`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pt(e){return e.usage(`$0 zero-trust access keys get
117
+
118
+ Gets the Access key rotation settings for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`get`,describe:`Get the Access key configuration`,builder:Pt,handler:async n=>l({command:`zero-trust access keys get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.keys.get({account_id:l})),{successLabel:`Loaded`})})};function It(e){return e.usage(`$0 zero-trust access keys rotate
119
+
120
+ Perfoms a key rotation for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Lt={command:`rotate`,describe:`Rotate Access keys`,builder:It,handler:async n=>l({command:`zero-trust access keys rotate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access keys rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/keys/rotate`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.keys.rotate({account_id:l})),{successLabel:`Created`})})};function Rt(e){return e.usage(`$0 zero-trust access keys update
121
+
122
+ Updates the Access key rotation settings for an account.`).option(`key-rotation-interval-days`,{type:`number`,description:`The number of days between key rotations.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const zt={command:`update`,describe:`Update the Access key configuration`,builder:Rt,handler:async n=>l({command:`zero-trust access keys update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/keys`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({key_rotation_interval_days:n[`key-rotation-interval-days`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.access.keys.update({...e,account_id:l})),{successLabel:`Updated`});return}if(n[`key-rotation-interval-days`]===void 0)throw Error(`--key-rotation-interval-days is required (or pass --body with this field set).`);let u=p({key_rotation_interval_days:n[`key-rotation-interval-days`]});o(await c(`Updating`,async()=>i.zeroTrust.access.keys.update({...u,account_id:l})),{successLabel:`Updated`})})},Bt={command:`keys`,describe:`Operations for access.keys`,builder:e=>e.command(Ft).command(Lt).command(zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Vt(e){return e.usage(`$0 zero-trust access logs access-requests list
123
+
124
+ Gets a list of Access authentication audit logs for an account.`).option(`limit`,{type:`number`,description:`The maximum number of log entries to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological sorting order for the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`The earliest event timestamp to query.`}).option(`until`,{type:`string`,description:`The latest event timestamp to query.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`email`,{type:`string`,description:"Filter by user email. Match mode is controlled by `emailOp` (preferred) or the legacy `email_exact` flag.\n- Default (no `emailOp`, `email_exact=false` or unset): substring match — `email=@example.com` returns all events with that domain.\n- Exact match: set `emailOp=eq` (preferred) or `email_exact=true` — e.g. `email=user@example.com&email_exact=true` returns only that user.\n- Explicit substring match: set `emailOp=contains` (without `email_exact=true`). When both are set, `email_exact=true` takes precedence and the match is exact.\n- Exclusion: set `emailOp=neq`. With `email_exact=true` this is an exact-value exclusion; without it, a fuzzy substring exclusion."}).option(`email-exact`,{type:`boolean`,description:"When true, `email` is matched exactly instead of substring matching."}).option(`user-id`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter. Use `email` instead."}).option(`allowed-op`,{type:`string`,description:"Operator for the `allowed` filter.",choices:[`eq`,`neq`]}).option(`country-code-op`,{type:`string`,description:"Operator for the `country_code` filter.",choices:[`eq`,`neq`]}).option(`app-type-op`,{type:`string`,description:"Operator for the `app_type` filter.",choices:[`eq`,`neq`]}).option(`app-uid-op`,{type:`string`,description:"Operator for the `app_uid` filter.",choices:[`eq`,`neq`]}).option(`ray-id-op`,{type:`string`,description:"Operator for the `ray_id` filter.",choices:[`eq`,`neq`]}).option(`email-op`,{type:`string`,description:"Operator for the `email` filter.\n`contains` performs a substring (case-sensitive) match. When `email_exact=true`\nis also set, `email_exact` takes precedence and `contains` is ignored.",choices:[`eq`,`neq`,`contains`]}).option(`idp-op`,{type:`string`,description:"Operator for the `idp` filter.",choices:[`eq`,`neq`]}).option(`non-identity-op`,{type:`string`,description:"Operator for the `non_identity` filter.",choices:[`eq`,`neq`]}).option(`user-id-op`,{type:`string`,description:"Deprecated. Accepted for backward compatibility but no longer applied\nas a filter (the `user_id` parameter is itself deprecated).",choices:[`eq`,`neq`]}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response.
125
+ When omitted, all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`Get Access authentication logs`,builder:y(Vt),handler:async n=>l({command:`zero-trust access logs access-requests list`,classification:{safeFlags:[`direction`,`email-exact`,`allowed-op`,`country-code-op`,`app-type-op`,`app-uid-op`,`ray-id-op`,`email-op`,`idp-op`,`non-identity-op`,`user-id-op`,`dry-run`]}},n,async()=>{let i={limit:n.limit,direction:n.direction,since:n.since,until:n.until,page:n.page,per_page:n[`per-page`],email:n.email,email_exact:n[`email-exact`],user_id:n[`user-id`],allowedOp:n[`allowed-op`],country_codeOp:n[`country-code-op`],app_typeOp:n[`app-type-op`],app_uidOp:n[`app-uid-op`],ray_idOp:n[`ray-id-op`],emailOp:n[`email-op`],idpOp:n[`idp-op`],non_identityOp:n[`non-identity-op`],user_idOp:n[`user-id-op`],fields:n.fields};if(n.dryRun){s({command:`cf zero-trust access logs access-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/logs/access_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.accessRequests.list({account_id:u,...i})),{successLabel:`Loaded`})})},Ut={command:`access-requests`,describe:`Operations for access.logs.access-requests`,builder:e=>e.command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wt(e){return e.usage(`$0 zero-trust access logs jit-requests get <knock-request-id>
126
+
127
+ Gets an account-scoped Access JIT request summary and its lifecycle events in chronological order.`).positional(`knock-request-id`,{type:`string`,description:`Knock request ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gt={command:`get <knock-request-id>`,describe:`Get an Access JIT request log`,builder:Wt,handler:async n=>l({command:`zero-trust access logs jit-requests get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access logs jit-requests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/logs/jit_requests/${n[`knock-request-id`]==null?`<knock-request-id>`:encodeURIComponent(String(n[`knock-request-id`]))}`,pathParams:{"knock-request-id":String(n[`knock-request-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.logs.jitRequests.get({account_id:l,knock_request_id:n[`knock-request-id`]})),{successLabel:`Loaded`})})};function Kt(e){return e.usage(`$0 zero-trust access logs jit-requests list
128
+
129
+ Lists account-wide Access JIT request logs reconstructed from request lifecycle events.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`status`,{type:`string`,description:"JIT request status. `SPENT` is deprecated and interpreted as `APPROVED`.",choices:[`PENDING`,`APPROVED`,`DENIED`,`CANCELED`,`SPENT`]}).option(`search`,{type:`string`,description:`Case-insensitive search over request ID, requester email, application audience, and application hostname.`}).option(`since`,{type:`string`,description:`The earliest request timestamp to query. Defaults to 366 days before the current time.`}).option(`until`,{type:`string`,description:`The latest request timestamp to query. Defaults to the current time.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qt={command:`list`,describe:`List Access JIT request logs`,builder:y(Kt),handler:async n=>l({command:`zero-trust access logs jit-requests list`,classification:{safeFlags:[`status`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],status:n.status,search:n.search,since:n.since,until:n.until};if(n.dryRun){s({command:`cf zero-trust access logs jit-requests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/logs/jit_requests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.jitRequests.list({account_id:u,...i})),{successLabel:`Loaded`})})},Jt={command:`jit-requests`,describe:`Operations for access.logs.jit-requests`,builder:e=>e.command(Gt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yt(e){return e.usage(`$0 zero-trust access logs scim updates list
130
+
131
+ Lists Access SCIM update logs that maintain a record of updates made to User and Group resources synced to Cloudflare via the System for Cross-domain Identity Management (SCIM).`).option(`limit`,{type:`number`,description:`The maximum number of update logs to retrieve.`}).option(`direction`,{type:`string`,description:`The chronological order used to sort the logs.`,choices:[`desc`,`asc`]}).option(`since`,{type:`string`,description:`the timestamp of the earliest update log.`}).option(`until`,{type:`string`,description:`the timestamp of the most-recent update log.`}).option(`idp-id`,{type:`string`,description:`The unique Id of the IdP that has SCIM enabled.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status of the SCIM request.`}).option(`resource-type`,{type:`string`,description:`The resource type of the SCIM request.`}).option(`request-method`,{type:`string`,description:`The request method of the SCIM request.`}).option(`resource-user-email`,{type:`string`,description:"The email address of the SCIM User resource. Pass once for a single\nlookup (`?resource_user_email=A`) or repeat the parameter\n(`?resource_user_email=A&resource_user_email=B`) to filter by multiple\nemails in one request."}).option(`resource-group-name`,{type:`string`,description:"The display name of the SCIM Group resource. Pass once for a single\nlookup (`?resource_group_name=A`) or repeat the parameter\n(`?resource_group_name=A&resource_group_name=B`) to filter by multiple\ngroup names in one request."}).option(`cf-resource-id`,{type:`string`,description:"The unique Cloudflare-generated Id of the SCIM resource. Pass once for\na single lookup (`?cf_resource_id=A`) or repeat the parameter\n(`?cf_resource_id=A&cf_resource_id=B`) to filter by multiple resources\nin one request."}).option(`idp-resource-id`,{type:`string`,description:"The IdP-generated Id of the SCIM resource. Pass once for a single\nlookup (`?idp_resource_id=A`) or repeat the parameter\n(`?idp_resource_id=A&idp_resource_id=B`) to filter by multiple\nresources in one request."}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xt={command:`list`,describe:`List Access SCIM update logs`,builder:y(Yt),handler:async n=>l({command:`zero-trust access logs scim updates list`,classification:{safeFlags:[`direction`,`dry-run`]}},n,async()=>{let i={limit:n.limit,direction:n.direction,since:n.since,until:n.until,idp_id:n[`idp-id`],status:n.status,resource_type:n[`resource-type`],request_method:n[`request-method`],resource_user_email:n[`resource-user-email`],resource_group_name:n[`resource-group-name`],cf_resource_id:n[`cf-resource-id`],idp_resource_id:n[`idp-resource-id`],page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust access logs scim updates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/logs/scim/updates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.logs.scim.updates.list({account_id:u,...i})),{successLabel:`Loaded`})})},Zt={command:`updates`,describe:`Operations for access.logs.scim.updates`,builder:e=>e.command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qt={command:`scim`,describe:`Operations for access.logs.scim`,builder:e=>e.command(Zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$t={command:`logs`,describe:`Operations for access.logs`,builder:e=>e.command(Ut).command(Jt).command(Qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function en(e){return e.usage(`$0 zero-trust access policies create
132
+
133
+ Creates a new Access reusable policy.`).option(`decision`,{type:`string`,description:`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,choices:[`allow`,`deny`,`non_identity`,`bypass`]}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the Access policy.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const tn={command:`create`,describe:`Create an Access reusable policy`,builder:en,handler:async n=>l({command:`zero-trust access policies create`,classification:{safeFlags:[`decision`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policies`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({decision:m(n.decision,`decision`,`text`),exclude:f(n.exclude,`exclude`),include:f(n.include,`include`),name:m(n.name,`name`,`text`),require:f(n.require,`require`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:e,account_id:l})),{successLabel:`Created`});return}if(n.decision===void 0&&(n.decision=await _(`decision`,`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,[`allow`,`deny`,`non_identity`,`bypass`])),n.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(n.decision,`decision`,`text`),exclude:f(n.exclude,`exclude`),include:f(n.include,`include`),name:m(n.name,`name`,`text`),require:f(n.require,`require`)});o(await c(`Creating`,async()=>i.zeroTrust.access.policies.create({body:u,account_id:l})),{successLabel:`Created`})})};function nn(e){return e.usage(`$0 zero-trust access policies delete <policy-id>
134
+
135
+ Deletes an Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const rn={command:`delete <policy-id>`,describe:`Delete an Access reusable policy`,builder:nn,handler:async n=>l({command:`zero-trust access policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
136
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.policies.delete({account_id:l,policy_id:n[`policy-id`]})),{successLabel:`Deleted`})})};function an(e){return e.usage(`$0 zero-trust access policies get <policy-id>
137
+
138
+ Fetches a single Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const on={command:`get <policy-id>`,describe:`Get an Access reusable policy`,builder:an,handler:async n=>l({command:`zero-trust access policies get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.policies.get({account_id:l,policy_id:n[`policy-id`]})),{successLabel:`Loaded`})})};function sn(e){return e.usage(`$0 zero-trust access policies list
139
+
140
+ Lists Access reusable policies.`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cn={command:`list`,describe:`List Access reusable policies`,builder:sn,handler:async n=>l({command:`zero-trust access policies list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust access policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policies`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.policies.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ln(e){return e.usage(`$0 zero-trust access policies update <policy-id>
141
+
142
+ Updates a Access reusable policy.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy`,demandOption:!0}).option(`decision`,{type:`string`,description:`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,choices:[`allow`,`deny`,`non_identity`,`bypass`]}).option(`exclude`,{type:`string`,description:`Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`include`,{type:`string`,description:`Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name of the Access policy.`}).option(`require`,{type:`string`,description:`Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const un={command:`update <policy-id>`,describe:`Update an Access reusable policy`,builder:ln,handler:async n=>l({command:`zero-trust access policies update`,classification:{safeFlags:[`decision`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}`,pathParams:{"policy-id":String(n[`policy-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({decision:m(n.decision,`decision`,`text`),exclude:f(n.exclude,`exclude`),include:f(n.include,`include`),name:m(n.name,`name`,`text`),require:f(n.require,`require`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:e,account_id:l,policy_id:n[`policy-id`]})),{successLabel:`Updated`});return}if(n.decision===void 0&&(n.decision=await _(`decision`,`The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action.`,[`allow`,`deny`,`non_identity`,`bypass`])),n.include===void 0)throw Error(`--include is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name of the Access policy.`));let u=p({decision:m(n.decision,`decision`,`text`),exclude:f(n.exclude,`exclude`),include:f(n.include,`include`),name:m(n.name,`name`,`text`),require:f(n.require,`require`)});o(await c(`Updating`,async()=>i.zeroTrust.access.policies.update({body:u,account_id:l,policy_id:n[`policy-id`]})),{successLabel:`Updated`})})},dn={command:`policies`,describe:`Operations for access.policies`,builder:e=>e.command(tn).command(rn).command(on).command(cn).command(un).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fn(e){return e.usage(`$0 zero-trust access saml-certificates get-pem <saml-cert-set-id>
143
+
144
+ Downloads the current SAML encryption certificate's public key in PEM format for the specified certificate set. This endpoint is useful for providing the certificate to Identity Providers for SAML assertion encryption configuration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pn={command:`get-pem <saml-cert-set-id>`,describe:`Download current certificate in PEM format`,builder:fn,handler:async n=>l({command:`zero-trust access saml-certificates get-pem`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access saml-certificates get-pem`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/saml_certificates/${n[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(n[`saml-cert-set-id`]))}/pem`,pathParams:{"saml-cert-set-id":String(n[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.getPem({account_id:l,saml_cert_set_id:n[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function mn(e){return e.usage(`$0 zero-trust access saml-certificates get <saml-cert-set-id>
145
+
146
+ Retrieves a specific SAML encryption certificate set by its UID, including both current and previous certificates if available.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const hn={command:`get <saml-cert-set-id>`,describe:`Get SAML certificate set`,builder:mn,handler:async n=>l({command:`zero-trust access saml-certificates get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access saml-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/saml_certificates/${n[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(n[`saml-cert-set-id`]))}`,pathParams:{"saml-cert-set-id":String(n[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.samlCertificates.get({account_id:l,saml_cert_set_id:n[`saml-cert-set-id`]})),{successLabel:`Loaded`})})};function gn(e){return e.usage(`$0 zero-trust access saml-certificates list
147
+
148
+ Returns a paginated list of the organization's SAML encryption certificate sets. Each certificate set includes the current and (if present) previous certificates.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`id`,{type:`string`,description:`Filter by SAML certificate set UID. Accepts a comma-separated list of UIDs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _n={command:`list`,describe:`List SAML certificate sets`,builder:gn,handler:async n=>l({command:`zero-trust access saml-certificates list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],id:n.id};if(n.dryRun){s({command:`cf zero-trust access saml-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/saml_certificates`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.samlCertificates.list({account_id:u,...i})),{successLabel:`Loaded`})})};function vn(e){return e.usage(`$0 zero-trust access saml-certificates rotate <saml-cert-set-id>
149
+
150
+ Rotates the SAML encryption certificates within the specified certificate set. This generates a new certificate and moves the current certificate to the previous slot. If a previous certificate exists, it will be deactivated and removed. This endpoint ensures zero-downtime rotation by maintaining both current and previous certificates during the transition period, allowing IdPs time to update their configurations. Automated rotation happens 30 days before a current certificate's expiration.`).positional(`saml-cert-set-id`,{type:`string`,description:`UID of the SAML certificate set to rotate.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yn={command:`rotate <saml-cert-set-id>`,describe:`Rotate SAML certificate`,builder:vn,handler:async n=>l({command:`zero-trust access saml-certificates rotate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access saml-certificates rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/saml_certificates/${n[`saml-cert-set-id`]==null?`<saml-cert-set-id>`:encodeURIComponent(String(n[`saml-cert-set-id`]))}/rotate`,pathParams:{"saml-cert-set-id":String(n[`saml-cert-set-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.samlCertificates.rotate({account_id:l,saml_cert_set_id:n[`saml-cert-set-id`]})),{successLabel:`Created`})})},bn={command:`saml-certificates`,describe:`Operations for access.saml-certificates`,builder:e=>e.command(hn).command(pn).command(_n).command(yn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xn(e){return e.usage(`$0 zero-trust access service-tokens create
151
+
152
+ Generates a new service token. **Note:** This is the only time you can get the Client Secret. If you lose the Client Secret, you will have to rotate the Client Secret or create a new service token.`).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`.",default:1}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h).",default:`8760h`}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Sn={command:`create`,describe:`Create a service token`,builder:xn,handler:async i=>l({command:`zero-trust access service-tokens create`,classification:{safeFlags:[`enabled`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i.name===void 0&&(i.name=await g(`name`,`The name of the service token.`));let h=p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.access.serviceTokens.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function Cn(e){return e.usage(`$0 zero-trust access service-tokens delete <service-token-id>
153
+
154
+ Deletes a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const wn={command:`delete <service-token-id>`,describe:`Delete a service token`,builder:Cn,handler:async i=>l({command:`zero-trust access service-tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
155
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.access.serviceTokens.delete({account_or_zone:u,account_or_zone_id:d,service_token_id:i[`service-token-id`]})),{successLabel:`Deleted`})})};function Tn(e){return e.usage(`$0 zero-trust access service-tokens get <service-token-id>
156
+
157
+ Fetches a single service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const En={command:`get <service-token-id>`,describe:`Get a service token`,builder:Tn,handler:async i=>l({command:`zero-trust access service-tokens get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.access.serviceTokens.get({account_or_zone:u,account_or_zone_id:d,service_token_id:i[`service-token-id`]})),{successLabel:`Loaded`})})};function Dn(e){return e.usage(`$0 zero-trust access service-tokens list
158
+
159
+ Lists all service tokens.`).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`search`,{type:`string`,description:`Search for service tokens by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const On={command:`list`,describe:`List service tokens`,builder:Dn,handler:async i=>l({command:`zero-trust access service-tokens list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={name:i.name,search:i.search,page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.access.serviceTokens.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function kn(e){return e.usage(`$0 zero-trust access service-tokens refresh <service-token-id>
160
+
161
+ Refreshes the expiration of a service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const An={command:`refresh <service-token-id>`,describe:`Refresh a service token`,builder:kn,handler:async n=>l({command:`zero-trust access service-tokens refresh`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access service-tokens refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/service_tokens/${n[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(n[`service-token-id`]))}/refresh`,pathParams:{"service-token-id":String(n[`service-token-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.refresh({account_id:l,service_token_id:n[`service-token-id`]})),{successLabel:`Created`})})};function jn(e){return e.usage(`$0 zero-trust access service-tokens rotate <service-token-id>
162
+
163
+ Generates a new Client Secret for a service token and revokes the old one.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. If not provided, it defaults to the current timestamp in order to immediately expire the previous secret."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Mn={command:`rotate <service-token-id>`,describe:`Rotate a service token`,builder:jn,handler:async n=>l({command:`zero-trust access service-tokens rotate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access service-tokens rotate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/service_tokens/${n[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(n[`service-token-id`]))}/rotate`,pathParams:{"service-token-id":String(n[`service-token-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({previous_client_secret_expires_at:m(n[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...e,account_id:l,service_token_id:n[`service-token-id`]})),{successLabel:`Created`});return}let u=p({previous_client_secret_expires_at:m(n[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.serviceTokens.rotate({...u,account_id:l,service_token_id:n[`service-token-id`]})),{successLabel:`Created`})})};function Nn(e){return e.usage(`$0 zero-trust access service-tokens update <service-token-id>
164
+
165
+ Updates a configured service token.`).positional(`service-token-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`client-secret-version`,{type:`number`,description:"A version number identifying the current `client_secret` associated with the service token. Incrementing it triggers a rotation; the previous secret will still be accepted until the time indicated by `previous_client_secret_expires_at`."}).option(`duration`,{type:`string`,description:"The duration for how long the service token will be valid. Must be in the format `300ms` or `2h45m`, or the special value `forever` for non-expiring tokens. Valid time units are: ns, us (or µs), ms, s, m, h. The default is 1 year in hours (8760h)."}).option(`enabled`,{type:`boolean`,description:"Whether the service token is enabled. A disabled service token cannot be used to authenticate; both its current and previous `client_secret` stop being accepted, but the token itself is preserved and can be re-enabled at any time. Defaults to enabled when omitted on create."}).option(`name`,{type:`string`,description:`The name of the service token.`}).option(`previous-client-secret-expires-at`,{type:`string`,description:"The expiration of the previous `client_secret`. This can be modified at any point after a rotation. For example, you may extend it further into the future if you need more time to update services with the new secret; or move it into the past to immediately invalidate the previous token in case of compromise."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pn={command:`update <service-token-id>`,describe:`Update a service token`,builder:Nn,handler:async i=>l({command:`zero-trust access service-tokens update`,classification:{safeFlags:[`enabled`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust access service-tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/service_tokens/${i[`service-token-id`]==null?`<service-token-id>`:encodeURIComponent(String(i[`service-token-id`]))}`,pathParams:{"account-or-zone":String(n),"service-token-id":String(i[`service-token-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...e,account_or_zone:u,account_or_zone_id:f,service_token_id:i[`service-token-id`]})),{successLabel:`Updated`});return}let h=p({client_secret_version:i[`client-secret-version`],duration:m(i.duration,`duration`,`text`),enabled:i.enabled,name:m(i.name,`name`,`text`),previous_client_secret_expires_at:m(i[`previous-client-secret-expires-at`],`previous-client-secret-expires-at`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.access.serviceTokens.update({...h,account_or_zone:u,account_or_zone_id:f,service_token_id:i[`service-token-id`]})),{successLabel:`Updated`})})},Fn={command:`service-tokens`,describe:`Operations for access.service-tokens`,builder:e=>e.command(Sn).command(wn).command(En).command(On).command(An).command(Mn).command(Pn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function In(e){return e.usage(`$0 zero-trust access tags create
166
+
167
+ Create a tag`).option(`name`,{type:`string`,description:`The name of the tag`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ln={command:`create`,describe:`Create a tag`,builder:In,handler:async n=>l({command:`zero-trust access tags create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/tags`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.tags.create({...u,account_id:l})),{successLabel:`Created`})})};function Rn(e){return e.usage(`$0 zero-trust access tags delete <tag-name>
168
+
169
+ Delete a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const zn={command:`delete <tag-name>`,describe:`Delete a tag`,builder:Rn,handler:async n=>l({command:`zero-trust access tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/tags/${n[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(n[`tag-name`]))}`,pathParams:{"tag-name":String(n[`tag-name`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
170
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.tags.delete({account_id:l,tag_name:n[`tag-name`]})),{successLabel:`Deleted`})})};function Bn(e){return e.usage(`$0 zero-trust access tags get <tag-name>
171
+
172
+ Get a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vn={command:`get <tag-name>`,describe:`Get a tag`,builder:Bn,handler:async n=>l({command:`zero-trust access tags get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/tags/${n[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(n[`tag-name`]))}`,pathParams:{"tag-name":String(n[`tag-name`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.tags.get({account_id:l,tag_name:n[`tag-name`]})),{successLabel:`Loaded`})})};function Hn(e){return e.usage(`$0 zero-trust access tags list
173
+
174
+ List tags`).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Un={command:`list`,describe:`List tags`,builder:Hn,handler:async n=>l({command:`zero-trust access tags list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust access tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/tags`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.tags.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Wn(e){return e.usage(`$0 zero-trust access tags update <tag-name>
175
+
176
+ Update a tag`).positional(`tag-name`,{type:`string`,description:`The name of the tag`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the tag`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A tag`})}const Gn={command:`update <tag-name>`,describe:`Update a tag`,builder:Wn,handler:async n=>l({command:`zero-trust access tags update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/tags/${n[`tag-name`]==null?`<tag-name>`:encodeURIComponent(String(n[`tag-name`]))}`,pathParams:{"tag-name":String(n[`tag-name`]??``)},bodyKind:`json`,body:n.body===void 0?p({name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...e,account_id:l,tag_name:n[`tag-name`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await g(`name`,`The name of the tag`));let u=p({name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.tags.update({...u,account_id:l,tag_name:n[`tag-name`]})),{successLabel:`Updated`})})},Kn={command:`tags`,describe:`Operations for access.tags`,builder:e=>e.command(Ln).command(zn).command(Vn).command(Un).command(Gn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qn(e){return e.usage(`$0 zero-trust access users active-sessions get <nonce>
177
+
178
+ Get an active session for a single user.`).positional(`nonce`,{type:`string`,description:`Nonce`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Jn={command:`get <nonce>`,describe:`Get single active session`,builder:qn,handler:async n=>l({command:`zero-trust access users active-sessions get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users active-sessions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/active_sessions/${n.nonce==null?`<nonce>`:encodeURIComponent(String(n.nonce))}`,pathParams:{"user-id":String(n[`user-id`]??``),nonce:String(n.nonce??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.get({account_id:l,user_id:n[`user-id`],nonce:n.nonce})),{successLabel:`Loaded`})})};function Yn(e){return e.usage(`$0 zero-trust access users active-sessions list
179
+
180
+ Get active sessions for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xn={command:`list`,describe:`Get active sessions`,builder:Yn,handler:async n=>l({command:`zero-trust access users active-sessions list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users active-sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/active_sessions`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.activeSessions.list({account_id:l,user_id:n[`user-id`]})),{successLabel:`Loaded`})})},Zn={command:`active-sessions`,describe:`Operations for access.users.active-sessions`,builder:e=>e.command(Jn).command(Xn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qn(e){return e.usage(`$0 zero-trust access users create
181
+
182
+ Creates a new user.`).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $n={command:`create`,describe:`Create a user`,builder:Qn,handler:async n=>l({command:`zero-trust access users create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({email:m(n.email,`email`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...e,account_id:l})),{successLabel:`Created`});return}n.email===void 0&&(n.email=await g(`email`,`The email of the user.`));let u=p({email:m(n.email,`email`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.access.users.create({...u,account_id:l})),{successLabel:`Created`})})};function er(e){return e.usage(`$0 zero-trust access users delete <user-id>
183
+
184
+ Deletes a specific user for an account. This will also revoke any active seats and tokens for the user.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tr={command:`delete <user-id>`,describe:`Delete a user`,builder:er,handler:async n=>l({command:`zero-trust access users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
185
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.access.users.delete({account_id:l,user_id:n[`user-id`]})),{successLabel:`Deleted`})})};function nr(e){return e.usage(`$0 zero-trust access users failed-logins list
186
+
187
+ Get all failed login attempts for a single user.`).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rr={command:`list`,describe:`Get failed logins`,builder:nr,handler:async n=>l({command:`zero-trust access users failed-logins list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users failed-logins list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/failed_logins`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.failedLogins.list({account_id:l,user_id:n[`user-id`]})),{successLabel:`Loaded`})})},ir={command:`failed-logins`,describe:`Operations for access.users.failed-logins`,builder:e=>e.command(rr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ar(e){return e.usage(`$0 zero-trust access users get <user-id>
188
+
189
+ Gets a specific user for an account.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const or={command:`get <user-id>`,describe:`Get a user`,builder:ar,handler:async n=>l({command:`zero-trust access users get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.get({account_id:l,user_id:n[`user-id`]})),{successLabel:`Loaded`})})};function sr(e){return e.usage(`$0 zero-trust access users last-seen-identity get <user-id>
190
+
191
+ Get last seen identity for a single user.`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cr={command:`get <user-id>`,describe:`Get last seen identity`,builder:sr,handler:async n=>l({command:`zero-trust access users last-seen-identity get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users last-seen-identity get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/last_seen_identity`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.access.users.lastSeenIdentity.get({account_id:l,user_id:n[`user-id`]})),{successLabel:`Loaded`})})},lr={command:`last-seen-identity`,describe:`Operations for access.users.last-seen-identity`,builder:e=>e.command(cr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ur(e){return e.usage(`$0 zero-trust access users list
192
+
193
+ Gets a list of users for an account.`).option(`name`,{type:`string`,description:`The name of the user.`}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`search`,{type:`string`,description:`Search for users by other listed query parameters.`}).option(`page`,{type:`number`,description:`Page number of results.`}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dr={command:`list`,describe:`Get users`,builder:ur,handler:async n=>l({command:`zero-trust access users list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={name:n.name,email:n.email,search:n.search,page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust access users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.access.users.list({account_id:u,...i})),{successLabel:`Loaded`})})};function fr(e){return e.usage(`$0 zero-trust access users update <user-id>
194
+
195
+ Updates a specific user's name for an account. Requires the user's current email as confirmation (email cannot be changed).`).positional(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`email`,{type:`string`,description:`The email of the user.`}).option(`name`,{type:`string`,description:`The name of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pr={command:`update <user-id>`,describe:`Update a user`,builder:fr,handler:async n=>l({command:`zero-trust access users update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust access users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({email:m(n.email,`email`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...e,account_id:l,user_id:n[`user-id`]})),{successLabel:`Updated`});return}n.email===void 0&&(n.email=await g(`email`,`The email of the user.`)),n.name===void 0&&(n.name=await g(`name`,`The name of the user.`));let u=p({email:m(n.email,`email`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.access.users.update({...u,account_id:l,user_id:n[`user-id`]})),{successLabel:`Updated`})})},mr={command:`users`,describe:`Operations for access.users`,builder:e=>e.command($n).command(tr).command(or).command(dr).command(pr).command(Zn).command(ir).command(lr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},hr={command:`access`,describe:`Operations for access`,builder:e=>e.command(_e).command(be).command(je).command(qe).command(ot).command(pt).command(wt).command(Nt).command(Bt).command($t).command(dn).command(bn).command(Fn).command(Kn).command(mr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gr(e){return e.usage(`$0 zero-trust apps policies make reusable update <policy-id>
196
+
197
+ Converts an application-scoped policy to a reusable policy. The policy will no longer be exclusively scoped to the application. Further updates to the policy should go through the /accounts/{account_id}/policies/{uid} endpoint.`).positional(`policy-id`,{type:`string`,description:`The policy ID.`,demandOption:!0}).option(`app-id`,{type:`string`,description:`The application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _r={command:`update <policy-id>`,describe:`Convert an Access application policy to a reusable policy`,builder:gr,handler:async n=>l({command:`zero-trust apps policies make reusable update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust apps policies make reusable update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/apps/${n[`app-id`]==null?`<app-id>`:encodeURIComponent(String(n[`app-id`]))}/policies/${n[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(n[`policy-id`]))}/make_reusable`,pathParams:{"app-id":String(n[`app-id`]??``),"policy-id":String(n[`policy-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Updating`,async()=>i.zeroTrust.apps.policies.make.reusable.update({account_id:l,app_id:n[`app-id`],policy_id:n[`policy-id`]})),{successLabel:`Updated`})})},vr={command:`reusable`,describe:`Operations for apps.policies.make.reusable`,builder:e=>e.command(_r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},yr={command:`make`,describe:`Operations for apps.policies.make`,builder:e=>e.command(vr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},br={command:`policies`,describe:`Operations for apps.policies`,builder:e=>e.command(yr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xr(e){return e.usage(`$0 zero-trust apps review status list
198
+
199
+ Retrieve the statuses of your applications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Sr={command:`list`,describe:`List applications review statuses`,builder:xr,handler:async n=>l({command:`zero-trust apps review status list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust apps review status list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.apps.review.status.list({account_id:l})),{successLabel:`Loaded`})})};function Cr(e){return e.usage(`$0 zero-trust apps review status update
200
+
201
+ Update the statuses of your applications.`).option(`approved-apps`,{type:`string`,array:!0,description:`Contains the ids of the approved applications.`}).option(`in-review-apps`,{type:`string`,array:!0,description:`Contains the ids of the applications in review.`}).option(`unapproved-apps`,{type:`string`,array:!0,description:`Contains the ids of the unapproved applications.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const wr={command:`update`,describe:`Update applications review statuses`,builder:Cr,handler:async n=>l({command:`zero-trust apps review status update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust apps review status update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/apps/review_status`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({approved_apps:n[`approved-apps`],in_review_apps:n[`in-review-apps`],unapproved_apps:n[`unapproved-apps`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...e,account_id:l})),{successLabel:`Updated`});return}if(n[`approved-apps`]===void 0)throw Error(`--approved-apps is required (or pass --body with this field set).`);if(n[`in-review-apps`]===void 0)throw Error(`--in-review-apps is required (or pass --body with this field set).`);if(n[`unapproved-apps`]===void 0)throw Error(`--unapproved-apps is required (or pass --body with this field set).`);let u=p({approved_apps:n[`approved-apps`],in_review_apps:n[`in-review-apps`],unapproved_apps:n[`unapproved-apps`]});o(await c(`Updating`,async()=>i.zeroTrust.apps.review.status.update({...u,account_id:l})),{successLabel:`Updated`})})},Tr={command:`status`,describe:`Operations for apps.review.status`,builder:e=>e.command(Sr).command(wr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Er={command:`review`,describe:`Operations for apps.review`,builder:e=>e.command(Tr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Dr={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(br).command(Er).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Or(e){return e.usage(`$0 zero-trust casb applications auth-methods list
202
+
203
+ Returns available auth methods for the specified vendor, including credential schema, instructions, and example payloads. Use this to understand what credentials are required before calling POST /v2/integrations.`).option(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kr={command:`list`,describe:`Get auth methods`,builder:y(Or),handler:async n=>l({command:`zero-trust casb applications auth-methods list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,page_size:n[`page-size`]};if(n.dryRun){s({command:`cf zero-trust casb applications auth-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/applications/${n[`application-id`]==null?`<application-id>`:encodeURIComponent(String(n[`application-id`]))}/auth-methods`,pathParams:{"application-id":String(n[`application-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.authMethods.list({account_id:u,application_id:n[`application-id`],...i})),{successLabel:`Loaded`})})},Ar={command:`auth-methods`,describe:`Operations for casb.applications.auth-methods`,builder:e=>e.command(kr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jr(e){return e.usage(`$0 zero-trust casb applications get <application-id>
204
+
205
+ Returns full application details including auth methods, use cases, and permissions.`).positional(`application-id`,{type:`string`,description:`Application/vendor identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mr={command:`get <application-id>`,describe:`Get application details`,builder:y(jr),handler:async n=>l({command:`zero-trust casb applications get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/applications/${n[`application-id`]==null?`<application-id>`:encodeURIComponent(String(n[`application-id`]))}`,pathParams:{"application-id":String(n[`application-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.applications.get({account_id:l,application_id:n[`application-id`]})),{successLabel:`Loaded`})})};function Nr(e){return e.usage(`$0 zero-trust casb applications list
206
+
207
+ Returns a list of available applications with use cases and permissions.`).option(`environment`,{type:`string`,description:`Filter by supported environment (standard, fedramp).`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`page-size`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pr={command:`list`,describe:`List applications`,builder:Nr,handler:async n=>l({command:`zero-trust casb applications list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={environment:n.environment,page:n.page,page_size:n[`page-size`]};if(n.dryRun){s({command:`cf zero-trust casb applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.applications.list({account_id:u,...i})),{successLabel:`Loaded`})})},Fr={command:`applications`,describe:`Operations for casb.applications`,builder:e=>e.command(Mr).command(Pr).command(Ar).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ir(e){return e.usage(`$0 zero-trust casb integrations create
208
+
209
+ Creates a new integration for the specified application. Integration creation with OAuth is not supported by API at the moment. For other auth methods, use \`GET /v2/applications/{application_id}/credential-guide\` to see the required credential structure and example payloads for each vendor.`).option(`application`,{type:`string`,description:"Vendor/application slug (e.g., GOOGLE_WORKSPACE).\n\n* `ANTHROPIC` - ANTHROPIC\n* `AWS` - AWS\n* `BITBUCKET` - BITBUCKET\n* `BOX` - BOX\n* `CONFLUENCE` - CONFLUENCE\n* `DROPBOX` - DROPBOX\n* `GITHUB` - GITHUB\n* `GOOGLE_CLOUD_PLATFORM` - GOOGLE_CLOUD_PLATFORM\n* `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE\n* `JIRA` - JIRA\n* `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL\n* `OPENAI` - OPENAI\n* `SALESFORCE` - SALESFORCE\n* `SERVICENOW` - SERVICENOW\n* `SLACK` - SLACK",choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).option(`auth-method`,{type:`string`,description:`Authentication method slug (uses default if omitted).`}).option(`dlp-profiles`,{type:`string`,array:!0,description:`List of DLP profile IDs to associate.`}).option(`name`,{type:`string`,description:`Name of the integration.`}).option(`permissions`,{type:`string`,array:!0,description:`List of permission scopes (uses policy defaults if empty).`}).option(`use-cases`,{type:`string`,array:!0,description:`List of use case or feature slugs to enroll (e.g., ['casb', 'ces', 'auto_remediation']).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Serializer for v2 integration create requests.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Lr={command:`create`,describe:`Create integration`,builder:Ir,handler:async n=>l({command:`zero-trust casb integrations create`,classification:{safeFlags:[`application`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({application:m(n.application,`application`,`text`),auth_method:m(n[`auth-method`],`auth-method`,`text`),dlp_profiles:n[`dlp-profiles`],name:m(n.name,`name`,`text`),permissions:n.permissions,use_cases:n[`use-cases`]}):d(n.body)});return}let l=await a(n),f=n.local?e:await r();if(n.accountId=f,n.file){let e=h(n.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}})),{successLabel:`Created`});return}if(n.body){let e=d(n.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:e})),{successLabel:`Created`});return}n.application===void 0&&(n.application=await _(`application`,"Vendor/application slug (e.g., GOOGLE_WORKSPACE). * `ANTHROPIC` - ANTHROPIC * `AWS` - AWS * `BITBUCKET` - BITBUCKET * `BOX` - BOX * `CONFLUENCE` - CONFLUENCE * `DROPBOX` - DROPBOX * `GITHUB` - GITHUB * `GOOGLE_CLOUD_PLATFORM` - GOOGLE_CLOUD_PLATFORM * `GOOGLE_WORKSPACE` - GOOGLE_WORKSPACE * `JIRA` - JIRA * `MICROSOFT_INTERNAL` - MICROSOFT_INTERNAL * `OPENAI` - OPENAI * `SALESFORCE` - SALESFORCE * `SERVICENOW` - SERVICENOW * `SLACK` - SLACK",[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`])),n.name===void 0&&(n.name=await g(`name`,`Name of the integration.`));let v={};n.application!==void 0&&u(v,[`application`],m(n.application,`application`,`text`)),n[`auth-method`]!==void 0&&u(v,[`auth_method`],m(n[`auth-method`],`auth-method`,`text`)),n[`dlp-profiles`]!==void 0&&u(v,[`dlp_profiles`],n[`dlp-profiles`]),n.name!==void 0&&u(v,[`name`],m(n.name,`name`,`text`)),n.permissions!==void 0&&u(v,[`permissions`],n.permissions),n[`use-cases`]!==void 0&&u(v,[`use_cases`],n[`use-cases`]),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${f}/one/integrations`,{body:Object.keys(v).length>0?v:void 0})),{successLabel:`Created`})})};function Rr(e){return e.usage(`$0 zero-trust casb integrations delete <id>
210
+
211
+ 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 zr={command:`delete <id>`,describe:`Delete integration`,builder:Rr,handler:async n=>l({command:`zero-trust casb integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
212
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.casb.integrations.delete({account_id:l,id:n.id})),{successLabel:`Deleted`})})};function Br(e){return e.usage(`$0 zero-trust casb integrations get <id>
213
+
214
+ 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 Vr={command:`get <id>`,describe:`Get integration details`,builder:Br,handler:async n=>l({command:`zero-trust casb integrations get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.casb.integrations.get({account_id:l,id:n.id})),{successLabel:`Loaded`})})};function Hr(e){return e.usage(`$0 zero-trust casb integrations list
215
+
216
+ 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 Ur={command:`list`,describe:`List integrations`,builder:y(Hr),handler:async n=>l({command:`zero-trust casb integrations list`,classification:{safeFlags:[`direction`,`dlp-enabled`,`order`,`status`,`dry-run`]}},n,async()=>{let i={application:n.application,direction:n.direction,dlp_enabled:n[`dlp-enabled`],order:n.order,page:n.page,page_size:n[`page-size`],search:n.search,status:n.status,use_cases:n[`use-cases`]};if(n.dryRun){s({command:`cf zero-trust casb integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.casb.integrations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Wr(e){return e.usage(`$0 zero-trust casb integrations pause <id>
217
+
218
+ 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 Gr={command:`pause <id>`,describe:`Pause integration`,builder:Wr,handler:async n=>l({command:`zero-trust casb integrations pause`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations pause`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}/pause`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.pause({account_id:l,id:n.id})),{successLabel:`Created`})})};function Kr(e){return e.usage(`$0 zero-trust casb integrations resume <id>
219
+
220
+ 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 qr={command:`resume <id>`,describe:`Resume integration`,builder:Kr,handler:async n=>l({command:`zero-trust casb integrations resume`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations resume`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}/resume`,pathParams:{id:String(n.id??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.casb.integrations.resume({account_id:l,id:n.id})),{successLabel:`Created`})})};function Jr(e){return e.usage(`$0 zero-trust casb integrations update <id>
221
+
222
+ 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 Yr={command:`update <id>`,describe:`Update integration`,builder:Jr,handler:async n=>l({command:`zero-trust casb integrations update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust casb integrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/one/integrations/${n.id==null?`<id>`:encodeURIComponent(String(n.id))}`,pathParams:{id:String(n.id??``)},bodyKind:`json`,body:n.body===void 0?p({dlp_profiles:n[`dlp-profiles`],name:m(n.name,`name`,`text`),permissions:n.permissions,use_cases:n[`use-cases`]}):d(n.body)});return}let l=await a(n),f=n.local?e:await r();if(n.accountId=f,n.file){let e=h(n.file);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(n.id))}`,{body:e,headers:{"Content-Type":`text/plain;charset=UTF-8`}})),{successLabel:`Updated`});return}if(n.body){let e=d(n.body);o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(n.id))}`,{body:e})),{successLabel:`Updated`});return}let g={};n[`dlp-profiles`]!==void 0&&u(g,[`dlp_profiles`],n[`dlp-profiles`]),n.name!==void 0&&u(g,[`name`],m(n.name,`name`,`text`)),n.permissions!==void 0&&u(g,[`permissions`],n.permissions),n[`use-cases`]!==void 0&&u(g,[`use_cases`],n[`use-cases`]),o(await c(`Updating`,async()=>i(l,`PATCH`,`/accounts/${f}/one/integrations/${encodeURIComponent(String(n.id))}`,{body:Object.keys(g).length>0?g:void 0})),{successLabel:`Updated`})})},Xr={command:`integrations`,describe:`Operations for casb.integrations`,builder:e=>e.command(Lr).command(zr).command(Vr).command(Ur).command(Gr).command(qr).command(Yr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Zr={command:`casb`,describe:`Operations for casb`,builder:e=>e.command(Fr).command(Xr).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qr(e){return e.usage(`$0 zero-trust connectivity-settings edit
223
+
224
+ 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 $r={command:`edit`,describe:`Updates the Zero Trust Connectivity Settings`,builder:Qr,handler:async n=>l({command:`zero-trust connectivity-settings edit`,classification:{safeFlags:[`icmp-proxy-enabled`,`offramp-warp-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust connectivity-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({icmp_proxy_enabled:n[`icmp-proxy-enabled`],offramp_warp_enabled:n[`offramp-warp-enabled`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({icmp_proxy_enabled:n[`icmp-proxy-enabled`],offramp_warp_enabled:n[`offramp-warp-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.connectivitySettings.edit({...u,account_id:l})),{successLabel:`Updated`})})};function ei(e){return e.usage(`$0 zero-trust connectivity-settings get
225
+
226
+ 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 ti={command:`get`,describe:`Get Zero Trust Connectivity Settings`,builder:ei,handler:async n=>l({command:`zero-trust connectivity-settings get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust connectivity-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zerotrust/connectivity_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.connectivitySettings.get({account_id:l})),{successLabel:`Loaded`})})},ni={command:`connectivity-settings`,describe:`Operations for connectivity-settings`,builder:e=>e.command($r).command(ti).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ri(e){return e.usage(`$0 zero-trust dex colos list
227
+
228
+ 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 ii={command:`list`,describe:`List Cloudflare colos`,builder:y(ri),handler:async n=>l({command:`zero-trust dex colos list`,classification:{safeFlags:[`sort-by`,`dry-run`]}},n,async()=>{let i={from:n.from,to:n.to,sortBy:n[`sort-by`]};if(n.dryRun){s({command:`cf zero-trust dex colos list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/colos`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.colos.list({account_id:u,...i})),{successLabel:`Loaded`})})},ai={command:`colos`,describe:`Operations for dex.colos`,builder:e=>e.command(ii).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oi(e){return e.usage(`$0 zero-trust dex commands create
229
+
230
+ 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 si={command:`create`,describe:`Create account commands`,builder:oi,handler:async n=>l({command:`zero-trust dex commands create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex commands create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/commands`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({commands:f(n.commands,`commands`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...e,account_id:l})),{successLabel:`Created`});return}if(n.commands===void 0)throw Error(`--commands is required (or pass --body with this field set).`);let u=p({commands:f(n.commands,`commands`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.commands.create({...u,account_id:l})),{successLabel:`Created`})})};function ci(e){return e.usage(`$0 zero-trust dex commands eligible-devices list
231
+
232
+ 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 li={command:`list`,describe:`List devices eligible for remote captures`,builder:ci,handler:async n=>l({command:`zero-trust dex commands eligible-devices list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],search:n.search};if(n.dryRun){s({command:`cf zero-trust dex commands eligible-devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/commands/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.eligibleDevices.list({account_id:u,...i})),{successLabel:`Loaded`})})},ui={command:`eligible-devices`,describe:`Operations for dex.commands.eligible-devices`,builder:e=>e.command(li).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function di(e){return e.usage(`$0 zero-trust dex commands list
233
+
234
+ 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 fi={command:`list`,describe:`List account commands`,builder:y(di),handler:async n=>l({command:`zero-trust dex commands list`,classification:{safeFlags:[`command-type`,`status`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],from:n.from,to:n.to,device_id:n[`device-id`],user_email:n[`user-email`],command_type:n[`command-type`],status:n.status};if(n.dryRun){s({command:`cf zero-trust dex commands list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/commands`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.commands.list({account_id:u,...i})),{successLabel:`Loaded`})})};function pi(e){return e.usage(`$0 zero-trust dex commands quota get
235
+
236
+ 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 mi={command:`get`,describe:`Returns account commands usage, quota, and reset time`,builder:pi,handler:async n=>l({command:`zero-trust dex commands quota get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex commands quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/commands/quota`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.commands.quota.get({account_id:l})),{successLabel:`Loaded`})})},hi={command:`quota`,describe:`Operations for dex.commands.quota`,builder:e=>e.command(mi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gi(e){return e.usage(`$0 zero-trust dex commands results get <filename>
237
+
238
+ 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 _i={command:`get <filename>`,describe:`Download command output file`,builder:gi,handler:async n=>l({command:`zero-trust dex commands results get`,classification:{safeFlags:[`dry-run`,`text`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex commands results get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/commands/${n[`command-id`]==null?`<command-id>`:encodeURIComponent(String(n[`command-id`]))}/downloads/${n.filename==null?`<filename>`:encodeURIComponent(String(n.filename))}`,pathParams:{"command-id":String(n[`command-id`]??``),filename:String(n.filename??``)},bodyKind:`none`});return}await a(n);let i=n.local?e:await r();n.accountId=i;let o=await c(`Loading`,async()=>te(`/accounts/${i}/dex/commands/${encodeURIComponent(String(n[`command-id`]))}/downloads/${encodeURIComponent(String(n.filename))}`,{method:`GET`,local:n.local===!0,persistTo:n.persistTo}));ee(n.text===!0?o.toString(`utf-8`):o)})},vi={command:`results`,describe:`Operations for dex.commands.results`,builder:e=>e.command(_i).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},yi={command:`commands`,describe:`Operations for dex.commands`,builder:e=>e.command(si).command(fi).command(ui).command(hi).command(vi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bi(e){return e.usage(`$0 zero-trust dex devices aggregates live get
239
+
240
+ 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 xi={command:`get`,describe:`Get live aggregate device details by dimension`,builder:bi,handler:async n=>l({command:`zero-trust dex devices aggregates live get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={since_minutes:n[`since-minutes`]};if(n.dryRun){s({command:`cf zero-trust dex devices aggregates live get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/fleet-status/live`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.live.get({account_id:u,...i})),{successLabel:`Loaded`})})},Si={command:`live`,describe:`Operations for dex.devices.aggregates.live`,builder:e=>e.command(xi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ci(e){return e.usage(`$0 zero-trust dex devices aggregates over-time get
241
+
242
+ 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 wi={command:`get`,describe:`Get over time aggregate details for devices by dimension`,builder:Ci,handler:async n=>l({command:`zero-trust dex devices aggregates over-time get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={to:n.to,from:n.from,colo:n.colo,device_id:n[`device-id`]};if(n.dryRun){s({command:`cf zero-trust dex devices aggregates over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/fleet-status/over-time`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.aggregates.overTime.get({account_id:u,...i})),{successLabel:`Loaded`})})},Ti={command:`over-time`,describe:`Operations for dex.devices.aggregates.over-time`,builder:e=>e.command(wi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ei={command:`aggregates`,describe:`Operations for dex.devices.aggregates`,builder:e=>e.command(Si).command(Ti).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Di(e){return e.usage(`$0 zero-trust dex devices get <device-id>
243
+
244
+ 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 Oi={command:`get <device-id>`,describe:`Get the latest status of a device.`,builder:Di,handler:async n=>l({command:`zero-trust dex devices get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={since_minutes:n[`since-minutes`],time_now:n[`time-now`],colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/${n[`device-id`]==null?`<device-id>`:encodeURIComponent(String(n[`device-id`]))}/fleet-status/live`,pathParams:{"device-id":String(n[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.get({account_id:u,device_id:n[`device-id`],...i})),{successLabel:`Loaded`})})};function ki(e){return e.usage(`$0 zero-trust dex devices list
245
+
246
+ List details of devices using WARP.`).option(`to`,{type:`string`,description:`End of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`from`,{type:`string`,description:`Start of the time range to query. Timestamp can be provided in ISO 8601 datetime format or milliseconds since epoch.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`,demandOption:!0}).option(`sort-by`,{type:`string`,description:`Dimension to sort results by.`,choices:[`colo`,`device_id`,`mode`,`platform`,`status`,`timestamp`,`version`]}).option(`colo`,{type:`string`,description:`Cloudflare colo airport code.`}).option(`device-id`,{type:`string`,description:`Device-specific ID, given as UUID.`}).option(`status`,{type:`string`,description:`Network status.`}).option(`platform`,{type:`string`,description:`Operating system.`}).option(`version`,{type:`string`,description:`WARP client version.`}).option(`source`,{type:`string`,description:"Source:\n * `hourly` - device details aggregated hourly, up to 7 days prior\n * `last_seen` - device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges.\n * `raw` - device details, up to 7 days prior",choices:[`last_seen`,`hourly`,`raw`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ai={command:`list`,describe:`List details of devices using WARP.`,builder:y(ki),handler:async n=>l({command:`zero-trust dex devices list`,classification:{safeFlags:[`sort-by`,`source`,`dry-run`]}},n,async()=>{let i={to:n.to,from:n.from,page:n.page,per_page:n[`per-page`],sort_by:n[`sort-by`],colo:n.colo,device_id:n[`device-id`],status:n.status,platform:n.platform,version:n.version,source:n.source};if(n.dryRun){s({command:`cf zero-trust dex devices list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/fleet-status/devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.list({account_id:u,...i})),{successLabel:`Loaded`})})};function ji(e){return e.usage(`$0 zero-trust dex devices over-time get <device-id>
247
+
248
+ 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 Mi={command:`get <device-id>`,describe:`Get the status over time for a device`,builder:y(ji),handler:async n=>l({command:`zero-trust dex devices over-time get`,classification:{safeFlags:[`interval`,`dry-run`]}},n,async()=>{let i={from:n.from,to:n.to,interval:n.interval,colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex devices over-time get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/${n[`device-id`]==null?`<device-id>`:encodeURIComponent(String(n[`device-id`]))}/fleet-status/over-time`,pathParams:{"device-id":String(n[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.devices.overTime.get({account_id:u,device_id:n[`device-id`],...i})),{successLabel:`Loaded`})})},Ni={command:`over-time`,describe:`Operations for dex.devices.over-time`,builder:e=>e.command(Mi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Pi={command:`devices`,describe:`Operations for dex.devices`,builder:e=>e.command(Oi).command(Ai).command(Ei).command(Ni).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fi(e){return e.usage(`$0 zero-trust dex isps list
249
+
250
+ 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 Ii={command:`list`,describe:`List device ISPs`,builder:y(Fi),handler:async n=>l({command:`zero-trust dex isps list`,classification:{safeFlags:[`sort-by`,`sort-order`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],cursor:n.cursor,sort_by:n[`sort-by`],sort_order:n[`sort-order`],from:n.from,to:n.to};if(n.dryRun){s({command:`cf zero-trust dex isps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/${n[`device-id`]==null?`<device-id>`:encodeURIComponent(String(n[`device-id`]))}/isps`,pathParams:{"device-id":String(n[`device-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.isps.list({account_id:u,device_id:n[`device-id`],...i})),{successLabel:`Loaded`})})},Li={command:`isps`,describe:`Operations for dex.isps`,builder:e=>e.command(Ii).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ri(e){return e.usage(`$0 zero-trust dex overview tests list
251
+
252
+ 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 zi={command:`list`,describe:`List DEX test analytics`,builder:y(Ri),handler:async n=>l({command:`zero-trust dex overview tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},n,async()=>{let i={colo:n.colo,testName:n[`test-name`],deviceId:n[`device-id`],registration_id:n[`registration-id`],page:n.page,per_page:n[`per-page`],kind:n.kind};if(n.dryRun){s({command:`cf zero-trust dex overview tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/tests/overview`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Bi(e){return e.usage(`$0 zero-trust dex overview tests unique-devices get
253
+
254
+ 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 Vi={command:`get`,describe:`Get count of devices targeted`,builder:Bi,handler:async n=>l({command:`zero-trust dex overview tests unique-devices get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={testName:n[`test-name`],deviceId:n[`device-id`]};if(n.dryRun){s({command:`cf zero-trust dex overview tests unique-devices get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/tests/unique-devices`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.overview.tests.uniqueDevices.get({account_id:u,...i})),{successLabel:`Loaded`})})},Hi={command:`unique-devices`,describe:`Operations for dex.overview.tests.unique-devices`,builder:e=>e.command(Vi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ui={command:`tests`,describe:`Operations for dex.overview.tests`,builder:e=>e.command(zi).command(Hi).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Wi={command:`overview`,describe:`Operations for dex.overview`,builder:e=>e.command(Ui).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gi(e){return e.usage(`$0 zero-trust dex rules create
255
+
256
+ 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 Ki={command:`create`,describe:`Create a DEX Rule`,builder:Gi,handler:async n=>l({command:`zero-trust dex rules create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),match:m(n.match,`match`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...e,account_id:l})),{successLabel:`Created`});return}n.match===void 0&&(n.match=await g(`match`,`The wirefilter expression to match.`)),n.name===void 0&&(n.name=await g(`name`,`The name of the Rule.`));let u=p({description:m(n.description,`description`,`text`),match:m(n.match,`match`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dex.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function qi(e){return e.usage(`$0 zero-trust dex rules delete <rule-id>
257
+
258
+ 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 Ji={command:`delete <rule-id>`,describe:`Delete a DEX Rule`,builder:qi,handler:async n=>l({command:`zero-trust dex rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
259
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.rules.delete({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Deleted`})})};function Yi(e){return e.usage(`$0 zero-trust dex rules get <rule-id>
260
+
261
+ 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 Xi={command:`get <rule-id>`,describe:`Get DEX Rule`,builder:Yi,handler:async n=>l({command:`zero-trust dex rules get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.rules.get({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Loaded`})})};function Zi(e){return e.usage(`$0 zero-trust dex rules list
262
+
263
+ 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 Qi={command:`list`,describe:`List DEX Rules`,builder:y(Zi),handler:async n=>l({command:`zero-trust dex rules list`,classification:{safeFlags:[`sort-order`,`sort-by`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],sort_order:n[`sort-order`],sort_by:n[`sort-by`],name:n.name};if(n.dryRun){s({command:`cf zero-trust dex rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function $i(e){return e.usage(`$0 zero-trust dex rules update <rule-id>
264
+
265
+ 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 ea={command:`update <rule-id>`,describe:`Update a DEX Rule`,builder:$i,handler:async n=>l({command:`zero-trust dex rules update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),match:m(n.match,`match`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...e,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),match:m(n.match,`match`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dex.rules.update({...u,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`})})},ta={command:`rules`,describe:`Operations for dex.rules`,builder:e=>e.command(Ki).command(Ji).command(Xi).command(Qi).command(ea).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function na(e){return e.usage(`$0 zero-trust dex test-results http get <test-id>
266
+
267
+ 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 ra={command:`get <test-id>`,describe:`Get details and aggregate metrics for an http test`,builder:y(na),handler:async n=>l({command:`zero-trust dex test-results http get`,classification:{safeFlags:[`interval`,`dry-run`]}},n,async()=>{let i={deviceId:n[`device-id`],from:n.from,to:n.to,interval:n.interval,colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex test-results http get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/http-tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}`,pathParams:{"test-id":String(n[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.get({account_id:u,test_id:n[`test-id`],...i})),{successLabel:`Loaded`})})};function ia(e){return e.usage(`$0 zero-trust dex test-results http percentiles get <test-id>
268
+
269
+ 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 aa={command:`get <test-id>`,describe:`Get percentiles for an http test`,builder:ia,handler:async n=>l({command:`zero-trust dex test-results http percentiles get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={deviceId:n[`device-id`],from:n.from,to:n.to,colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex test-results http percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/http-tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}/percentiles`,pathParams:{"test-id":String(n[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.http.percentiles.get({account_id:u,test_id:n[`test-id`],...i})),{successLabel:`Loaded`})})},oa={command:`percentiles`,describe:`Operations for dex.test-results.http.percentiles`,builder:e=>e.command(aa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},sa={command:`http`,describe:`Operations for dex.test-results.http`,builder:e=>e.command(ra).command(oa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ca(e){return e.usage(`$0 zero-trust dex test-results traceroute get <test-id>
270
+
271
+ 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 la={command:`get <test-id>`,describe:`Get details and aggregate metrics for a traceroute test`,builder:y(ca),handler:async n=>l({command:`zero-trust dex test-results traceroute get`,classification:{safeFlags:[`interval`,`dry-run`]}},n,async()=>{let i={deviceId:n[`device-id`],from:n.from,to:n.to,interval:n.interval,colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex test-results traceroute get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/traceroute-tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}`,pathParams:{"test-id":String(n[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.get({account_id:u,test_id:n[`test-id`],...i})),{successLabel:`Loaded`})})};function ua(e){return e.usage(`$0 zero-trust dex test-results traceroute network-path get <test-result-id>
272
+
273
+ 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 da={command:`get <test-result-id>`,describe:`Get details for a specific traceroute test run`,builder:ua,handler:async n=>l({command:`zero-trust dex test-results traceroute network-path get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex test-results traceroute network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/traceroute-test-results/${n[`test-result-id`]==null?`<test-result-id>`:encodeURIComponent(String(n[`test-result-id`]))}/network-path`,pathParams:{"test-result-id":String(n[`test-result-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.testResults.traceroute.networkPath.get({account_id:l,test_result_id:n[`test-result-id`]})),{successLabel:`Loaded`})})},fa={command:`network-path`,describe:`Operations for dex.test-results.traceroute.network-path`,builder:e=>e.command(da).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pa(e){return e.usage(`$0 zero-trust dex test-results traceroute percentiles get <test-id>
274
+
275
+ 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 ma={command:`get <test-id>`,describe:`Get percentiles for a traceroute test`,builder:pa,handler:async n=>l({command:`zero-trust dex test-results traceroute percentiles get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={deviceId:n[`device-id`],from:n.from,to:n.to,colo:n.colo};if(n.dryRun){s({command:`cf zero-trust dex test-results traceroute percentiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/traceroute-tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}/percentiles`,pathParams:{"test-id":String(n[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.testResults.traceroute.percentiles.get({account_id:u,test_id:n[`test-id`],...i})),{successLabel:`Loaded`})})},ha={command:`percentiles`,describe:`Operations for dex.test-results.traceroute.percentiles`,builder:e=>e.command(ma).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ga={command:`traceroute`,describe:`Operations for dex.test-results.traceroute`,builder:e=>e.command(la).command(fa).command(ha).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_a={command:`test-results`,describe:`Operations for dex.test-results`,builder:e=>e.command(sa).command(ga).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function va(e){return e.usage(`$0 zero-trust dex tests create
276
+
277
+ Create a DEX test.`).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`targeted`,{type:`boolean`,description:`The targeted field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ya={command:`create`,describe:`Create Device DEX test`,builder:va,handler:async n=>l({command:`zero-trust dex tests create`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex tests create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({data:{host:m(n[`data-host`],`data-host`,`text`),kind:m(n[`data-kind`],`data-kind`,`text`),method:m(n[`data-method`],`data-method`,`text`)},description:m(n.description,`description`,`text`),enabled:n.enabled,interval:m(n.interval,`interval`,`text`),name:m(n.name,`name`,`text`),targeted:n.targeted}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:e,account_id:l})),{successLabel:`Created`});return}if(n[`data-host`]===void 0&&(n[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),n[`data-kind`]===void 0&&(n[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.interval===void 0&&(n.interval=await g(`interval`,`How often the test will run.`)),n.name===void 0&&(n.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(n[`data-host`],`data-host`,`text`),kind:m(n[`data-kind`],`data-kind`,`text`),method:m(n[`data-method`],`data-method`,`text`)},description:m(n.description,`description`,`text`),enabled:n.enabled,interval:m(n.interval,`interval`,`text`),name:m(n.name,`name`,`text`),targeted:n.targeted});o(await c(`Creating`,async()=>i.zeroTrust.dex.tests.create({body:u,account_id:l})),{successLabel:`Created`})})};function ba(e){return e.usage(`$0 zero-trust dex tests delete <dex-test-id>
278
+
279
+ 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 xa={command:`delete <dex-test-id>`,describe:`Delete Device DEX test`,builder:ba,handler:async n=>l({command:`zero-trust dex tests delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex tests delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/dex_tests/${n[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(n[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(n[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
280
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dex.tests.delete({account_id:l,dex_test_id:n[`dex-test-id`]})),{successLabel:`Deleted`})})};function Sa(e){return e.usage(`$0 zero-trust dex tests get <dex-test-id>
281
+
282
+ 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 Ca={command:`get <dex-test-id>`,describe:`Get Device DEX test`,builder:Sa,handler:async n=>l({command:`zero-trust dex tests get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex tests get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/dex_tests/${n[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(n[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(n[`dex-test-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dex.tests.get({account_id:l,dex_test_id:n[`dex-test-id`]})),{successLabel:`Loaded`})})};function wa(e){return e.usage(`$0 zero-trust dex tests list
283
+
284
+ 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 Ta={command:`list`,describe:`List Device DEX tests`,builder:y(wa),handler:async n=>l({command:`zero-trust dex tests list`,classification:{safeFlags:[`kind`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],testName:n[`test-name`],kind:n.kind};if(n.dryRun){s({command:`cf zero-trust dex tests list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/dex_tests`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Ea(e){return e.usage(`$0 zero-trust dex tests network-path get <test-id>
285
+
286
+ 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 Da={command:`get <test-id>`,describe:`Get network path breakdown for a traceroute test`,builder:y(Ea),handler:async n=>l({command:`zero-trust dex tests network-path get`,classification:{safeFlags:[`interval`,`dry-run`]}},n,async()=>{let i={deviceId:n[`device-id`],from:n.from,to:n.to,interval:n.interval};if(n.dryRun){s({command:`cf zero-trust dex tests network-path get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/traceroute-tests/${n[`test-id`]==null?`<test-id>`:encodeURIComponent(String(n[`test-id`]))}/network-path`,pathParams:{"test-id":String(n[`test-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.tests.networkPath.get({account_id:u,test_id:n[`test-id`],...i})),{successLabel:`Loaded`})})},Oa={command:`network-path`,describe:`Operations for dex.tests.network-path`,builder:e=>e.command(Da).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ka(e){return e.usage(`$0 zero-trust dex tests update <dex-test-id>
287
+
288
+ Update a DEX test.`).positional(`dex-test-id`,{type:`string`,description:`Unique identifier for a DEX test.`,demandOption:!0}).option(`data-host`,{type:`string`,description:`The desired endpoint to test.`}).option(`data-kind`,{type:`string`,description:`The type of test.`,choices:[`http`,`traceroute`]}).option(`data-method`,{type:`string`,description:`The HTTP request method type.`,choices:[`GET`]}).option(`description`,{type:`string`,description:`Additional details about the test.`}).option(`enabled`,{type:`boolean`,description:`Determines whether or not the test is active.`}).option(`interval`,{type:`string`,description:`How often the test will run.`}).option(`name`,{type:`string`,description:`The name of the DEX test. Must be unique.`}).option(`targeted`,{type:`boolean`,description:`The targeted field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Aa={command:`update <dex-test-id>`,describe:`Update Device DEX test`,builder:ka,handler:async n=>l({command:`zero-trust dex tests update`,classification:{safeFlags:[`data-kind`,`data-method`,`enabled`,`targeted`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dex tests update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/devices/dex_tests/${n[`dex-test-id`]==null?`<dex-test-id>`:encodeURIComponent(String(n[`dex-test-id`]))}`,pathParams:{"dex-test-id":String(n[`dex-test-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({data:{host:m(n[`data-host`],`data-host`,`text`),kind:m(n[`data-kind`],`data-kind`,`text`),method:m(n[`data-method`],`data-method`,`text`)},description:m(n.description,`description`,`text`),enabled:n.enabled,interval:m(n.interval,`interval`,`text`),name:m(n.name,`name`,`text`),targeted:n.targeted}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:e,account_id:l,dex_test_id:n[`dex-test-id`]})),{successLabel:`Updated`});return}if(n[`data-host`]===void 0&&(n[`data-host`]=await g(`data-host`,`The desired endpoint to test.`)),n[`data-kind`]===void 0&&(n[`data-kind`]=await _(`data-kind`,`The type of test.`,[`http`,`traceroute`])),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.interval===void 0&&(n.interval=await g(`interval`,`How often the test will run.`)),n.name===void 0&&(n.name=await g(`name`,`The name of the DEX test. Must be unique.`));let u=p({data:{host:m(n[`data-host`],`data-host`,`text`),kind:m(n[`data-kind`],`data-kind`,`text`),method:m(n[`data-method`],`data-method`,`text`)},description:m(n.description,`description`,`text`),enabled:n.enabled,interval:m(n.interval,`interval`,`text`),name:m(n.name,`name`,`text`),targeted:n.targeted});o(await c(`Updating`,async()=>i.zeroTrust.dex.tests.update({body:u,account_id:l,dex_test_id:n[`dex-test-id`]})),{successLabel:`Updated`})})},ja={command:`tests`,describe:`Operations for dex.tests`,builder:e=>e.command(ya).command(xa).command(Ca).command(Ta).command(Aa).command(Oa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ma(e){return e.usage(`$0 zero-trust dex warp-change-events list
289
+
290
+ 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 Na={command:`list`,describe:`List WARP change events.`,builder:y(Ma),handler:async n=>l({command:`zero-trust dex warp-change-events list`,classification:{safeFlags:[`type`,`toggle`,`sort-order`,`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`],from:n.from,to:n.to,type:n.type,toggle:n.toggle,config_name:n[`config-name`],account_name:n[`account-name`],sort_order:n[`sort-order`]};if(n.dryRun){s({command:`cf zero-trust dex warp-change-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dex/warp-change-events`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dex.warpChangeEvents.list({account_id:u,...i})),{successLabel:`Loaded`})})},Pa={command:`warp-change-events`,describe:`Operations for dex.warp-change-events`,builder:e=>e.command(Na).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fa={command:`dex`,describe:`Digital Experience Monitoring — synthetic tests, fleet-wide device metrics, and network path diagnostics`,builder:e=>e.command(ai).command(yi).command(Pi).command(Li).command(Wi).command(ta).command(_a).command(ja).command(Pa).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ia(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics create
291
+
292
+ 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 La={command:`create`,describe:`Create custom prompt topic`,builder:Ia,handler:async n=>l({command:`zero-trust dlp custom-prompt-topics create`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`),topic:m(n.topic,`topic`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...e,account_id:l})),{successLabel:`Created`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`)),n.topic===void 0&&(n.topic=await g(`topic`,`The topic field`));let u=p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`),topic:m(n.topic,`topic`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.customPromptTopics.create({...u,account_id:l})),{successLabel:`Created`})})};function Ra(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics delete <entry-id>
293
+
294
+ 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 za={command:`delete <entry-id>`,describe:`Delete custom prompt topic`,builder:Ra,handler:async n=>l({command:`zero-trust dlp custom-prompt-topics delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/custom_prompt_topics/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
295
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.customPromptTopics.delete({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Deleted`})})};function Ba(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics get <entry-id>
296
+
297
+ 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 Va={command:`get <entry-id>`,describe:`Get custom prompt topic`,builder:Ba,handler:async n=>l({command:`zero-trust dlp custom-prompt-topics get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/custom_prompt_topics/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.get({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Loaded`})})};function Ha(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics list
298
+
299
+ 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 Ua={command:`list`,describe:`List custom prompt topics`,builder:Ha,handler:async n=>l({command:`zero-trust dlp custom-prompt-topics list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/custom_prompt_topics`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.customPromptTopics.list({account_id:l})),{successLabel:`Loaded`})})};function Wa(e){return e.usage(`$0 zero-trust dlp custom-prompt-topics update <entry-id>
300
+
301
+ 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 Ga={command:`update <entry-id>`,describe:`Update custom prompt topic`,builder:Wa,handler:async n=>l({command:`zero-trust dlp custom-prompt-topics update`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp custom-prompt-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/custom_prompt_topics/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),topic:m(n.topic,`topic`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...e,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`)),n.topic===void 0&&(n.topic=await g(`topic`,`The topic field`));let u=p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),topic:m(n.topic,`topic`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.customPromptTopics.update({...u,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`})})},Ka={command:`custom-prompt-topics`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(La).command(za).command(Va).command(Ua).command(Ga).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qa(e){return e.usage(`$0 zero-trust dlp data-classes create
302
+
303
+ 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 Ja={command:`create`,describe:`Creates a new data class`,builder:qa,handler:async n=>l({command:`zero-trust dlp data-classes create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-classes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),expression:m(n.expression,`expression`,`text`),name:m(n.name,`name`,`text`),sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...e,account_id:l})),{successLabel:`Created`});return}if(n[`data-tags`]===void 0)throw Error(`--data-tags is required (or pass --body with this field set).`);if(n.expression===void 0&&(n.expression=await g(`expression`,`The expression field`)),n.name===void 0&&(n.name=await g(`name`,`The name field`)),n[`sensitivity-levels`]===void 0)throw Error(`--sensitivity-levels is required (or pass --body with this field set).`);let u=p({data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),expression:m(n.expression,`expression`,`text`),name:m(n.name,`name`,`text`),sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataClasses.create({...u,account_id:l})),{successLabel:`Created`})})};function Ya(e){return e.usage(`$0 zero-trust dlp data-classes delete <data-class-id>
304
+
305
+ 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 Xa={command:`delete <data-class-id>`,describe:`Delete a single data class`,builder:Ya,handler:async n=>l({command:`zero-trust dlp data-classes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-classes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_classes/${n[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(n[`data-class-id`]))}`,pathParams:{"data-class-id":String(n[`data-class-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
306
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataClasses.delete({account_id:l,data_class_id:n[`data-class-id`]})),{successLabel:`Deleted`})})};function Za(e){return e.usage(`$0 zero-trust dlp data-classes get <data-class-id>
307
+
308
+ 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 Qa={command:`get <data-class-id>`,describe:`Retrieve a specific data class`,builder:Za,handler:async n=>l({command:`zero-trust dlp data-classes get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-classes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_classes/${n[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(n[`data-class-id`]))}`,pathParams:{"data-class-id":String(n[`data-class-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.get({account_id:l,data_class_id:n[`data-class-id`]})),{successLabel:`Loaded`})})};function $a(e){return e.usage(`$0 zero-trust dlp data-classes list
309
+
310
+ Lists data classes configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const eo={command:`list`,describe:`Retrieve all data classes in an account`,builder:$a,handler:async n=>l({command:`zero-trust dlp data-classes list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-classes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_classes`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataClasses.list({account_id:l})),{successLabel:`Loaded`})})};function to(e){return e.usage(`$0 zero-trust dlp data-classes update <data-class-id>
311
+
312
+ 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 no={command:`update <data-class-id>`,describe:`Update the attributes of a single data class`,builder:to,handler:async n=>l({command:`zero-trust dlp data-classes update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-classes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_classes/${n[`data-class-id`]==null?`<data-class-id>`:encodeURIComponent(String(n[`data-class-id`]))}`,pathParams:{"data-class-id":String(n[`data-class-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),expression:m(n.expression,`expression`,`text`),name:m(n.name,`name`,`text`),sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...e,account_id:l,data_class_id:n[`data-class-id`]})),{successLabel:`Updated`});return}let u=p({data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),expression:m(n.expression,`expression`,`text`),name:m(n.name,`name`,`text`),sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataClasses.update({...u,account_id:l,data_class_id:n[`data-class-id`]})),{successLabel:`Updated`})})},ro={command:`data-classes`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ja).command(Xa).command(Qa).command(eo).command(no).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function io(e){return e.usage(`$0 zero-trust dlp data-tag-categories create
313
+
314
+ 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 ao={command:`create`,describe:`Creates a new data tag category.`,builder:io,handler:async n=>l({command:`zero-trust dlp data-tag-categories create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-categories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),tags:f(n.tags,`tags`),template_id:m(n[`template-id`],`template-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),tags:f(n.tags,`tags`),template_id:m(n[`template-id`],`template-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTagCategories.create({...u,account_id:l})),{successLabel:`Created`})})};function oo(e){return e.usage(`$0 zero-trust dlp data-tag-categories delete <category-id>
315
+
316
+ 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 so={command:`delete <category-id>`,describe:`Delete a single data tag category.`,builder:oo,handler:async n=>l({command:`zero-trust dlp data-tag-categories delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-categories delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
317
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTagCategories.delete({account_id:l,category_id:n[`category-id`]})),{successLabel:`Deleted`})})};function co(e){return e.usage(`$0 zero-trust dlp data-tag-categories get <category-id>
318
+
319
+ 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 lo={command:`get <category-id>`,describe:`Retrieve a specific data tag category.`,builder:co,handler:async n=>l({command:`zero-trust dlp data-tag-categories get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-categories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.get({account_id:l,category_id:n[`category-id`]})),{successLabel:`Loaded`})})};function uo(e){return e.usage(`$0 zero-trust dlp data-tag-categories list
320
+
321
+ 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 fo={command:`list`,describe:`Retrieve all data tag categories in an account`,builder:uo,handler:async n=>l({command:`zero-trust dlp data-tag-categories list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategories.list({account_id:l})),{successLabel:`Loaded`})})};function po(e){return e.usage(`$0 zero-trust dlp data-tag-categories update <category-id>
322
+
323
+ 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 mo={command:`update <category-id>`,describe:`Update the attributes of a single data tag category.`,builder:po,handler:async n=>l({command:`zero-trust dlp data-tag-categories update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-categories update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),tags:f(n.tags,`tags`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...e,account_id:l,category_id:n[`category-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),tags:f(n.tags,`tags`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTagCategories.update({...u,account_id:l,category_id:n[`category-id`]})),{successLabel:`Updated`})})},ho={command:`data-tag-categories`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ao).command(so).command(lo).command(fo).command(mo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function go(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates get <template-id>
324
+
325
+ 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 _o={command:`get <template-id>`,describe:`Retrieve a specific data tag category template.`,builder:go,handler:async n=>l({command:`zero-trust dlp data-tag-category-templates get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_category_templates/${n[`template-id`]==null?`<template-id>`:encodeURIComponent(String(n[`template-id`]))}`,pathParams:{"template-id":String(n[`template-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.get({account_id:l,template_id:n[`template-id`]})),{successLabel:`Loaded`})})};function vo(e){return e.usage(`$0 zero-trust dlp data-tag-category-templates list
326
+
327
+ Lists available data tag category templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const yo={command:`list`,describe:`Retrieve all data tag category templates in an account`,builder:vo,handler:async n=>l({command:`zero-trust dlp data-tag-category-templates list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tag-category-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_category_templates`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTagCategoryTemplates.list({account_id:l})),{successLabel:`Loaded`})})},bo={command:`data-tag-category-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(_o).command(yo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xo(e){return e.usage(`$0 zero-trust dlp data-tags create <category-id>
328
+
329
+ 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 So={command:`create <category-id>`,describe:`Creates a new data tag.`,builder:xo,handler:async n=>l({command:`zero-trust dlp data-tags create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}/data_tags`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:e,account_id:l,category_id:n[`category-id`]})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.dataTags.create({body:u,account_id:l,category_id:n[`category-id`]})),{successLabel:`Created`})})};function Co(e){return e.usage(`$0 zero-trust dlp data-tags delete <tag-id>
330
+
331
+ 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 wo={command:`delete <tag-id>`,describe:`Delete a single data tag.`,builder:Co,handler:async n=>l({command:`zero-trust dlp data-tags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}/data_tags/${n[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(n[`tag-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``),"tag-id":String(n[`tag-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
332
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.dataTags.delete({account_id:l,category_id:n[`category-id`],tag_id:n[`tag-id`]})),{successLabel:`Deleted`})})};function To(e){return e.usage(`$0 zero-trust dlp data-tags get <tag-id>
333
+
334
+ 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 Eo={command:`get <tag-id>`,describe:`Retrieve a specific data tag.`,builder:To,handler:async n=>l({command:`zero-trust dlp data-tags get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}/data_tags/${n[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(n[`tag-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``),"tag-id":String(n[`tag-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.get({account_id:l,category_id:n[`category-id`],tag_id:n[`tag-id`]})),{successLabel:`Loaded`})})};function Do(e){return e.usage(`$0 zero-trust dlp data-tags list
335
+
336
+ 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 Oo={command:`list`,describe:`Retrieve all data tags in a data tag category`,builder:Do,handler:async n=>l({command:`zero-trust dlp data-tags list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}/data_tags`,pathParams:{"category-id":String(n[`category-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.dataTags.list({account_id:l,category_id:n[`category-id`]})),{successLabel:`Loaded`})})};function ko(e){return e.usage(`$0 zero-trust dlp data-tags update <tag-id>
337
+
338
+ 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 Ao={command:`update <tag-id>`,describe:`Update the attributes of a single data tag.`,builder:ko,handler:async n=>l({command:`zero-trust dlp data-tags update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp data-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/data_tag_categories/${n[`category-id`]==null?`<category-id>`:encodeURIComponent(String(n[`category-id`]))}/data_tags/${n[`tag-id`]==null?`<tag-id>`:encodeURIComponent(String(n[`tag-id`]))}`,pathParams:{"category-id":String(n[`category-id`]??``),"tag-id":String(n[`tag-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...e,account_id:l,category_id:n[`category-id`],tag_id:n[`tag-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.dataTags.update({...u,account_id:l,category_id:n[`category-id`],tag_id:n[`tag-id`]})),{successLabel:`Updated`})})},jo={command:`data-tags`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(So).command(wo).command(Eo).command(Oo).command(Ao).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Mo(e){return e.usage(`$0 zero-trust dlp datasets create
339
+
340
+ 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.
341
+ Determines if the words should be matched in a case-sensitive manner
342
+ 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
343
+
344
+ Non-secret custom word lists with no header are always version 1.
345
+ Secret EDM lists with no header are version 1.
346
+ Multicolumn CSV with headers are version 2.
347
+ Omitting this field provides the default value 0, which is interpreted
348
+ the same as 1.`}).option(`name`,{type:`string`,description:`The name field`}).option(`secret`,{type:`boolean`,description:`Generate a secret dataset.
349
+
350
+ If true, the response will include a secret to use with the EDM encoder.
351
+ 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 No={command:`create`,describe:`Create a new dataset`,builder:Mo,handler:async n=>l({command:`zero-trust dlp datasets create`,classification:{safeFlags:[`case-sensitive`,`secret`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({case_sensitive:n[`case-sensitive`],description:m(n.description,`description`,`text`),encoding_version:n[`encoding-version`],name:m(n.name,`name`,`text`),secret:n.secret}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({case_sensitive:n[`case-sensitive`],description:m(n.description,`description`,`text`),encoding_version:n[`encoding-version`],name:m(n.name,`name`,`text`),secret:n.secret});o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.create({...u,account_id:l})),{successLabel:`Created`})})};function Po(e){return e.usage(`$0 zero-trust dlp datasets delete <dataset-id>
352
+
353
+ 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 Fo={command:`delete <dataset-id>`,describe:`Delete a dataset`,builder:Po,handler:async n=>l({command:`zero-trust dlp datasets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
354
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.datasets.delete({account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Deleted`})})};function Io(e){return e.usage(`$0 zero-trust dlp datasets get <dataset-id>
355
+
356
+ 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 Lo={command:`get <dataset-id>`,describe:`Fetch a specific dataset`,builder:Io,handler:async n=>l({command:`zero-trust dlp datasets get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.get({account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Loaded`})})};function Ro(e){return e.usage(`$0 zero-trust dlp datasets list
357
+
358
+ 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 zo={command:`list`,describe:`Fetch all datasets`,builder:Ro,handler:async n=>l({command:`zero-trust dlp datasets list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.datasets.list({account_id:l})),{successLabel:`Loaded`})})};function Bo(e){return e.usage(`$0 zero-trust dlp datasets update <dataset-id>
359
+
360
+ 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.
361
+
362
+ 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 Vo={command:`update <dataset-id>`,describe:`Update details about a dataset`,builder:Bo,handler:async n=>l({command:`zero-trust dlp datasets update`,classification:{safeFlags:[`case-sensitive`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({case_sensitive:n[`case-sensitive`],description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...e,account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Updated`});return}let u=p({case_sensitive:n[`case-sensitive`],description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.datasets.update({...u,account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Updated`})})};function Ho(e){return e.usage(`$0 zero-trust dlp datasets upload create <dataset-id>
363
+
364
+ 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 Uo={command:`create <dataset-id>`,describe:`Prepare to upload a new version of a dataset`,builder:Ho,handler:async n=>l({command:`zero-trust dlp datasets upload create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/upload`,pathParams:{"dataset-id":String(n[`dataset-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.upload.create({account_id:l,dataset_id:n[`dataset-id`]})),{successLabel:`Created`})})};function Wo(e){return e.usage(`$0 zero-trust dlp datasets upload edit <version>
365
+
366
+ 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 Go={command:`edit <version>`,describe:`Upload a new version of a dataset`,builder:Wo,handler:async n=>l({command:`zero-trust dlp datasets upload edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets upload edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/upload/${n.version==null?`<version>`:encodeURIComponent(String(n.version))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``),version:String(n.version??``)},bodyKind:`octet-stream`,body:n.body});return}let l=await a(n),u=n.local?e:await r();if(n.accountId=u,n.file){let e=h(n.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(n[`dataset-id`]))}/upload/${encodeURIComponent(String(n.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(n.body){let e=m(n.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(n[`dataset-id`]))}/upload/${encodeURIComponent(String(n.version))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ko={command:`upload`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Uo).command(Go).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qo(e){return e.usage(`$0 zero-trust dlp datasets versions create <version>
367
+
368
+ This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard. The columns in the response appear in the same order as in the request.`).positional(`version`,{type:`string`,description:`Version`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`array of new columns to create for this dataset version.`})}const Jo={command:`create <version>`,describe:`Sets the column information for a multi-column upload`,builder:qo,handler:async n=>l({command:`zero-trust dlp datasets versions create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/versions/${n.version==null?`<version>`:encodeURIComponent(String(n.version))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``),version:String(n.version??``)},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.datasets.versions.create({body:e,account_id:l,dataset_id:n[`dataset-id`],version:n.version})),{successLabel:`Created`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Yo(e){return e.usage(`$0 zero-trust dlp datasets versions entries create <entry-id>
369
+
370
+ This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dataset-id`,{type:`string`,description:`Dataset ID`,demandOption:!0}).option(`version`,{type:`string`,description:`Version`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Dataset content.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Xo={command:`create <entry-id>`,describe:`Upload a new version of a multi-column dataset`,builder:Yo,handler:async n=>l({command:`zero-trust dlp datasets versions entries create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp datasets versions entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/datasets/${n[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(n[`dataset-id`]))}/versions/${n.version==null?`<version>`:encodeURIComponent(String(n.version))}/entries/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"dataset-id":String(n[`dataset-id`]??``),version:String(n.version??``),"entry-id":String(n[`entry-id`]??``)},bodyKind:`octet-stream`,body:n.body});return}let l=await a(n),u=n.local?e:await r();if(n.accountId=u,n.file){let e=h(n.file);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(n[`dataset-id`]))}/versions/${encodeURIComponent(String(n.version))}/entries/${encodeURIComponent(String(n[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(n.body){let e=m(n.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/dlp/datasets/${encodeURIComponent(String(n[`dataset-id`]))}/versions/${encodeURIComponent(String(n.version))}/entries/${encodeURIComponent(String(n[`entry-id`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Created`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Zo={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Xo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qo={command:`versions`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Jo).command(Zo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$o={command:`datasets`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(No).command(Fo).command(Lo).command(zo).command(Vo).command(Ko).command(Qo).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function es(e){return e.usage(`$0 zero-trust dlp email account-mapping create
371
+
372
+ Creates a mapping between a Cloudflare account and an email provider for DLP email scanning integration.`).option(`auth-requirements-allowed-microsoft-organizations`,{type:`string`,array:!0,description:`The auth_requirements.allowed_microsoft_organizations field`}).option(`auth-requirements-type`,{type:`string`,description:`The auth_requirements.type field`,choices:[`Org`,`NoAuth`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Account mapping.`})}const ts={command:`create`,describe:`Create mapping`,builder:es,handler:async n=>l({command:`zero-trust dlp email account-mapping create`,classification:{safeFlags:[`auth-requirements-type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email account-mapping create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({auth_requirements:{allowed_microsoft_organizations:n[`auth-requirements-allowed-microsoft-organizations`],type:m(n[`auth-requirements-type`],`auth-requirements-type`,`text`)}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...e,account_id:l})),{successLabel:`Created`});return}n[`auth-requirements-type`]===void 0&&(n[`auth-requirements-type`]=await _(`auth-requirements-type`,`The auth_requirements.type field`,[`Org`,`NoAuth`]));let u=p({auth_requirements:{allowed_microsoft_organizations:n[`auth-requirements-allowed-microsoft-organizations`],type:m(n[`auth-requirements-type`],`auth-requirements-type`,`text`)}});o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.accountMapping.create({...u,account_id:l})),{successLabel:`Created`})})};function ns(e){return e.usage(`$0 zero-trust dlp email account-mapping get
373
+
374
+ 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 rs={command:`get`,describe:`Get mapping`,builder:ns,handler:async n=>l({command:`zero-trust dlp email account-mapping get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email account-mapping get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/account_mapping`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.accountMapping.get({account_id:l})),{successLabel:`Loaded`})})},is={command:`account-mapping`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ts).command(rs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function as(e){return e.usage(`$0 zero-trust dlp email rules bulk-edit
375
+
376
+ 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 os={command:`bulk-edit`,describe:`Update email scanner rule priorities`,builder:as,handler:async n=>l({command:`zero-trust dlp email rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.bulkEdit({...e,account_id:l})),{successLabel:`Updated`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function $(e){return e.usage(`$0 zero-trust dlp email rules create
377
+
378
+ Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.`).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).option(`action-message`,{type:`string`,description:`The action.message field`}).option(`conditions`,{type:`string`,description:`Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json.`}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule description.`})}const ss={command:`create`,describe:`Create email scanner rule`,builder:$,handler:async n=>l({command:`zero-trust dlp email rules create`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({action:{action:m(n[`action-action`],`action-action`,`text`),message:m(n[`action-message`],`action-message`,`text`)},conditions:f(n.conditions,`conditions`),description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:e,account_id:l})),{successLabel:`Created`});return}if(n[`action-action`]===void 0&&(n[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),n.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({action:{action:m(n[`action-action`],`action-action`,`text`),message:m(n[`action-message`],`action-message`,`text`)},conditions:f(n.conditions,`conditions`),description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.email.rules.create({body:u,account_id:l})),{successLabel:`Created`})})};function cs(e){return e.usage(`$0 zero-trust dlp email rules delete <rule-id>
379
+
380
+ 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 ls={command:`delete <rule-id>`,describe:`Delete email scanner rule`,builder:cs,handler:async n=>l({command:`zero-trust dlp email rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
381
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.email.rules.delete({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Deleted`})})};function us(e){return e.usage(`$0 zero-trust dlp email rules get <rule-id>
382
+
383
+ 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 ds={command:`get <rule-id>`,describe:`Get an email scanner rule`,builder:us,handler:async n=>l({command:`zero-trust dlp email rules get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.get({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Loaded`})})};function fs(e){return e.usage(`$0 zero-trust dlp email rules list
384
+
385
+ 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 ps={command:`list`,describe:`List all email scanner rules`,builder:fs,handler:async n=>l({command:`zero-trust dlp email rules list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.email.rules.list({account_id:l})),{successLabel:`Loaded`})})};function ms(e){return e.usage(`$0 zero-trust dlp email rules update <rule-id>
386
+
387
+ Updates a DLP email scanning rule.`).positional(`rule-id`,{type:`string`,description:`Rule ID`,demandOption:!0}).option(`action-action`,{type:`string`,description:`The action.action field`,choices:[`Block`]}).option(`action-message`,{type:`string`,description:`The action.message field`}).option(`conditions`,{type:`string`,description:`Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json.`}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Rule description.`})}const hs={command:`update <rule-id>`,describe:`Update email scanner rule`,builder:ms,handler:async n=>l({command:`zero-trust dlp email rules update`,classification:{safeFlags:[`action-action`,`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp email rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/email/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({action:{action:m(n[`action-action`],`action-action`,`text`),message:m(n[`action-message`],`action-message`,`text`)},conditions:f(n.conditions,`conditions`),description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:e,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}if(n[`action-action`]===void 0&&(n[`action-action`]=await _(`action-action`,`The action.action field`,[`Block`])),n.conditions===void 0)throw Error(`--conditions is required (or pass --body with this field set).`);if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({action:{action:m(n[`action-action`],`action-action`,`text`),message:m(n[`action-message`],`action-message`,`text`)},conditions:f(n.conditions,`conditions`),description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.email.rules.update({body:u,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`})})},gs={command:`rules`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(os).command(ss).command(ls).command(ds).command(ps).command(hs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_s={command:`email`,describe:`Operations for dlp.email`,builder:e=>e.command(is).command(gs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vs(e){return e.usage(`$0 zero-trust dlp entries create
388
+
389
+ Creates a DLP custom entry.`).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).option(`profile-id`,{type:`string`,description:`The profile_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A new entry to create.`})}const ys={command:`create`,describe:`Create custom entry`,builder:vs,handler:async n=>l({command:`zero-trust dlp entries create`,classification:{safeFlags:[`enabled`,`pattern-validation`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(n[`profile-id`],`profile-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...e,account_id:l})),{successLabel:`Created`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`)),n[`pattern-regex`]===void 0&&(n[`pattern-regex`]=await g(`pattern-regex`,`The pattern.regex field`));let u=p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},profile_id:m(n[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.create({...u,account_id:l})),{successLabel:`Created`})})};function bs(e){return e.usage(`$0 zero-trust dlp entries custom update <entry-id>
390
+
391
+ Updates a DLP custom entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update to be applied to the entry.`})}const xs={command:`update <entry-id>`,describe:`Update custom entry`,builder:bs,handler:async n=>l({command:`zero-trust dlp entries custom update`,classification:{safeFlags:[`pattern-validation`,`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/custom/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},enabled:n.enabled}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...e,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`});return}if(n.name===void 0&&(n.name=await g(`name`,`The name field`)),n[`pattern-regex`]===void 0&&(n[`pattern-regex`]=await g(`pattern-regex`,`The pattern.regex field`)),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},enabled:n.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.custom.update({...u,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`})})},Ss={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(xs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cs(e){return e.usage(`$0 zero-trust dlp entries delete <entry-id>
392
+
393
+ 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 ws={command:`delete <entry-id>`,describe:`Delete custom entry`,builder:Cs,handler:async n=>l({command:`zero-trust dlp entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
394
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.delete({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Deleted`})})};function Ts(e){return e.usage(`$0 zero-trust dlp entries get <entry-id>
395
+
396
+ 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 Es={command:`get <entry-id>`,describe:`Get DLP Entry`,builder:Ts,handler:async n=>l({command:`zero-trust dlp entries get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.get({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Loaded`})})};function Ds(e){return e.usage(`$0 zero-trust dlp entries integration create
397
+
398
+ Integration entries can't be created, this will update an existing integration entry. This is needed for our generated terraform API.`).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`entry-id`,{type:`string`,description:`The entry_id field`}).option(`profile-id`,{type:`string`,description:`This field is not used as the owning profile.
399
+ For predefined entries it is already set to a predefined profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`This endpoint will update an existing integration entry. It is not possible to create new integration entries.`})}const Os={command:`create`,describe:`Create integration entry`,builder:Ds,handler:async n=>l({command:`zero-trust dlp entries integration create`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries integration create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/integration`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({enabled:n.enabled,entry_id:m(n[`entry-id`],`entry-id`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:e,account_id:l})),{successLabel:`Created`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n[`entry-id`]===void 0&&(n[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:n.enabled,entry_id:m(n[`entry-id`],`entry-id`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.integration.create({body:u,account_id:l})),{successLabel:`Created`})})};function ks(e){return e.usage(`$0 zero-trust dlp entries integration delete <entry-id>
400
+
401
+ This is a no-op as integration entires can't be deleted but is needed for our generated terraform API.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const As={command:`delete <entry-id>`,describe:`Delete integration entry`,builder:ks,handler:async n=>l({command:`zero-trust dlp entries integration delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries integration delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/integration/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
402
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.integration.delete({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Deleted`})})};function js(e){return e.usage(`$0 zero-trust dlp entries integration update <entry-id>
403
+
404
+ Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Enable or disable integration entry in owning profile.`})}const Ms={command:`update <entry-id>`,describe:`Update integration entry`,builder:js,handler:async n=>l({command:`zero-trust dlp entries integration update`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries integration update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/integration/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({enabled:n.enabled}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:e,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:n.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.integration.update({body:u,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`})})},Ns={command:`integration`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Os).command(As).command(Ms).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ps(e){return e.usage(`$0 zero-trust dlp entries list
405
+
406
+ Lists all DLP entries in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fs={command:`list`,describe:`List all entries`,builder:Ps,handler:async n=>l({command:`zero-trust dlp entries list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.entries.list({account_id:l})),{successLabel:`Loaded`})})};function Is(e){return e.usage(`$0 zero-trust dlp entries predefined create
407
+
408
+ Predefined entries can't be created, this will update an existing predefined entry. This is needed for our generated terraform API.`).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`entry-id`,{type:`string`,description:`The entry_id field`}).option(`profile-id`,{type:`string`,description:`This field is not used as the owning profile.
409
+ For predefined entries it is already set to a predefined profile.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`This endpoint will update an existing predefined entry. It is not possible to create new predefined entries.`})}const Ls={command:`create`,describe:`Create predefined entry`,builder:Is,handler:async n=>l({command:`zero-trust dlp entries predefined create`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/predefined`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({enabled:n.enabled,entry_id:m(n[`entry-id`],`entry-id`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:e,account_id:l})),{successLabel:`Created`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n[`entry-id`]===void 0&&(n[`entry-id`]=await g(`entry-id`,`The entry_id field`));let u=p({enabled:n.enabled,entry_id:m(n[`entry-id`],`entry-id`,`text`),profile_id:m(n[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.entries.predefined.create({body:u,account_id:l})),{successLabel:`Created`})})};function Rs(e){return e.usage(`$0 zero-trust dlp entries predefined delete <entry-id>
410
+
411
+ This is a no-op as predefined entires can't be deleted but is needed for our generated terraform API.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const zs={command:`delete <entry-id>`,describe:`Delete predefined entry`,builder:Rs,handler:async n=>l({command:`zero-trust dlp entries predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/predefined/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
412
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.entries.predefined.delete({account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Deleted`})})};function Bs(e){return e.usage(`$0 zero-trust dlp entries predefined update <entry-id>
413
+
414
+ Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Settings to enable or disable predefined entry in owning profile.`})}const Vs={command:`update <entry-id>`,describe:`Update predefined entry`,builder:Bs,handler:async n=>l({command:`zero-trust dlp entries predefined update`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/predefined/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({enabled:n.enabled}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:e,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:n.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.predefined.update({body:u,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`})})},Hs={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Ls).command(zs).command(Vs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Us(e){return e.usage(`$0 zero-trust dlp entries update <entry-id>
415
+
416
+ Updates a DLP entry.`).positional(`entry-id`,{type:`string`,description:`Entry ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`pattern-regex`,{type:`string`,description:`The pattern.regex field`}).option(`pattern-validation`,{type:`string`,description:`The pattern.validation field`,choices:[`luhn`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`custom`,`predefined`,`integration`]}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update to be applied to the entry.`}).check(e=>{if([`pattern-regex`,`pattern-validation`].some(t=>e[t]!==void 0)){let t=[`pattern-regex`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --pattern-* flag is set`)}return!0})}const Ws={command:`update <entry-id>`,describe:`Update entry`,builder:Us,handler:async n=>l({command:`zero-trust dlp entries update`,classification:{safeFlags:[`pattern-validation`,`type`,`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/entries/${n[`entry-id`]==null?`<entry-id>`:encodeURIComponent(String(n[`entry-id`]))}`,pathParams:{"entry-id":String(n[`entry-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},type:m(n.type,`type`,`text`),enabled:n.enabled}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:e,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`});return}if(n.type===void 0&&(n.type=await _(`type`,`The type field`,[`custom`,`predefined`,`integration`])),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),pattern:{regex:m(n[`pattern-regex`],`pattern-regex`,`text`),validation:m(n[`pattern-validation`],`pattern-validation`,`text`)},type:m(n.type,`type`,`text`),enabled:n.enabled});o(await c(`Updating`,async()=>i.zeroTrust.dlp.entries.update({body:u,account_id:l,entry_id:n[`entry-id`]})),{successLabel:`Updated`})})},Gs={command:`entries`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ys).command(ws).command(Es).command(Fs).command(Ws).command(Ss).command(Ns).command(Hs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ks(e){return e.usage(`$0 zero-trust dlp limits list
417
+
418
+ 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 qs={command:`list`,describe:`Fetch limits associated with DLP for account`,builder:Ks,handler:async n=>l({command:`zero-trust dlp limits list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp limits list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/limits`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.limits.list({account_id:l})),{successLabel:`Loaded`})})},Js={command:`limits`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(qs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ys(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 Xs={command:`validate`,describe:`Validate a DLP regex pattern`,builder:Ys,handler:async n=>l({command:`zero-trust dlp patterns validate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp patterns validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/patterns/validate`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({max_match_bytes:n[`max-match-bytes`],regex:m(n.regex,`regex`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...e,account_id:l})),{successLabel:`Created`});return}n.regex===void 0&&(n.regex=await g(`regex`,`The regex field`));let u=p({max_match_bytes:n[`max-match-bytes`],regex:m(n.regex,`regex`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.patterns.validate({...u,account_id:l})),{successLabel:`Created`})})},Zs={command:`patterns`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Xs).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qs(e){return e.usage(`$0 zero-trust dlp payload-logs get
419
+
420
+ Gets the current payload logging configuration for DLP, showing whether matched content is being logged.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $s={command:`get`,describe:`Get payload log settings`,builder:Qs,handler:async n=>l({command:`zero-trust dlp payload-logs get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp payload-logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.payloadLogs.get({account_id:l})),{successLabel:`Loaded`})})};function ec(e){return e.usage(`$0 zero-trust dlp payload-logs update
421
+
422
+ Enables or disables payload logging for DLP matches. When enabled, matched content is stored for review.`).option(`masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).option(`public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
423
+
424
+ - Set to null or empty string to disable payload logging.
425
+ - Set to a non-empty base64 string to enable payload logging with the given key.
426
+
427
+ For customers with configurable payload masking feature rolled out:
428
+ - If the field is missing, the existing setting will be kept. Note that this is different from setting to null or empty string.
429
+
430
+ For all other customers:
431
+ - If the field is missing, the existing setting will be cleared.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`New payload log settings.`})}const tc={command:`update`,describe:`Set payload log settings`,builder:ec,handler:async n=>l({command:`zero-trust dlp payload-logs update`,classification:{safeFlags:[`masking-level`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp payload-logs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/payload_log`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({masking_level:m(n[`masking-level`],`masking-level`,`text`),public_key:m(n[`public-key`],`public-key`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({masking_level:m(n[`masking-level`],`masking-level`,`text`),public_key:m(n[`public-key`],`public-key`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.payloadLogs.update({...u,account_id:l})),{successLabel:`Updated`})})},nc={command:`payload-logs`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command($s).command(tc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rc(e){return e.usage(`$0 zero-trust dlp profiles custom create
432
+
433
+ 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 ic={command:`create`,describe:`Create custom profile`,builder:rc,handler:async n=>l({command:`zero-trust dlp profiles custom create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},data_classes:n[`data-classes`],data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),entries:f(n.entries,`entries`),name:m(n.name,`name`,`text`),ocr_enabled:n[`ocr-enabled`],sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(n[`shared-entries`],`shared-entries`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},data_classes:n[`data-classes`],data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),entries:f(n.entries,`entries`),name:m(n.name,`name`,`text`),ocr_enabled:n[`ocr-enabled`],sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(n[`shared-entries`],`shared-entries`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.custom.create({...u,account_id:l})),{successLabel:`Created`})})};function ac(e){return e.usage(`$0 zero-trust dlp profiles custom delete <profile-id>
434
+
435
+ 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 oc={command:`delete <profile-id>`,describe:`Delete custom profile`,builder:ac,handler:async n=>l({command:`zero-trust dlp profiles custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/custom/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
436
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.custom.delete({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Deleted`})})};function sc(e){return e.usage(`$0 zero-trust dlp profiles custom get <profile-id>
437
+
438
+ Fetches a custom DLP profile by id.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const cc={command:`get <profile-id>`,describe:`Get custom profile`,builder:sc,handler:async n=>l({command:`zero-trust dlp profiles custom get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/custom/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.custom.get({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Loaded`})})};function lc(e){return e.usage(`$0 zero-trust dlp profiles custom update <profile-id>
439
+
440
+ 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.
441
+ 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 uc={command:`update <profile-id>`,describe:`Update custom profile`,builder:lc,handler:async n=>l({command:`zero-trust dlp profiles custom update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/custom/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},data_classes:n[`data-classes`],data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),entries:f(n.entries,`entries`),name:m(n.name,`name`,`text`),ocr_enabled:n[`ocr-enabled`],sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(n[`shared-entries`],`shared-entries`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...e,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},data_classes:n[`data-classes`],data_tags:n[`data-tags`],description:m(n.description,`description`,`text`),entries:f(n.entries,`entries`),name:m(n.name,`name`,`text`),ocr_enabled:n[`ocr-enabled`],sensitivity_levels:f(n[`sensitivity-levels`],`sensitivity-levels`),shared_entries:f(n[`shared-entries`],`shared-entries`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.custom.update({...u,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`})})},dc={command:`custom`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(ic).command(oc).command(cc).command(uc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fc(e){return e.usage(`$0 zero-trust dlp profiles get <profile-id>
442
+
443
+ 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 pc={command:`get <profile-id>`,describe:`Get DLP Profile`,builder:fc,handler:async n=>l({command:`zero-trust dlp profiles get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.get({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Loaded`})})};function mc(e){return e.usage(`$0 zero-trust dlp profiles list
444
+
445
+ 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 hc={command:`list`,describe:`List all profiles`,builder:mc,handler:async n=>l({command:`zero-trust dlp profiles list`,classification:{safeFlags:[`all`,`dry-run`]}},n,async()=>{let i={all:n.all};if(n.dryRun){s({command:`cf zero-trust dlp profiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.dlp.profiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function gc(e){return e.usage(`$0 zero-trust dlp profiles predefined create <profile-id>
446
+
447
+ This is similar to \`update_predefined\` but only returns entries that are enabled. This is needed for our terraform API Creates a DLP predefined profile. Only supports enabling/disabling entries.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`,default:0}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`,default:`low`}).option(`enabled-entries`,{type:`string`,array:!0,description:`The enabled_entries field`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Predefined profiles can not be created. This endpoint will only update an existing predefined profiles settings.`})}const _c={command:`create <profile-id>`,describe:`Create predefined profile`,builder:gc,handler:async n=>l({command:`zero-trust dlp profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}/config`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:n[`enabled-entries`],entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:e,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Created`});return}let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:n[`enabled-entries`],entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]});o(await c(`Creating`,async()=>i.zeroTrust.dlp.profiles.predefined.create({body:u,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Created`})})};function vc(e){return e.usage(`$0 zero-trust dlp profiles predefined delete <profile-id>
448
+
449
+ This is a no-op as predefined profiles can't be deleted but is needed for our generated terraform API.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const yc={command:`delete <profile-id>`,describe:`Delete predefined profile`,builder:vc,handler:async n=>l({command:`zero-trust dlp profiles predefined delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles predefined delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
450
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.profiles.predefined.delete({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Deleted`})})};function bc(e){return e.usage(`$0 zero-trust dlp profiles predefined get <profile-id>
451
+
452
+ This is similar to \`get_predefined\` but only returns entries that are enabled. This is needed for our terraform API Fetches a predefined DLP profile by id.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xc={command:`get <profile-id>`,describe:`Get predefined profile config`,builder:bc,handler:async n=>l({command:`zero-trust dlp profiles predefined get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}/config`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.profiles.predefined.get({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Loaded`})})};function Sc(e){return e.usage(`$0 zero-trust dlp profiles predefined update <profile-id>
453
+
454
+ This is similar to \`update_predefined\` but only returns entries that are enabled. This is needed for our terraform API Updates a DLP predefined profile. Only supports enabling/disabling entries.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`}).option(`enabled-entries`,{type:`string`,array:!0,description:`The enabled_entries field`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The updated parameters for the predefined profile.`})}const Cc={command:`update <profile-id>`,describe:`Update predefined profile config`,builder:Sc,handler:async n=>l({command:`zero-trust dlp profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}/config`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:n[`enabled-entries`],entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:e,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`});return}let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),enabled_entries:n[`enabled-entries`],entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.profiles.predefined.update({body:u,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`})})},wc={command:`predefined`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(_c).command(yc).command(xc).command(Cc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tc={command:`profiles`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(pc).command(hc).command(dc).command(wc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ec(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates get <template-id>
455
+
456
+ 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 Dc={command:`get <template-id>`,describe:`Retrieve a specific sensitivity group template.`,builder:Ec,handler:async n=>l({command:`zero-trust dlp sensitivity-group-templates get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/templates/${n[`template-id`]==null?`<template-id>`:encodeURIComponent(String(n[`template-id`]))}`,pathParams:{"template-id":String(n[`template-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.get({account_id:l,template_id:n[`template-id`]})),{successLabel:`Loaded`})})};function Oc(e){return e.usage(`$0 zero-trust dlp sensitivity-group-templates list
457
+
458
+ Lists available sensitivity group templates.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kc={command:`list`,describe:`Retrieve all sensitivity group templates in an account`,builder:Oc,handler:async n=>l({command:`zero-trust dlp sensitivity-group-templates list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-group-templates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/templates`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroupTemplates.list({account_id:l})),{successLabel:`Loaded`})})},Ac={command:`sensitivity-group-templates`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Dc).command(kc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups create
459
+
460
+ 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 Mc={command:`create`,describe:`Creates a new sensitivity group.`,builder:jc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),levels:f(n.levels,`levels`),name:m(n.name,`name`,`text`),template_id:m(n[`template-id`],`template-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({description:m(n.description,`description`,`text`),levels:f(n.levels,`levels`),name:m(n.name,`name`,`text`),template_id:m(n[`template-id`],`template-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityGroups.create({...u,account_id:l})),{successLabel:`Created`})})};function Nc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups delete <sensitivity-group-id>
461
+
462
+ 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 Pc={command:`delete <sensitivity-group-id>`,describe:`Delete a single sensitivity group.`,builder:Nc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
463
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityGroups.delete({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Deleted`})})};function Fc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get-level-order <sensitivity-group-id>
464
+
465
+ 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 Ic={command:`get-level-order <sensitivity-group-id>`,describe:`Retrieve the ordered list of level IDs for a sensitivity group.`,builder:Fc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups get-level-order`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get-level-order`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.getLevelOrder({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function Lc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups get <sensitivity-group-id>
466
+
467
+ 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 Rc={command:`get <sensitivity-group-id>`,describe:`Retrieve a specific sensitivity group.`,builder:Lc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.get({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function zc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups list
468
+
469
+ Lists sensitivity groups configured for the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bc={command:`list`,describe:`Retrieve all sensitivity groups in an account`,builder:zc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityGroups.list({account_id:l})),{successLabel:`Loaded`})})};function Vc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update-level-order <sensitivity-group-id>
470
+
471
+ 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 Hc={command:`update-level-order <sensitivity-group-id>`,describe:`Set the ordering of levels within a sensitivity group.`,builder:Vc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups update-level-order`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update-level-order`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/level_order`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({level_ids:n[`level-ids`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:e,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Updated`});return}if(n[`level-ids`]===void 0)throw Error(`--level-ids is required (or pass --body with this field set).`);let u=p({level_ids:n[`level-ids`]});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.updateLevelOrder({body:u,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Updated`})})};function Uc(e){return e.usage(`$0 zero-trust dlp sensitivity-groups update <sensitivity-group-id>
472
+
473
+ 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 Wc={command:`update <sensitivity-group-id>`,describe:`Update the attributes of a single sensitivity group.`,builder:Uc,handler:async n=>l({command:`zero-trust dlp sensitivity-groups update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),levels:f(n.levels,`levels`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...e,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),levels:f(n.levels,`levels`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityGroups.update({...u,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Updated`})})},Gc={command:`sensitivity-groups`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(Mc).command(Pc).command(Rc).command(Ic).command(Bc).command(Wc).command(Hc).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kc(e){return e.usage(`$0 zero-trust dlp sensitivity-levels create <sensitivity-group-id>
474
+
475
+ 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 qc={command:`create <sensitivity-group-id>`,describe:`Creates a new sensitivity level.`,builder:Kc,handler:async n=>l({command:`zero-trust dlp sensitivity-levels create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-levels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:e,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.dlp.sensitivityLevels.create({body:u,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Created`})})};function Jc(e){return e.usage(`$0 zero-trust dlp sensitivity-levels delete <sensitivity-level-id>
476
+
477
+ 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 Yc={command:`delete <sensitivity-level-id>`,describe:`Delete a single sensitivity level.`,builder:Jc,handler:async n=>l({command:`zero-trust dlp sensitivity-levels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-levels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/levels/${n[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(n[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``),"sensitivity-level-id":String(n[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
478
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.dlp.sensitivityLevels.delete({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`],sensitivity_level_id:n[`sensitivity-level-id`]})),{successLabel:`Deleted`})})};function Xc(e){return e.usage(`$0 zero-trust dlp sensitivity-levels get <sensitivity-level-id>
479
+
480
+ 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 Zc={command:`get <sensitivity-level-id>`,describe:`Retrieve a specific sensitivity level.`,builder:Xc,handler:async n=>l({command:`zero-trust dlp sensitivity-levels get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-levels get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/levels/${n[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(n[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``),"sensitivity-level-id":String(n[`sensitivity-level-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.get({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`],sensitivity_level_id:n[`sensitivity-level-id`]})),{successLabel:`Loaded`})})};function Qc(e){return e.usage(`$0 zero-trust dlp sensitivity-levels list
481
+
482
+ 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 $c={command:`list`,describe:`Retrieve all sensitivity levels in a sensitivity group`,builder:Qc,handler:async n=>l({command:`zero-trust dlp sensitivity-levels list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-levels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/levels`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.dlp.sensitivityLevels.list({account_id:l,sensitivity_group_id:n[`sensitivity-group-id`]})),{successLabel:`Loaded`})})};function el(e){return e.usage(`$0 zero-trust dlp sensitivity-levels update <sensitivity-level-id>
483
+
484
+ 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 tl={command:`update <sensitivity-level-id>`,describe:`Update the attributes of a single sensitivity level.`,builder:el,handler:async n=>l({command:`zero-trust dlp sensitivity-levels update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust dlp sensitivity-levels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/sensitivity_groups/${n[`sensitivity-group-id`]==null?`<sensitivity-group-id>`:encodeURIComponent(String(n[`sensitivity-group-id`]))}/levels/${n[`sensitivity-level-id`]==null?`<sensitivity-level-id>`:encodeURIComponent(String(n[`sensitivity-level-id`]))}`,pathParams:{"sensitivity-group-id":String(n[`sensitivity-group-id`]??``),"sensitivity-level-id":String(n[`sensitivity-level-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...e,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`],sensitivity_level_id:n[`sensitivity-level-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.dlp.sensitivityLevels.update({...u,account_id:l,sensitivity_group_id:n[`sensitivity-group-id`],sensitivity_level_id:n[`sensitivity-level-id`]})),{successLabel:`Updated`})})},nl={command:`sensitivity-levels`,describe:`Data Loss Prevention — detection profiles, custom patterns, datasets, and entry scanning rules`,builder:e=>e.command(qc).command(Yc).command(Zc).command($c).command(tl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rl={command:`dlp`,describe:`Operations for dlp`,builder:e=>e.command(Ka).command(ro).command(ho).command(bo).command(jo).command($o).command(_s).command(Gs).command(Js).command(Zs).command(nc).command(Tc).command(Ac).command(Gc).command(nl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function il(e){return e.usage(`$0 zero-trust document-fingerprints create document fingerprints
485
+
486
+ 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 al={command:`fingerprints`,describe:`Creates a new document fingerprint.`,builder:il,handler:async n=>l({command:`zero-trust document-fingerprints create document fingerprints`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints create document fingerprints`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),match_percent:n[`match-percent`],name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...e,account_id:l})),{successLabel:`Created`});return}if(n[`match-percent`]===void 0)throw Error(`--match-percent is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await g(`name`,`The name field`));let u=p({description:m(n.description,`description`,`text`),match_percent:n[`match-percent`],name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.document.fingerprints({...u,account_id:l})),{successLabel:`Created`})})},ol={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(al).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sl(e){return e.usage(`$0 zero-trust document-fingerprints create v2 <document-fingerprint-id>
487
+
488
+ 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 cl={command:`v2 <document-fingerprint-id>`,describe:`Update the attributes of a single document fingerprint.`,builder:sl,handler:async n=>l({command:`zero-trust document-fingerprints create v2`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints/${n[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(n[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(n[`document-fingerprint-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),match_percent:n[`match-percent`],name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...e,account_id:l,document_fingerprint_id:n[`document-fingerprint-id`]})),{successLabel:`Created`});return}let u=p({description:m(n.description,`description`,`text`),match_percent:n[`match-percent`],name:m(n.name,`name`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.documentFingerprints.create.v2({...u,account_id:l,document_fingerprint_id:n[`document-fingerprint-id`]})),{successLabel:`Created`})})},ll={command:`create`,describe:`Document Fingerprints operations`,builder:e=>e.command(cl).command(ol).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ul(e){return e.usage(`$0 zero-trust document-fingerprints delete <document-fingerprint-id>
489
+
490
+ 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 dl={command:`delete <document-fingerprint-id>`,describe:`Delete a single document fingerprint.`,builder:ul,handler:async n=>l({command:`zero-trust document-fingerprints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints/${n[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(n[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(n[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
491
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.documentFingerprints.delete({account_id:l,document_fingerprint_id:n[`document-fingerprint-id`]})),{successLabel:`Deleted`})})};function fl(e){return e.usage(`$0 zero-trust document-fingerprints get document fingerprints <document-fingerprint-id>
492
+
493
+ 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 pl={command:`fingerprints <document-fingerprint-id>`,describe:`Retrieve data about a specific document fingerprint.`,builder:fl,handler:async n=>l({command:`zero-trust document-fingerprints get document fingerprints`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints get document fingerprints`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints/${n[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(n[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(n[`document-fingerprint-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.document.fingerprints({account_id:l,document_fingerprint_id:n[`document-fingerprint-id`]})),{successLabel:`Loaded`})})},ml={command:`document`,describe:`Document Fingerprints operations`,builder:e=>e.command(pl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function hl(e){return e.usage(`$0 zero-trust document-fingerprints get fingerprints all
494
+
495
+ 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 gl={command:`all`,describe:`Retrieve data about all document fingerprints.`,builder:hl,handler:async n=>l({command:`zero-trust document-fingerprints get fingerprints all`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints get fingerprints all`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.documentFingerprints.get.fingerprints.all({account_id:l})),{successLabel:`Loaded`})})},_l={command:`fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(gl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vl={command:`get`,describe:`Operations for document-fingerprints.get`,builder:e=>e.command(ml).command(_l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yl(e){return e.usage(`$0 zero-trust document-fingerprints update <document-fingerprint-id>
496
+
497
+ 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 bl={command:`update <document-fingerprint-id>`,describe:`Uploads a new version for a document fingerprint.`,builder:yl,handler:async n=>l({command:`zero-trust document-fingerprints update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust document-fingerprints update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/document_fingerprints/${n[`document-fingerprint-id`]==null?`<document-fingerprint-id>`:encodeURIComponent(String(n[`document-fingerprint-id`]))}`,pathParams:{"document-fingerprint-id":String(n[`document-fingerprint-id`]??``)},bodyKind:`multipart`,body:{body:n.body,file:n.file}});return}let l=await a(n),u=n.local?e:await r();if(n.accountId=u,n.file!==void 0||n.body!==void 0){let e=new FormData;if(n.file){let t=h(n.file);e.append(`file`,new Blob([t]),n.file.split(/[\\/]/).filter(Boolean).pop())}else n.body!==void 0&&e.append(`file`,n.body);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(n[`document-fingerprint-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(n.body){let e=m(n.body,`body`,`binary`);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/dlp/document_fingerprints/${encodeURIComponent(String(n[`document-fingerprint-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},xl={command:`document-fingerprints`,describe:`Document Fingerprints operations`,builder:e=>e.command(dl).command(bl).command(ll).command(vl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Sl(e){return e.usage(`$0 zero-trust gateway app-types list
498
+
499
+ List all application and application type mappings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Cl={command:`list`,describe:`List application and application type mappings`,builder:Sl,handler:async n=>l({command:`zero-trust gateway app-types list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway app-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/app_types`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.appTypes.list({account_id:l})),{successLabel:`Loaded`})})},wl={command:`app-types`,describe:`Operations for gateway.app-types`,builder:e=>e.command(Cl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tl(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings get
500
+
501
+ 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 El={command:`get`,describe:`Get Zero Trust SSH settings`,builder:Tl,handler:async n=>l({command:`zero-trust gateway audit-ssh-settings get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.auditSshSettings.get({account_id:l})),{successLabel:`Loaded`})})};function Dl(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings rotate-seed
502
+
503
+ 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 Ol={command:`rotate-seed`,describe:`Rotate Zero Trust SSH account seed`,builder:Dl,handler:async n=>l({command:`zero-trust gateway audit-ssh-settings rotate-seed`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings rotate-seed`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/audit_ssh_settings/rotate_seed`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.auditSshSettings.rotateSeed({account_id:l})),{successLabel:`Created`})})};function kl(e){return e.usage(`$0 zero-trust gateway audit-ssh-settings update
504
+
505
+ 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 Al={command:`update`,describe:`Update Zero Trust SSH settings`,builder:kl,handler:async n=>l({command:`zero-trust gateway audit-ssh-settings update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway audit-ssh-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/audit_ssh_settings`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({public_key:m(n[`public-key`],`public-key`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...e,account_id:l})),{successLabel:`Updated`});return}n[`public-key`]===void 0&&(n[`public-key`]=await g(`public-key`,`Provide the Base64-encoded HPKE public key that encrypts SSH session logs. See https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access/#enable-ssh-command-logging.`));let u=p({public_key:m(n[`public-key`],`public-key`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.auditSshSettings.update({...u,account_id:l})),{successLabel:`Updated`})})},jl={command:`audit-ssh-settings`,describe:`Operations for gateway.audit-ssh-settings`,builder:e=>e.command(El).command(Ol).command(Al).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ml(e){return e.usage(`$0 zero-trust gateway categories list
506
+
507
+ List all categories.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Nl={command:`list`,describe:`List categories`,builder:Ml,handler:async n=>l({command:`zero-trust gateway categories list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway categories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/categories`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.categories.list({account_id:l})),{successLabel:`Loaded`})})},Pl={command:`categories`,describe:`Operations for gateway.categories`,builder:e=>e.command(Nl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fl(e){return e.usage(`$0 zero-trust gateway certificates activate <certificate-id>
508
+
509
+ 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 Il={command:`activate <certificate-id>`,describe:`Activate a Zero Trust certificate`,builder:Fl,handler:async n=>l({command:`zero-trust gateway certificates activate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates activate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates/${n[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(n[`certificate-id`]))}/activate`,pathParams:{"certificate-id":String(n[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.activate({account_id:l,certificate_id:n[`certificate-id`]})),{successLabel:`Created`})})};function Ll(e){return e.usage(`$0 zero-trust gateway certificates create
510
+
511
+ 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 Rl={command:`create`,describe:`Create Zero Trust certificate`,builder:Ll,handler:async n=>l({command:`zero-trust gateway certificates create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({validity_period_days:n[`validity-period-days`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...e,account_id:l})),{successLabel:`Created`});return}let u=p({validity_period_days:n[`validity-period-days`]});o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.create({...u,account_id:l})),{successLabel:`Created`})})};function zl(e){return e.usage(`$0 zero-trust gateway certificates deactivate <certificate-id>
512
+
513
+ 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 Bl={command:`deactivate <certificate-id>`,describe:`Deactivate a Zero Trust certificate`,builder:zl,handler:async n=>l({command:`zero-trust gateway certificates deactivate`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates deactivate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates/${n[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(n[`certificate-id`]))}/deactivate`,pathParams:{"certificate-id":String(n[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.certificates.deactivate({account_id:l,certificate_id:n[`certificate-id`]})),{successLabel:`Created`})})};function Vl(e){return e.usage(`$0 zero-trust gateway certificates delete <certificate-id>
514
+
515
+ 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 Hl={command:`delete <certificate-id>`,describe:`Delete Zero Trust certificate`,builder:Vl,handler:async n=>l({command:`zero-trust gateway certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates/${n[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(n[`certificate-id`]))}`,pathParams:{"certificate-id":String(n[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
516
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.certificates.delete({account_id:l,certificate_id:n[`certificate-id`]})),{successLabel:`Deleted`})})};function Ul(e){return e.usage(`$0 zero-trust gateway certificates get <certificate-id>
517
+
518
+ 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 Wl={command:`get <certificate-id>`,describe:`Get Zero Trust certificate details`,builder:Ul,handler:async n=>l({command:`zero-trust gateway certificates get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates/${n[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(n[`certificate-id`]))}`,pathParams:{"certificate-id":String(n[`certificate-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.get({account_id:l,certificate_id:n[`certificate-id`]})),{successLabel:`Loaded`})})};function Gl(e){return e.usage(`$0 zero-trust gateway certificates list
519
+
520
+ 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 Kl={command:`list`,describe:`List Zero Trust certificates`,builder:Gl,handler:async n=>l({command:`zero-trust gateway certificates list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/certificates`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.certificates.list({account_id:l})),{successLabel:`Loaded`})})},ql={command:`certificates`,describe:`Operations for gateway.certificates`,builder:e=>e.command(Il).command(Rl).command(Bl).command(Hl).command(Wl).command(Kl).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jl(e){return e.usage("$0 zero-trust gateway configurations edit\n\nUpdate (PATCH) a single subcollection of settings such as `antivirus`, `tls_decrypt`, `activity_log`, `block_page`, `browser_isolation`, `fips`, `body_scanning`, `certificate`, or `max_ttl_secs` without updating the entire configuration object. This endpoint returns an error if any settings collection lacks proper configuration.").option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).option(`settings-block-page-name`,{type:`string`,description:`Specify the block page title when the mode is customized_block_page.`}).option(`settings-block-page-suppress-footer`,{type:`boolean`,description:`Specify whether to suppress detailed information at the bottom of the block page when the mode is customized_block_page.`}).option(`settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to redirect users to when the mode is redirect_uri.`}).option(`settings-body-scanning-inspection-mode`,{type:`string`,description:"Specify the inspection mode as either `deep` or `shallow`.",choices:[`deep`,`shallow`]}).option(`settings-browser-isolation-non-identity-enabled`,{type:`boolean`,description:`Specify whether to enable non-identity onramp support for Browser Isolation.`}).option(`settings-browser-isolation-url-browser-isolation-enabled`,{type:`boolean`,description:`Specify whether to enable Clientless Browser Isolation.`}).option(`settings-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate used for interception. Ensure the certificate is available at the edge(previously called 'active'). A nil UUID directs Cloudflare to use the Root CA.`}).option(`settings-custom-certificate-enabled`,{type:`boolean`,description:`Specify whether to enable a custom certificate authority for signing Gateway traffic.`}).option(`settings-custom-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate (ID from MTLS certificate store).`}).option(`settings-extended-email-matching-enabled`,{type:`boolean`,description:`Specify whether to match all variants of user emails (with + or . modifiers) used as criteria in Firewall policies.`}).option(`settings-fips-tls`,{type:`boolean`,description:`Enforce cipher suites and TLS versions compliant with FIPS 140-2.`}).option(`settings-host-selector-enabled`,{type:`boolean`,description:`Specify whether to enable filtering via hosts for egress policies.`}).option(`settings-inspection-mode`,{type:`string`,description:`Define the proxy inspection mode. 1. static: Gateway applies static inspection to HTTP on TCP(80). With TLS decryption on, Gateway inspects HTTPS traffic on TCP(443) and UDP(443). 2. dynamic: Gateway applies protocol detection to inspect HTTP and HTTPS traffic on any port. TLS decryption must remain on to inspect HTTPS traffic.`,choices:[`static`,`dynamic`]}).option(`settings-max-ttl-secs`,{type:`number`,description:"Account-level cap on DNS response TTLs, in seconds. Gateway rewrites DNS responses so returned record TTLs do not exceed this value. Null means no cap. Each DNS location can inherit, override, or disable it through the location `max_ttl` setting."}).option(`settings-protocol-detection-enabled`,{type:`boolean`,description:`Specify whether to detect protocols from the initial bytes of client traffic.`}).option(`settings-sandbox-enabled`,{type:`boolean`,description:`Specify whether to enable the sandbox.`}).option(`settings-sandbox-fallback-action`,{type:`string`,description:`Specify the action to take when the system cannot scan the file.`,choices:[`allow`,`block`]}).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if(`settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const Yl={command:`edit`,describe:`Patch Zero Trust account configuration`,builder:Jl,handler:async n=>l({command:`zero-trust gateway configurations edit`,classification:{safeFlags:[`settings-activity-log-enabled`,`settings-antivirus-enabled-download-phase`,`settings-antivirus-enabled-upload-phase`,`settings-antivirus-fail-closed`,`settings-antivirus-notification-settings-enabled`,`settings-antivirus-notification-settings-include-context`,`settings-block-page-enabled`,`settings-block-page-include-context`,`settings-block-page-mode`,`settings-block-page-suppress-footer`,`settings-body-scanning-inspection-mode`,`settings-browser-isolation-non-identity-enabled`,`settings-browser-isolation-url-browser-isolation-enabled`,`settings-custom-certificate-enabled`,`settings-extended-email-matching-enabled`,`settings-fips-tls`,`settings-host-selector-enabled`,`settings-inspection-mode`,`settings-protocol-detection-enabled`,`settings-sandbox-enabled`,`settings-sandbox-fallback-action`,`settings-tls-decrypt-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway configurations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({settings:{activity_log:{enabled:n[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:n[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:n[`settings-antivirus-enabled-upload-phase`],fail_closed:n[`settings-antivirus-fail-closed`],notification_settings:{enabled:n[`settings-antivirus-notification-settings-enabled`],include_context:n[`settings-antivirus-notification-settings-include-context`],msg:m(n[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(n[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(n[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:n[`settings-block-page-enabled`],footer_text:m(n[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(n[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:n[`settings-block-page-include-context`],logo_path:m(n[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(n[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(n[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(n[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(n[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:n[`settings-block-page-suppress-footer`],target_uri:m(n[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(n[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:n[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:n[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(n[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:n[`settings-custom-certificate-enabled`],id:m(n[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:n[`settings-extended-email-matching-enabled`]},fips:{tls:n[`settings-fips-tls`]},host_selector:{enabled:n[`settings-host-selector-enabled`]},inspection:{mode:m(n[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:n[`settings-max-ttl-secs`],protocol_detection:{enabled:n[`settings-protocol-detection-enabled`]},sandbox:{enabled:n[`settings-sandbox-enabled`],fallback_action:m(n[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:n[`settings-tls-decrypt-enabled`]}}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({settings:{activity_log:{enabled:n[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:n[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:n[`settings-antivirus-enabled-upload-phase`],fail_closed:n[`settings-antivirus-fail-closed`],notification_settings:{enabled:n[`settings-antivirus-notification-settings-enabled`],include_context:n[`settings-antivirus-notification-settings-include-context`],msg:m(n[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(n[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(n[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:n[`settings-block-page-enabled`],footer_text:m(n[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(n[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:n[`settings-block-page-include-context`],logo_path:m(n[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(n[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(n[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(n[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(n[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:n[`settings-block-page-suppress-footer`],target_uri:m(n[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(n[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:n[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:n[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(n[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:n[`settings-custom-certificate-enabled`],id:m(n[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:n[`settings-extended-email-matching-enabled`]},fips:{tls:n[`settings-fips-tls`]},host_selector:{enabled:n[`settings-host-selector-enabled`]},inspection:{mode:m(n[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:n[`settings-max-ttl-secs`],protocol_detection:{enabled:n[`settings-protocol-detection-enabled`]},sandbox:{enabled:n[`settings-sandbox-enabled`],fallback_action:m(n[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:n[`settings-tls-decrypt-enabled`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.edit({body:u,account_id:l})),{successLabel:`Updated`})})};function Xl(e){return e.usage(`$0 zero-trust gateway configurations get
521
+
522
+ Retrieve the current Zero Trust account configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Zl={command:`get`,describe:`Get Zero Trust account configuration`,builder:Xl,handler:async n=>l({command:`zero-trust gateway configurations get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.configurations.get({account_id:l})),{successLabel:`Loaded`})})};function Ql(e){return e.usage(`$0 zero-trust gateway configurations update
523
+
524
+ Update the current Zero Trust account configuration.`).option(`settings-activity-log-enabled`,{type:`boolean`,description:`Specify whether to log activity.`}).option(`settings-antivirus-enabled-download-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on downloads.`}).option(`settings-antivirus-enabled-upload-phase`,{type:`boolean`,description:`Specify whether to enable anti-virus scanning on uploads.`}).option(`settings-antivirus-fail-closed`,{type:`boolean`,description:`Specify whether to block requests for unscannable files.`}).option(`settings-antivirus-notification-settings-enabled`,{type:`boolean`,description:`Specify whether to enable notifications.`}).option(`settings-antivirus-notification-settings-include-context`,{type:`boolean`,description:`Specify whether to include context information as query parameters.`}).option(`settings-antivirus-notification-settings-msg`,{type:`string`,description:`Specify the message to show in the notification.`}).option(`settings-antivirus-notification-settings-support-url`,{type:`string`,description:`Specify a URL that directs users to more information. If unset, the notification opens a block page.`}).option(`settings-block-page-background-color`,{type:`string`,description:"Specify the block page background color in `#rrggbb` format when the mode is customized_block_page."}).option(`settings-block-page-enabled`,{type:`boolean`,description:`Specify whether to enable the custom block page.`}).option(`settings-block-page-footer-text`,{type:`string`,description:`Specify the block page footer text when the mode is customized_block_page.`}).option(`settings-block-page-header-text`,{type:`string`,description:`Specify the block page header text when the mode is customized_block_page.`}).option(`settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to append context to target_uri as query parameters. This applies only when the mode is redirect_uri.`}).option(`settings-block-page-logo-path`,{type:`string`,description:`Specify the full URL to the logo file when the mode is customized_block_page.`}).option(`settings-block-page-mailto-address`,{type:`string`,description:`Specify the admin email for users to contact when the mode is customized_block_page.`}).option(`settings-block-page-mailto-subject`,{type:`string`,description:`Specify the subject line for emails created from the block page when the mode is customized_block_page.`}).option(`settings-block-page-mode`,{type:`string`,description:`Specify whether to redirect users to a Cloudflare-hosted block page or a customer-provided URI.`,choices:[`customized_block_page`,`redirect_uri`]}).option(`settings-block-page-name`,{type:`string`,description:`Specify the block page title when the mode is customized_block_page.`}).option(`settings-block-page-suppress-footer`,{type:`boolean`,description:`Specify whether to suppress detailed information at the bottom of the block page when the mode is customized_block_page.`}).option(`settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to redirect users to when the mode is redirect_uri.`}).option(`settings-body-scanning-inspection-mode`,{type:`string`,description:"Specify the inspection mode as either `deep` or `shallow`.",choices:[`deep`,`shallow`]}).option(`settings-browser-isolation-non-identity-enabled`,{type:`boolean`,description:`Specify whether to enable non-identity onramp support for Browser Isolation.`}).option(`settings-browser-isolation-url-browser-isolation-enabled`,{type:`boolean`,description:`Specify whether to enable Clientless Browser Isolation.`}).option(`settings-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate used for interception. Ensure the certificate is available at the edge(previously called 'active'). A nil UUID directs Cloudflare to use the Root CA.`}).option(`settings-custom-certificate-enabled`,{type:`boolean`,description:`Specify whether to enable a custom certificate authority for signing Gateway traffic.`}).option(`settings-custom-certificate-id`,{type:`string`,description:`Specify the UUID of the certificate (ID from MTLS certificate store).`}).option(`settings-extended-email-matching-enabled`,{type:`boolean`,description:`Specify whether to match all variants of user emails (with + or . modifiers) used as criteria in Firewall policies.`}).option(`settings-fips-tls`,{type:`boolean`,description:`Enforce cipher suites and TLS versions compliant with FIPS 140-2.`}).option(`settings-host-selector-enabled`,{type:`boolean`,description:`Specify whether to enable filtering via hosts for egress policies.`}).option(`settings-inspection-mode`,{type:`string`,description:`Define the proxy inspection mode. 1. static: Gateway applies static inspection to HTTP on TCP(80). With TLS decryption on, Gateway inspects HTTPS traffic on TCP(443) and UDP(443). 2. dynamic: Gateway applies protocol detection to inspect HTTP and HTTPS traffic on any port. TLS decryption must remain on to inspect HTTPS traffic.`,choices:[`static`,`dynamic`]}).option(`settings-max-ttl-secs`,{type:`number`,description:"Account-level cap on DNS response TTLs, in seconds. Gateway rewrites DNS responses so returned record TTLs do not exceed this value. Null means no cap. Each DNS location can inherit, override, or disable it through the location `max_ttl` setting."}).option(`settings-protocol-detection-enabled`,{type:`boolean`,description:`Specify whether to detect protocols from the initial bytes of client traffic.`}).option(`settings-sandbox-enabled`,{type:`boolean`,description:`Specify whether to enable the sandbox.`}).option(`settings-sandbox-fallback-action`,{type:`string`,description:`Specify the action to take when the system cannot scan the file.`,choices:[`allow`,`block`]}).option(`settings-tls-decrypt-enabled`,{type:`boolean`,description:`Specify whether to inspect encrypted HTTP traffic.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify account settings.`}).check(e=>{if(`settings-activity-log-enabled.settings-antivirus-enabled-download-phase.settings-antivirus-enabled-upload-phase.settings-antivirus-fail-closed.settings-antivirus-notification-settings-enabled.settings-antivirus-notification-settings-include-context.settings-antivirus-notification-settings-msg.settings-antivirus-notification-settings-support-url.settings-block-page-background-color.settings-block-page-enabled.settings-block-page-footer-text.settings-block-page-header-text.settings-block-page-include-context.settings-block-page-logo-path.settings-block-page-mailto-address.settings-block-page-mailto-subject.settings-block-page-mode.settings-block-page-name.settings-block-page-suppress-footer.settings-block-page-target-uri.settings-body-scanning-inspection-mode.settings-browser-isolation-non-identity-enabled.settings-browser-isolation-url-browser-isolation-enabled.settings-certificate-id.settings-custom-certificate-enabled.settings-custom-certificate-id.settings-extended-email-matching-enabled.settings-fips-tls.settings-host-selector-enabled.settings-inspection-mode.settings-max-ttl-secs.settings-protocol-detection-enabled.settings-sandbox-enabled.settings-sandbox-fallback-action.settings-tls-decrypt-enabled`.split(`.`).some(t=>e[t]!==void 0)){let t=[`settings-certificate-id`,`settings-custom-certificate-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --settings-* flag is set`)}return!0})}const $l={command:`update`,describe:`Update Zero Trust account configuration`,builder:Ql,handler:async n=>l({command:`zero-trust gateway configurations update`,classification:{safeFlags:[`settings-activity-log-enabled`,`settings-antivirus-enabled-download-phase`,`settings-antivirus-enabled-upload-phase`,`settings-antivirus-fail-closed`,`settings-antivirus-notification-settings-enabled`,`settings-antivirus-notification-settings-include-context`,`settings-block-page-enabled`,`settings-block-page-include-context`,`settings-block-page-mode`,`settings-block-page-suppress-footer`,`settings-body-scanning-inspection-mode`,`settings-browser-isolation-non-identity-enabled`,`settings-browser-isolation-url-browser-isolation-enabled`,`settings-custom-certificate-enabled`,`settings-extended-email-matching-enabled`,`settings-fips-tls`,`settings-host-selector-enabled`,`settings-inspection-mode`,`settings-protocol-detection-enabled`,`settings-sandbox-enabled`,`settings-sandbox-fallback-action`,`settings-tls-decrypt-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/configuration`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({settings:{activity_log:{enabled:n[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:n[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:n[`settings-antivirus-enabled-upload-phase`],fail_closed:n[`settings-antivirus-fail-closed`],notification_settings:{enabled:n[`settings-antivirus-notification-settings-enabled`],include_context:n[`settings-antivirus-notification-settings-include-context`],msg:m(n[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(n[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(n[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:n[`settings-block-page-enabled`],footer_text:m(n[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(n[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:n[`settings-block-page-include-context`],logo_path:m(n[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(n[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(n[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(n[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(n[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:n[`settings-block-page-suppress-footer`],target_uri:m(n[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(n[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:n[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:n[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(n[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:n[`settings-custom-certificate-enabled`],id:m(n[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:n[`settings-extended-email-matching-enabled`]},fips:{tls:n[`settings-fips-tls`]},host_selector:{enabled:n[`settings-host-selector-enabled`]},inspection:{mode:m(n[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:n[`settings-max-ttl-secs`],protocol_detection:{enabled:n[`settings-protocol-detection-enabled`]},sandbox:{enabled:n[`settings-sandbox-enabled`],fallback_action:m(n[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:n[`settings-tls-decrypt-enabled`]}}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({settings:{activity_log:{enabled:n[`settings-activity-log-enabled`]},antivirus:{enabled_download_phase:n[`settings-antivirus-enabled-download-phase`],enabled_upload_phase:n[`settings-antivirus-enabled-upload-phase`],fail_closed:n[`settings-antivirus-fail-closed`],notification_settings:{enabled:n[`settings-antivirus-notification-settings-enabled`],include_context:n[`settings-antivirus-notification-settings-include-context`],msg:m(n[`settings-antivirus-notification-settings-msg`],`settings-antivirus-notification-settings-msg`,`text`),support_url:m(n[`settings-antivirus-notification-settings-support-url`],`settings-antivirus-notification-settings-support-url`,`text`)}},block_page:{background_color:m(n[`settings-block-page-background-color`],`settings-block-page-background-color`,`text`),enabled:n[`settings-block-page-enabled`],footer_text:m(n[`settings-block-page-footer-text`],`settings-block-page-footer-text`,`text`),header_text:m(n[`settings-block-page-header-text`],`settings-block-page-header-text`,`text`),include_context:n[`settings-block-page-include-context`],logo_path:m(n[`settings-block-page-logo-path`],`settings-block-page-logo-path`,`text`),mailto_address:m(n[`settings-block-page-mailto-address`],`settings-block-page-mailto-address`,`text`),mailto_subject:m(n[`settings-block-page-mailto-subject`],`settings-block-page-mailto-subject`,`text`),mode:m(n[`settings-block-page-mode`],`settings-block-page-mode`,`text`),name:m(n[`settings-block-page-name`],`settings-block-page-name`,`text`),suppress_footer:n[`settings-block-page-suppress-footer`],target_uri:m(n[`settings-block-page-target-uri`],`settings-block-page-target-uri`,`text`)},body_scanning:{inspection_mode:m(n[`settings-body-scanning-inspection-mode`],`settings-body-scanning-inspection-mode`,`text`)},browser_isolation:{non_identity_enabled:n[`settings-browser-isolation-non-identity-enabled`],url_browser_isolation_enabled:n[`settings-browser-isolation-url-browser-isolation-enabled`]},certificate:{id:m(n[`settings-certificate-id`],`settings-certificate-id`,`text`)},custom_certificate:{enabled:n[`settings-custom-certificate-enabled`],id:m(n[`settings-custom-certificate-id`],`settings-custom-certificate-id`,`text`)},extended_email_matching:{enabled:n[`settings-extended-email-matching-enabled`]},fips:{tls:n[`settings-fips-tls`]},host_selector:{enabled:n[`settings-host-selector-enabled`]},inspection:{mode:m(n[`settings-inspection-mode`],`settings-inspection-mode`,`text`)},max_ttl_secs:n[`settings-max-ttl-secs`],protocol_detection:{enabled:n[`settings-protocol-detection-enabled`]},sandbox:{enabled:n[`settings-sandbox-enabled`],fallback_action:m(n[`settings-sandbox-fallback-action`],`settings-sandbox-fallback-action`,`text`)},tls_decrypt:{enabled:n[`settings-tls-decrypt-enabled`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.configurations.update({body:u,account_id:l})),{successLabel:`Updated`})})},eu={command:`configurations`,describe:`Operations for gateway.configurations`,builder:e=>e.command(Yl).command(Zl).command($l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tu(e){return e.usage(`$0 zero-trust gateway create
525
+
526
+ 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 nu={command:`create`,describe:`Create Zero Trust account`,builder:tu,handler:async n=>l({command:`zero-trust gateway create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.create({account_id:l})),{successLabel:`Created`})})};function ru(e){return e.usage(`$0 zero-trust gateway dns-destination-ips list
527
+
528
+ 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 iu={command:`list`,describe:`List Zero Trust Gateway DNS destination IPv4 address pairs`,builder:ru,handler:async n=>l({command:`zero-trust gateway dns-destination-ips list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway dns-destination-ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/dns_destination_ips`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.dnsDestinationIps.list({account_id:l})),{successLabel:`Loaded`})})},au={command:`dns-destination-ips`,describe:`Operations for gateway.dns-destination-ips`,builder:e=>e.command(iu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ou(e){return e.usage(`$0 zero-trust gateway egress-cidr-pairs list
529
+
530
+ 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 su={command:`list`,describe:`Get gateway egress CIDRs pairs assigned to this account`,builder:ou,handler:async n=>l({command:`zero-trust gateway egress-cidr-pairs list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway egress-cidr-pairs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/egress_cidr_pairs`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.egressCidrPairs.list({account_id:l})),{successLabel:`Loaded`})})},cu={command:`egress-cidr-pairs`,describe:`Operations for gateway.egress-cidr-pairs`,builder:e=>e.command(su).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lu(e){return e.usage(`$0 zero-trust gateway list
531
+
532
+ 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 uu={command:`list`,describe:`Get Zero Trust account information`,builder:lu,handler:async n=>l({command:`zero-trust gateway list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.list({account_id:l})),{successLabel:`Loaded`})})};function du(e){return e.usage(`$0 zero-trust gateway lists create
533
+
534
+ Creates a new Zero Trust list.`).option(`description`,{type:`string`,description:`Provide the list description.`}).option(`items`,{type:`string`,description:`Add items to the list. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`Specify the list name.`}).option(`type`,{type:`string`,description:`Specify the list type.`,choices:[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fu={command:`create`,describe:`Create Zero Trust list`,builder:du,handler:async n=>l({command:`zero-trust gateway lists create`,classification:{safeFlags:[`type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),items:f(n.items,`items`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`Specify the list name.`)),n.type===void 0&&(n.type=await _(`type`,`Specify the list type.`,[`SERIAL`,`URL`,`DOMAIN`,`EMAIL`,`IP`,`CATEGORY`,`LOCATION`,`DEVICE`,`AAGUID`]));let u=p({description:m(n.description,`description`,`text`),items:f(n.items,`items`),name:m(n.name,`name`,`text`),type:m(n.type,`type`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.lists.create({...u,account_id:l})),{successLabel:`Created`})})};function pu(e){return e.usage(`$0 zero-trust gateway lists delete <list-id>
535
+
536
+ 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 mu={command:`delete <list-id>`,describe:`Delete Zero Trust list`,builder:pu,handler:async n=>l({command:`zero-trust gateway lists delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/${n[`list-id`]==null?`<list-id>`:encodeURIComponent(String(n[`list-id`]))}`,pathParams:{"list-id":String(n[`list-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
537
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.lists.delete({account_id:l,list_id:n[`list-id`]})),{successLabel:`Deleted`})})};function hu(e){return e.usage(`$0 zero-trust gateway lists edit <list-id>
538
+
539
+ 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 gu={command:`edit <list-id>`,describe:`Patch Zero Trust list.`,builder:hu,handler:async n=>l({command:`zero-trust gateway lists edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/${n[`list-id`]==null?`<list-id>`:encodeURIComponent(String(n[`list-id`]))}`,pathParams:{"list-id":String(n[`list-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({append:f(n.append,`append`),remove:n.remove}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...e,account_id:l,list_id:n[`list-id`]})),{successLabel:`Updated`});return}let u=p({append:f(n.append,`append`),remove:n.remove});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.edit({...u,account_id:l,list_id:n[`list-id`]})),{successLabel:`Updated`})})};function _u(e){return e.usage(`$0 zero-trust gateway lists get <list-id>
540
+
541
+ 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 vu={command:`get <list-id>`,describe:`Get Zero Trust list details`,builder:_u,handler:async n=>l({command:`zero-trust gateway lists get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/${n[`list-id`]==null?`<list-id>`:encodeURIComponent(String(n[`list-id`]))}`,pathParams:{"list-id":String(n[`list-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.lists.get({account_id:l,list_id:n[`list-id`]})),{successLabel:`Loaded`})})};function yu(e){return e.usage(`$0 zero-trust gateway lists items list
542
+
543
+ 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 bu={command:`list`,describe:`Get Zero Trust list items`,builder:yu,handler:async n=>l({command:`zero-trust gateway lists items list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust gateway lists items list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/${n[`list-id`]==null?`<list-id>`:encodeURIComponent(String(n[`list-id`]))}/items`,pathParams:{"list-id":String(n[`list-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.lists.items.list({account_id:u,list_id:n[`list-id`],...i})),{successLabel:`Loaded`})})},xu={command:`items`,describe:`Operations for gateway.lists.items`,builder:e=>e.command(bu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Su(e){return e.usage(`$0 zero-trust gateway lists list
544
+
545
+ 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 Cu={command:`list`,describe:`List Zero Trust lists`,builder:y(Su),handler:async n=>l({command:`zero-trust gateway lists list`,classification:{safeFlags:[`type`,`order-by`,`direction`,`dry-run`]}},n,async()=>{let i={type:n.type,filter:n.filter,search:n.search,order_by:n[`order-by`],direction:n.direction};if(n.dryRun){s({command:`cf zero-trust gateway lists list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.lists.list({account_id:u,...i})),{successLabel:`Loaded`})})};function wu(e){return e.usage(`$0 zero-trust gateway lists update <list-id>
546
+
547
+ 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 Tu={command:`update <list-id>`,describe:`Update Zero Trust list`,builder:wu,handler:async n=>l({command:`zero-trust gateway lists update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/${n[`list-id`]==null?`<list-id>`:encodeURIComponent(String(n[`list-id`]))}`,pathParams:{"list-id":String(n[`list-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),items:f(n.items,`items`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...e,account_id:l,list_id:n[`list-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await g(`name`,`Specify the list name.`));let u=p({description:m(n.description,`description`,`text`),items:f(n.items,`items`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.lists.update({...u,account_id:l,list_id:n[`list-id`]})),{successLabel:`Updated`})})};function Eu(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 Du={command:`upload`,describe:`Create Zero Trust list from CSV`,builder:Eu,handler:async n=>l({command:`zero-trust gateway lists upload`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway lists upload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/lists/upload`,pathParams:{},bodyKind:`multipart`,body:{body:n.body,file:n.file}});return}let l=await a(n),u=n.local?e:await r();if(n.accountId=u,n.file!==void 0||n.body!==void 0){let e=new FormData;if(n.file){let t=h(n.file);e.append(`file`,new Blob([t]),n.file.split(/[\\/]/).filter(Boolean).pop())}else n.body!==void 0&&e.append(`file`,n.body);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e})),{successLabel:`Created`});return}if(n.body){let e=m(n.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/gateway/lists/upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ou={command:`lists`,describe:`Operations for gateway.lists`,builder:e=>e.command(fu).command(mu).command(gu).command(vu).command(Cu).command(Tu).command(Du).command(xu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ku(e){return e.usage(`$0 zero-trust gateway locations create
548
+
549
+ Create a new Zero Trust Gateway location.`).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`,default:!1}).option(`dns-destination-ips-id`,{type:`string`,description:`Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged.`}).option(`ecs-support`,{type:`boolean`,description:`Indicate whether the location must resolve EDNS queries.`,default:!1}).option(`endpoints-doh-enabled`,{type:`boolean`,description:`Indicate whether the DOH endpoint is enabled for this location.`}).option(`endpoints-doh-require-token`,{type:`boolean`,description:`Specify whether the DOH endpoint requires user identity authentication.`}).option(`endpoints-dot-enabled`,{type:`boolean`,description:`Indicate whether the DOT endpoint is enabled for this location.`}).option(`endpoints-ipv4-enabled`,{type:`boolean`,description:`Indicate whether the IPv4 endpoint is enabled for this location.`}).option(`endpoints-ipv6-enabled`,{type:`boolean`,description:`Indicate whether the IPV6 endpoint is enabled for this location.`}).option(`max-ttl-mode`,{type:`string`,description:"`inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged.",choices:[`inherit`,`override`,`disabled`]}).option(`max-ttl-ttl-secs`,{type:`number`,description:"Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`."}).option(`name`,{type:`string`,description:`Specify the location name.`}).option(`networks`,{type:`string`,description:`Specify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`max-ttl-mode`,`max-ttl-ttl-secs`].some(t=>e[t]!==void 0)){let t=[`max-ttl-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --max_ttl-* flag is set`)}return!0})}const Au={command:`create`,describe:`Create a Zero Trust Gateway location`,builder:ku,handler:async n=>l({command:`zero-trust gateway locations create`,classification:{safeFlags:[`client-default`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway locations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/locations`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({client_default:n[`client-default`],dns_destination_ips_id:m(n[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:n[`ecs-support`],endpoints:{doh:{enabled:n[`endpoints-doh-enabled`],require_token:n[`endpoints-doh-require-token`]},dot:{enabled:n[`endpoints-dot-enabled`]},ipv4:{enabled:n[`endpoints-ipv4-enabled`]},ipv6:{enabled:n[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(n[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:n[`max-ttl-ttl-secs`]},name:m(n.name,`name`,`text`),networks:f(n.networks,`networks`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await g(`name`,`Specify the location name.`));let u=p({client_default:n[`client-default`],dns_destination_ips_id:m(n[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:n[`ecs-support`],endpoints:{doh:{enabled:n[`endpoints-doh-enabled`],require_token:n[`endpoints-doh-require-token`]},dot:{enabled:n[`endpoints-dot-enabled`]},ipv4:{enabled:n[`endpoints-ipv4-enabled`]},ipv6:{enabled:n[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(n[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:n[`max-ttl-ttl-secs`]},name:m(n.name,`name`,`text`),networks:f(n.networks,`networks`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.locations.create({...u,account_id:l})),{successLabel:`Created`})})};function ju(e){return e.usage(`$0 zero-trust gateway locations delete <location-id>
550
+
551
+ 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 Mu={command:`delete <location-id>`,describe:`Delete a Zero Trust Gateway location`,builder:ju,handler:async n=>l({command:`zero-trust gateway locations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway locations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/locations/${n[`location-id`]==null?`<location-id>`:encodeURIComponent(String(n[`location-id`]))}`,pathParams:{"location-id":String(n[`location-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
552
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.locations.delete({account_id:l,location_id:n[`location-id`]})),{successLabel:`Deleted`})})};function Nu(e){return e.usage(`$0 zero-trust gateway locations get <location-id>
553
+
554
+ 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 Pu={command:`get <location-id>`,describe:`Get Zero Trust Gateway location details`,builder:Nu,handler:async n=>l({command:`zero-trust gateway locations get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway locations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/locations/${n[`location-id`]==null?`<location-id>`:encodeURIComponent(String(n[`location-id`]))}`,pathParams:{"location-id":String(n[`location-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.locations.get({account_id:l,location_id:n[`location-id`]})),{successLabel:`Loaded`})})};function Fu(e){return e.usage(`$0 zero-trust gateway locations list
555
+
556
+ 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 Iu={command:`list`,describe:`List Zero Trust Gateway locations`,builder:y(Fu),handler:async n=>l({command:`zero-trust gateway locations list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},n,async()=>{let i={filter:n.filter,search:n.search,order_by:n[`order-by`],direction:n.direction};if(n.dryRun){s({command:`cf zero-trust gateway locations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/locations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.locations.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Lu(e){return e.usage(`$0 zero-trust gateway locations update <location-id>
557
+
558
+ Update a configured Zero Trust Gateway location.`).positional(`location-id`,{type:`string`,description:`Location ID`,demandOption:!0}).option(`client-default`,{type:`boolean`,description:`Indicate whether this location is the default location.`}).option(`dns-destination-ips-id`,{type:`string`,description:`Specify the identifier of the pair of IPv4 addresses assigned to this location. When creating a location, if this field is absent or set to null, the pair of shared IPv4 addresses (0e4a32c6-6fb8-4858-9296-98f51631e8e6) is auto-assigned. When updating a location, if this field is absent or set to null, the pre-assigned pair remains unchanged.`}).option(`ecs-support`,{type:`boolean`,description:`Indicate whether the location must resolve EDNS queries.`}).option(`endpoints-doh-enabled`,{type:`boolean`,description:`Indicate whether the DOH endpoint is enabled for this location.`}).option(`endpoints-doh-require-token`,{type:`boolean`,description:`Specify whether the DOH endpoint requires user identity authentication.`}).option(`endpoints-dot-enabled`,{type:`boolean`,description:`Indicate whether the DOT endpoint is enabled for this location.`}).option(`endpoints-ipv4-enabled`,{type:`boolean`,description:`Indicate whether the IPv4 endpoint is enabled for this location.`}).option(`endpoints-ipv6-enabled`,{type:`boolean`,description:`Indicate whether the IPV6 endpoint is enabled for this location.`}).option(`max-ttl-mode`,{type:`string`,description:"`inherit` uses the account `max_ttl_secs`. `override` uses this location's `ttl_secs`. `disabled` leaves returned TTLs unchanged.",choices:[`inherit`,`override`,`disabled`]}).option(`max-ttl-ttl-secs`,{type:`number`,description:"Location-specific cap on DNS response TTLs, in seconds. Required when `mode` is `override`. Must be omitted when `mode` is `inherit` or `disabled`."}).option(`name`,{type:`string`,description:`Specify the location name.`}).option(`networks`,{type:`string`,description:`Specify the list of network ranges from which requests at this location originate. The list takes effect only if it is non-empty and the IPv4 endpoint is enabled for this location. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`max-ttl-mode`,`max-ttl-ttl-secs`].some(t=>e[t]!==void 0)){let t=[`max-ttl-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --max_ttl-* flag is set`)}return!0})}const Ru={command:`update <location-id>`,describe:`Update a Zero Trust Gateway location`,builder:Lu,handler:async n=>l({command:`zero-trust gateway locations update`,classification:{safeFlags:[`client-default`,`ecs-support`,`endpoints-doh-enabled`,`endpoints-doh-require-token`,`endpoints-dot-enabled`,`endpoints-ipv4-enabled`,`endpoints-ipv6-enabled`,`max-ttl-mode`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway locations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/locations/${n[`location-id`]==null?`<location-id>`:encodeURIComponent(String(n[`location-id`]))}`,pathParams:{"location-id":String(n[`location-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({client_default:n[`client-default`],dns_destination_ips_id:m(n[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:n[`ecs-support`],endpoints:{doh:{enabled:n[`endpoints-doh-enabled`],require_token:n[`endpoints-doh-require-token`]},dot:{enabled:n[`endpoints-dot-enabled`]},ipv4:{enabled:n[`endpoints-ipv4-enabled`]},ipv6:{enabled:n[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(n[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:n[`max-ttl-ttl-secs`]},name:m(n.name,`name`,`text`),networks:f(n.networks,`networks`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...e,account_id:l,location_id:n[`location-id`]})),{successLabel:`Updated`});return}n.name===void 0&&(n.name=await g(`name`,`Specify the location name.`));let u=p({client_default:n[`client-default`],dns_destination_ips_id:m(n[`dns-destination-ips-id`],`dns-destination-ips-id`,`text`),ecs_support:n[`ecs-support`],endpoints:{doh:{enabled:n[`endpoints-doh-enabled`],require_token:n[`endpoints-doh-require-token`]},dot:{enabled:n[`endpoints-dot-enabled`]},ipv4:{enabled:n[`endpoints-ipv4-enabled`]},ipv6:{enabled:n[`endpoints-ipv6-enabled`]}},max_ttl:{mode:m(n[`max-ttl-mode`],`max-ttl-mode`,`text`),ttl_secs:n[`max-ttl-ttl-secs`]},name:m(n.name,`name`,`text`),networks:f(n.networks,`networks`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.locations.update({...u,account_id:l,location_id:n[`location-id`]})),{successLabel:`Updated`})})},zu={command:`locations`,describe:`Operations for gateway.locations`,builder:e=>e.command(Au).command(Mu).command(Pu).command(Iu).command(Ru).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Bu(e){return e.usage(`$0 zero-trust gateway logging get
559
+
560
+ 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 Vu={command:`get`,describe:`Get logging settings for the Zero Trust account`,builder:Bu,handler:async n=>l({command:`zero-trust gateway logging get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway logging get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.logging.get({account_id:l})),{successLabel:`Loaded`})})};function Hu(e){return e.usage(`$0 zero-trust gateway logging update
561
+
562
+ 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 Uu={command:`update`,describe:`Update Zero Trust account logging settings`,builder:Hu,handler:async n=>l({command:`zero-trust gateway logging update`,classification:{safeFlags:[`redact-pii`,`settings-by-rule-type-dns-log-all`,`settings-by-rule-type-dns-log-blocks`,`settings-by-rule-type-http-log-all`,`settings-by-rule-type-http-log-blocks`,`settings-by-rule-type-l4-log-all`,`settings-by-rule-type-l4-log-blocks`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway logging update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/logging`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({redact_pii:n[`redact-pii`],settings_by_rule_type:{dns:{log_all:n[`settings-by-rule-type-dns-log-all`],log_blocks:n[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:n[`settings-by-rule-type-http-log-all`],log_blocks:n[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:n[`settings-by-rule-type-l4-log-all`],log_blocks:n[`settings-by-rule-type-l4-log-blocks`]}}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({redact_pii:n[`redact-pii`],settings_by_rule_type:{dns:{log_all:n[`settings-by-rule-type-dns-log-all`],log_blocks:n[`settings-by-rule-type-dns-log-blocks`]},http:{log_all:n[`settings-by-rule-type-http-log-all`],log_blocks:n[`settings-by-rule-type-http-log-blocks`]},l4:{log_all:n[`settings-by-rule-type-l4-log-all`],log_blocks:n[`settings-by-rule-type-l4-log-blocks`]}}});o(await c(`Updating`,async()=>i.zeroTrust.gateway.logging.update({body:u,account_id:l})),{successLabel:`Updated`})})},Wu={command:`logging`,describe:`Operations for gateway.logging`,builder:e=>e.command(Vu).command(Uu).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gu(e){return e.usage(`$0 zero-trust gateway operations get <operation-id>
563
+
564
+ 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 Ku={command:`get <operation-id>`,describe:`Zero Trust Gateway operation details`,builder:Gu,handler:async n=>l({command:`zero-trust gateway operations get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/operations/${n[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(n[`operation-id`]))}`,pathParams:{"operation-id":String(n[`operation-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.get({account_id:l,operation_id:n[`operation-id`]})),{successLabel:`Loaded`})})};function qu(e){return e.usage(`$0 zero-trust gateway operations list
565
+
566
+ 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 Ju={command:`list`,describe:`List Zero Trust Gateway operations`,builder:qu,handler:async n=>l({command:`zero-trust gateway operations list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/operations`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.operations.list({account_id:l})),{successLabel:`Loaded`})})},Yu={command:`operations`,describe:`Operations for gateway.operations`,builder:e=>e.command(Ku).command(Ju).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Xu(e){return e.usage(`$0 zero-trust gateway pacfiles create
567
+
568
+ 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 Zu={command:`create`,describe:`Create a PAC file`,builder:Xu,handler:async n=>l({command:`zero-trust gateway pacfiles create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway pacfiles create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/pacfiles`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({contents:m(n.contents,`contents`,`text`),description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),slug:m(n.slug,`slug`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...e,account_id:l})),{successLabel:`Created`});return}n.contents===void 0&&(n.contents=await g(`contents`,`Actual contents of the PAC file`)),n.name===void 0&&(n.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(n.contents,`contents`,`text`),description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`),slug:m(n.slug,`slug`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.pacfiles.create({...u,account_id:l})),{successLabel:`Created`})})};function Qu(e){return e.usage(`$0 zero-trust gateway pacfiles delete <pacfile-id>
569
+
570
+ 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 $u={command:`delete <pacfile-id>`,describe:`Delete a PAC file`,builder:Qu,handler:async n=>l({command:`zero-trust gateway pacfiles delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway pacfiles delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/pacfiles/${n[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(n[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(n[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
571
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.pacfiles.delete({account_id:l,pacfile_id:n[`pacfile-id`]})),{successLabel:`Deleted`})})};function ed(e){return e.usage(`$0 zero-trust gateway pacfiles get <pacfile-id>
572
+
573
+ 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 td={command:`get <pacfile-id>`,describe:`Get a PAC file`,builder:ed,handler:async n=>l({command:`zero-trust gateway pacfiles get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway pacfiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/pacfiles/${n[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(n[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(n[`pacfile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.pacfiles.get({account_id:l,pacfile_id:n[`pacfile-id`]})),{successLabel:`Loaded`})})};function nd(e){return e.usage(`$0 zero-trust gateway pacfiles list
574
+
575
+ 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 rd={command:`list`,describe:`List PAC files`,builder:nd,handler:async n=>l({command:`zero-trust gateway pacfiles list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust gateway pacfiles list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/pacfiles`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.pacfiles.list({account_id:u,...i})),{successLabel:`Loaded`})})};function id(e){return e.usage(`$0 zero-trust gateway pacfiles update <pacfile-id>
576
+
577
+ 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 ad={command:`update <pacfile-id>`,describe:`Update a Zero Trust Gateway PAC file`,builder:id,handler:async n=>l({command:`zero-trust gateway pacfiles update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway pacfiles update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/pacfiles/${n[`pacfile-id`]==null?`<pacfile-id>`:encodeURIComponent(String(n[`pacfile-id`]))}`,pathParams:{"pacfile-id":String(n[`pacfile-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({contents:m(n.contents,`contents`,`text`),description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...e,account_id:l,pacfile_id:n[`pacfile-id`]})),{successLabel:`Updated`});return}n.contents===void 0&&(n.contents=await g(`contents`,`Actual contents of the PAC file`)),n.description===void 0&&(n.description=await g(`description`,`Detailed description of the PAC file.`)),n.name===void 0&&(n.name=await g(`name`,`Name of the PAC file.`));let u=p({contents:m(n.contents,`contents`,`text`),description:m(n.description,`description`,`text`),name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.pacfiles.update({...u,account_id:l,pacfile_id:n[`pacfile-id`]})),{successLabel:`Updated`})})},od={command:`pacfiles`,describe:`Operations for gateway.pacfiles`,builder:e=>e.command(Zu).command($u).command(td).command(rd).command(ad).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sd(e){return e.usage(`$0 zero-trust gateway proxy-endpoints create
578
+
579
+ Create a new Zero Trust Gateway proxy endpoint.`).option(`kind`,{type:`string`,description:`The proxy endpoint kind.`,choices:[`ip`,`identity`],default:`ip`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const cd={command:`create`,describe:`Create a proxy endpoint`,builder:sd,handler:async n=>l({command:`zero-trust gateway proxy-endpoints create`,classification:{safeFlags:[`kind`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway proxy-endpoints create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({kind:m(n.kind,`kind`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:e,account_id:l})),{successLabel:`Created`});return}n.kind===`identity`&&n.kind===void 0&&(n.kind=await g(`kind`,`The proxy endpoint kind.`,{question:`Enter value for --kind`}));let u=p({kind:m(n.kind,`kind`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.proxyEndpoints.create({body:u,account_id:l})),{successLabel:`Created`})})};function ld(e){return e.usage(`$0 zero-trust gateway proxy-endpoints delete <proxy-endpoint-id>
580
+
581
+ 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 ud={command:`delete <proxy-endpoint-id>`,describe:`Delete a proxy endpoint`,builder:ld,handler:async n=>l({command:`zero-trust gateway proxy-endpoints delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway proxy-endpoints delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/proxy_endpoints/${n[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(n[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(n[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
582
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.proxyEndpoints.delete({account_id:l,proxy_endpoint_id:n[`proxy-endpoint-id`]})),{successLabel:`Deleted`})})};function dd(e){return e.usage(`$0 zero-trust gateway proxy-endpoints edit <proxy-endpoint-id>
583
+
584
+ 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 fd={command:`edit <proxy-endpoint-id>`,describe:`Update a proxy endpoint`,builder:dd,handler:async n=>l({command:`zero-trust gateway proxy-endpoints edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway proxy-endpoints edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/proxy_endpoints/${n[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(n[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(n[`proxy-endpoint-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({ips:n.ips,name:m(n.name,`name`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...e,account_id:l,proxy_endpoint_id:n[`proxy-endpoint-id`]})),{successLabel:`Updated`});return}let u=p({ips:n.ips,name:m(n.name,`name`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.proxyEndpoints.edit({...u,account_id:l,proxy_endpoint_id:n[`proxy-endpoint-id`]})),{successLabel:`Updated`})})};function pd(e){return e.usage(`$0 zero-trust gateway proxy-endpoints get <proxy-endpoint-id>
585
+
586
+ 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 md={command:`get <proxy-endpoint-id>`,describe:`Get a proxy endpoint`,builder:pd,handler:async n=>l({command:`zero-trust gateway proxy-endpoints get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway proxy-endpoints get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/proxy_endpoints/${n[`proxy-endpoint-id`]==null?`<proxy-endpoint-id>`:encodeURIComponent(String(n[`proxy-endpoint-id`]))}`,pathParams:{"proxy-endpoint-id":String(n[`proxy-endpoint-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.proxyEndpoints.get({account_id:l,proxy_endpoint_id:n[`proxy-endpoint-id`]})),{successLabel:`Loaded`})})};function hd(e){return e.usage(`$0 zero-trust gateway proxy-endpoints list
587
+
588
+ 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 gd={command:`list`,describe:`List proxy endpoints`,builder:y(hd),handler:async n=>l({command:`zero-trust gateway proxy-endpoints list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},n,async()=>{let i={filter:n.filter,search:n.search,order_by:n[`order-by`],direction:n.direction};if(n.dryRun){s({command:`cf zero-trust gateway proxy-endpoints list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/proxy_endpoints`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.proxyEndpoints.list({account_id:u,...i})),{successLabel:`Loaded`})})},_d={command:`proxy-endpoints`,describe:`Operations for gateway.proxy-endpoints`,builder:e=>e.command(cd).command(ud).command(fd).command(md).command(gd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vd(e){return e.usage(`$0 zero-trust gateway rules bulk-edit
589
+
590
+ 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 yd={command:`bulk-edit`,describe:`Patch multiple Zero Trust Gateway rules`,builder:vd,handler:async n=>l({command:`zero-trust gateway rules bulk-edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.bulkEdit({body:e,account_id:l})),{successLabel:`Updated`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function bd(e){return e.usage(`$0 zero-trust gateway rules create
591
+
592
+ Create a new Zero Trust Gateway rule.`).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`device-posture`,{type:`string`,description:`Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`,default:!1}).option(`expiration-duration`,{type:`number`,description:"Defines the default duration a policy active in minutes. Must set in order to use the `reset_expiration` endpoint on this rule."}).option(`filters`,{type:`string`,array:!0,description:`Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.`}).option(`identity`,{type:`string`,description:`Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).option(`rule-settings-allow-child-bypass`,{type:`boolean`,description:`Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.`}).option(`rule-settings-audit-ssh-command-logging`,{type:`boolean`,description:`Enable SSH command logging.`}).option(`rule-settings-biso-admin-controls-copy`,{type:`string`,description:`Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dcp`,{type:`boolean`,description:'Set to false to enable copy-pasting. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dd`,{type:`boolean`,description:'Set to false to enable downloading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dk`,{type:`boolean`,description:'Set to false to enable keyboard usage. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-download`,{type:`string`,description:`Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dp`,{type:`boolean`,description:'Set to false to enable printing. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-du`,{type:`boolean`,description:'Set to false to enable uploading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-keyboard`,{type:`string`,description:`Configure keyboard usage behavior. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-paste`,{type:`string`,description:`Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-printing`,{type:`string`,description:`Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-upload`,{type:`string`,description:`Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).option(`rule-settings-biso-admin-controls-wm-id`,{type:`string`,description:`Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.`}).option(`rule-settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-block-page-enabled`,{type:`boolean`,description:"Enable the custom block page. Settable only for `dns` rules with action `block`."}).option(`rule-settings-block-reason`,{type:`string`,description:"Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for `dns`, `l4`, and `http` rules when the action set to `block`."}).option(`rule-settings-bypass-parent-rule`,{type:`boolean`,description:`Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.`}).option(`rule-settings-check-session-duration`,{type:`string`,description:`Sets the required session freshness threshold. The API returns a normalized version of this value.`}).option(`rule-settings-check-session-enforce`,{type:`boolean`,description:`Enable session enforcement.`}).option(`rule-settings-delete-headers`,{type:`string`,array:!0,description:"Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for `http` rules with the action set to `allow`."}).option(`rule-settings-egress-ipv4`,{type:`string`,description:`Specify the IPv4 address to use for egress.`}).option(`rule-settings-egress-ipv4-fallback`,{type:`string`,description:`Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.`}).option(`rule-settings-egress-ipv6`,{type:`string`,description:`Specify the IPv6 range to use for egress.`}).option(`rule-settings-forensic-copy-enabled`,{type:`boolean`,description:`Enable sending the copy to storage.`}).option(`rule-settings-ignore-cname-category-matches`,{type:`boolean`,description:"Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-insecure-disable-dnssec-validation`,{type:`boolean`,description:"Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for `dns` rules."}).option(`rule-settings-ip-categories`,{type:`boolean`,description:"Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-ip-indicator-feeds`,{type:`boolean`,description:"Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-l4override-ip`,{type:`string`,description:`Defines the IPv4 or IPv6 address.`}).option(`rule-settings-l4override-port`,{type:`number`,description:`Defines a port number to use for TCP/UDP overrides.`}).option(`rule-settings-notification-settings-enabled`,{type:`boolean`,description:`Enable notification.`}).option(`rule-settings-notification-settings-include-context`,{type:`boolean`,description:`Indicates whether to pass the context information as query parameters.`}).option(`rule-settings-notification-settings-msg`,{type:`string`,description:`Customize the message shown in the notification.`}).option(`rule-settings-notification-settings-support-url`,{type:`string`,description:`Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.`}).option(`rule-settings-override-host`,{type:`string`,description:"Defines a hostname for override, for the matching DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-override-ips`,{type:`string`,array:!0,description:"Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-payload-log-enabled`,{type:`boolean`,description:`Enable DLP payload logging for this rule.`}).option(`rule-settings-quarantine-file-types`,{type:`string`,array:!0,description:`Specify the types of files to sandbox.`}).option(`rule-settings-redirect-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-redirect-preserve-path-and-query`,{type:`boolean`,description:`Specify whether to append the path and query parameters from the original request to target_uri.`}).option(`rule-settings-redirect-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-resolve-dns-internally-fallback`,{type:`string`,description:`Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.`,choices:[`none`,`public_dns`]}).option(`rule-settings-resolve-dns-internally-view-id`,{type:`string`,description:`Specify the internal DNS view identifier to pass to the internal DNS service.`}).option(`rule-settings-resolve-dns-through-cloudflare`,{type:`boolean`,description:"Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for `dns_resolver` rules."}).option(`rule-settings-untrusted-cert-action`,{type:`string`,description:`Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.`,choices:[`pass_through`,`block`,`error`]}).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`,default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if(`rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const xd={command:`create`,describe:`Create a Zero Trust Gateway rule`,builder:bd,handler:async n=>l({command:`zero-trust gateway rules create`,classification:{safeFlags:`action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({action:m(n.action,`action`,`text`),description:m(n.description,`description`,`text`),device_posture:m(n[`device-posture`],`device-posture`,`text`),enabled:n.enabled,expiration:{duration:n[`expiration-duration`]},filters:n.filters,identity:m(n.identity,`identity`,`text`),name:m(n.name,`name`,`text`),precedence:n.precedence,rule_settings:{allow_child_bypass:n[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:n[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(n[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:n[`rule-settings-biso-admin-controls-dcp`],dd:n[`rule-settings-biso-admin-controls-dd`],dk:n[`rule-settings-biso-admin-controls-dk`],download:m(n[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:n[`rule-settings-biso-admin-controls-dp`],du:n[`rule-settings-biso-admin-controls-du`],keyboard:m(n[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(n[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(n[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(n[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(n[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(n[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:n[`rule-settings-block-page-include-context`],target_uri:m(n[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:n[`rule-settings-block-page-enabled`],block_reason:m(n[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:n[`rule-settings-bypass-parent-rule`],check_session:{duration:m(n[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:n[`rule-settings-check-session-enforce`]},delete_headers:n[`rule-settings-delete-headers`],egress:{ipv4:m(n[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(n[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(n[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:n[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:n[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:n[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:n[`rule-settings-ip-categories`],ip_indicator_feeds:n[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(n[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:n[`rule-settings-l4override-port`]},notification_settings:{enabled:n[`rule-settings-notification-settings-enabled`],include_context:n[`rule-settings-notification-settings-include-context`],msg:m(n[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(n[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(n[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:n[`rule-settings-override-ips`],payload_log:{enabled:n[`rule-settings-payload-log-enabled`]},quarantine:{file_types:n[`rule-settings-quarantine-file-types`]},redirect:{include_context:n[`rule-settings-redirect-include-context`],preserve_path_and_query:n[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(n[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(n[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(n[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:n[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(n[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(n[`schedule-fri`],`schedule-fri`,`text`),mon:m(n[`schedule-mon`],`schedule-mon`,`text`),sat:m(n[`schedule-sat`],`schedule-sat`,`text`),sun:m(n[`schedule-sun`],`schedule-sun`,`text`),thu:m(n[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(n[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(n[`schedule-tue`],`schedule-tue`,`text`),wed:m(n[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(n.traffic,`traffic`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...e,account_id:l})),{successLabel:`Created`});return}n.action===void 0&&(n.action=await _(`action`,"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`])),n.name===void 0&&(n.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(n.action,`action`,`text`),description:m(n.description,`description`,`text`),device_posture:m(n[`device-posture`],`device-posture`,`text`),enabled:n.enabled,expiration:{duration:n[`expiration-duration`]},filters:n.filters,identity:m(n.identity,`identity`,`text`),name:m(n.name,`name`,`text`),precedence:n.precedence,rule_settings:{allow_child_bypass:n[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:n[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(n[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:n[`rule-settings-biso-admin-controls-dcp`],dd:n[`rule-settings-biso-admin-controls-dd`],dk:n[`rule-settings-biso-admin-controls-dk`],download:m(n[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:n[`rule-settings-biso-admin-controls-dp`],du:n[`rule-settings-biso-admin-controls-du`],keyboard:m(n[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(n[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(n[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(n[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(n[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(n[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:n[`rule-settings-block-page-include-context`],target_uri:m(n[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:n[`rule-settings-block-page-enabled`],block_reason:m(n[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:n[`rule-settings-bypass-parent-rule`],check_session:{duration:m(n[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:n[`rule-settings-check-session-enforce`]},delete_headers:n[`rule-settings-delete-headers`],egress:{ipv4:m(n[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(n[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(n[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:n[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:n[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:n[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:n[`rule-settings-ip-categories`],ip_indicator_feeds:n[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(n[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:n[`rule-settings-l4override-port`]},notification_settings:{enabled:n[`rule-settings-notification-settings-enabled`],include_context:n[`rule-settings-notification-settings-include-context`],msg:m(n[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(n[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(n[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:n[`rule-settings-override-ips`],payload_log:{enabled:n[`rule-settings-payload-log-enabled`]},quarantine:{file_types:n[`rule-settings-quarantine-file-types`]},redirect:{include_context:n[`rule-settings-redirect-include-context`],preserve_path_and_query:n[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(n[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(n[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(n[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:n[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(n[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(n[`schedule-fri`],`schedule-fri`,`text`),mon:m(n[`schedule-mon`],`schedule-mon`,`text`),sat:m(n[`schedule-sat`],`schedule-sat`,`text`),sun:m(n[`schedule-sun`],`schedule-sun`,`text`),thu:m(n[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(n[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(n[`schedule-tue`],`schedule-tue`,`text`),wed:m(n[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(n.traffic,`traffic`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.create({...u,account_id:l})),{successLabel:`Created`})})};function Sd(e){return e.usage(`$0 zero-trust gateway rules delete <rule-id>
593
+
594
+ 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 Cd={command:`delete <rule-id>`,describe:`Delete a Zero Trust Gateway rule`,builder:Sd,handler:async n=>l({command:`zero-trust gateway rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
595
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.gateway.rules.delete({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Deleted`})})};function wd(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 Td={command:`edit <rule-id>`,describe:`Patch a Zero Trust Gateway rule`,builder:wd,handler:async n=>l({command:`zero-trust gateway rules edit`,classification:{safeFlags:[`enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),precedence:n.precedence}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...e,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}let u=p({description:m(n.description,`description`,`text`),enabled:n.enabled,name:m(n.name,`name`,`text`),precedence:n.precedence});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.edit({...u,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`})})};function Ed(e){return e.usage(`$0 zero-trust gateway rules get <rule-id>
596
+
597
+ 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 Dd={command:`get <rule-id>`,describe:`Get Zero Trust Gateway rule details.`,builder:Ed,handler:async n=>l({command:`zero-trust gateway rules get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.get({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Loaded`})})};function Od(e){return e.usage(`$0 zero-trust gateway rules list-tenant
598
+
599
+ 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 kd={command:`list-tenant`,describe:`List Zero Trust Gateway rules inherited from the parent account`,builder:Od,handler:async n=>l({command:`zero-trust gateway rules list-tenant`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules list-tenant`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/tenant`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.gateway.rules.listTenant({account_id:l})),{successLabel:`Loaded`})})};function Ad(e){return e.usage(`$0 zero-trust gateway rules list
600
+
601
+ 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 jd={command:`list`,describe:`List Zero Trust Gateway rules`,builder:y(Ad),handler:async n=>l({command:`zero-trust gateway rules list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},n,async()=>{let i={filter:n.filter,search:n.search,order_by:n[`order-by`],direction:n.direction};if(n.dryRun){s({command:`cf zero-trust gateway rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.gateway.rules.list({account_id:u,...i})),{successLabel:`Loaded`})})};function Md(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 Nd={command:`reset-expiration <rule-id>`,describe:`Reset the expiration of a Zero Trust Gateway Rule`,builder:Md,handler:async n=>l({command:`zero-trust gateway rules reset-expiration`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules reset-expiration`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}/reset_expiration`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.gateway.rules.resetExpiration({account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Created`})})};function Pd(e){return e.usage(`$0 zero-trust gateway rules update <rule-id>
602
+
603
+ Update a configured Zero Trust Gateway rule.`).positional(`rule-id`,{type:`string`,description:`Identify the API resource with a UUID.`,demandOption:!0}).option(`action`,{type:`string`,description:"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",choices:[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`]}).option(`description`,{type:`string`,description:`Specify the rule description.`}).option(`device-posture`,{type:`string`,description:`Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`enabled`,{type:`boolean`,description:`Specify whether the rule is enabled.`}).option(`expiration-duration`,{type:`number`,description:"Defines the default duration a policy active in minutes. Must set in order to use the `reset_expiration` endpoint on this rule."}).option(`filters`,{type:`string`,array:!0,description:`Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.`}).option(`identity`,{type:`string`,description:`Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`name`,{type:`string`,description:`Specify the rule name.`}).option(`precedence`,{type:`number`,description:`Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) to manage precedence via Terraform.`}).option(`rule-settings-allow-child-bypass`,{type:`boolean`,description:`Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.`}).option(`rule-settings-audit-ssh-command-logging`,{type:`boolean`,description:`Enable SSH command logging.`}).option(`rule-settings-biso-admin-controls-copy`,{type:`string`,description:`Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dcp`,{type:`boolean`,description:'Set to false to enable copy-pasting. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dd`,{type:`boolean`,description:'Set to false to enable downloading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-dk`,{type:`boolean`,description:'Set to false to enable keyboard usage. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-download`,{type:`string`,description:`Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-dp`,{type:`boolean`,description:'Set to false to enable printing. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-du`,{type:`boolean`,description:'Set to false to enable uploading. Only applies when `version == "v1"`.'}).option(`rule-settings-biso-admin-controls-keyboard`,{type:`string`,description:`Configure keyboard usage behavior. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-paste`,{type:`string`,description:`Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`,`remote_only`]}).option(`rule-settings-biso-admin-controls-printing`,{type:`string`,description:`Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-upload`,{type:`string`,description:`Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".`,choices:[`enabled`,`disabled`]}).option(`rule-settings-biso-admin-controls-version`,{type:`string`,description:`Indicate which version of the browser isolation controls should apply.`,choices:[`v1`,`v2`]}).option(`rule-settings-biso-admin-controls-wm-id`,{type:`string`,description:`Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.`}).option(`rule-settings-block-page-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-block-page-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-block-page-enabled`,{type:`boolean`,description:"Enable the custom block page. Settable only for `dns` rules with action `block`."}).option(`rule-settings-block-reason`,{type:`string`,description:"Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for `dns`, `l4`, and `http` rules when the action set to `block`."}).option(`rule-settings-bypass-parent-rule`,{type:`boolean`,description:`Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.`}).option(`rule-settings-check-session-duration`,{type:`string`,description:`Sets the required session freshness threshold. The API returns a normalized version of this value.`}).option(`rule-settings-check-session-enforce`,{type:`boolean`,description:`Enable session enforcement.`}).option(`rule-settings-delete-headers`,{type:`string`,array:!0,description:"Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for `http` rules with the action set to `allow`."}).option(`rule-settings-egress-ipv4`,{type:`string`,description:`Specify the IPv4 address to use for egress.`}).option(`rule-settings-egress-ipv4-fallback`,{type:`string`,description:`Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.`}).option(`rule-settings-egress-ipv6`,{type:`string`,description:`Specify the IPv6 range to use for egress.`}).option(`rule-settings-forensic-copy-enabled`,{type:`boolean`,description:`Enable sending the copy to storage.`}).option(`rule-settings-ignore-cname-category-matches`,{type:`boolean`,description:"Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-insecure-disable-dnssec-validation`,{type:`boolean`,description:"Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for `dns` rules."}).option(`rule-settings-ip-categories`,{type:`boolean`,description:"Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-ip-indicator-feeds`,{type:`boolean`,description:"Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for `dns` and `dns_resolver` rules."}).option(`rule-settings-l4override-ip`,{type:`string`,description:`Defines the IPv4 or IPv6 address.`}).option(`rule-settings-l4override-port`,{type:`number`,description:`Defines a port number to use for TCP/UDP overrides.`}).option(`rule-settings-notification-settings-enabled`,{type:`boolean`,description:`Enable notification.`}).option(`rule-settings-notification-settings-include-context`,{type:`boolean`,description:`Indicates whether to pass the context information as query parameters.`}).option(`rule-settings-notification-settings-msg`,{type:`string`,description:`Customize the message shown in the notification.`}).option(`rule-settings-notification-settings-support-url`,{type:`string`,description:`Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.`}).option(`rule-settings-override-host`,{type:`string`,description:"Defines a hostname for override, for the matching DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-override-ips`,{type:`string`,array:!0,description:"Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for `dns` rules with the action set to `override`."}).option(`rule-settings-payload-log-enabled`,{type:`boolean`,description:`Enable DLP payload logging for this rule.`}).option(`rule-settings-quarantine-file-types`,{type:`string`,array:!0,description:`Specify the types of files to sandbox.`}).option(`rule-settings-redirect-include-context`,{type:`boolean`,description:`Specify whether to pass the context information as query parameters.`}).option(`rule-settings-redirect-preserve-path-and-query`,{type:`boolean`,description:`Specify whether to append the path and query parameters from the original request to target_uri.`}).option(`rule-settings-redirect-target-uri`,{type:`string`,description:`Specify the URI to which the user is redirected.`}).option(`rule-settings-resolve-dns-internally-fallback`,{type:`string`,description:`Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.`,choices:[`none`,`public_dns`]}).option(`rule-settings-resolve-dns-internally-view-id`,{type:`string`,description:`Specify the internal DNS view identifier to pass to the internal DNS service.`}).option(`rule-settings-resolve-dns-through-cloudflare`,{type:`boolean`,description:"Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for `dns_resolver` rules."}).option(`rule-settings-untrusted-cert-action`,{type:`string`,description:`Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.`,choices:[`pass_through`,`block`,`error`]}).option(`schedule-fri`,{type:`string`,description:`Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-mon`,{type:`string`,description:`Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sat`,{type:`string`,description:`Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-sun`,{type:`string`,description:`Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-thu`,{type:`string`,description:`Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-time-zone`,{type:`string`,description:`Specify the time zone for rule evaluation. When a [valid time zone city name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.`}).option(`schedule-tue`,{type:`string`,description:`Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`schedule-wed`,{type:`string`,description:`Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.`}).option(`traffic`,{type:`string`,description:`Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if(`rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-biso-admin-controls-wm-id.rule-settings-block-page-include-context.rule-settings-block-page-target-uri.rule-settings-block-page-enabled.rule-settings-block-reason.rule-settings-bypass-parent-rule.rule-settings-check-session-duration.rule-settings-check-session-enforce.rule-settings-delete-headers.rule-settings-egress-ipv4.rule-settings-egress-ipv4-fallback.rule-settings-egress-ipv6.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-l4override-ip.rule-settings-l4override-port.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-notification-settings-msg.rule-settings-notification-settings-support-url.rule-settings-override-host.rule-settings-override-ips.rule-settings-payload-log-enabled.rule-settings-quarantine-file-types.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-redirect-target-uri.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-internally-view-id.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action`.split(`.`).some(t=>e[t]!==void 0)){let t=[`rule-settings-block-page-target-uri`,`rule-settings-redirect-target-uri`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --rule_settings-* flag is set`)}return!0})}const Fd={command:`update <rule-id>`,describe:`Update a Zero Trust Gateway rule`,builder:Pd,handler:async n=>l({command:`zero-trust gateway rules update`,classification:{safeFlags:`action.enabled.rule-settings-allow-child-bypass.rule-settings-audit-ssh-command-logging.rule-settings-biso-admin-controls-copy.rule-settings-biso-admin-controls-dcp.rule-settings-biso-admin-controls-dd.rule-settings-biso-admin-controls-dk.rule-settings-biso-admin-controls-download.rule-settings-biso-admin-controls-dp.rule-settings-biso-admin-controls-du.rule-settings-biso-admin-controls-keyboard.rule-settings-biso-admin-controls-paste.rule-settings-biso-admin-controls-printing.rule-settings-biso-admin-controls-upload.rule-settings-biso-admin-controls-version.rule-settings-block-page-include-context.rule-settings-block-page-enabled.rule-settings-bypass-parent-rule.rule-settings-check-session-enforce.rule-settings-forensic-copy-enabled.rule-settings-ignore-cname-category-matches.rule-settings-insecure-disable-dnssec-validation.rule-settings-ip-categories.rule-settings-ip-indicator-feeds.rule-settings-notification-settings-enabled.rule-settings-notification-settings-include-context.rule-settings-payload-log-enabled.rule-settings-redirect-include-context.rule-settings-redirect-preserve-path-and-query.rule-settings-resolve-dns-internally-fallback.rule-settings-resolve-dns-through-cloudflare.rule-settings-untrusted-cert-action.dry-run`.split(`.`)}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust gateway rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/gateway/rules/${n[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(n[`rule-id`]))}`,pathParams:{"rule-id":String(n[`rule-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({action:m(n.action,`action`,`text`),description:m(n.description,`description`,`text`),device_posture:m(n[`device-posture`],`device-posture`,`text`),enabled:n.enabled,expiration:{duration:n[`expiration-duration`]},filters:n.filters,identity:m(n.identity,`identity`,`text`),name:m(n.name,`name`,`text`),precedence:n.precedence,rule_settings:{allow_child_bypass:n[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:n[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(n[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:n[`rule-settings-biso-admin-controls-dcp`],dd:n[`rule-settings-biso-admin-controls-dd`],dk:n[`rule-settings-biso-admin-controls-dk`],download:m(n[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:n[`rule-settings-biso-admin-controls-dp`],du:n[`rule-settings-biso-admin-controls-du`],keyboard:m(n[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(n[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(n[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(n[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(n[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(n[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:n[`rule-settings-block-page-include-context`],target_uri:m(n[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:n[`rule-settings-block-page-enabled`],block_reason:m(n[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:n[`rule-settings-bypass-parent-rule`],check_session:{duration:m(n[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:n[`rule-settings-check-session-enforce`]},delete_headers:n[`rule-settings-delete-headers`],egress:{ipv4:m(n[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(n[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(n[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:n[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:n[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:n[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:n[`rule-settings-ip-categories`],ip_indicator_feeds:n[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(n[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:n[`rule-settings-l4override-port`]},notification_settings:{enabled:n[`rule-settings-notification-settings-enabled`],include_context:n[`rule-settings-notification-settings-include-context`],msg:m(n[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(n[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(n[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:n[`rule-settings-override-ips`],payload_log:{enabled:n[`rule-settings-payload-log-enabled`]},quarantine:{file_types:n[`rule-settings-quarantine-file-types`]},redirect:{include_context:n[`rule-settings-redirect-include-context`],preserve_path_and_query:n[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(n[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(n[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(n[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:n[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(n[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(n[`schedule-fri`],`schedule-fri`,`text`),mon:m(n[`schedule-mon`],`schedule-mon`,`text`),sat:m(n[`schedule-sat`],`schedule-sat`,`text`),sun:m(n[`schedule-sun`],`schedule-sun`,`text`),thu:m(n[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(n[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(n[`schedule-tue`],`schedule-tue`,`text`),wed:m(n[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(n.traffic,`traffic`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...e,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`});return}n.action===void 0&&(n.action=await _(`action`,"Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to `true`.",[`on`,`off`,`allow`,`block`,`scan`,`noscan`,`safesearch`,`ytrestricted`,`isolate`,`noisolate`,`override`,`l4_override`,`egress`,`resolve`,`quarantine`,`redirect`])),n.name===void 0&&(n.name=await g(`name`,`Specify the rule name.`));let u=p({action:m(n.action,`action`,`text`),description:m(n.description,`description`,`text`),device_posture:m(n[`device-posture`],`device-posture`,`text`),enabled:n.enabled,expiration:{duration:n[`expiration-duration`]},filters:n.filters,identity:m(n.identity,`identity`,`text`),name:m(n.name,`name`,`text`),precedence:n.precedence,rule_settings:{allow_child_bypass:n[`rule-settings-allow-child-bypass`],audit_ssh:{command_logging:n[`rule-settings-audit-ssh-command-logging`]},biso_admin_controls:{copy:m(n[`rule-settings-biso-admin-controls-copy`],`rule-settings-biso-admin-controls-copy`,`text`),dcp:n[`rule-settings-biso-admin-controls-dcp`],dd:n[`rule-settings-biso-admin-controls-dd`],dk:n[`rule-settings-biso-admin-controls-dk`],download:m(n[`rule-settings-biso-admin-controls-download`],`rule-settings-biso-admin-controls-download`,`text`),dp:n[`rule-settings-biso-admin-controls-dp`],du:n[`rule-settings-biso-admin-controls-du`],keyboard:m(n[`rule-settings-biso-admin-controls-keyboard`],`rule-settings-biso-admin-controls-keyboard`,`text`),paste:m(n[`rule-settings-biso-admin-controls-paste`],`rule-settings-biso-admin-controls-paste`,`text`),printing:m(n[`rule-settings-biso-admin-controls-printing`],`rule-settings-biso-admin-controls-printing`,`text`),upload:m(n[`rule-settings-biso-admin-controls-upload`],`rule-settings-biso-admin-controls-upload`,`text`),version:m(n[`rule-settings-biso-admin-controls-version`],`rule-settings-biso-admin-controls-version`,`text`),wm_id:m(n[`rule-settings-biso-admin-controls-wm-id`],`rule-settings-biso-admin-controls-wm-id`,`text`)},block_page:{include_context:n[`rule-settings-block-page-include-context`],target_uri:m(n[`rule-settings-block-page-target-uri`],`rule-settings-block-page-target-uri`,`text`)},block_page_enabled:n[`rule-settings-block-page-enabled`],block_reason:m(n[`rule-settings-block-reason`],`rule-settings-block-reason`,`text`),bypass_parent_rule:n[`rule-settings-bypass-parent-rule`],check_session:{duration:m(n[`rule-settings-check-session-duration`],`rule-settings-check-session-duration`,`text`),enforce:n[`rule-settings-check-session-enforce`]},delete_headers:n[`rule-settings-delete-headers`],egress:{ipv4:m(n[`rule-settings-egress-ipv4`],`rule-settings-egress-ipv4`,`text`),ipv4_fallback:m(n[`rule-settings-egress-ipv4-fallback`],`rule-settings-egress-ipv4-fallback`,`text`),ipv6:m(n[`rule-settings-egress-ipv6`],`rule-settings-egress-ipv6`,`text`)},forensic_copy:{enabled:n[`rule-settings-forensic-copy-enabled`]},ignore_cname_category_matches:n[`rule-settings-ignore-cname-category-matches`],insecure_disable_dnssec_validation:n[`rule-settings-insecure-disable-dnssec-validation`],ip_categories:n[`rule-settings-ip-categories`],ip_indicator_feeds:n[`rule-settings-ip-indicator-feeds`],l4override:{ip:m(n[`rule-settings-l4override-ip`],`rule-settings-l4override-ip`,`text`),port:n[`rule-settings-l4override-port`]},notification_settings:{enabled:n[`rule-settings-notification-settings-enabled`],include_context:n[`rule-settings-notification-settings-include-context`],msg:m(n[`rule-settings-notification-settings-msg`],`rule-settings-notification-settings-msg`,`text`),support_url:m(n[`rule-settings-notification-settings-support-url`],`rule-settings-notification-settings-support-url`,`text`)},override_host:m(n[`rule-settings-override-host`],`rule-settings-override-host`,`text`),override_ips:n[`rule-settings-override-ips`],payload_log:{enabled:n[`rule-settings-payload-log-enabled`]},quarantine:{file_types:n[`rule-settings-quarantine-file-types`]},redirect:{include_context:n[`rule-settings-redirect-include-context`],preserve_path_and_query:n[`rule-settings-redirect-preserve-path-and-query`],target_uri:m(n[`rule-settings-redirect-target-uri`],`rule-settings-redirect-target-uri`,`text`)},resolve_dns_internally:{fallback:m(n[`rule-settings-resolve-dns-internally-fallback`],`rule-settings-resolve-dns-internally-fallback`,`text`),view_id:m(n[`rule-settings-resolve-dns-internally-view-id`],`rule-settings-resolve-dns-internally-view-id`,`text`)},resolve_dns_through_cloudflare:n[`rule-settings-resolve-dns-through-cloudflare`],untrusted_cert:{action:m(n[`rule-settings-untrusted-cert-action`],`rule-settings-untrusted-cert-action`,`text`)}},schedule:{fri:m(n[`schedule-fri`],`schedule-fri`,`text`),mon:m(n[`schedule-mon`],`schedule-mon`,`text`),sat:m(n[`schedule-sat`],`schedule-sat`,`text`),sun:m(n[`schedule-sun`],`schedule-sun`,`text`),thu:m(n[`schedule-thu`],`schedule-thu`,`text`),time_zone:m(n[`schedule-time-zone`],`schedule-time-zone`,`text`),tue:m(n[`schedule-tue`],`schedule-tue`,`text`),wed:m(n[`schedule-wed`],`schedule-wed`,`text`)},traffic:m(n.traffic,`traffic`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.gateway.rules.update({...u,account_id:l,rule_id:n[`rule-id`]})),{successLabel:`Updated`})})},Id={command:`rules`,describe:`Operations for gateway.rules`,builder:e=>e.command(yd).command(xd).command(Cd).command(Td).command(Dd).command(jd).command(kd).command(Nd).command(Fd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ld={command:`gateway`,describe:`Operations for gateway`,builder:e=>e.command(nu).command(uu).command(wl).command(jl).command(Pl).command(ql).command(eu).command(au).command(cu).command(Ou).command(zu).command(Wu).command(Yu).command(od).command(_d).command(Id).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Rd(e){return e.usage(`$0 zero-trust identity-providers create
604
+
605
+ 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 zd={command:`create`,describe:`Add an Access identity provider`,builder:Rd,handler:async i=>l({command:`zero-trust identity-providers create`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.identityProviders.create({body:e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Bd(e){return e.usage(`$0 zero-trust identity-providers delete <identity-provider-id>
606
+
607
+ 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 Vd={command:`delete <identity-provider-id>`,describe:`Delete an Access identity provider`,builder:Bd,handler:async i=>l({command:`zero-trust identity-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=d:i.accountId=d,!await v({force:!!i.force})){process.stderr.write(`Aborted.
608
+ `);return}o(await c(`Deleting`,async()=>l.zeroTrust.identityProviders.delete({account_or_zone:u,account_or_zone_id:d,identity_provider_id:i[`identity-provider-id`]})),{successLabel:`Deleted`})})};function Hd(e){return e.usage(`$0 zero-trust identity-providers get <identity-provider-id>
609
+
610
+ 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 Ud={command:`get <identity-provider-id>`,describe:`Get an Access identity provider`,builder:Hd,handler:async i=>l({command:`zero-trust identity-providers get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.get({account_or_zone:u,account_or_zone_id:d,identity_provider_id:i[`identity-provider-id`]})),{successLabel:`Loaded`})})};function Wd(e){return e.usage(`$0 zero-trust identity-providers list
611
+
612
+ 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 Gd={command:`list`,describe:`List Access identity providers`,builder:Wd,handler:async i=>l({command:`zero-trust identity-providers list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={scim_enabled:i[`scim-enabled`],page:i.page,per_page:i[`per-page`]};if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await n({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await r();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.zeroTrust.identityProviders.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function Kd(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 qd={command:`create <identity-provider-id>`,describe:`Create SAML encryption certificate for Identity Provider`,builder:Kd,handler:async n=>l({command:`zero-trust identity-providers saml-certificate create`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust identity-providers saml-certificate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/identity_providers/${n[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(n[`identity-provider-id`]))}/saml_certificate`,pathParams:{"identity-provider-id":String(n[`identity-provider-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Creating`,async()=>i.zeroTrust.identityProviders.samlCertificate.create({account_id:l,identity_provider_id:n[`identity-provider-id`]})),{successLabel:`Created`})})},Jd={command:`saml-certificate`,describe:`Operations for identity-providers.saml-certificate`,builder:e=>e.command(qd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yd(e){return e.usage(`$0 zero-trust identity-providers scim groups list
613
+
614
+ 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 Xd={command:`list`,describe:`List SCIM Group resources`,builder:Yd,handler:async n=>l({command:`zero-trust identity-providers scim groups list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={cf_resource_id:n[`cf-resource-id`],idp_resource_id:n[`idp-resource-id`],name:n.name,page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust identity-providers scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/identity_providers/${n[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(n[`identity-provider-id`]))}/scim/groups`,pathParams:{"identity-provider-id":String(n[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.groups.list({account_id:u,identity_provider_id:n[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},Zd={command:`groups`,describe:`Operations for identity-providers.scim.groups`,builder:e=>e.command(Xd).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qd(e){return e.usage(`$0 zero-trust identity-providers scim users list
615
+
616
+ 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 $d={command:`list`,describe:`List SCIM User resources`,builder:Qd,handler:async n=>l({command:`zero-trust identity-providers scim users list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let i={cf_resource_id:n[`cf-resource-id`],idp_resource_id:n[`idp-resource-id`],username:n.username,email:n.email,name:n.name,page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf zero-trust identity-providers scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/identity_providers/${n[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(n[`identity-provider-id`]))}/scim/users`,pathParams:{"identity-provider-id":String(n[`identity-provider-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(n),u=n.local?e:await r();n.accountId=u,o(await c(`Loading`,async()=>l.zeroTrust.identityProviders.scim.users.list({account_id:u,identity_provider_id:n[`identity-provider-id`],...i})),{successLabel:`Loaded`})})},ef={command:`users`,describe:`Operations for identity-providers.scim.users`,builder:e=>e.command($d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tf={command:`scim`,describe:`Operations for identity-providers.scim`,builder:e=>e.command(Zd).command(ef).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nf(e){return e.usage(`$0 zero-trust identity-providers update <identity-provider-id>
617
+
618
+ 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 rf={command:`update <identity-provider-id>`,describe:`Update an Access identity provider`,builder:nf,handler:async i=>l({command:`zero-trust identity-providers update`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust identity-providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/identity_providers/${i[`identity-provider-id`]==null?`<identity-provider-id>`:encodeURIComponent(String(i[`identity-provider-id`]))}`,pathParams:{"account-or-zone":String(n),"identity-provider-id":String(i[`identity-provider-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?void 0:d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.identityProviders.update({body:e,account_or_zone:u,account_or_zone_id:f,identity_provider_id:i[`identity-provider-id`]})),{successLabel:`Updated`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},af={command:`identity-providers`,describe:`Operations for identity-providers`,builder:e=>e.command(zd).command(Vd).command(Ud).command(Gd).command(rf).command(Jd).command(tf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function of(e){return e.usage(`$0 zero-trust organizations create
619
+
620
+ Sets up a Zero Trust organization for your account or zone.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`,default:!1}).option(`auth-domain`,{type:`string`,description:`The unique subdomain assigned to your Zero Trust organization.`}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login.",default:!1}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`,default:!1}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).option(`mfa-piv-key-requirements-require-fips-device`,{type:`boolean`,description:`Requires the PIV key to be stored on a FIPS 140-2 Level 1 or higher validated device.`}).option(`mfa-piv-key-requirements-ssh-key-size`,{type:`string`,array:!0,description:`Specifies the allowed SSH key sizes in bits. Valid sizes depend on key type. Ed25519 has a fixed key size and does not accept this parameter.`}).option(`mfa-piv-key-requirements-ssh-key-type`,{type:`string`,array:!0,description:"Specifies the allowed SSH key types. Valid values are `ecdsa`, `ed25519`, and `rsa`."}).option(`mfa-piv-key-requirements-touch-policy`,{type:`string`,description:"Defines when physical touch is required to use the SSH key. Valid values: `never` (no touch required), `always` (touch required for each use), `cached` (touch cached for 15 seconds).",choices:[`never`,`always`,`cached`]}).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`,default:!1}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization.`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`,default:!1}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const sf={command:`create`,describe:`Create your Zero Trust organization`,builder:of,handler:async i=>l({command:`zero-trust organizations create`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`warp-auth-non-browser-401`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.zeroTrust.organizations.create({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`});return}i[`auth-domain`]===void 0&&(i[`auth-domain`]=await g(`auth-domain`,`The unique subdomain assigned to your Zero Trust organization.`)),i.name===void 0&&(i.name=await g(`name`,`The name of your Zero Trust organization.`));let h=p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)});o(await c(`Creating`,async()=>l.zeroTrust.organizations.create({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Created`})})};function cf(e){return e.usage(`$0 zero-trust organizations doh get
621
+
622
+ 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 lf={command:`get`,describe:`Get your Zero Trust organization DoH settings`,builder:cf,handler:async n=>l({command:`zero-trust organizations doh get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust organizations doh get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.organizations.doh.get({account_id:l})),{successLabel:`Loaded`})})};function uf(e){return e.usage(`$0 zero-trust organizations doh update
623
+
624
+ 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 df={command:`update`,describe:`Update your Zero Trust organization DoH settings`,builder:uf,handler:async n=>l({command:`zero-trust organizations doh update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust organizations doh update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/organizations/doh`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({doh_jwt_duration:m(n[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(n[`service-token-id`],`service-token-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.organizations.doh.update({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({doh_jwt_duration:m(n[`doh-jwt-duration`],`doh-jwt-duration`,`text`),service_token_id:m(n[`service-token-id`],`service-token-id`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.organizations.doh.update({...u,account_id:l})),{successLabel:`Updated`})})},ff={command:`doh`,describe:`Operations for organizations.doh`,builder:e=>e.command(lf).command(df).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pf(e){return e.usage(`$0 zero-trust organizations list
625
+
626
+ 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 mf={command:`list`,describe:`Get your Zero Trust organization`,builder:pf,handler:async i=>l({command:`zero-trust organizations list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.zeroTrust.organizations.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})};function hf(e){return e.usage(`$0 zero-trust organizations revoke-users
627
+
628
+ 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 gf={command:`revoke-users`,describe:`Revoke all Access tokens for a user`,builder:hf,handler:async i=>l({command:`zero-trust organizations revoke-users`,classification:{safeFlags:[`devices`,`warp-session-reauth`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations revoke-users`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations/revoke_user`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({devices:i.devices,email:m(i.email,`email`,`text`),user_uid:m(i[`user-uid`],`user-uid`,`text`),warp_session_reauth:i[`warp-session-reauth`]}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,!await v({force:!!i.force,message:`This operation revokes all access tokens for a user destructively.`})){process.stderr.write(`Aborted.
629
+ `);return}if(i.body){let e=d(i.body);o(await c(`Deleting`,async()=>l.zeroTrust.organizations.revokeUsers({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Deleted`});return}i.email===void 0&&(i.email=await g(`email`,`The email of the user to revoke.`));let h=p({devices:i.devices,email:m(i.email,`email`,`text`),user_uid:m(i[`user-uid`],`user-uid`,`text`),warp_session_reauth:i[`warp-session-reauth`]});o(await c(`Deleting`,async()=>l.zeroTrust.organizations.revokeUsers({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Deleted`})})};function _f(e){return e.usage(`$0 zero-trust organizations update
630
+
631
+ Updates the configuration for your Zero Trust organization.`).option(`allow-authenticate-via-warp`,{type:`boolean`,description:`When set to true, users can authenticate via WARP for any application in your organization. Application settings will take precedence over this value.`}).option(`auth-domain`,{type:`string`,description:`The unique subdomain assigned to your Zero Trust organization.`}).option(`auto-redirect-to-identity`,{type:`boolean`,description:"When set to `true`, users skip the identity provider selection step during login."}).option(`custom-pages-forbidden`,{type:`string`,description:`The uid of the custom page to use when a user is denied access after failing a non-identity rule.`}).option(`custom-pages-identity-denied`,{type:`string`,description:`The uid of the custom page to use when a user is denied access.`}).option(`deny-unmatched-requests`,{type:`boolean`,description:"Determines whether to deny all requests to Cloudflare-protected resources that lack an associated Access application. If enabled, you must explicitly configure an Access application and policy to allow traffic to your Cloudflare-protected resources. For domains you want to be public across all subdomains, add the domain to the `deny_unmatched_requests_exempted_zone_names` array."}).option(`deny-unmatched-requests-exempted-zone-names`,{type:`string`,array:!0,description:"Contains zone names to exempt from the `deny_unmatched_requests` feature. Requests to a subdomain in an exempted zone will block unauthenticated traffic by default if there is a configured Access application and policy that matches the request."}).option(`is-ui-read-only`,{type:`boolean`,description:`Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled.`}).option(`login-design-background-color`,{type:`string`,description:`The background color on your login page.`}).option(`login-design-footer-text`,{type:`string`,description:`The text at the bottom of your login page.`}).option(`login-design-header-text`,{type:`string`,description:`The text at the top of your login page.`}).option(`login-design-logo-path`,{type:`string`,description:`The URL of the logo on your login page.`}).option(`login-design-text-color`,{type:`string`,description:`The text color on your login page.`}).option(`mfa-config-allowed-authenticators`,{type:`string`,array:!0,description:"Lists the MFA methods that users can authenticate with. The `piv_key` and `ssh_fido2_key` values are supported only for infrastructure applications."}).option(`mfa-config-amr-matching-session-duration`,{type:`string`,description:`Allows a user to skip MFA via Authentication Method Reference (AMR) matching when the AMR claim provided by the IdP the user used to authenticate contains "mfa". Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days).`}).option(`mfa-config-required-aaguids`,{type:`string`,description:`Specifies a Cloudflare List of required FIDO2 authenticator device AAGUIDs.`}).option(`mfa-config-session-duration`,{type:`string`,description:"Defines the duration of an MFA session. Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). Examples:`5m` or `24h`."}).option(`mfa-piv-key-requirements-pin-policy`,{type:`string`,description:"Defines when a PIN is required to use the SSH key. Valid values: `never` (no PIN required), `once` (PIN required once per session), `always` (PIN required for each use).",choices:[`never`,`once`,`always`]}).option(`mfa-piv-key-requirements-require-fips-device`,{type:`boolean`,description:`Requires the PIV key to be stored on a FIPS 140-2 Level 1 or higher validated device.`}).option(`mfa-piv-key-requirements-ssh-key-size`,{type:`string`,array:!0,description:`Specifies the allowed SSH key sizes in bits. Valid sizes depend on key type. Ed25519 has a fixed key size and does not accept this parameter.`}).option(`mfa-piv-key-requirements-ssh-key-type`,{type:`string`,array:!0,description:"Specifies the allowed SSH key types. Valid values are `ecdsa`, `ed25519`, and `rsa`."}).option(`mfa-piv-key-requirements-touch-policy`,{type:`string`,description:"Defines when physical touch is required to use the SSH key. Valid values: `never` (no touch required), `always` (touch required for each use), `cached` (touch cached for 15 seconds).",choices:[`never`,`always`,`cached`]}).option(`mfa-required-for-all-apps`,{type:`boolean`,description:`Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. Note: 'allowed_authenticators' cannot contain only the infrastructure SSH authenticators ('piv_key' and 'ssh_fido2_key') if the organization has any non-infrastructure applications.`}).option(`name`,{type:`string`,description:`The name of your Zero Trust organization.`}).option(`service-token-inactivity-action`,{type:`string`,description:`The action applied to an inactive service token.`,choices:[`disable`,`delete`]}).option(`service-token-inactivity-enabled`,{type:`boolean`,description:`Whether automatic enforcement for inactive service tokens is enabled.`}).option(`service-token-inactivity-inactivity-threshold-days`,{type:`number`,description:`The number of days a service token must be inactive before the configured action is applied.`}).option(`session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h."}).option(`ui-read-only-toggle-reason`,{type:`string`,description:`A description of the reason why the UI read only field is being toggled.`}).option(`user-seat-expiration-inactive-time`,{type:`string`,description:"The amount of time a user seat is inactive before it expires. When the user seat exceeds the set time of inactivity, the user is removed as an active seat and no longer counts against your Teams seat count. Minimum value for this setting is 1 month (730h). Must be in the format `300ms` or `2h45m`. Valid time units are: `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`."}).option(`warp-auth-non-browser-401`,{type:`boolean`,description:`When enabled, unsuccessful WARP authentication requests with a non-HTML Accept header return a 401 response instead of redirecting to the login page.`}).option(`warp-auth-session-duration`,{type:`string`,description:"The amount of time that tokens issued for applications will be valid. Must be in the format `30m` or `2h45m`. Valid time units are: m, h."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].some(t=>e[t]!==void 0)){let t=[`service-token-inactivity-action`,`service-token-inactivity-enabled`,`service-token-inactivity-inactivity-threshold-days`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --service_token_inactivity-* flag is set`)}return!0})}const vf={command:`update`,describe:`Update your Zero Trust organization`,builder:_f,handler:async i=>l({command:`zero-trust organizations update`,classification:{safeFlags:[`allow-authenticate-via-warp`,`auto-redirect-to-identity`,`deny-unmatched-requests`,`is-ui-read-only`,`mfa-piv-key-requirements-pin-policy`,`mfa-piv-key-requirements-require-fips-device`,`mfa-piv-key-requirements-touch-policy`,`mfa-required-for-all-apps`,`service-token-inactivity-action`,`service-token-inactivity-enabled`,`warp-auth-non-browser-401`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=i.zone===void 0?await t():void 0,n=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf zero-trust organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${n}/${r}/access/organizations`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],custom_pages:{forbidden:m(i[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(i[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,f=u===`zones`?await n({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await r();if(u===`zones`?i.zoneId=f:i.accountId=f,i.body){let e=d(i.body);o(await c(`Updating`,async()=>l.zeroTrust.organizations.update({...e,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Updated`});return}let h=p({allow_authenticate_via_warp:i[`allow-authenticate-via-warp`],auth_domain:m(i[`auth-domain`],`auth-domain`,`text`),auto_redirect_to_identity:i[`auto-redirect-to-identity`],custom_pages:{forbidden:m(i[`custom-pages-forbidden`],`custom-pages-forbidden`,`text`),identity_denied:m(i[`custom-pages-identity-denied`],`custom-pages-identity-denied`,`text`)},deny_unmatched_requests:i[`deny-unmatched-requests`],deny_unmatched_requests_exempted_zone_names:i[`deny-unmatched-requests-exempted-zone-names`],is_ui_read_only:i[`is-ui-read-only`],login_design:{background_color:m(i[`login-design-background-color`],`login-design-background-color`,`text`),footer_text:m(i[`login-design-footer-text`],`login-design-footer-text`,`text`),header_text:m(i[`login-design-header-text`],`login-design-header-text`,`text`),logo_path:m(i[`login-design-logo-path`],`login-design-logo-path`,`text`),text_color:m(i[`login-design-text-color`],`login-design-text-color`,`text`)},mfa_config:{allowed_authenticators:i[`mfa-config-allowed-authenticators`],amr_matching_session_duration:m(i[`mfa-config-amr-matching-session-duration`],`mfa-config-amr-matching-session-duration`,`text`),required_aaguids:m(i[`mfa-config-required-aaguids`],`mfa-config-required-aaguids`,`text`),session_duration:m(i[`mfa-config-session-duration`],`mfa-config-session-duration`,`text`)},mfa_piv_key_requirements:{pin_policy:m(i[`mfa-piv-key-requirements-pin-policy`],`mfa-piv-key-requirements-pin-policy`,`text`),require_fips_device:i[`mfa-piv-key-requirements-require-fips-device`],ssh_key_size:i[`mfa-piv-key-requirements-ssh-key-size`],ssh_key_type:i[`mfa-piv-key-requirements-ssh-key-type`],touch_policy:m(i[`mfa-piv-key-requirements-touch-policy`],`mfa-piv-key-requirements-touch-policy`,`text`)},mfa_required_for_all_apps:i[`mfa-required-for-all-apps`],name:m(i.name,`name`,`text`),service_token_inactivity:{action:m(i[`service-token-inactivity-action`],`service-token-inactivity-action`,`text`),enabled:i[`service-token-inactivity-enabled`],inactivity_threshold_days:i[`service-token-inactivity-inactivity-threshold-days`]},session_duration:m(i[`session-duration`],`session-duration`,`text`),ui_read_only_toggle_reason:m(i[`ui-read-only-toggle-reason`],`ui-read-only-toggle-reason`,`text`),user_seat_expiration_inactive_time:m(i[`user-seat-expiration-inactive-time`],`user-seat-expiration-inactive-time`,`text`),warp_auth_non_browser_401:i[`warp-auth-non-browser-401`],warp_auth_session_duration:m(i[`warp-auth-session-duration`],`warp-auth-session-duration`,`text`)});o(await c(`Updating`,async()=>l.zeroTrust.organizations.update({...h,account_or_zone:u,account_or_zone_id:f})),{successLabel:`Updated`})})},yf={command:`organizations`,describe:`Operations for organizations`,builder:e=>e.command(sf).command(mf).command(gf).command(vf).command(ff).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bf(e){return e.usage(`$0 zero-trust profiles custom list
632
+
633
+ Lists all DLP custom profiles in an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xf={command:`list`,describe:`List all custom profiles`,builder:bf,handler:async n=>l({command:`zero-trust profiles custom list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust profiles custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/custom`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.custom.list({account_id:l})),{successLabel:`Loaded`})})},Sf={command:`custom`,describe:`Profiles operations`,builder:e=>e.command(xf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Cf(e){return e.usage(`$0 zero-trust profiles predefined create
634
+
635
+ Creates a DLP predefined profile. Only supports enabling/disabling entries.`).option(`ai-context-enabled`,{type:`boolean`,description:`The ai_context_enabled field`,default:!1}).option(`allowed-match-count`,{type:`number`,description:`The allowed_match_count field`,default:0}).option(`confidence-threshold`,{type:`string`,description:`The confidence_threshold field`,default:`low`}).option(`context-awareness-enabled`,{type:`boolean`,description:`If true, scan the context of predefined entries to only return matches surrounded by keywords.`}).option(`context-awareness-skip-files`,{type:`boolean`,description:`If the content type is a file, skip context analysis and return all matches.`}).option(`entries`,{type:`string`,description:`The entries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`ocr-enabled`,{type:`boolean`,description:`The ocr_enabled field`,default:!1}).option(`profile-id`,{type:`string`,description:`The profile_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Predefined profiles can not be created. This endpoint will only update an existing predefined profiles settings.`}).check(e=>{if([`context-awareness-enabled`,`context-awareness-skip-files`].some(t=>e[t]!==void 0)){let t=[`context-awareness-enabled`,`context-awareness-skip-files`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --context_awareness-* flag is set`)}return!0})}const wf={command:`create`,describe:`Create predefined profile`,builder:Cf,handler:async n=>l({command:`zero-trust profiles predefined create`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust profiles predefined create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`],profile_id:m(n[`profile-id`],`profile-id`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...e,account_id:l})),{successLabel:`Created`});return}n[`profile-id`]===void 0&&(n[`profile-id`]=await g(`profile-id`,`The profile_id field`));let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`],profile_id:m(n[`profile-id`],`profile-id`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.profiles.predefined.create({...u,account_id:l})),{successLabel:`Created`})})};function Tf(e){return e.usage(`$0 zero-trust profiles predefined get <profile-id>
636
+
637
+ Fetches a predefined DLP profile by id.`).positional(`profile-id`,{type:`string`,description:`Profile ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ef={command:`get <profile-id>`,describe:`Get predefined profile`,builder:Tf,handler:async n=>l({command:`zero-trust profiles predefined get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust profiles predefined get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.profiles.predefined.get({account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Loaded`})})};function Df(e){return e.usage(`$0 zero-trust profiles predefined update <profile-id>
638
+
639
+ 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 Of={command:`update <profile-id>`,describe:`Update predefined profile`,builder:Df,handler:async n=>l({command:`zero-trust profiles predefined update`,classification:{safeFlags:[`ai-context-enabled`,`context-awareness-enabled`,`context-awareness-skip-files`,`ocr-enabled`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust profiles predefined update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/profiles/predefined/${n[`profile-id`]==null?`<profile-id>`:encodeURIComponent(String(n[`profile-id`]))}`,pathParams:{"profile-id":String(n[`profile-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...e,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`});return}let u=p({ai_context_enabled:n[`ai-context-enabled`],allowed_match_count:n[`allowed-match-count`],confidence_threshold:m(n[`confidence-threshold`],`confidence-threshold`,`text`),context_awareness:{enabled:n[`context-awareness-enabled`],skip:{files:n[`context-awareness-skip-files`]}},entries:f(n.entries,`entries`),ocr_enabled:n[`ocr-enabled`]});o(await c(`Updating`,async()=>i.zeroTrust.profiles.predefined.update({...u,account_id:l,profile_id:n[`profile-id`]})),{successLabel:`Updated`})})},kf={command:`predefined`,describe:`Profiles operations`,builder:e=>e.command(wf).command(Ef).command(Of).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Af={command:`profiles`,describe:`Operations for profiles`,builder:e=>e.command(Sf).command(kf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jf(e){return e.usage(`$0 zero-trust risk-scoring behaviours get
640
+
641
+ 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 Mf={command:`get`,describe:`Get all behaviors and associated configuration`,builder:jf,handler:async n=>l({command:`zero-trust risk-scoring behaviours get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring behaviours get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.behaviours.get({account_id:l})),{successLabel:`Loaded`})})};function Nf(e){return e.usage(`$0 zero-trust risk-scoring behaviours update
642
+
643
+ 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 Pf={command:`update`,describe:`Update configuration for risk behaviors`,builder:Nf,handler:async n=>l({command:`zero-trust risk-scoring behaviours update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring behaviours update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/behaviors`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.behaviours.update({body:e,account_id:l})),{successLabel:`Updated`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ff={command:`behaviours`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Mf).command(Pf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function If(e){return e.usage(`$0 zero-trust risk-scoring get <user-id>
644
+
645
+ 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 Lf={command:`get <user-id>`,describe:`Get risk event/score information for a specific user`,builder:If,handler:async n=>l({command:`zero-trust risk-scoring get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.get({account_id:l,user_id:n[`user-id`]})),{successLabel:`Loaded`})})};function Rf(e){return e.usage(`$0 zero-trust risk-scoring integrations create
646
+
647
+ Creates a new Zero Trust risk score integration, connecting external risk signals to Cloudflare's risk scoring system.`).option(`integration-type`,{type:`string`,description:`The integration_type field`,choices:[`Okta`]}).option(`reference-id`,{type:`string`,description:`A reference id that can be supplied by the client. Currently this should be set to the Access-Okta IDP ID (a UUIDv4).
648
+ 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 zf={command:`create`,describe:`Create new risk score integration.`,builder:Rf,handler:async n=>l({command:`zero-trust risk-scoring integrations create`,classification:{safeFlags:[`integration-type`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({integration_type:m(n[`integration-type`],`integration-type`,`text`),reference_id:m(n[`reference-id`],`reference-id`,`text`),tenant_url:m(n[`tenant-url`],`tenant-url`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...e,account_id:l})),{successLabel:`Created`});return}n[`integration-type`]===void 0&&(n[`integration-type`]=await _(`integration-type`,`The integration_type field`,[`Okta`])),n[`tenant-url`]===void 0&&(n[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({integration_type:m(n[`integration-type`],`integration-type`,`text`),reference_id:m(n[`reference-id`],`reference-id`,`text`),tenant_url:m(n[`tenant-url`],`tenant-url`,`text`)});o(await c(`Creating`,async()=>i.zeroTrust.riskScoring.integrations.create({...u,account_id:l})),{successLabel:`Created`})})};function Bf(e){return e.usage(`$0 zero-trust risk-scoring integrations delete <integration-id>
649
+
650
+ 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 Vf={command:`delete <integration-id>`,describe:`Delete a risk score integration.`,builder:Bf,handler:async n=>l({command:`zero-trust risk-scoring integrations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations/${n[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(n[`integration-id`]))}`,pathParams:{"integration-id":String(n[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
651
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.integrations.delete({account_id:l,integration_id:n[`integration-id`]})),{successLabel:`Deleted`})})};function Hf(e){return e.usage(`$0 zero-trust risk-scoring integrations get <integration-id>
652
+
653
+ 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 Uf={command:`get <integration-id>`,describe:`Get risk score integration by id.`,builder:Hf,handler:async n=>l({command:`zero-trust risk-scoring integrations get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations/${n[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(n[`integration-id`]))}`,pathParams:{"integration-id":String(n[`integration-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.get({account_id:l,integration_id:n[`integration-id`]})),{successLabel:`Loaded`})})};function Wf(e){return e.usage(`$0 zero-trust risk-scoring integrations list
654
+
655
+ 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 Gf={command:`list`,describe:`List all risk score integrations for the account.`,builder:Wf,handler:async n=>l({command:`zero-trust risk-scoring integrations list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.list({account_id:l})),{successLabel:`Loaded`})})};function Kf(e){return e.usage(`$0 zero-trust risk-scoring integrations references get <reference-id>
656
+
657
+ 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 qf={command:`get <reference-id>`,describe:`Get risk score integration by reference id.`,builder:Kf,handler:async n=>l({command:`zero-trust risk-scoring integrations references get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations/reference_id/${n[`reference-id`]==null?`<reference-id>`:encodeURIComponent(String(n[`reference-id`]))}`,pathParams:{"reference-id":String(n[`reference-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.integrations.references.get({account_id:l,reference_id:n[`reference-id`]})),{successLabel:`Loaded`})})},Jf={command:`references`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(qf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Yf(e){return e.usage(`$0 zero-trust risk-scoring integrations update <integration-id>
658
+
659
+ 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).
660
+ 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 Xf={command:`update <integration-id>`,describe:`Update a risk score integration.`,builder:Yf,handler:async n=>l({command:`zero-trust risk-scoring integrations update`,classification:{safeFlags:[`active`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/integrations/${n[`integration-id`]==null?`<integration-id>`:encodeURIComponent(String(n[`integration-id`]))}`,pathParams:{"integration-id":String(n[`integration-id`]??``)},bodyKind:`json`,body:n.body===void 0?p({active:n.active,reference_id:m(n[`reference-id`],`reference-id`,`text`),tenant_url:m(n[`tenant-url`],`tenant-url`,`text`)}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...e,account_id:l,integration_id:n[`integration-id`]})),{successLabel:`Updated`});return}if(n.active===void 0)throw Error(`--active is required (or pass --body with this field set).`);n[`tenant-url`]===void 0&&(n[`tenant-url`]=await g(`tenant-url`,`The base url of the tenant, e.g. "https://tenant.okta.com".`));let u=p({active:n.active,reference_id:m(n[`reference-id`],`reference-id`,`text`),tenant_url:m(n[`tenant-url`],`tenant-url`,`text`)});o(await c(`Updating`,async()=>i.zeroTrust.riskScoring.integrations.update({...u,account_id:l,integration_id:n[`integration-id`]})),{successLabel:`Updated`})})},Zf={command:`integrations`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(zf).command(Vf).command(Uf).command(Gf).command(Xf).command(Jf).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qf(e){return e.usage(`$0 zero-trust risk-scoring reset <user-id>
661
+
662
+ 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 $f={command:`reset <user-id>`,describe:`Clear the risk score for a particular user`,builder:Qf,handler:async n=>l({command:`zero-trust risk-scoring reset`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring reset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/reset`,pathParams:{"user-id":String(n[`user-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force,message:`This operation wipes risk-scoring history.`})){process.stderr.write(`Aborted.
663
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.riskScoring.reset({account_id:l,user_id:n[`user-id`]})),{successLabel:`Deleted`})})};function ep(e){return e.usage(`$0 zero-trust risk-scoring summary get
664
+
665
+ 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 tp={command:`get`,describe:`Get risk score info for all users in the account`,builder:ep,handler:async n=>l({command:`zero-trust risk-scoring summary get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust risk-scoring summary get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/zt_risk_scoring/summary`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.riskScoring.summary.get({account_id:l})),{successLabel:`Loaded`})})},np={command:`summary`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(tp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rp={command:`risk-scoring`,describe:`User and entity risk scores derived from behavior signals, used to trigger adaptive access policies`,builder:e=>e.command(Lf).command($f).command(Ff).command(Zf).command(np).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ip(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 ap={command:`edit`,describe:`Update a user seat`,builder:ip,handler:async n=>l({command:`zero-trust seats edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust seats edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/seats`,pathParams:{},bodyKind:`json`,body:n.body===void 0?void 0:d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.seats.edit({body:e,account_id:l})),{successLabel:`Updated`});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},op={command:`seats`,describe:`Operations for seats`,builder:e=>e.command(ap).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function sp(e){return e.usage(`$0 zero-trust settings delete
666
+
667
+ 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 cp={command:`delete`,describe:`Delete (reset) DLP account-level settings to initial values.`,builder:sp,handler:async n=>l({command:`zero-trust settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
668
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.settings.delete({account_id:l})),{successLabel:`Deleted`})})};function lp(e){return e.usage(`$0 zero-trust settings edit
669
+
670
+ Missing fields keep their existing values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
671
+
672
+ - Set to a non-empty base64 string to enable payload logging with the given key.
673
+ - Set to an empty string to disable payload logging.
674
+ - 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 up={command:`edit`,describe:`Partially update DLP account-level settings.`,builder:lp,handler:async n=>l({command:`zero-trust settings edit`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({ai_context_analysis:n[`ai-context-analysis`],ocr:n.ocr,payload_logging:{masking_level:m(n[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(n[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.edit({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({ai_context_analysis:n[`ai-context-analysis`],ocr:n.ocr,payload_logging:{masking_level:m(n[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(n[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}});o(await c(`Updating`,async()=>i.zeroTrust.settings.edit({body:u,account_id:l})),{successLabel:`Updated`})})};function dp(e){return e.usage(`$0 zero-trust settings get
675
+
676
+ Gets the account-level DLP settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fp={command:`get`,describe:`Get DLP account-level settings.`,builder:dp,handler:async n=>l({command:`zero-trust settings get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();n.accountId=l,o(await c(`Loading`,async()=>i.zeroTrust.settings.get({account_id:l})),{successLabel:`Loaded`})})};function pp(e){return e.usage(`$0 zero-trust settings update
677
+
678
+ Missing fields are reset to initial (unconfigured) values.`).option(`ai-context-analysis`,{type:`boolean`,description:`Whether AI context analysis is enabled at the account level.`}).option(`ocr`,{type:`boolean`,description:`Whether OCR is enabled at the account level.`}).option(`payload-logging-masking-level`,{type:`string`,description:"Masking level for payload logs.\n\n- `full`: The entire payload is masked.\n- `partial`: Only partial payload content is masked.\n- `clear`: No masking is applied to the payload content.\n- `default`: DLP uses its default masking behavior.",choices:[`full`,`partial`,`clear`,`default`]}).option(`payload-logging-public-key`,{type:`string`,description:`Base64-encoded public key for encrypting payload logs.
679
+
680
+ - Set to a non-empty base64 string to enable payload logging with the given key.
681
+ - Set to an empty string to disable payload logging.
682
+ - 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 mp={command:`update`,describe:`Update DLP account-level settings (full replacement).`,builder:pp,handler:async n=>l({command:`zero-trust settings update`,classification:{safeFlags:[`ai-context-analysis`,`ocr`,`payload-logging-masking-level`,`dry-run`]}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/dlp/settings`,pathParams:{},bodyKind:`json`,body:n.body===void 0?p({ai_context_analysis:n[`ai-context-analysis`],ocr:n.ocr,payload_logging:{masking_level:m(n[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(n[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}}):d(n.body)});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,n.body){let e=d(n.body);o(await c(`Updating`,async()=>i.zeroTrust.settings.update({body:e,account_id:l})),{successLabel:`Updated`});return}let u=p({ai_context_analysis:n[`ai-context-analysis`],ocr:n.ocr,payload_logging:{masking_level:m(n[`payload-logging-masking-level`],`payload-logging-masking-level`,`text`),public_key:m(n[`payload-logging-public-key`],`payload-logging-public-key`,`text`)}});o(await c(`Updating`,async()=>i.zeroTrust.settings.update({body:u,account_id:l})),{successLabel:`Updated`})})},hp={command:`settings`,describe:`Settings operations`,builder:e=>e.command(cp).command(up).command(fp).command(mp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function gp(e){return e.usage(`$0 zero-trust users mfa authenticators delete <authenticator-id>
683
+
684
+ Deletes a specific MFA device, including a PIV key or FIDO2 key enrollment, for a user. This action is only available if MFA is turned on for the organization. Successful deletion revokes the enrollment and returns a null result.`).positional(`authenticator-id`,{type:`string`,description:`The unique identifier for the MFA device.`,demandOption:!0}).option(`user-id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _p={command:`delete <authenticator-id>`,describe:`Delete a user's MFA device`,builder:gp,handler:async n=>l({command:`zero-trust users mfa authenticators delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){s({command:`cf zero-trust users mfa authenticators delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/access/users/${n[`user-id`]==null?`<user-id>`:encodeURIComponent(String(n[`user-id`]))}/mfa_authenticators/${n[`authenticator-id`]==null?`<authenticator-id>`:encodeURIComponent(String(n[`authenticator-id`]))}`,pathParams:{"user-id":String(n[`user-id`]??``),"authenticator-id":String(n[`authenticator-id`]??``)},bodyKind:`none`});return}let i=await a(n),l=n.local?e:await r();if(n.accountId=l,!await v({force:!!n.force})){process.stderr.write(`Aborted.
685
+ `);return}o(await c(`Deleting`,async()=>i.zeroTrust.users.mfa.authenticators.delete({account_id:l,user_id:n[`user-id`],authenticator_id:n[`authenticator-id`]})),{successLabel:`Deleted`})})},vp={command:`authenticators`,describe:`Operations for users.mfa.authenticators`,builder:e=>e.command(_p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},yp={command:`mfa`,describe:`Operations for users.mfa`,builder:e=>e.command(vp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},bp={command:`users`,describe:`Operations for users`,builder:e=>e.command(yp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xp={command:`zero-trust`,describe:`Cloudflare's SASE platform — secure access, device posture, DLP, tunnels, gateway policies, and network segmentation`,builder:e=>e.command(hr).command(Dr).command(Zr).command(ni).command(Fa).command(rl).command(xl).command(Ld).command(af).command(yf).command(Af).command(rp).command(op).command(hp).command(bp).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{xp as default};