cf 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/README.md +2 -4
  2. package/bin/cf +11 -0
  3. package/dist/_meta/agent-context.json +7 -7
  4. package/dist/_meta/commands.json +9051 -1085
  5. package/dist/abuse-reports-ChV_yD7f.mjs +8 -0
  6. package/dist/accounts-BCYecXFh.mjs +21 -0
  7. package/dist/acm-DD8zSds2.mjs +3 -0
  8. package/dist/addressing-D4Eqw5Bi.mjs +13 -0
  9. package/dist/{agent-context-BBJnI_Q7.mjs → agent-context-D26woB9J.mjs} +1 -1
  10. package/dist/ai-DfXMOMx_.mjs +2 -0
  11. package/dist/ai-gateway-DdRFthMo.mjs +8 -0
  12. package/dist/ai-search-C_68CDj1.mjs +7 -0
  13. package/dist/alerting-DbhqhVCp.mjs +6 -0
  14. package/dist/analytics-BSBBc7ep.mjs +20 -0
  15. package/dist/api-gateway-CZ4swbkQ.mjs +33 -0
  16. package/dist/argo-tms9ZwHO.mjs +2 -0
  17. package/dist/audit-logs-24qyW8cl.mjs +2 -0
  18. package/dist/auth-BlSmtIKd.mjs +112 -0
  19. package/dist/auth-DQ8miey6.mjs +6 -0
  20. package/dist/autorag-kgNt06GD.mjs +2 -0
  21. package/dist/billing-lwBHNTXC.mjs +2 -0
  22. package/dist/body-parser-Br-BoYk-.mjs +2 -0
  23. package/dist/bot-management-LKf7BqUr.mjs +5 -0
  24. package/dist/botnet-feed-nQ-gErTS.mjs +3 -0
  25. package/dist/brand-protection-DOKv9GRr.mjs +3 -0
  26. package/dist/browser-rendering-CBExtgGt.mjs +4 -0
  27. package/dist/build-C_48VvoK.mjs +1056 -0
  28. package/dist/{builds-B5sC8Gh_.mjs → builds-C_ySULja.mjs} +1 -1
  29. package/dist/cache-BBiiNZHP.mjs +5 -0
  30. package/dist/calls-DA5Xzwev.mjs +4 -0
  31. package/dist/certificate-authorities-sXyR_yGp.mjs +2 -0
  32. package/dist/chunk-DH-VkVmc.mjs +2 -0
  33. package/dist/client-certificates-tV0aCLQJ.mjs +3 -0
  34. package/dist/cloud-connector-DZfHcSso.mjs +2 -0
  35. package/dist/cloudforce-one-y1PgQmI9.mjs +21 -0
  36. package/dist/{completions-BSRqbcrz.mjs → completions-BKrxcfhN.mjs} +1 -1
  37. package/dist/config-BIfdEY0E.mjs +2 -0
  38. package/dist/connectivity-8SOqaFDn.mjs +3 -0
  39. package/dist/content-scanning-B9y6K_G5.mjs +4 -0
  40. package/dist/context-DTIbtQn5.mjs +2 -0
  41. package/dist/custom-certificates-sWksR8Ys.mjs +5 -0
  42. package/dist/custom-hostnames-91QZkdqN.mjs +5 -0
  43. package/dist/custom-nameservers-DajZaZvE.mjs +3 -0
  44. package/dist/custom-pages-Cu7gmwzT.mjs +4 -0
  45. package/dist/d1-H_VRsVmF.mjs +3 -0
  46. package/dist/dcv-delegation-C-qhEYEZ.mjs +2 -0
  47. package/dist/delegate.mjs +2 -0
  48. package/dist/deploy--9wYOkHg.mjs +2 -0
  49. package/dist/dev-BfKYB-R_.mjs +6 -0
  50. package/dist/diagnostics-D2B2LPZZ.mjs +3 -0
  51. package/dist/dispatch-namespaces-CyrXBU_w.mjs +7 -0
  52. package/dist/dist-C_bu5HwZ.mjs +82 -0
  53. package/dist/dist-DvKjT2TT.mjs +303 -0
  54. package/dist/dns-Bn9Uz_Nj.mjs +29 -0
  55. package/dist/dns-firewall-BslP4p-j.mjs +57 -0
  56. package/dist/durable-objects-BN1ZnHhm.mjs +2 -0
  57. package/dist/email-routing-n2TnTaRR.mjs +10 -0
  58. package/dist/email-security-C9SEx0kh.mjs +60 -0
  59. package/dist/email-sending-DayZ7u3I.mjs +3 -0
  60. package/dist/filters-CI_XTgfQ.mjs +4 -0
  61. package/dist/firewall-CcaayGig.mjs +11 -0
  62. package/dist/fraud-Cr7aPCV8.mjs +8 -0
  63. package/dist/google-tag-gateway-B3GpYgQ4.mjs +2 -0
  64. package/dist/healthchecks-CVTsR_OC.mjs +4 -0
  65. package/dist/hostnames-Bd_Wa5l6.mjs +3 -0
  66. package/dist/hyperdrive-BBJhEDZd.mjs +18 -0
  67. package/dist/iam-D_FN0pDF.mjs +6 -0
  68. package/dist/images-CAP2hAlZ.mjs +5 -0
  69. package/dist/index.mjs +1 -1
  70. package/dist/input-validation-zEO81MWN.mjs +2 -0
  71. package/dist/intel-CkxfzqmJ.mjs +3 -0
  72. package/dist/ips-B0cK7D0_.mjs +2 -0
  73. package/dist/keyless-certificates-LcLmHZsX.mjs +3 -0
  74. package/dist/kv-_TkUQ6fs.mjs +5 -0
  75. package/dist/leaked-credential-checks-Dhvaen22.mjs +3 -0
  76. package/dist/lib-Eu1wXxuh.mjs +68 -0
  77. package/dist/load-balancers-Ckr0UIpk.mjs +6 -0
  78. package/dist/local-VJaJ3BZ1.mjs +2 -0
  79. package/dist/logpush-Cj946hxT.mjs +4 -0
  80. package/dist/logs-DgC9hjvJ.mjs +3 -0
  81. package/dist/magic-cloud-networking-WbDvPzuG.mjs +5 -0
  82. package/dist/magic-network-monitoring-BcHShvGQ.mjs +4 -0
  83. package/dist/magic-transit-B8sCOkt_.mjs +89 -0
  84. package/dist/managed-transforms-BpOr-8HY.mjs +3 -0
  85. package/dist/mtls-certificates-fOul8D5g.mjs +3 -0
  86. package/dist/network-interconnects-BSW65xlh.mjs +36 -0
  87. package/dist/organizations-T4vKGFAb.mjs +41 -0
  88. package/dist/origin-ca-certificates-ChM0lZ64.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-C7o26ARh.mjs +2 -0
  90. package/dist/origin-tls-client-auth-D32dpZk_.mjs +5 -0
  91. package/dist/{output-CqGQp2r6.mjs → output-D7_yAFVR.mjs} +1 -1
  92. package/dist/page-rules-RFoj8CjN.mjs +18 -0
  93. package/dist/page-shield-VTktzKDN.mjs +37 -0
  94. package/dist/pages-L1ITjXDZ.mjs +10 -0
  95. package/dist/pipelines-BPO0Lnil.mjs +6 -0
  96. package/dist/progress-DZfTxbrx.mjs +2 -0
  97. package/dist/queues-B0C06L9r.mjs +6 -0
  98. package/dist/r2-DP020Tmq.mjs +21 -0
  99. package/dist/r2-data-catalog-Dmipvz5F.mjs +14 -0
  100. package/dist/radar-DR3VMknH.mjs +2 -0
  101. package/dist/rate-limits-DnHPBPgU.mjs +5 -0
  102. package/dist/raw-fetch-DlXYwVA8.mjs +2 -0
  103. package/dist/realtime-kit-C430aq2d.mjs +6 -0
  104. package/dist/registrar-7Qy50zbW.mjs +46 -0
  105. package/dist/request-tracers-sv99NDIl.mjs +2 -0
  106. package/dist/resolve-BuJRWSk0.mjs +2 -0
  107. package/dist/resource-sharing-uEjC7lnQ.mjs +5 -0
  108. package/dist/resource-tagging-CiODdP3N.mjs +16 -0
  109. package/dist/rules-FXAyTrwk.mjs +4 -0
  110. package/dist/rulesets-B6aUsFFB.mjs +8 -0
  111. package/dist/rum-CyyGJhp5.mjs +4 -0
  112. package/dist/{schema-qJlCfmo8.mjs → schema-D0_cbcDt.mjs} +1 -1
  113. package/dist/schema-validation-ByU49h--.mjs +4 -0
  114. package/dist/scim-DdTS65_C.mjs +3 -0
  115. package/dist/{scm-C872x0C2.mjs → scm-CilfPOue.mjs} +1 -1
  116. package/dist/secrets-store-ClOUVhBJ.mjs +18 -0
  117. package/dist/security-center-4iSBqTrf.mjs +2 -0
  118. package/dist/security-txt-kGxdkDY6.mjs +3 -0
  119. package/dist/session-mW-s8ghP.mjs +2 -0
  120. package/dist/smart-shield-B-SQd2Qp.mjs +3 -0
  121. package/dist/snippets-Aq58ojqw.mjs +4 -0
  122. package/dist/spawn-D_cjG87Z.mjs +10 -0
  123. package/dist/spectrum-0gFvGI6y.mjs +59 -0
  124. package/dist/speed-DAZU8w3T.mjs +4 -0
  125. package/dist/src-C5qivNKH.mjs +108 -0
  126. package/dist/ssl-BRlXa-5w.mjs +15 -0
  127. package/dist/stream-BAxsVeBX.mjs +14 -0
  128. package/dist/tenants-Df6xDqoA.mjs +2 -0
  129. package/dist/{theme-BKCxTQTe.mjs → theme-BklJDrb2.mjs} +2 -2
  130. package/dist/token-validation-pO4dCjCy.mjs +4 -0
  131. package/dist/{tools-CawscCBu.mjs → tools-CtKbk6VS.mjs} +1 -1
  132. package/dist/turnstile-B1dmO8wE.mjs +23 -0
  133. package/dist/{ui-Dj3No2vN.mjs → ui-mP_arYIg.mjs} +1 -1
  134. package/dist/url-normalization-sUDVmrUt.mjs +3 -0
  135. package/dist/url-scanner-CwOKRkYo.mjs +2 -0
  136. package/dist/user-D_UrIdNq.mjs +10 -0
  137. package/dist/vectorize-BEbBn9G9.mjs +4 -0
  138. package/dist/{vuln-scanner-B1VwCIko.mjs → vuln-scanner-Br_2lQp1.mjs} +1 -1
  139. package/dist/waiting-rooms-BQC-urV4.mjs +11 -0
  140. package/dist/web3-CIH2iQeX.mjs +4 -0
  141. package/dist/workers-B9EvrpH3.mjs +16 -0
  142. package/dist/workers-builds-DzWSiRd2.mjs +7 -0
  143. package/dist/workflows-aD81gA4k.mjs +4 -0
  144. package/dist/zaraz-Cg1dsvrZ.mjs +2 -0
  145. package/dist/zero-trust-D-xQXWcy.mjs +119 -0
  146. package/dist/zones-DQzucJDd.mjs +28 -0
  147. package/package.json +13 -3
  148. package/dist/abuse-reports-DR0yMg-Q.mjs +0 -2
  149. package/dist/accounts-BjGtCB8T.mjs +0 -6
  150. package/dist/acm-h4YPDN7k.mjs +0 -3
  151. package/dist/addressing-BiEnQ1o1.mjs +0 -11
  152. package/dist/ai-BPln2Yka.mjs +0 -2
  153. package/dist/ai-gateway-DgD9nKyd.mjs +0 -8
  154. package/dist/ai-search-EjrONI5a.mjs +0 -7
  155. package/dist/alerting-CPWMKr-m.mjs +0 -6
  156. package/dist/analytics-3dX9-scQ.mjs +0 -2
  157. package/dist/api-gateway-7FKFHdI-.mjs +0 -9
  158. package/dist/argo-Dxz9P37E.mjs +0 -2
  159. package/dist/audit-logs-D_Xw5x8Y.mjs +0 -2
  160. package/dist/auth-BHD_B2p9.mjs +0 -277
  161. package/dist/auth-caVo2j1K.mjs +0 -6
  162. package/dist/autorag-D7nMweNF.mjs +0 -2
  163. package/dist/billing-yaIBp1Xq.mjs +0 -2
  164. package/dist/body-parser-iA3vRFmh.mjs +0 -2
  165. package/dist/bot-management-C0H6U0t4.mjs +0 -2
  166. package/dist/botnet-feed-BXV9GVwF.mjs +0 -3
  167. package/dist/brand-protection-CI0NQa_l.mjs +0 -3
  168. package/dist/browser-rendering-DnKNRJJe.mjs +0 -4
  169. package/dist/cache-B6M_pm_D.mjs +0 -5
  170. package/dist/calls-C5XCC0i1.mjs +0 -4
  171. package/dist/certificate-authorities-BQuHL4dm.mjs +0 -2
  172. package/dist/client-certificates-CwpzEnCT.mjs +0 -3
  173. package/dist/cloud-connector-CU3PLNLe.mjs +0 -2
  174. package/dist/cloudforce-one-DzrArr1o.mjs +0 -21
  175. package/dist/config-BmTd_qeU.mjs +0 -2
  176. package/dist/connectivity-C4tXPkW_.mjs +0 -3
  177. package/dist/content-scanning-CH_YXdlZ.mjs +0 -4
  178. package/dist/context-6lBIck1r.mjs +0 -2
  179. package/dist/custom-certificates-pllRyU2y.mjs +0 -3
  180. package/dist/custom-hostnames-GmF0DfYA.mjs +0 -5
  181. package/dist/custom-nameservers-DPVHUlUQ.mjs +0 -3
  182. package/dist/custom-pages-XWwfn7hV.mjs +0 -4
  183. package/dist/d1-c_zhZGWf.mjs +0 -3
  184. package/dist/dcv-delegation-pXpU48A8.mjs +0 -2
  185. package/dist/dev-Bu26u5Jm.mjs +0 -14
  186. package/dist/diagnostics-BU07Jnku.mjs +0 -3
  187. package/dist/dispatch-namespaces-D_Kq_2gX.mjs +0 -7
  188. package/dist/dns-CrvIxztB.mjs +0 -11
  189. package/dist/dns-firewall-CLtGAQ9x.mjs +0 -3
  190. package/dist/dry-run-FV0pZwdg.mjs +0 -2
  191. package/dist/durable-objects-Y5rLFSQX.mjs +0 -2
  192. package/dist/email-routing-CxU5JlXT.mjs +0 -10
  193. package/dist/email-security-CnpAHWpj.mjs +0 -8
  194. package/dist/email-sending-MeCKsktR.mjs +0 -3
  195. package/dist/filters-Sx2Po1UP.mjs +0 -4
  196. package/dist/firewall-B0_012XO.mjs +0 -9
  197. package/dist/fraud-CG0G_VG-.mjs +0 -2
  198. package/dist/google-tag-gateway-BLbj1y3h.mjs +0 -2
  199. package/dist/healthchecks-C0LgExxa.mjs +0 -4
  200. package/dist/hostnames-D4K6s9EX.mjs +0 -3
  201. package/dist/hyperdrive-D7XvTRys.mjs +0 -3
  202. package/dist/iam-4LhJianW.mjs +0 -6
  203. package/dist/images-BqXyIycX.mjs +0 -5
  204. package/dist/input-validation-BpVQi9rR.mjs +0 -2
  205. package/dist/intel-CiO3Sy4x.mjs +0 -3
  206. package/dist/ips-DLuGN7Mr.mjs +0 -2
  207. package/dist/keyless-certificates-x-87T5SM.mjs +0 -3
  208. package/dist/kv-CVYCrk7L.mjs +0 -5
  209. package/dist/leaked-credential-checks-FvhVCL23.mjs +0 -3
  210. package/dist/load-balancers-cxodJuI2.mjs +0 -6
  211. package/dist/local-OqhVQbv0.mjs +0 -2
  212. package/dist/logpush-BX7z2xWz.mjs +0 -4
  213. package/dist/logs-C7vxr6Kp.mjs +0 -3
  214. package/dist/magic-cloud-networking-C3grROf-.mjs +0 -5
  215. package/dist/magic-network-monitoring-DiZ5ZXxh.mjs +0 -4
  216. package/dist/magic-transit-troGMFb9.mjs +0 -30
  217. package/dist/managed-transforms-B5w_LlVN.mjs +0 -3
  218. package/dist/mtls-certificates-C1S9MciH.mjs +0 -3
  219. package/dist/network-interconnects-CVSiv1fF.mjs +0 -4
  220. package/dist/organizations-BtlEchi-.mjs +0 -4
  221. package/dist/origin-ca-certificates-0XCi4dO6.mjs +0 -3
  222. package/dist/origin-post-quantum-encryption-CTvkdYDG.mjs +0 -2
  223. package/dist/origin-tls-client-auth-qAvRD1BQ.mjs +0 -5
  224. package/dist/page-rules-CcMmrvY4.mjs +0 -3
  225. package/dist/page-shield-Dxh4bJ-w.mjs +0 -3
  226. package/dist/pages-F1vdzqgC.mjs +0 -6
  227. package/dist/pipelines-DsF1HHMY.mjs +0 -6
  228. package/dist/progress-5sHFvwez.mjs +0 -2
  229. package/dist/queues-BuvkxFPX.mjs +0 -6
  230. package/dist/r2-Du-fgHiT.mjs +0 -9
  231. package/dist/r2-data-catalog-BUiMNSwc.mjs +0 -3
  232. package/dist/radar-C0eqNmWR.mjs +0 -2
  233. package/dist/rate-limits-CUv2cxXV.mjs +0 -3
  234. package/dist/raw-fetch-CxFs4i0R.mjs +0 -2
  235. package/dist/realtime-kit-C-jix3I_.mjs +0 -6
  236. package/dist/registrar-B7V7i89n.mjs +0 -2
  237. package/dist/request-tracers-D2V7QUrC.mjs +0 -2
  238. package/dist/resolve-GtphSYWh.mjs +0 -2
  239. package/dist/resource-sharing-BgH0w9wm.mjs +0 -5
  240. package/dist/resource-tagging-BOknFugv.mjs +0 -4
  241. package/dist/rolldown-runtime-CR7SCCRW.mjs +0 -2
  242. package/dist/rules-DzJFHGW1.mjs +0 -4
  243. package/dist/rulesets-BzI1dUiq.mjs +0 -8
  244. package/dist/rum-CQ_rJ96u.mjs +0 -4
  245. package/dist/schema-validation-TmikfxS9.mjs +0 -4
  246. package/dist/scim-ByZ5kqXS.mjs +0 -3
  247. package/dist/secrets-store-D7HL4VXw.mjs +0 -8
  248. package/dist/security-center-OUrILUnx.mjs +0 -2
  249. package/dist/security-txt-Ca13oCJ8.mjs +0 -3
  250. package/dist/session-Dxi_LbAk.mjs +0 -2
  251. package/dist/smart-shield-foPT0J9L.mjs +0 -3
  252. package/dist/snippets-FDPiBMWc.mjs +0 -4
  253. package/dist/spectrum-DPoh_BPx.mjs +0 -3
  254. package/dist/speed-BuEappVX.mjs +0 -4
  255. package/dist/src-D8_cWUwt.mjs +0 -104
  256. package/dist/ssl-bJbzEoRv.mjs +0 -3
  257. package/dist/stream-DuYGiGk6.mjs +0 -13
  258. package/dist/tenants-BYqEutrr.mjs +0 -2
  259. package/dist/token-validation-DwmtbWUB.mjs +0 -4
  260. package/dist/turnstile-Dy91RVTn.mjs +0 -3
  261. package/dist/url-normalization-DoD9iHWH.mjs +0 -3
  262. package/dist/url-scanner-qwL64FIo.mjs +0 -2
  263. package/dist/user-Cduf3VRi.mjs +0 -7
  264. package/dist/vectorize-CMLobU9V.mjs +0 -4
  265. package/dist/waiting-rooms-B4-IAJeT.mjs +0 -5
  266. package/dist/web3-Bcx68Kq3.mjs +0 -4
  267. package/dist/workers-D5fOQsUA.mjs +0 -16
  268. package/dist/workers-builds-2kdzxjlN.mjs +0 -7
  269. package/dist/workflows-qFD80noW.mjs +0 -4
  270. package/dist/zaraz-C0iJimA4.mjs +0 -2
  271. package/dist/zero-trust-Btix6zOy.mjs +0 -73
  272. package/dist/zones-Nu3wMtds.mjs +0 -5
  273. /package/dist/{metadata-DhSO1vle.mjs → metadata-DGdCpUxn.mjs} +0 -0
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,h as t,o as n,p as r,t as i,u as a}from"./auth-BHD_B2p9.mjs";import{n as o,r as s}from"./input-validation-BpVQi9rR.mjs";import{n as c,t as l}from"./body-parser-iA3vRFmh.mjs";import{t as u}from"./output-CqGQp2r6.mjs";import{t as d}from"./dry-run-FV0pZwdg.mjs";import{t as f}from"./local-OqhVQbv0.mjs";import{t as p}from"./progress-5sHFvwez.mjs";const m={command:`create`,describe:`Create a new load balancer.`,builder:e=>e.option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned.",default:!1}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. - `"pop"`: Use the Cloudflare PoP location. - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`],default:`pop`}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. - `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`],default:`Auto`}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`],default:`Auto`}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer. - `"off"`: Use `default_pools`. - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`. - `"random"`: Select a pool randomly. - `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks). - `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. - `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. - `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf load-balancers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/load_balancers`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{adaptiveRoutingFailoverAcrossPools:e.adaptiveRoutingFailoverAcrossPools,defaultPools:e.defaultPools,description:e.description,fallbackPool:e.fallbackPool,locationStrategyMode:e.locationStrategyMode,locationStrategyPreferEcs:e.locationStrategyPreferEcs,name:e.name,networks:e.networks,proxied:e.proxied,randomSteeringDefaultWeight:e.randomSteeringDefaultWeight,sessionAffinity:e.sessionAffinity,sessionAffinityAttributesDrainDuration:e.sessionAffinityAttributesDrainDuration,sessionAffinityAttributesHeaders:e.sessionAffinityAttributesHeaders,sessionAffinityAttributesRequireAllHeaders:e.sessionAffinityAttributesRequireAllHeaders,sessionAffinityAttributesSamesite:e.sessionAffinityAttributesSamesite,sessionAffinityAttributesSecure:e.sessionAffinityAttributesSecure,sessionAffinityAttributesZeroDowntimeFailover:e.sessionAffinityAttributesZeroDowntimeFailover,sessionAffinityTtl:e.sessionAffinityTtl,steeringPolicy:e.steeringPolicy,ttl:e.ttl,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating load balancer`,async()=>n.post(`/zones/${e.zoneId}/load_balancers`,{body:t})),{successLabel:`Created load balancer`});return}if(e.defaultPools===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);e.fallbackPool===void 0&&(e.fallbackPool=await t(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),e.name===void 0&&(e.name=await t(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let r={};e.adaptiveRoutingFailoverAcrossPools!==void 0&&c(r,[`adaptive_routing`,`failover_across_pools`],e.adaptiveRoutingFailoverAcrossPools),e.defaultPools!==void 0&&c(r,[`default_pools`],e.defaultPools),e.description!==void 0&&c(r,[`description`],o(e.description,`description`,`text`)),e.fallbackPool!==void 0&&c(r,[`fallback_pool`],o(e.fallbackPool,`fallbackPool`,`text`)),e.locationStrategyMode!==void 0&&c(r,[`location_strategy`,`mode`],o(e.locationStrategyMode,`locationStrategyMode`,`text`)),e.locationStrategyPreferEcs!==void 0&&c(r,[`location_strategy`,`prefer_ecs`],o(e.locationStrategyPreferEcs,`locationStrategyPreferEcs`,`text`)),e.name!==void 0&&c(r,[`name`],o(e.name,`name`,`text`)),e.networks!==void 0&&c(r,[`networks`],e.networks),e.proxied!==void 0&&c(r,[`proxied`],e.proxied),e.randomSteeringDefaultWeight!==void 0&&c(r,[`random_steering`,`default_weight`],e.randomSteeringDefaultWeight),e.sessionAffinity!==void 0&&c(r,[`session_affinity`],o(e.sessionAffinity,`sessionAffinity`,`text`)),e.sessionAffinityAttributesDrainDuration!==void 0&&c(r,[`session_affinity_attributes`,`drain_duration`],e.sessionAffinityAttributesDrainDuration),e.sessionAffinityAttributesHeaders!==void 0&&c(r,[`session_affinity_attributes`,`headers`],e.sessionAffinityAttributesHeaders),e.sessionAffinityAttributesRequireAllHeaders!==void 0&&c(r,[`session_affinity_attributes`,`require_all_headers`],e.sessionAffinityAttributesRequireAllHeaders),e.sessionAffinityAttributesSamesite!==void 0&&c(r,[`session_affinity_attributes`,`samesite`],o(e.sessionAffinityAttributesSamesite,`sessionAffinityAttributesSamesite`,`text`)),e.sessionAffinityAttributesSecure!==void 0&&c(r,[`session_affinity_attributes`,`secure`],o(e.sessionAffinityAttributesSecure,`sessionAffinityAttributesSecure`,`text`)),e.sessionAffinityAttributesZeroDowntimeFailover!==void 0&&c(r,[`session_affinity_attributes`,`zero_downtime_failover`],o(e.sessionAffinityAttributesZeroDowntimeFailover,`sessionAffinityAttributesZeroDowntimeFailover`,`text`)),e.sessionAffinityTtl!==void 0&&c(r,[`session_affinity_ttl`],e.sessionAffinityTtl),e.steeringPolicy!==void 0&&c(r,[`steering_policy`],o(e.steeringPolicy,`steeringPolicy`,`text`)),e.ttl!==void 0&&c(r,[`ttl`],e.ttl),u(await p(`Creating load balancer`,async()=>n.post(`/zones/${e.zoneId}/load_balancers`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created load balancer`})}},h={command:`delete <loadBalancerId>`,describe:`Delete a configured load balancer.`,builder:e=>e.positional(`loadBalancerId`,{type:`string`,description:`Load balancer 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(s(e.loadBalancerId,`loadBalancerId`),e.dryRun){d({command:`cf load-balancers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/load_balancers/${e.loadBalancerId??`<loadBalancerId>`}`,pathParams:{zoneId:String(e.zoneId??``),loadBalancerId:String(e.loadBalancerId??``)},bodyKind:`json`,body:{body:e.body},validation:`passed`});return}let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await r(`load balancer`,String(e.loadBalancerId??``),{force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}if(e.body){let n=l(e.body);u(await p(`Deleting load balancer`,async()=>t.delete(`/zones/${e.zoneId}/load_balancers/${e.loadBalancerId}`,{body:n})),{successLabel:`Deleted load balancer`});return}u(await p(`Deleting load balancer`,async()=>t.loadBalancers.delete(n,e.loadBalancerId)),{successLabel:`Deleted load balancer`})}},g={command:`edit <loadBalancerId>`,describe:`Apply changes to an existing load balancer, overwriting the supplied properties.`,builder:e=>e.positional(`loadBalancerId`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned.",default:!1}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`,default:!0}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. - `"pop"`: Use the Cloudflare PoP location. - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`],default:`pop`}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. - `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`],default:`Auto`}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`],default:`Auto`}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer. - `"off"`: Use `default_pools`. - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`. - `"random"`: Select a pool randomly. - `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks). - `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. - `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. - `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(s(e.loadBalancerId,`loadBalancerId`),e.dryRun){d({command:`cf load-balancers edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/load_balancers/${e.loadBalancerId??`<loadBalancerId>`}`,pathParams:{zoneId:String(e.zoneId??``),loadBalancerId:String(e.loadBalancerId??``)},bodyKind:`json`,body:{adaptiveRoutingFailoverAcrossPools:e.adaptiveRoutingFailoverAcrossPools,defaultPools:e.defaultPools,description:e.description,enabled:e.enabled,fallbackPool:e.fallbackPool,locationStrategyMode:e.locationStrategyMode,locationStrategyPreferEcs:e.locationStrategyPreferEcs,name:e.name,proxied:e.proxied,randomSteeringDefaultWeight:e.randomSteeringDefaultWeight,sessionAffinity:e.sessionAffinity,sessionAffinityAttributesDrainDuration:e.sessionAffinityAttributesDrainDuration,sessionAffinityAttributesHeaders:e.sessionAffinityAttributesHeaders,sessionAffinityAttributesRequireAllHeaders:e.sessionAffinityAttributesRequireAllHeaders,sessionAffinityAttributesSamesite:e.sessionAffinityAttributesSamesite,sessionAffinityAttributesSecure:e.sessionAffinityAttributesSecure,sessionAffinityAttributesZeroDowntimeFailover:e.sessionAffinityAttributesZeroDowntimeFailover,sessionAffinityTtl:e.sessionAffinityTtl,steeringPolicy:e.steeringPolicy,ttl:e.ttl,body:e.body},validation:`passed`});return}let t=await i(e);if(e.zoneId=await a({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=l(e.body);u(await p(`Updating load balancer`,async()=>t.patch(`/zones/${e.zoneId}/load_balancers/${e.loadBalancerId}`,{body:n})),{successLabel:`Updated load balancer`});return}let n={};e.adaptiveRoutingFailoverAcrossPools!==void 0&&c(n,[`adaptive_routing`,`failover_across_pools`],e.adaptiveRoutingFailoverAcrossPools),e.defaultPools!==void 0&&c(n,[`default_pools`],e.defaultPools),e.description!==void 0&&c(n,[`description`],o(e.description,`description`,`text`)),e.enabled!==void 0&&c(n,[`enabled`],e.enabled),e.fallbackPool!==void 0&&c(n,[`fallback_pool`],o(e.fallbackPool,`fallbackPool`,`text`)),e.locationStrategyMode!==void 0&&c(n,[`location_strategy`,`mode`],o(e.locationStrategyMode,`locationStrategyMode`,`text`)),e.locationStrategyPreferEcs!==void 0&&c(n,[`location_strategy`,`prefer_ecs`],o(e.locationStrategyPreferEcs,`locationStrategyPreferEcs`,`text`)),e.name!==void 0&&c(n,[`name`],o(e.name,`name`,`text`)),e.proxied!==void 0&&c(n,[`proxied`],e.proxied),e.randomSteeringDefaultWeight!==void 0&&c(n,[`random_steering`,`default_weight`],e.randomSteeringDefaultWeight),e.sessionAffinity!==void 0&&c(n,[`session_affinity`],o(e.sessionAffinity,`sessionAffinity`,`text`)),e.sessionAffinityAttributesDrainDuration!==void 0&&c(n,[`session_affinity_attributes`,`drain_duration`],e.sessionAffinityAttributesDrainDuration),e.sessionAffinityAttributesHeaders!==void 0&&c(n,[`session_affinity_attributes`,`headers`],e.sessionAffinityAttributesHeaders),e.sessionAffinityAttributesRequireAllHeaders!==void 0&&c(n,[`session_affinity_attributes`,`require_all_headers`],e.sessionAffinityAttributesRequireAllHeaders),e.sessionAffinityAttributesSamesite!==void 0&&c(n,[`session_affinity_attributes`,`samesite`],o(e.sessionAffinityAttributesSamesite,`sessionAffinityAttributesSamesite`,`text`)),e.sessionAffinityAttributesSecure!==void 0&&c(n,[`session_affinity_attributes`,`secure`],o(e.sessionAffinityAttributesSecure,`sessionAffinityAttributesSecure`,`text`)),e.sessionAffinityAttributesZeroDowntimeFailover!==void 0&&c(n,[`session_affinity_attributes`,`zero_downtime_failover`],o(e.sessionAffinityAttributesZeroDowntimeFailover,`sessionAffinityAttributesZeroDowntimeFailover`,`text`)),e.sessionAffinityTtl!==void 0&&c(n,[`session_affinity_ttl`],e.sessionAffinityTtl),e.steeringPolicy!==void 0&&c(n,[`steering_policy`],o(e.steeringPolicy,`steeringPolicy`,`text`)),e.ttl!==void 0&&c(n,[`ttl`],e.ttl),u(await p(`Updating load balancer`,async()=>t.patch(`/zones/${e.zoneId}/load_balancers/${e.loadBalancerId}`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated load balancer`})}},_={command:`get <loadBalancerId>`,describe:`Fetch a single configured load balancer.`,builder:e=>e.positional(`loadBalancerId`,{type:`string`,description:`Load balancer ID`,demandOption:!0}),handler:async e=>{s(e.loadBalancerId,`loadBalancerId`);let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading load balancer`,async()=>t.loadBalancers.get(n,e.loadBalancerId)),{successLabel:`Loaded load balancer`})}},v={command:`list`,describe:`List configured load balancers.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading load balancers`,async()=>t.loadBalancers.list(n)),{successLabel:`Loaded load balancers`})}},y={command:`create`,describe:`Create a new monitor group.`,builder:e=>e.option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`id`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:{description:r.description,id:r.id,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating monitor group`,async()=>a.post(`/accounts/${m}/load_balancers/monitor_groups`,{body:e})),{successLabel:`Created monitor group`});return}r.description===void 0&&(r.description=await t(`description`,`A short description of the monitor group`)),r.id===void 0&&(r.id=await t(`id`,`The ID of the Monitor Group to use for checking the health of origins within this pool.`));let h={};r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.id!==void 0&&c(h,[`id`],o(r.id,`id`,`text`)),u(await p(`Creating monitor group`,async()=>a.post(`/accounts/${m}/load_balancers/monitor_groups`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created monitor group`})}},b={command:`delete <monitorGroupId>`,describe:`Delete a configured monitor group.`,builder:e=>e.positional(`monitorGroupId`,{type:`string`,description:`Monitor 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}),handler:async t=>{if(s(t.monitorGroupId,`monitorGroupId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitor_groups/${t.monitorGroupId??`<monitorGroupId>`}`,pathParams:{monitorGroupId:String(t.monitorGroupId??``)},bodyKind:`none`,validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`monitor group`,String(t.monitorGroupId??``),{force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}u(await p(`Deleting monitor group`,async()=>a.loadBalancers.monitorGroups.delete(t.monitorGroupId,o)),{successLabel:`Deleted monitor group`})}},x={command:`edit <monitorGroupId>`,describe:`Apply changes to an existing monitor group, overwriting the supplied properties.`,builder:e=>e.positional(`monitorGroupId`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`id`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(s(r.monitorGroupId,`monitorGroupId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${r.monitorGroupId??`<monitorGroupId>`}`,pathParams:{monitorGroupId:String(r.monitorGroupId??``)},bodyKind:`json`,body:{description:r.description,id:r.id,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Updating monitor group`,async()=>a.patch(`/accounts/${m}/load_balancers/monitor_groups/${r.monitorGroupId}`,{body:e})),{successLabel:`Updated monitor group`});return}r.description===void 0&&(r.description=await t(`description`,`A short description of the monitor group`)),r.id===void 0&&(r.id=await t(`id`,`The ID of the Monitor Group to use for checking the health of origins within this pool.`));let h={};r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.id!==void 0&&c(h,[`id`],o(r.id,`id`,`text`)),u(await p(`Updating monitor group`,async()=>a.patch(`/accounts/${m}/load_balancers/monitor_groups/${r.monitorGroupId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated monitor group`})}},S={command:`get <monitorGroupId>`,describe:`Fetch a single configured monitor group.`,builder:e=>e.positional(`monitorGroupId`,{type:`string`,description:`Monitor group ID`,demandOption:!0}),handler:async e=>{s(e.monitorGroupId,`monitorGroupId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading monitor group`,async()=>t.loadBalancers.monitorGroups.get(e.monitorGroupId,r)),{successLabel:`Loaded monitor group`})}},C={command:`list`,describe:`List configured monitor groups.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading monitor groups`,async()=>t.loadBalancers.monitorGroups.list(r)),{successLabel:`Loaded monitor groups`})}},w={command:`list`,describe:`Get the list of resources that reference the provided monitor group.`,builder:e=>e.option(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}),handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading references`,async()=>t.loadBalancers.monitorGroups.references.list(e.monitorGroupId,r)),{successLabel:`Loaded references`})}},T={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(w).demandCommand(1),handler:()=>{}},E={command:`update <monitorGroupId>`,describe:`Modify a configured monitor group.`,builder:e=>e.positional(`monitorGroupId`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`id`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(s(r.monitorGroupId,`monitorGroupId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/monitor_groups/${r.monitorGroupId??`<monitorGroupId>`}`,pathParams:{monitorGroupId:String(r.monitorGroupId??``)},bodyKind:`json`,body:{description:r.description,id:r.id,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Updating monitor group`,async()=>a.put(`/accounts/${m}/load_balancers/monitor_groups/${r.monitorGroupId}`,{body:e})),{successLabel:`Updated monitor group`});return}r.description===void 0&&(r.description=await t(`description`,`A short description of the monitor group`)),r.id===void 0&&(r.id=await t(`id`,`The ID of the Monitor Group to use for checking the health of origins within this pool.`));let h={};r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.id!==void 0&&c(h,[`id`],o(r.id,`id`,`text`)),u(await p(`Updating monitor group`,async()=>a.put(`/accounts/${m}/load_balancers/monitor_groups/${r.monitorGroupId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated monitor group`})}},D={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(y).command(b).command(x).command(S).command(C).command(E).command(T).demandCommand(1),handler:()=>{}},O={command:`create`,describe:`Create a configured monitor.`,builder:e=>e.option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:{allowInsecure:t.allowInsecure,consecutiveDown:t.consecutiveDown,consecutiveUp:t.consecutiveUp,description:t.description,expectedBody:t.expectedBody,expectedCodes:t.expectedCodes,followRedirects:t.followRedirects,interval:t.interval,method:t.method,path:t.path,port:t.port,probeZone:t.probeZone,retries:t.retries,timeout:t.timeout,type:t.type,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Creating monitor`,async()=>r.post(`/accounts/${a}/load_balancers/monitors`,{body:e})),{successLabel:`Created monitor`});return}let m={};t.allowInsecure!==void 0&&c(m,[`allow_insecure`],t.allowInsecure),t.consecutiveDown!==void 0&&c(m,[`consecutive_down`],t.consecutiveDown),t.consecutiveUp!==void 0&&c(m,[`consecutive_up`],t.consecutiveUp),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.expectedBody!==void 0&&c(m,[`expected_body`],o(t.expectedBody,`expectedBody`,`text`)),t.expectedCodes!==void 0&&c(m,[`expected_codes`],o(t.expectedCodes,`expectedCodes`,`text`)),t.followRedirects!==void 0&&c(m,[`follow_redirects`],t.followRedirects),t.interval!==void 0&&c(m,[`interval`],t.interval),t.method!==void 0&&c(m,[`method`],o(t.method,`method`,`text`)),t.path!==void 0&&c(m,[`path`],o(t.path,`path`,`text`)),t.port!==void 0&&c(m,[`port`],t.port),t.probeZone!==void 0&&c(m,[`probe_zone`],o(t.probeZone,`probeZone`,`text`)),t.retries!==void 0&&c(m,[`retries`],t.retries),t.timeout!==void 0&&c(m,[`timeout`],t.timeout),t.type!==void 0&&c(m,[`type`],o(t.type,`type`,`text`)),u(await p(`Creating monitor`,async()=>r.post(`/accounts/${a}/load_balancers/monitors`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created monitor`})}},k={command:`delete <monitorId>`,describe:`Delete a configured monitor.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.monitorId,`monitorId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitors/${t.monitorId??`<monitorId>`}`,pathParams:{monitorId:String(t.monitorId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`monitor`,String(t.monitorId??``),{force:!!t.force})){process.stderr.write(`Aborted.
5
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting monitor`,async()=>a.delete(`/accounts/${o}/load_balancers/monitors/${t.monitorId}`,{body:e})),{successLabel:`Deleted monitor`});return}u(await p(`Deleting monitor`,async()=>a.loadBalancers.monitors.delete(t.monitorId,o)),{successLabel:`Deleted monitor`})}},A={command:`edit <monitorId>`,describe:`Apply changes to an existing monitor, overwriting the supplied properties.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.monitorId,`monitorId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitors/${t.monitorId??`<monitorId>`}`,pathParams:{monitorId:String(t.monitorId??``)},bodyKind:`json`,body:{allowInsecure:t.allowInsecure,consecutiveDown:t.consecutiveDown,consecutiveUp:t.consecutiveUp,description:t.description,expectedBody:t.expectedBody,expectedCodes:t.expectedCodes,followRedirects:t.followRedirects,interval:t.interval,method:t.method,path:t.path,port:t.port,probeZone:t.probeZone,retries:t.retries,timeout:t.timeout,type:t.type,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating monitor`,async()=>r.patch(`/accounts/${a}/load_balancers/monitors/${t.monitorId}`,{body:e})),{successLabel:`Updated monitor`});return}let m={};t.allowInsecure!==void 0&&c(m,[`allow_insecure`],t.allowInsecure),t.consecutiveDown!==void 0&&c(m,[`consecutive_down`],t.consecutiveDown),t.consecutiveUp!==void 0&&c(m,[`consecutive_up`],t.consecutiveUp),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.expectedBody!==void 0&&c(m,[`expected_body`],o(t.expectedBody,`expectedBody`,`text`)),t.expectedCodes!==void 0&&c(m,[`expected_codes`],o(t.expectedCodes,`expectedCodes`,`text`)),t.followRedirects!==void 0&&c(m,[`follow_redirects`],t.followRedirects),t.interval!==void 0&&c(m,[`interval`],t.interval),t.method!==void 0&&c(m,[`method`],o(t.method,`method`,`text`)),t.path!==void 0&&c(m,[`path`],o(t.path,`path`,`text`)),t.port!==void 0&&c(m,[`port`],t.port),t.probeZone!==void 0&&c(m,[`probe_zone`],o(t.probeZone,`probeZone`,`text`)),t.retries!==void 0&&c(m,[`retries`],t.retries),t.timeout!==void 0&&c(m,[`timeout`],t.timeout),t.type!==void 0&&c(m,[`type`],o(t.type,`type`,`text`)),u(await p(`Updating monitor`,async()=>r.patch(`/accounts/${a}/load_balancers/monitors/${t.monitorId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated monitor`})}},j={command:`get <monitorId>`,describe:`List a single configured monitor for an account.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor ID`,demandOption:!0}),handler:async e=>{s(e.monitorId,`monitorId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading monitor`,async()=>t.loadBalancers.monitors.get(e.monitorId,r)),{successLabel:`Loaded monitor`})}},M={command:`list`,describe:`List configured monitors for an account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading monitors`,async()=>t.loadBalancers.monitors.list(r)),{successLabel:`Loaded monitors`})}},N={command:`create <monitorId>`,describe:`Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.monitorId,`monitorId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitors previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitors/${t.monitorId??`<monitorId>`}/preview`,pathParams:{monitorId:String(t.monitorId??``)},bodyKind:`json`,body:{allowInsecure:t.allowInsecure,consecutiveDown:t.consecutiveDown,consecutiveUp:t.consecutiveUp,description:t.description,expectedBody:t.expectedBody,expectedCodes:t.expectedCodes,followRedirects:t.followRedirects,interval:t.interval,method:t.method,path:t.path,port:t.port,probeZone:t.probeZone,retries:t.retries,timeout:t.timeout,type:t.type,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Creating preview`,async()=>r.post(`/accounts/${a}/load_balancers/monitors/${t.monitorId}/preview`,{body:e})),{successLabel:`Created preview`});return}let m={};t.allowInsecure!==void 0&&c(m,[`allow_insecure`],t.allowInsecure),t.consecutiveDown!==void 0&&c(m,[`consecutive_down`],t.consecutiveDown),t.consecutiveUp!==void 0&&c(m,[`consecutive_up`],t.consecutiveUp),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.expectedBody!==void 0&&c(m,[`expected_body`],o(t.expectedBody,`expectedBody`,`text`)),t.expectedCodes!==void 0&&c(m,[`expected_codes`],o(t.expectedCodes,`expectedCodes`,`text`)),t.followRedirects!==void 0&&c(m,[`follow_redirects`],t.followRedirects),t.interval!==void 0&&c(m,[`interval`],t.interval),t.method!==void 0&&c(m,[`method`],o(t.method,`method`,`text`)),t.path!==void 0&&c(m,[`path`],o(t.path,`path`,`text`)),t.port!==void 0&&c(m,[`port`],t.port),t.probeZone!==void 0&&c(m,[`probe_zone`],o(t.probeZone,`probeZone`,`text`)),t.retries!==void 0&&c(m,[`retries`],t.retries),t.timeout!==void 0&&c(m,[`timeout`],t.timeout),t.type!==void 0&&c(m,[`type`],o(t.type,`type`,`text`)),u(await p(`Creating preview`,async()=>r.post(`/accounts/${a}/load_balancers/monitors/${t.monitorId}/preview`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created preview`})}},P={command:`previews`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(N).demandCommand(1),handler:()=>{}},F={command:`get <monitorId>`,describe:`Get the list of resources that reference the provided monitor.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor ID`,demandOption:!0}),handler:async e=>{s(e.monitorId,`monitorId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading reference`,async()=>t.loadBalancers.monitors.references.get(e.monitorId,r)),{successLabel:`Loaded reference`})}},I={command:`references`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(F).demandCommand(1),handler:()=>{}},ee={command:`update <monitorId>`,describe:`Modify a configured monitor.`,builder:e=>e.positional(`monitorId`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.monitorId,`monitorId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/monitors/${t.monitorId??`<monitorId>`}`,pathParams:{monitorId:String(t.monitorId??``)},bodyKind:`json`,body:{allowInsecure:t.allowInsecure,consecutiveDown:t.consecutiveDown,consecutiveUp:t.consecutiveUp,description:t.description,expectedBody:t.expectedBody,expectedCodes:t.expectedCodes,followRedirects:t.followRedirects,interval:t.interval,method:t.method,path:t.path,port:t.port,probeZone:t.probeZone,retries:t.retries,timeout:t.timeout,type:t.type,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating monitor`,async()=>r.put(`/accounts/${a}/load_balancers/monitors/${t.monitorId}`,{body:e})),{successLabel:`Updated monitor`});return}let m={};t.allowInsecure!==void 0&&c(m,[`allow_insecure`],t.allowInsecure),t.consecutiveDown!==void 0&&c(m,[`consecutive_down`],t.consecutiveDown),t.consecutiveUp!==void 0&&c(m,[`consecutive_up`],t.consecutiveUp),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.expectedBody!==void 0&&c(m,[`expected_body`],o(t.expectedBody,`expectedBody`,`text`)),t.expectedCodes!==void 0&&c(m,[`expected_codes`],o(t.expectedCodes,`expectedCodes`,`text`)),t.followRedirects!==void 0&&c(m,[`follow_redirects`],t.followRedirects),t.interval!==void 0&&c(m,[`interval`],t.interval),t.method!==void 0&&c(m,[`method`],o(t.method,`method`,`text`)),t.path!==void 0&&c(m,[`path`],o(t.path,`path`,`text`)),t.port!==void 0&&c(m,[`port`],t.port),t.probeZone!==void 0&&c(m,[`probe_zone`],o(t.probeZone,`probeZone`,`text`)),t.retries!==void 0&&c(m,[`retries`],t.retries),t.timeout!==void 0&&c(m,[`timeout`],t.timeout),t.type!==void 0&&c(m,[`type`],o(t.type,`type`,`text`)),u(await p(`Updating monitor`,async()=>r.put(`/accounts/${a}/load_balancers/monitors/${t.monitorId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated monitor`})}},L={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(O).command(k).command(A).command(j).command(M).command(ee).command(P).command(I).demandCommand(1),handler:()=>{}},R={command:`bulk-edit`,describe:"Apply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending `name`. Returns the list of affected pools. Supports the standard pagination query parameters, either `limit`/`offset` or `per_page`/`page`.",builder:e=>e.option(`notification-email`,{type:`string`,description:'The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only resetting this field with an empty string `""` is accepted.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers pools bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:{notificationEmail:t.notificationEmail,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating pools`,async()=>r.patch(`/accounts/${a}/load_balancers/pools`,{body:e})),{successLabel:`Updated pools`});return}let m={};t.notificationEmail!==void 0&&c(m,[`notification_email`],o(t.notificationEmail,`notificationEmail`,`text`)),u(await p(`Updating pools`,async()=>r.patch(`/accounts/${a}/load_balancers/pools`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated pools`})}},z={command:`create`,describe:`Create a new pool.`,builder:e=>e.option(`description`,{type:`string`,description:`A human-readable description of the pool.`,default:``}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`,default:!0}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`,default:0}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`],default:`random`}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`,default:0}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`],default:`hash`}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`,default:1}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`,default:``}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use. - `"random"`: Select an origin randomly. - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address. - `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`],default:`random`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:{description:r.description,enabled:r.enabled,latitude:r.latitude,loadSheddingDefaultPercent:r.loadSheddingDefaultPercent,loadSheddingDefaultPolicy:r.loadSheddingDefaultPolicy,loadSheddingSessionPercent:r.loadSheddingSessionPercent,loadSheddingSessionPolicy:r.loadSheddingSessionPolicy,longitude:r.longitude,minimumOrigins:r.minimumOrigins,monitor:r.monitor,monitorGroup:r.monitorGroup,name:r.name,notificationEmail:r.notificationEmail,notificationFilterOriginDisable:r.notificationFilterOriginDisable,notificationFilterOriginHealthy:r.notificationFilterOriginHealthy,notificationFilterPoolDisable:r.notificationFilterPoolDisable,notificationFilterPoolHealthy:r.notificationFilterPoolHealthy,originSteeringPolicy:r.originSteeringPolicy,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating pool`,async()=>a.post(`/accounts/${m}/load_balancers/pools`,{body:e})),{successLabel:`Created pool`});return}r.name===void 0&&(r.name=await t(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let h={};r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.enabled!==void 0&&c(h,[`enabled`],r.enabled),r.latitude!==void 0&&c(h,[`latitude`],r.latitude),r.loadSheddingDefaultPercent!==void 0&&c(h,[`load_shedding`,`default_percent`],r.loadSheddingDefaultPercent),r.loadSheddingDefaultPolicy!==void 0&&c(h,[`load_shedding`,`default_policy`],o(r.loadSheddingDefaultPolicy,`loadSheddingDefaultPolicy`,`text`)),r.loadSheddingSessionPercent!==void 0&&c(h,[`load_shedding`,`session_percent`],r.loadSheddingSessionPercent),r.loadSheddingSessionPolicy!==void 0&&c(h,[`load_shedding`,`session_policy`],o(r.loadSheddingSessionPolicy,`loadSheddingSessionPolicy`,`text`)),r.longitude!==void 0&&c(h,[`longitude`],r.longitude),r.minimumOrigins!==void 0&&c(h,[`minimum_origins`],r.minimumOrigins),r.monitor!==void 0&&c(h,[`monitor`],o(r.monitor,`monitor`,`text`)),r.monitorGroup!==void 0&&c(h,[`monitor_group`],o(r.monitorGroup,`monitorGroup`,`text`)),r.name!==void 0&&c(h,[`name`],o(r.name,`name`,`text`)),r.notificationEmail!==void 0&&c(h,[`notification_email`],o(r.notificationEmail,`notificationEmail`,`text`)),r.notificationFilterOriginDisable!==void 0&&c(h,[`notification_filter`,`origin`,`disable`],r.notificationFilterOriginDisable),r.notificationFilterOriginHealthy!==void 0&&c(h,[`notification_filter`,`origin`,`healthy`],r.notificationFilterOriginHealthy),r.notificationFilterPoolDisable!==void 0&&c(h,[`notification_filter`,`pool`,`disable`],r.notificationFilterPoolDisable),r.notificationFilterPoolHealthy!==void 0&&c(h,[`notification_filter`,`pool`,`healthy`],r.notificationFilterPoolHealthy),r.originSteeringPolicy!==void 0&&c(h,[`origin_steering`,`policy`],o(r.originSteeringPolicy,`originSteeringPolicy`,`text`)),u(await p(`Creating pool`,async()=>a.post(`/accounts/${m}/load_balancers/pools`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created pool`})}},B={command:`delete <poolId>`,describe:`Delete a configured pool.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.poolId,`poolId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/pools/${t.poolId??`<poolId>`}`,pathParams:{poolId:String(t.poolId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`pool`,String(t.poolId??``),{force:!!t.force})){process.stderr.write(`Aborted.
6
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting pool`,async()=>a.delete(`/accounts/${o}/load_balancers/pools/${t.poolId}`,{body:e})),{successLabel:`Deleted pool`});return}u(await p(`Deleting pool`,async()=>a.loadBalancers.pools.delete(t.poolId,o)),{successLabel:`Deleted pool`})}},V={command:`edit <poolId>`,describe:`Apply changes to an existing pool, overwriting the supplied properties.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`,default:``}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`,default:!0}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`,default:0}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`],default:`random`}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`,default:0}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`],default:`hash`}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`,default:1}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`,default:``}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use. - `"random"`: Select an origin randomly. - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address. - `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`],default:`random`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.poolId,`poolId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers pools edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/pools/${t.poolId??`<poolId>`}`,pathParams:{poolId:String(t.poolId??``)},bodyKind:`json`,body:{checkRegions:t.checkRegions,description:t.description,enabled:t.enabled,latitude:t.latitude,loadSheddingDefaultPercent:t.loadSheddingDefaultPercent,loadSheddingDefaultPolicy:t.loadSheddingDefaultPolicy,loadSheddingSessionPercent:t.loadSheddingSessionPercent,loadSheddingSessionPolicy:t.loadSheddingSessionPolicy,longitude:t.longitude,minimumOrigins:t.minimumOrigins,monitor:t.monitor,monitorGroup:t.monitorGroup,name:t.name,notificationEmail:t.notificationEmail,notificationFilterOriginDisable:t.notificationFilterOriginDisable,notificationFilterOriginHealthy:t.notificationFilterOriginHealthy,notificationFilterPoolDisable:t.notificationFilterPoolDisable,notificationFilterPoolHealthy:t.notificationFilterPoolHealthy,originSteeringPolicy:t.originSteeringPolicy,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating pool`,async()=>r.patch(`/accounts/${a}/load_balancers/pools/${t.poolId}`,{body:e})),{successLabel:`Updated pool`});return}let m={};t.checkRegions!==void 0&&c(m,[`check_regions`],t.checkRegions),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.enabled!==void 0&&c(m,[`enabled`],t.enabled),t.latitude!==void 0&&c(m,[`latitude`],t.latitude),t.loadSheddingDefaultPercent!==void 0&&c(m,[`load_shedding`,`default_percent`],t.loadSheddingDefaultPercent),t.loadSheddingDefaultPolicy!==void 0&&c(m,[`load_shedding`,`default_policy`],o(t.loadSheddingDefaultPolicy,`loadSheddingDefaultPolicy`,`text`)),t.loadSheddingSessionPercent!==void 0&&c(m,[`load_shedding`,`session_percent`],t.loadSheddingSessionPercent),t.loadSheddingSessionPolicy!==void 0&&c(m,[`load_shedding`,`session_policy`],o(t.loadSheddingSessionPolicy,`loadSheddingSessionPolicy`,`text`)),t.longitude!==void 0&&c(m,[`longitude`],t.longitude),t.minimumOrigins!==void 0&&c(m,[`minimum_origins`],t.minimumOrigins),t.monitor!==void 0&&c(m,[`monitor`],o(t.monitor,`monitor`,`text`)),t.monitorGroup!==void 0&&c(m,[`monitor_group`],o(t.monitorGroup,`monitorGroup`,`text`)),t.name!==void 0&&c(m,[`name`],o(t.name,`name`,`text`)),t.notificationEmail!==void 0&&c(m,[`notification_email`],o(t.notificationEmail,`notificationEmail`,`text`)),t.notificationFilterOriginDisable!==void 0&&c(m,[`notification_filter`,`origin`,`disable`],t.notificationFilterOriginDisable),t.notificationFilterOriginHealthy!==void 0&&c(m,[`notification_filter`,`origin`,`healthy`],t.notificationFilterOriginHealthy),t.notificationFilterPoolDisable!==void 0&&c(m,[`notification_filter`,`pool`,`disable`],t.notificationFilterPoolDisable),t.notificationFilterPoolHealthy!==void 0&&c(m,[`notification_filter`,`pool`,`healthy`],t.notificationFilterPoolHealthy),t.originSteeringPolicy!==void 0&&c(m,[`origin_steering`,`policy`],o(t.originSteeringPolicy,`originSteeringPolicy`,`text`)),u(await p(`Updating pool`,async()=>r.patch(`/accounts/${a}/load_balancers/pools/${t.poolId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated pool`})}},H={command:`get <poolId>`,describe:`Fetch a single configured pool.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}),handler:async e=>{s(e.poolId,`poolId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading pool`,async()=>t.loadBalancers.pools.get(e.poolId,r)),{successLabel:`Loaded pool`})}},U={command:`create <poolId>`,describe:`Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,default:!1}).option(`consecutive-down`,{type:`number`,description:`To be marked unhealthy the monitored origin must fail this healthcheck N consecutive times.`}).option(`consecutive-up`,{type:`number`,description:`To be marked healthy the monitored origin must pass this healthcheck N consecutive times.`}).option(`description`,{type:`string`,description:`Object description.`,default:``}).option(`expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`expected-codes`,{type:`string`,description:`The expected HTTP response code or code range of the health check. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`,default:!1}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may improve failover time, but will increase load on the origins as we check from multiple locations.`,default:60}).option(`method`,{type:`string`,description:`The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS based checks and 'connection_established' for TCP based health checks.`}).option(`path`,{type:`string`,description:`The endpoint path you want to conduct a health check against. This parameter is only valid for HTTP and HTTPS monitors.`}).option(`port`,{type:`number`,description:`The port number to connect to for the health check. Required for TCP, UDP, and SMTP checks. HTTP and HTTPS checks should only define the port when using a non-standard port (HTTP: default 80, HTTPS: default 443).`}).option(`probe-zone`,{type:`string`,description:`Assign this monitor to emulate the specified zone while probing. This parameter is only valid for HTTP and HTTPS monitors.`,default:``}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.`,choices:[`http`,`https`,`tcp`,`udp_icmp`,`icmp_ping`,`smtp`],default:`http`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.poolId,`poolId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf load-balancers pools health create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/load_balancers/pools/${t.poolId??`<poolId>`}/preview`,pathParams:{poolId:String(t.poolId??``)},bodyKind:`json`,body:{allowInsecure:t.allowInsecure,consecutiveDown:t.consecutiveDown,consecutiveUp:t.consecutiveUp,description:t.description,expectedBody:t.expectedBody,expectedCodes:t.expectedCodes,followRedirects:t.followRedirects,interval:t.interval,method:t.method,path:t.path,port:t.port,probeZone:t.probeZone,retries:t.retries,timeout:t.timeout,type:t.type,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Creating health`,async()=>r.post(`/accounts/${a}/load_balancers/pools/${t.poolId}/preview`,{body:e})),{successLabel:`Created health`});return}let m={};t.allowInsecure!==void 0&&c(m,[`allow_insecure`],t.allowInsecure),t.consecutiveDown!==void 0&&c(m,[`consecutive_down`],t.consecutiveDown),t.consecutiveUp!==void 0&&c(m,[`consecutive_up`],t.consecutiveUp),t.description!==void 0&&c(m,[`description`],o(t.description,`description`,`text`)),t.expectedBody!==void 0&&c(m,[`expected_body`],o(t.expectedBody,`expectedBody`,`text`)),t.expectedCodes!==void 0&&c(m,[`expected_codes`],o(t.expectedCodes,`expectedCodes`,`text`)),t.followRedirects!==void 0&&c(m,[`follow_redirects`],t.followRedirects),t.interval!==void 0&&c(m,[`interval`],t.interval),t.method!==void 0&&c(m,[`method`],o(t.method,`method`,`text`)),t.path!==void 0&&c(m,[`path`],o(t.path,`path`,`text`)),t.port!==void 0&&c(m,[`port`],t.port),t.probeZone!==void 0&&c(m,[`probe_zone`],o(t.probeZone,`probeZone`,`text`)),t.retries!==void 0&&c(m,[`retries`],t.retries),t.timeout!==void 0&&c(m,[`timeout`],t.timeout),t.type!==void 0&&c(m,[`type`],o(t.type,`type`,`text`)),u(await p(`Creating health`,async()=>r.post(`/accounts/${a}/load_balancers/pools/${t.poolId}/preview`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created health`})}},W={command:`get <poolId>`,describe:`Fetch the latest pool health status for a single pool.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}),handler:async e=>{s(e.poolId,`poolId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading health`,async()=>t.loadBalancers.pools.health.get(e.poolId,r)),{successLabel:`Loaded health`})}},G={command:`health`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(U).command(W).demandCommand(1),handler:()=>{}},K={command:`list`,describe:`List configured pools.`,builder:e=>e.option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}),handler:async e=>{let t={};e.monitor!==void 0&&(t.monitor=e.monitor);let r=await i(e),a=e.local?f:await n(r);e.accountId=a,u(await p(`Loading pools`,async()=>r.loadBalancers.pools.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded pools`})}},q={command:`get <poolId>`,describe:`Get the list of resources that reference the provided pool.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}),handler:async e=>{s(e.poolId,`poolId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading reference`,async()=>t.loadBalancers.pools.references.get(e.poolId,r)),{successLabel:`Loaded reference`})}},J={command:`references`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(q).demandCommand(1),handler:()=>{}},Y={command:`update <poolId>`,describe:`Modify a configured pool.`,builder:e=>e.positional(`poolId`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`,default:``}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`,default:!0}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`,default:0}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`],default:`random`}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`,default:0}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`],default:`hash`}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`,default:1}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`,default:``}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use. - `"random"`: Select an origin randomly. - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address. - `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`],default:`random`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(s(r.poolId,`poolId`),r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/load_balancers/pools/${r.poolId??`<poolId>`}`,pathParams:{poolId:String(r.poolId??``)},bodyKind:`json`,body:{checkRegions:r.checkRegions,description:r.description,enabled:r.enabled,latitude:r.latitude,loadSheddingDefaultPercent:r.loadSheddingDefaultPercent,loadSheddingDefaultPolicy:r.loadSheddingDefaultPolicy,loadSheddingSessionPercent:r.loadSheddingSessionPercent,loadSheddingSessionPolicy:r.loadSheddingSessionPolicy,longitude:r.longitude,minimumOrigins:r.minimumOrigins,monitor:r.monitor,monitorGroup:r.monitorGroup,name:r.name,notificationEmail:r.notificationEmail,notificationFilterOriginDisable:r.notificationFilterOriginDisable,notificationFilterOriginHealthy:r.notificationFilterOriginHealthy,notificationFilterPoolDisable:r.notificationFilterPoolDisable,notificationFilterPoolHealthy:r.notificationFilterPoolHealthy,originSteeringPolicy:r.originSteeringPolicy,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Updating pool`,async()=>a.put(`/accounts/${m}/load_balancers/pools/${r.poolId}`,{body:e})),{successLabel:`Updated pool`});return}r.name===void 0&&(r.name=await t(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let h={};r.checkRegions!==void 0&&c(h,[`check_regions`],r.checkRegions),r.description!==void 0&&c(h,[`description`],o(r.description,`description`,`text`)),r.enabled!==void 0&&c(h,[`enabled`],r.enabled),r.latitude!==void 0&&c(h,[`latitude`],r.latitude),r.loadSheddingDefaultPercent!==void 0&&c(h,[`load_shedding`,`default_percent`],r.loadSheddingDefaultPercent),r.loadSheddingDefaultPolicy!==void 0&&c(h,[`load_shedding`,`default_policy`],o(r.loadSheddingDefaultPolicy,`loadSheddingDefaultPolicy`,`text`)),r.loadSheddingSessionPercent!==void 0&&c(h,[`load_shedding`,`session_percent`],r.loadSheddingSessionPercent),r.loadSheddingSessionPolicy!==void 0&&c(h,[`load_shedding`,`session_policy`],o(r.loadSheddingSessionPolicy,`loadSheddingSessionPolicy`,`text`)),r.longitude!==void 0&&c(h,[`longitude`],r.longitude),r.minimumOrigins!==void 0&&c(h,[`minimum_origins`],r.minimumOrigins),r.monitor!==void 0&&c(h,[`monitor`],o(r.monitor,`monitor`,`text`)),r.monitorGroup!==void 0&&c(h,[`monitor_group`],o(r.monitorGroup,`monitorGroup`,`text`)),r.name!==void 0&&c(h,[`name`],o(r.name,`name`,`text`)),r.notificationEmail!==void 0&&c(h,[`notification_email`],o(r.notificationEmail,`notificationEmail`,`text`)),r.notificationFilterOriginDisable!==void 0&&c(h,[`notification_filter`,`origin`,`disable`],r.notificationFilterOriginDisable),r.notificationFilterOriginHealthy!==void 0&&c(h,[`notification_filter`,`origin`,`healthy`],r.notificationFilterOriginHealthy),r.notificationFilterPoolDisable!==void 0&&c(h,[`notification_filter`,`pool`,`disable`],r.notificationFilterPoolDisable),r.notificationFilterPoolHealthy!==void 0&&c(h,[`notification_filter`,`pool`,`healthy`],r.notificationFilterPoolHealthy),r.originSteeringPolicy!==void 0&&c(h,[`origin_steering`,`policy`],o(r.originSteeringPolicy,`originSteeringPolicy`,`text`)),u(await p(`Updating pool`,async()=>a.put(`/accounts/${m}/load_balancers/pools/${r.poolId}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated pool`})}},X={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(R).command(z).command(B).command(V).command(H).command(K).command(Y).command(G).command(J).demandCommand(1),handler:()=>{}},Z={command:`get <previewId>`,describe:`Get the result of a previous preview operation using the provided preview_id.`,builder:e=>e.positional(`previewId`,{type:`string`,description:`Preview ID`,demandOption:!0}),handler:async e=>{s(e.previewId,`previewId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading preview`,async()=>t.loadBalancers.previews.get(e.previewId,r)),{successLabel:`Loaded preview`})}},Q={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(Z).demandCommand(1),handler:()=>{}},$={command:`get <regionId>`,describe:`Get a single region mapping.`,builder:e=>e.positional(`regionId`,{type:`string`,description:`A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia).`,demandOption:!0}),handler:async e=>{s(e.regionId,`regionId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading region`,async()=>t.loadBalancers.regions.get(e.regionId,r)),{successLabel:`Loaded region`})}},te={command:`list`,describe:`List all region mappings.`,builder:e=>e.option(`subdivision-code`,{type:`string`,description:`Two-letter subdivision code followed in ISO 3166-2.`}).option(`subdivision-code-a2`,{type:`string`,description:`Two-letter subdivision code followed in ISO 3166-2.`}).option(`country-code-a2`,{type:`string`,description:`Two-letter alpha-2 country code followed in ISO 3166-1.`}),handler:async e=>{let t={};e.subdivisionCode!==void 0&&(t.subdivision_code=e.subdivisionCode),e.subdivisionCodeA2!==void 0&&(t.subdivision_code_a2=e.subdivisionCodeA2),e.countryCodeA2!==void 0&&(t.country_code_a2=e.countryCodeA2);let r=await i(e),a=e.local?f:await n(r);e.accountId=a,u(await p(`Loading regions`,async()=>r.loadBalancers.regions.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded regions`})}},ne={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command($).command(te).demandCommand(1),handler:()=>{}},re={command:`list`,describe:`Search for Load Balancing resources.`,builder:e=>e.option(`query`,{type:`string`,description:`Search query term.`}).option(`references`,{type:`string`,description:`The type of references to include. "*" to include both referral and referrer references. "" to not include any reference information.`,choices:[`*`,`referral`,`referrer`]}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}),handler:async e=>{let t={};e.query!==void 0&&(t.query=e.query),e.references!==void 0&&(t.references=e.references),e.page!==void 0&&(t.page=e.page),e.perPage!==void 0&&(t.per_page=e.perPage);let r=await i(e),a=e.local?f:await n(r);e.accountId=a,u(await p(`Loading searches`,async()=>r.loadBalancers.searches.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded searches`})}},ie={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(re).demandCommand(1),handler:()=>{}},ae={command:`update <loadBalancerId>`,describe:`Update a configured load balancer.`,builder:e=>e.positional(`loadBalancerId`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned.",default:!1}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`,default:!0}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful. - `"pop"`: Use the Cloudflare PoP location. - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`],default:`pop`}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location. - `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`],default:`proximity`}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`,default:!1}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`,default:1}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`],default:`none`}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.',default:!1}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`],default:`Auto`}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`],default:`Auto`}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`],default:`none`}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer. - `"off"`: Use `default_pools`. - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`. - `"random"`: Select a pool randomly. - `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks). - `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. - `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. - `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. - `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`],default:``}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(s(e.loadBalancerId,`loadBalancerId`),e.dryRun){d({command:`cf load-balancers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/load_balancers/${e.loadBalancerId??`<loadBalancerId>`}`,pathParams:{zoneId:String(e.zoneId??``),loadBalancerId:String(e.loadBalancerId??``)},bodyKind:`json`,body:{adaptiveRoutingFailoverAcrossPools:e.adaptiveRoutingFailoverAcrossPools,defaultPools:e.defaultPools,description:e.description,enabled:e.enabled,fallbackPool:e.fallbackPool,locationStrategyMode:e.locationStrategyMode,locationStrategyPreferEcs:e.locationStrategyPreferEcs,name:e.name,networks:e.networks,proxied:e.proxied,randomSteeringDefaultWeight:e.randomSteeringDefaultWeight,sessionAffinity:e.sessionAffinity,sessionAffinityAttributesDrainDuration:e.sessionAffinityAttributesDrainDuration,sessionAffinityAttributesHeaders:e.sessionAffinityAttributesHeaders,sessionAffinityAttributesRequireAllHeaders:e.sessionAffinityAttributesRequireAllHeaders,sessionAffinityAttributesSamesite:e.sessionAffinityAttributesSamesite,sessionAffinityAttributesSecure:e.sessionAffinityAttributesSecure,sessionAffinityAttributesZeroDowntimeFailover:e.sessionAffinityAttributesZeroDowntimeFailover,sessionAffinityTtl:e.sessionAffinityTtl,steeringPolicy:e.steeringPolicy,ttl:e.ttl,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Updating load balancer`,async()=>n.put(`/zones/${e.zoneId}/load_balancers/${e.loadBalancerId}`,{body:t})),{successLabel:`Updated load balancer`});return}if(e.defaultPools===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);e.fallbackPool===void 0&&(e.fallbackPool=await t(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),e.name===void 0&&(e.name=await t(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let r={};e.adaptiveRoutingFailoverAcrossPools!==void 0&&c(r,[`adaptive_routing`,`failover_across_pools`],e.adaptiveRoutingFailoverAcrossPools),e.defaultPools!==void 0&&c(r,[`default_pools`],e.defaultPools),e.description!==void 0&&c(r,[`description`],o(e.description,`description`,`text`)),e.enabled!==void 0&&c(r,[`enabled`],e.enabled),e.fallbackPool!==void 0&&c(r,[`fallback_pool`],o(e.fallbackPool,`fallbackPool`,`text`)),e.locationStrategyMode!==void 0&&c(r,[`location_strategy`,`mode`],o(e.locationStrategyMode,`locationStrategyMode`,`text`)),e.locationStrategyPreferEcs!==void 0&&c(r,[`location_strategy`,`prefer_ecs`],o(e.locationStrategyPreferEcs,`locationStrategyPreferEcs`,`text`)),e.name!==void 0&&c(r,[`name`],o(e.name,`name`,`text`)),e.networks!==void 0&&c(r,[`networks`],e.networks),e.proxied!==void 0&&c(r,[`proxied`],e.proxied),e.randomSteeringDefaultWeight!==void 0&&c(r,[`random_steering`,`default_weight`],e.randomSteeringDefaultWeight),e.sessionAffinity!==void 0&&c(r,[`session_affinity`],o(e.sessionAffinity,`sessionAffinity`,`text`)),e.sessionAffinityAttributesDrainDuration!==void 0&&c(r,[`session_affinity_attributes`,`drain_duration`],e.sessionAffinityAttributesDrainDuration),e.sessionAffinityAttributesHeaders!==void 0&&c(r,[`session_affinity_attributes`,`headers`],e.sessionAffinityAttributesHeaders),e.sessionAffinityAttributesRequireAllHeaders!==void 0&&c(r,[`session_affinity_attributes`,`require_all_headers`],e.sessionAffinityAttributesRequireAllHeaders),e.sessionAffinityAttributesSamesite!==void 0&&c(r,[`session_affinity_attributes`,`samesite`],o(e.sessionAffinityAttributesSamesite,`sessionAffinityAttributesSamesite`,`text`)),e.sessionAffinityAttributesSecure!==void 0&&c(r,[`session_affinity_attributes`,`secure`],o(e.sessionAffinityAttributesSecure,`sessionAffinityAttributesSecure`,`text`)),e.sessionAffinityAttributesZeroDowntimeFailover!==void 0&&c(r,[`session_affinity_attributes`,`zero_downtime_failover`],o(e.sessionAffinityAttributesZeroDowntimeFailover,`sessionAffinityAttributesZeroDowntimeFailover`,`text`)),e.sessionAffinityTtl!==void 0&&c(r,[`session_affinity_ttl`],e.sessionAffinityTtl),e.steeringPolicy!==void 0&&c(r,[`steering_policy`],o(e.steeringPolicy,`steeringPolicy`,`text`)),e.ttl!==void 0&&c(r,[`ttl`],e.ttl),u(await p(`Updating load balancer`,async()=>n.put(`/zones/${e.zoneId}/load_balancers/${e.loadBalancerId}`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Updated load balancer`})}},oe={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(m).command(h).command(g).command(_).command(v).command(ae).command(D).command(L).command(X).command(Q).command(ne).command(ie).demandCommand(1),handler:()=>{}};export{oe as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e}from"./rolldown-runtime-CR7SCCRW.mjs";var t=e({LOCAL_ACCOUNT_ID:()=>c,createLocalFetch:()=>r,rewriteHeaders:()=>s,rewriteRequest:()=>a,rewriteUrl:()=>o});const n=/^\/accounts\/[^/]+/;function r(e){let t=e.endpoint;return async function(e,n){let r=a(i(e,n),t);return globalThis.fetch(r)}}function i(e,t){return e instanceof Request?t?new Request(e,t):e:new Request(typeof e==`string`?e:e.toString(),t)}function a(e,t){let n=o(e.url,t),r=s(e.headers),i=e.body?e.clone():e;return new Request(n,{method:i.method,headers:r,body:i.body,duplex:`half`,signal:i.signal,credentials:i.credentials,redirect:i.redirect})}function o(e,t){if(!e.startsWith(`https://api.cloudflare.com/client/v4`))return e;let r=t.replace(/\/+$/,``),i=e.slice(36),a=i.indexOf(`?`),o=a===-1?i:i.slice(0,a),s=a===-1?``:i.slice(a),c=o.replace(n,``);return`${r}/cdn-cgi/explorer/api${c===``?`/`:c}${s}`}function s(e){let t=new Headers(e);return t.delete(`Authorization`),t.set(`Host`,`localhost`),t.set(`X-Miniflare-Explorer-No-Aggregate`,`true`),t}const c=`local`;export{r as n,t as r,c as t};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,h as t,o as n,p as r,t as i,u as a}from"./auth-BHD_B2p9.mjs";import{n as o,r as s}from"./input-validation-BpVQi9rR.mjs";import{n as c,t as l}from"./body-parser-iA3vRFmh.mjs";import{t as u}from"./output-CqGQp2r6.mjs";import{t as d}from"./dry-run-FV0pZwdg.mjs";import{t as f}from"./local-OqhVQbv0.mjs";import{t as p}from"./progress-5sHFvwez.mjs";const m={command:`get <datasetId>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:e=>e.positional(`datasetId`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}),handler:async e=>{s(e.datasetId,`datasetId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading field`,async()=>t.logpush.accountDatasets.fields.get(e.datasetId,r)),{successLabel:`Loaded field`})}},h={command:`fields`,describe:`Account-scoped Logpush dataset fields and jobs`,builder:e=>e.command(m).demandCommand(1),handler:()=>{}},ee={command:`get <datasetId>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:e=>e.positional(`datasetId`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}),handler:async e=>{s(e.datasetId,`datasetId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading job`,async()=>t.logpush.accountDatasets.jobs.get(e.datasetId,r)),{successLabel:`Loaded job`})}},g={command:`jobs`,describe:`Account-scoped Logpush dataset fields and jobs`,builder:e=>e.command(ee).demandCommand(1),handler:()=>{}},_={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(g).demandCommand(1),handler:()=>{}},v={command:`create`,describe:`Creates a new Logpush job for an account.`,builder:e=>e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.warp_config_changes.warp_toggle_changes.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:{dataset:r.dataset,destinationConf:r.destinationConf,enabled:r.enabled,filter:r.filter,frequency:r.frequency,kind:r.kind,logpullOptions:r.logpullOptions,name:r.name,outputOptionsCve202144228:r.outputOptionsCve202144228,outputOptionsBatchPrefix:r.outputOptionsBatchPrefix,outputOptionsBatchSuffix:r.outputOptionsBatchSuffix,outputOptionsFieldDelimiter:r.outputOptionsFieldDelimiter,outputOptionsFieldNames:r.outputOptionsFieldNames,outputOptionsMergeSubrequests:r.outputOptionsMergeSubrequests,outputOptionsOutputType:r.outputOptionsOutputType,outputOptionsRecordDelimiter:r.outputOptionsRecordDelimiter,outputOptionsRecordPrefix:r.outputOptionsRecordPrefix,outputOptionsRecordSuffix:r.outputOptionsRecordSuffix,outputOptionsRecordTemplate:r.outputOptionsRecordTemplate,outputOptionsSampleRate:r.outputOptionsSampleRate,outputOptionsTimestampFormat:r.outputOptionsTimestampFormat,ownershipChallenge:r.ownershipChallenge,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating account job`,async()=>a.post(`/accounts/${m}/logpush/jobs`,{body:e})),{successLabel:`Created account job`});return}r.destinationConf===void 0&&(r.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let h={};r.dataset!==void 0&&c(h,[`dataset`],o(r.dataset,`dataset`,`text`)),r.destinationConf!==void 0&&c(h,[`destination_conf`],o(r.destinationConf,`destinationConf`,`text`)),r.enabled!==void 0&&c(h,[`enabled`],r.enabled),r.filter!==void 0&&c(h,[`filter`],o(r.filter,`filter`,`text`)),r.frequency!==void 0&&c(h,[`frequency`],o(r.frequency,`frequency`,`text`)),r.kind!==void 0&&c(h,[`kind`],o(r.kind,`kind`,`text`)),r.logpullOptions!==void 0&&c(h,[`logpull_options`],o(r.logpullOptions,`logpullOptions`,`text`)),r.name!==void 0&&c(h,[`name`],o(r.name,`name`,`text`)),r.outputOptionsCve202144228!==void 0&&c(h,[`output_options`,`CVE-2021-44228`],r.outputOptionsCve202144228),r.outputOptionsBatchPrefix!==void 0&&c(h,[`output_options`,`batch_prefix`],o(r.outputOptionsBatchPrefix,`outputOptionsBatchPrefix`,`text`)),r.outputOptionsBatchSuffix!==void 0&&c(h,[`output_options`,`batch_suffix`],o(r.outputOptionsBatchSuffix,`outputOptionsBatchSuffix`,`text`)),r.outputOptionsFieldDelimiter!==void 0&&c(h,[`output_options`,`field_delimiter`],o(r.outputOptionsFieldDelimiter,`outputOptionsFieldDelimiter`,`text`)),r.outputOptionsFieldNames!==void 0&&c(h,[`output_options`,`field_names`],r.outputOptionsFieldNames),r.outputOptionsMergeSubrequests!==void 0&&c(h,[`output_options`,`merge_subrequests`],r.outputOptionsMergeSubrequests),r.outputOptionsOutputType!==void 0&&c(h,[`output_options`,`output_type`],o(r.outputOptionsOutputType,`outputOptionsOutputType`,`text`)),r.outputOptionsRecordDelimiter!==void 0&&c(h,[`output_options`,`record_delimiter`],o(r.outputOptionsRecordDelimiter,`outputOptionsRecordDelimiter`,`text`)),r.outputOptionsRecordPrefix!==void 0&&c(h,[`output_options`,`record_prefix`],o(r.outputOptionsRecordPrefix,`outputOptionsRecordPrefix`,`text`)),r.outputOptionsRecordSuffix!==void 0&&c(h,[`output_options`,`record_suffix`],o(r.outputOptionsRecordSuffix,`outputOptionsRecordSuffix`,`text`)),r.outputOptionsRecordTemplate!==void 0&&c(h,[`output_options`,`record_template`],o(r.outputOptionsRecordTemplate,`outputOptionsRecordTemplate`,`text`)),r.outputOptionsSampleRate!==void 0&&c(h,[`output_options`,`sample_rate`],r.outputOptionsSampleRate),r.outputOptionsTimestampFormat!==void 0&&c(h,[`output_options`,`timestamp_format`],o(r.outputOptionsTimestampFormat,`outputOptionsTimestampFormat`,`text`)),r.ownershipChallenge!==void 0&&c(h,[`ownership_challenge`],o(r.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Creating account job`,async()=>a.post(`/accounts/${m}/logpush/jobs`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account job`})}},y={command:`delete <jobId>`,describe:`Deletes a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.jobId,`jobId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/logpush/jobs/${t.jobId??`<jobId>`}`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`json`,body:{body:t.body},validation:`passed`});return}let a=await i(t),o=t.local?f:await n(a);if(t.accountId=o,!await r(`account job`,String(t.jobId??``),{force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}if(t.body){let e=l(t.body);u(await p(`Deleting account job`,async()=>a.delete(`/accounts/${o}/logpush/jobs/${t.jobId}`,{body:e})),{successLabel:`Deleted account job`});return}u(await p(`Deleting account job`,async()=>a.logpush.accountJobs.delete(t.jobId,o)),{successLabel:`Deleted account job`})}},b={command:`get <jobId>`,describe:`Gets the details of a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}),handler:async e=>{s(e.jobId,`jobId`);let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading account job`,async()=>t.logpush.accountJobs.get(e.jobId,r)),{successLabel:`Loaded account job`})}},x={command:`list`,describe:`Lists Logpush jobs for an account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading account jobs`,async()=>t.logpush.accountJobs.list(r)),{successLabel:`Loaded account jobs`})}},S={command:`update <jobId>`,describe:`Updates a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(s(t.jobId,`jobId`),t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/logpush/jobs/${t.jobId??`<jobId>`}`,pathParams:{jobId:String(t.jobId??``)},bodyKind:`json`,body:{destinationConf:t.destinationConf,enabled:t.enabled,filter:t.filter,frequency:t.frequency,kind:t.kind,logpullOptions:t.logpullOptions,name:t.name,outputOptionsCve202144228:t.outputOptionsCve202144228,outputOptionsBatchPrefix:t.outputOptionsBatchPrefix,outputOptionsBatchSuffix:t.outputOptionsBatchSuffix,outputOptionsFieldDelimiter:t.outputOptionsFieldDelimiter,outputOptionsFieldNames:t.outputOptionsFieldNames,outputOptionsMergeSubrequests:t.outputOptionsMergeSubrequests,outputOptionsOutputType:t.outputOptionsOutputType,outputOptionsRecordDelimiter:t.outputOptionsRecordDelimiter,outputOptionsRecordPrefix:t.outputOptionsRecordPrefix,outputOptionsRecordSuffix:t.outputOptionsRecordSuffix,outputOptionsRecordTemplate:t.outputOptionsRecordTemplate,outputOptionsSampleRate:t.outputOptionsSampleRate,outputOptionsTimestampFormat:t.outputOptionsTimestampFormat,ownershipChallenge:t.ownershipChallenge,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating account job`,async()=>r.put(`/accounts/${a}/logpush/jobs/${t.jobId}`,{body:e})),{successLabel:`Updated account job`});return}let m={};t.destinationConf!==void 0&&c(m,[`destination_conf`],o(t.destinationConf,`destinationConf`,`text`)),t.enabled!==void 0&&c(m,[`enabled`],t.enabled),t.filter!==void 0&&c(m,[`filter`],o(t.filter,`filter`,`text`)),t.frequency!==void 0&&c(m,[`frequency`],o(t.frequency,`frequency`,`text`)),t.kind!==void 0&&c(m,[`kind`],o(t.kind,`kind`,`text`)),t.logpullOptions!==void 0&&c(m,[`logpull_options`],o(t.logpullOptions,`logpullOptions`,`text`)),t.name!==void 0&&c(m,[`name`],o(t.name,`name`,`text`)),t.outputOptionsCve202144228!==void 0&&c(m,[`output_options`,`CVE-2021-44228`],t.outputOptionsCve202144228),t.outputOptionsBatchPrefix!==void 0&&c(m,[`output_options`,`batch_prefix`],o(t.outputOptionsBatchPrefix,`outputOptionsBatchPrefix`,`text`)),t.outputOptionsBatchSuffix!==void 0&&c(m,[`output_options`,`batch_suffix`],o(t.outputOptionsBatchSuffix,`outputOptionsBatchSuffix`,`text`)),t.outputOptionsFieldDelimiter!==void 0&&c(m,[`output_options`,`field_delimiter`],o(t.outputOptionsFieldDelimiter,`outputOptionsFieldDelimiter`,`text`)),t.outputOptionsFieldNames!==void 0&&c(m,[`output_options`,`field_names`],t.outputOptionsFieldNames),t.outputOptionsMergeSubrequests!==void 0&&c(m,[`output_options`,`merge_subrequests`],t.outputOptionsMergeSubrequests),t.outputOptionsOutputType!==void 0&&c(m,[`output_options`,`output_type`],o(t.outputOptionsOutputType,`outputOptionsOutputType`,`text`)),t.outputOptionsRecordDelimiter!==void 0&&c(m,[`output_options`,`record_delimiter`],o(t.outputOptionsRecordDelimiter,`outputOptionsRecordDelimiter`,`text`)),t.outputOptionsRecordPrefix!==void 0&&c(m,[`output_options`,`record_prefix`],o(t.outputOptionsRecordPrefix,`outputOptionsRecordPrefix`,`text`)),t.outputOptionsRecordSuffix!==void 0&&c(m,[`output_options`,`record_suffix`],o(t.outputOptionsRecordSuffix,`outputOptionsRecordSuffix`,`text`)),t.outputOptionsRecordTemplate!==void 0&&c(m,[`output_options`,`record_template`],o(t.outputOptionsRecordTemplate,`outputOptionsRecordTemplate`,`text`)),t.outputOptionsSampleRate!==void 0&&c(m,[`output_options`,`sample_rate`],t.outputOptionsSampleRate),t.outputOptionsTimestampFormat!==void 0&&c(m,[`output_options`,`timestamp_format`],o(t.outputOptionsTimestampFormat,`outputOptionsTimestampFormat`,`text`)),t.ownershipChallenge!==void 0&&c(m,[`ownership_challenge`],o(t.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Updating account job`,async()=>r.put(`/accounts/${a}/logpush/jobs/${t.jobId}`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Updated account job`})}},C={command:`account-jobs`,describe:`Account-scoped Logpush job management`,builder:e=>e.command(v).command(y).command(b).command(x).command(S).demandCommand(1),handler:()=>{}},w={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/ownership`,pathParams:{},bodyKind:`json`,body:{destinationConf:r.destinationConf,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating account ownership`,async()=>a.post(`/accounts/${m}/logpush/ownership`,{body:e})),{successLabel:`Created account ownership`});return}r.destinationConf===void 0&&(r.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let h={};r.destinationConf!==void 0&&c(h,[`destination_conf`],o(r.destinationConf,`destinationConf`,`text`)),u(await p(`Creating account ownership`,async()=>a.post(`/accounts/${m}/logpush/ownership`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account ownership`})}},T={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/ownership/validate`,pathParams:{},bodyKind:`json`,body:{destinationConf:r.destinationConf,ownershipChallenge:r.ownershipChallenge,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating account ownership`,async()=>a.post(`/accounts/${m}/logpush/ownership/validate`,{body:e})),{successLabel:`Created account ownership`});return}r.destinationConf===void 0&&(r.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),r.ownershipChallenge===void 0&&(r.ownershipChallenge=await t(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let h={};r.destinationConf!==void 0&&c(h,[`destination_conf`],o(r.destinationConf,`destinationConf`,`text`)),r.ownershipChallenge!==void 0&&c(h,[`ownership_challenge`],o(r.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Creating account ownership`,async()=>a.post(`/accounts/${m}/logpush/ownership/validate`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account ownership`})}},E={command:`validate`,describe:`Account-scoped Logpush destination ownership verification`,builder:e=>e.command(T).demandCommand(1),handler:()=>{}},D={command:`account-ownership`,describe:`Account-scoped Logpush destination ownership verification`,builder:e=>e.command(w).command(E).demandCommand(1),handler:()=>{}},O={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/validate/destination/exists`,pathParams:{},bodyKind:`json`,body:{destinationConf:r.destinationConf,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating account validate`,async()=>a.post(`/accounts/${m}/logpush/validate/destination/exists`,{body:e})),{successLabel:`Created account validate`});return}r.destinationConf===void 0&&(r.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let h={};r.destinationConf!==void 0&&c(h,[`destination_conf`],o(r.destinationConf,`destinationConf`,`text`)),u(await p(`Creating account validate`,async()=>a.post(`/accounts/${m}/logpush/validate/destination/exists`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account validate`})}},k={command:`delete`,describe:`Validates destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/validate/destination`,pathParams:{},bodyKind:`json`,body:{destinationConf:r.destinationConf,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating destination`,async()=>a.post(`/accounts/${m}/logpush/validate/destination`,{body:e})),{successLabel:`Created destination`});return}r.destinationConf===void 0&&(r.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let h={};r.destinationConf!==void 0&&c(h,[`destination_conf`],o(r.destinationConf,`destinationConf`,`text`)),u(await p(`Creating destination`,async()=>a.post(`/accounts/${m}/logpush/validate/destination`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created destination`})}},A={command:`destination`,describe:`Account-scoped Logpush destination and origin validation`,builder:e=>e.command(k).demandCommand(1),handler:()=>{}},j={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:e=>e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logpush/validate/origin`,pathParams:{},bodyKind:`json`,body:{logpullOptions:r.logpullOptions,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating origin`,async()=>a.post(`/accounts/${m}/logpush/validate/origin`,{body:e})),{successLabel:`Created origin`});return}r.logpullOptions===void 0&&(r.logpullOptions=await t(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let h={};r.logpullOptions!==void 0&&c(h,[`logpull_options`],o(r.logpullOptions,`logpullOptions`,`text`)),u(await p(`Creating origin`,async()=>a.post(`/accounts/${m}/logpush/validate/origin`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created origin`})}},M={command:`origin`,describe:`Account-scoped Logpush destination and origin validation`,builder:e=>e.command(j).demandCommand(1),handler:()=>{}},N={command:`account-validate`,describe:`Account-scoped Logpush destination and origin validation`,builder:e=>e.command(O).command(A).command(M).demandCommand(1),handler:()=>{}},P={command:`get <datasetId>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:e=>e.positional(`datasetId`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}),handler:async e=>{s(e.datasetId,`datasetId`);let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading field`,async()=>t.logpush.datasets.fields.get(e.datasetId,n)),{successLabel:`Loaded field`})}},F={command:`fields`,describe:`Available log datasets and their fields — HTTP requests, firewall events, DNS queries, etc.`,builder:e=>e.command(P).demandCommand(1),handler:()=>{}},I={command:`get <datasetId>`,describe:`Lists Logpush jobs for a zone for a dataset.`,builder:e=>e.positional(`datasetId`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}),handler:async e=>{s(e.datasetId,`datasetId`);let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading job`,async()=>t.logpush.datasets.jobs.get(e.datasetId,n)),{successLabel:`Loaded job`})}},L={command:`jobs`,describe:`Available log datasets and their fields — HTTP requests, firewall events, DNS queries, etc.`,builder:e=>e.command(I).demandCommand(1),handler:()=>{}},R={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(F).command(L).demandCommand(1),handler:()=>{}},z={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:e=>e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/edge/jobs`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{fields:e.fields,filter:e.filter,sample:e.sample,body:e.body},validation:`passed`});return}let t=await i(e);if(e.zoneId=await a({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=l(e.body);u(await p(`Creating edge`,async()=>t.post(`/zones/${e.zoneId}/logpush/edge/jobs`,{body:n})),{successLabel:`Created edge`});return}let n={};e.fields!==void 0&&c(n,[`fields`],o(e.fields,`fields`,`text`)),e.filter!==void 0&&c(n,[`filter`],o(e.filter,`filter`,`text`)),e.sample!==void 0&&c(n,[`sample`],e.sample),u(await p(`Creating edge`,async()=>t.post(`/zones/${e.zoneId}/logpush/edge/jobs`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Created edge`})}},B={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading edge`,async()=>t.logpush.edge.get(n)),{successLabel:`Loaded edge`})}},V={command:`edge`,describe:`Instant Logs — stream real-time log samples directly from the edge without storage`,builder:e=>e.command(z).command(B).demandCommand(1),handler:()=>{}},H={command:`create`,describe:`Creates a new Logpush job for a zone.`,builder:e=>e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.warp_config_changes.warp_toggle_changes.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/jobs`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{dataset:e.dataset,destinationConf:e.destinationConf,enabled:e.enabled,filter:e.filter,frequency:e.frequency,kind:e.kind,logpullOptions:e.logpullOptions,name:e.name,outputOptionsCve202144228:e.outputOptionsCve202144228,outputOptionsBatchPrefix:e.outputOptionsBatchPrefix,outputOptionsBatchSuffix:e.outputOptionsBatchSuffix,outputOptionsFieldDelimiter:e.outputOptionsFieldDelimiter,outputOptionsFieldNames:e.outputOptionsFieldNames,outputOptionsMergeSubrequests:e.outputOptionsMergeSubrequests,outputOptionsOutputType:e.outputOptionsOutputType,outputOptionsRecordDelimiter:e.outputOptionsRecordDelimiter,outputOptionsRecordPrefix:e.outputOptionsRecordPrefix,outputOptionsRecordSuffix:e.outputOptionsRecordSuffix,outputOptionsRecordTemplate:e.outputOptionsRecordTemplate,outputOptionsSampleRate:e.outputOptionsSampleRate,outputOptionsTimestampFormat:e.outputOptionsTimestampFormat,ownershipChallenge:e.ownershipChallenge,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating job`,async()=>n.post(`/zones/${e.zoneId}/logpush/jobs`,{body:t})),{successLabel:`Created job`});return}e.destinationConf===void 0&&(e.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let r={};e.dataset!==void 0&&c(r,[`dataset`],o(e.dataset,`dataset`,`text`)),e.destinationConf!==void 0&&c(r,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),e.enabled!==void 0&&c(r,[`enabled`],e.enabled),e.filter!==void 0&&c(r,[`filter`],o(e.filter,`filter`,`text`)),e.frequency!==void 0&&c(r,[`frequency`],o(e.frequency,`frequency`,`text`)),e.kind!==void 0&&c(r,[`kind`],o(e.kind,`kind`,`text`)),e.logpullOptions!==void 0&&c(r,[`logpull_options`],o(e.logpullOptions,`logpullOptions`,`text`)),e.name!==void 0&&c(r,[`name`],o(e.name,`name`,`text`)),e.outputOptionsCve202144228!==void 0&&c(r,[`output_options`,`CVE-2021-44228`],e.outputOptionsCve202144228),e.outputOptionsBatchPrefix!==void 0&&c(r,[`output_options`,`batch_prefix`],o(e.outputOptionsBatchPrefix,`outputOptionsBatchPrefix`,`text`)),e.outputOptionsBatchSuffix!==void 0&&c(r,[`output_options`,`batch_suffix`],o(e.outputOptionsBatchSuffix,`outputOptionsBatchSuffix`,`text`)),e.outputOptionsFieldDelimiter!==void 0&&c(r,[`output_options`,`field_delimiter`],o(e.outputOptionsFieldDelimiter,`outputOptionsFieldDelimiter`,`text`)),e.outputOptionsFieldNames!==void 0&&c(r,[`output_options`,`field_names`],e.outputOptionsFieldNames),e.outputOptionsMergeSubrequests!==void 0&&c(r,[`output_options`,`merge_subrequests`],e.outputOptionsMergeSubrequests),e.outputOptionsOutputType!==void 0&&c(r,[`output_options`,`output_type`],o(e.outputOptionsOutputType,`outputOptionsOutputType`,`text`)),e.outputOptionsRecordDelimiter!==void 0&&c(r,[`output_options`,`record_delimiter`],o(e.outputOptionsRecordDelimiter,`outputOptionsRecordDelimiter`,`text`)),e.outputOptionsRecordPrefix!==void 0&&c(r,[`output_options`,`record_prefix`],o(e.outputOptionsRecordPrefix,`outputOptionsRecordPrefix`,`text`)),e.outputOptionsRecordSuffix!==void 0&&c(r,[`output_options`,`record_suffix`],o(e.outputOptionsRecordSuffix,`outputOptionsRecordSuffix`,`text`)),e.outputOptionsRecordTemplate!==void 0&&c(r,[`output_options`,`record_template`],o(e.outputOptionsRecordTemplate,`outputOptionsRecordTemplate`,`text`)),e.outputOptionsSampleRate!==void 0&&c(r,[`output_options`,`sample_rate`],e.outputOptionsSampleRate),e.outputOptionsTimestampFormat!==void 0&&c(r,[`output_options`,`timestamp_format`],o(e.outputOptionsTimestampFormat,`outputOptionsTimestampFormat`,`text`)),e.ownershipChallenge!==void 0&&c(r,[`ownership_challenge`],o(e.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Creating job`,async()=>n.post(`/zones/${e.zoneId}/logpush/jobs`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created job`})}},U={command:`delete <jobId>`,describe:`Deletes a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(s(e.jobId,`jobId`),e.dryRun){d({command:`cf logpush jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/jobs/${e.jobId??`<jobId>`}`,pathParams:{jobId:String(e.jobId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{body:e.body},validation:`passed`});return}let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await r(`job`,String(e.jobId??``),{force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}if(e.body){let n=l(e.body);u(await p(`Deleting job`,async()=>t.delete(`/zones/${e.zoneId}/logpush/jobs/${e.jobId}`,{body:n})),{successLabel:`Deleted job`});return}u(await p(`Deleting job`,async()=>t.logpush.jobs.delete(e.jobId,n)),{successLabel:`Deleted job`})}},te={command:`get <jobId>`,describe:`Gets the details of a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}),handler:async e=>{s(e.jobId,`jobId`);let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading job`,async()=>t.logpush.jobs.get(e.jobId,n)),{successLabel:`Loaded job`})}},W={command:`list`,describe:`Lists Logpush jobs for a zone.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading jobs`,async()=>t.logpush.jobs.list(n)),{successLabel:`Loaded jobs`})}},G={command:`update <jobId>`,describe:`Updates a Logpush job.`,builder:e=>e.positional(`jobId`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(s(e.jobId,`jobId`),e.dryRun){d({command:`cf logpush jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/jobs/${e.jobId??`<jobId>`}`,pathParams:{jobId:String(e.jobId??``),zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{destinationConf:e.destinationConf,enabled:e.enabled,filter:e.filter,frequency:e.frequency,kind:e.kind,logpullOptions:e.logpullOptions,name:e.name,outputOptionsCve202144228:e.outputOptionsCve202144228,outputOptionsBatchPrefix:e.outputOptionsBatchPrefix,outputOptionsBatchSuffix:e.outputOptionsBatchSuffix,outputOptionsFieldDelimiter:e.outputOptionsFieldDelimiter,outputOptionsFieldNames:e.outputOptionsFieldNames,outputOptionsMergeSubrequests:e.outputOptionsMergeSubrequests,outputOptionsOutputType:e.outputOptionsOutputType,outputOptionsRecordDelimiter:e.outputOptionsRecordDelimiter,outputOptionsRecordPrefix:e.outputOptionsRecordPrefix,outputOptionsRecordSuffix:e.outputOptionsRecordSuffix,outputOptionsRecordTemplate:e.outputOptionsRecordTemplate,outputOptionsSampleRate:e.outputOptionsSampleRate,outputOptionsTimestampFormat:e.outputOptionsTimestampFormat,ownershipChallenge:e.ownershipChallenge,body:e.body},validation:`passed`});return}let t=await i(e);if(e.zoneId=await a({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=l(e.body);u(await p(`Updating job`,async()=>t.put(`/zones/${e.zoneId}/logpush/jobs/${e.jobId}`,{body:n})),{successLabel:`Updated job`});return}let n={};e.destinationConf!==void 0&&c(n,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),e.enabled!==void 0&&c(n,[`enabled`],e.enabled),e.filter!==void 0&&c(n,[`filter`],o(e.filter,`filter`,`text`)),e.frequency!==void 0&&c(n,[`frequency`],o(e.frequency,`frequency`,`text`)),e.kind!==void 0&&c(n,[`kind`],o(e.kind,`kind`,`text`)),e.logpullOptions!==void 0&&c(n,[`logpull_options`],o(e.logpullOptions,`logpullOptions`,`text`)),e.name!==void 0&&c(n,[`name`],o(e.name,`name`,`text`)),e.outputOptionsCve202144228!==void 0&&c(n,[`output_options`,`CVE-2021-44228`],e.outputOptionsCve202144228),e.outputOptionsBatchPrefix!==void 0&&c(n,[`output_options`,`batch_prefix`],o(e.outputOptionsBatchPrefix,`outputOptionsBatchPrefix`,`text`)),e.outputOptionsBatchSuffix!==void 0&&c(n,[`output_options`,`batch_suffix`],o(e.outputOptionsBatchSuffix,`outputOptionsBatchSuffix`,`text`)),e.outputOptionsFieldDelimiter!==void 0&&c(n,[`output_options`,`field_delimiter`],o(e.outputOptionsFieldDelimiter,`outputOptionsFieldDelimiter`,`text`)),e.outputOptionsFieldNames!==void 0&&c(n,[`output_options`,`field_names`],e.outputOptionsFieldNames),e.outputOptionsMergeSubrequests!==void 0&&c(n,[`output_options`,`merge_subrequests`],e.outputOptionsMergeSubrequests),e.outputOptionsOutputType!==void 0&&c(n,[`output_options`,`output_type`],o(e.outputOptionsOutputType,`outputOptionsOutputType`,`text`)),e.outputOptionsRecordDelimiter!==void 0&&c(n,[`output_options`,`record_delimiter`],o(e.outputOptionsRecordDelimiter,`outputOptionsRecordDelimiter`,`text`)),e.outputOptionsRecordPrefix!==void 0&&c(n,[`output_options`,`record_prefix`],o(e.outputOptionsRecordPrefix,`outputOptionsRecordPrefix`,`text`)),e.outputOptionsRecordSuffix!==void 0&&c(n,[`output_options`,`record_suffix`],o(e.outputOptionsRecordSuffix,`outputOptionsRecordSuffix`,`text`)),e.outputOptionsRecordTemplate!==void 0&&c(n,[`output_options`,`record_template`],o(e.outputOptionsRecordTemplate,`outputOptionsRecordTemplate`,`text`)),e.outputOptionsSampleRate!==void 0&&c(n,[`output_options`,`sample_rate`],e.outputOptionsSampleRate),e.outputOptionsTimestampFormat!==void 0&&c(n,[`output_options`,`timestamp_format`],o(e.outputOptionsTimestampFormat,`outputOptionsTimestampFormat`,`text`)),e.ownershipChallenge!==void 0&&c(n,[`ownership_challenge`],o(e.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Updating job`,async()=>t.put(`/zones/${e.zoneId}/logpush/jobs/${e.jobId}`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated job`})}},K={command:`jobs`,describe:`Logpush jobs that continuously deliver log batches to a configured destination`,builder:e=>e.command(H).command(U).command(te).command(W).command(G).demandCommand(1),handler:()=>{}},q={command:`list`,describe:`Returns all dataset types that this account can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading available`,async()=>t.logpush.logExplorerDatasets.accounts.available.list(r)),{successLabel:`Loaded available`})}},J={command:`available`,describe:`Log Explorer datasets for account-level log analysis and querying`,builder:e=>e.command(q).demandCommand(1),handler:()=>{}},Y={command:`create`,describe:"Create a new Log Explorer dataset for the account. Use the `/accounts/{account_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled.",builder:e=>e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async r=>{if(r.dryRun){let t=e();t&&s(t,`accountId`),d({command:`cf logpush log-explorer-datasets accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logs/explorer/datasets`,pathParams:{},bodyKind:`json`,body:{dataset:r.dataset,body:r.body},validation:`passed`});return}let a=await i(r),m=r.local?f:await n(a);if(r.accountId=m,r.body){let e=l(r.body);u(await p(`Creating account`,async()=>a.post(`/accounts/${m}/logs/explorer/datasets`,{body:e})),{successLabel:`Created account`});return}r.dataset===void 0&&(r.dataset=await t(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let h={};r.dataset!==void 0&&c(h,[`dataset`],o(r.dataset,`dataset`,`text`)),u(await p(`Creating account`,async()=>a.post(`/accounts/${m}/logs/explorer/datasets`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created account`})}},X={command:`get`,describe:`Retrieve a single Log Explorer dataset by ID for the account.`,builder:e=>e,handler:async e=>{let t=await i(e),r=e.local?f:await n(t);e.accountId=r,u(await p(`Loading account`,async()=>t.logpush.logExplorerDatasets.accounts.get(r,e.datasetId)),{successLabel:`Loaded account`})}},Z={command:`list`,describe:"Returns all Log Explorer datasets configured for the account. Pass `include_zones=true` to also include zone-level datasets that belong to this account. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:e=>e.option(`include-zones`,{type:`boolean`,description:`Set to true to include zone-scoped datasets belonging to this account.`,default:!1}),handler:async e=>{let t={};e.includeZones!==void 0&&(t.include_zones=e.includeZones);let r=await i(e),a=e.local?f:await n(r);e.accountId=a,u(await p(`Loading accounts`,async()=>r.logpush.logExplorerDatasets.accounts.list(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded accounts`})}},Q={command:`update`,describe:`Updates the enabled state and/or field configuration of an account dataset.`,builder:e=>e.option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf logpush log-explorer-datasets accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/logs/explorer/datasets/${t.datasetId??`<datasetId>`}`,pathParams:{datasetId:String(t.datasetId??``)},bodyKind:`json`,body:{enabled:t.enabled,body:t.body},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.body){let e=l(t.body);u(await p(`Updating account`,async()=>r.put(`/accounts/${a}/logs/explorer/datasets/${t.datasetId}`,{body:e})),{successLabel:`Updated account`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let o={};t.enabled!==void 0&&c(o,[`enabled`],t.enabled),u(await p(`Updating account`,async()=>r.put(`/accounts/${a}/logs/explorer/datasets/${t.datasetId}`,{body:Object.keys(o).length>0?o:void 0})),{successLabel:`Updated account`})}},ne={command:`accounts`,describe:`Log Explorer datasets for account-level log analysis and querying`,builder:e=>e.command(Y).command(X).command(Z).command(Q).command(J).demandCommand(1),handler:()=>{}},re={command:`list`,describe:`Returns all dataset types that this zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading available`,async()=>t.logpush.logExplorerDatasets.zones.available.list(n)),{successLabel:`Loaded available`})}},ie={command:`available`,describe:`Log Explorer datasets for account-level log analysis and querying`,builder:e=>e.command(re).demandCommand(1),handler:()=>{}},ae={command:`create`,describe:"Create a new Log Explorer dataset for the zone. Use the `/zones/{zone_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled.",builder:e=>e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush log-explorer-datasets zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logs/explorer/datasets`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{dataset:e.dataset,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating zone`,async()=>n.post(`/zones/${e.zoneId}/logs/explorer/datasets`,{body:t})),{successLabel:`Created zone`});return}e.dataset===void 0&&(e.dataset=await t(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let r={};e.dataset!==void 0&&c(r,[`dataset`],o(e.dataset,`dataset`,`text`)),u(await p(`Creating zone`,async()=>n.post(`/zones/${e.zoneId}/logs/explorer/datasets`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created zone`})}},oe={command:`get`,describe:`Retrieve a single Log Explorer dataset by ID for the zone.`,builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading zone`,async()=>t.logpush.logExplorerDatasets.zones.get(n,e.datasetId)),{successLabel:`Loaded zone`})}},se={command:`list`,describe:"Returns all Log Explorer datasets configured for the zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:e=>e,handler:async e=>{let t=await i(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,u(await p(`Loading zones`,async()=>t.logpush.logExplorerDatasets.zones.list(n)),{successLabel:`Loaded zones`})}},ce={command:`update`,describe:`Updates the enabled state and/or field configuration of a zone dataset.`,builder:e=>e.option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush log-explorer-datasets zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logs/explorer/datasets/${e.datasetId??`<datasetId>`}`,pathParams:{zoneId:String(e.zoneId??``),datasetId:String(e.datasetId??``)},bodyKind:`json`,body:{enabled:e.enabled,body:e.body},validation:`passed`});return}let t=await i(e);if(e.zoneId=await a({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=l(e.body);u(await p(`Updating zone`,async()=>t.put(`/zones/${e.zoneId}/logs/explorer/datasets/${e.datasetId}`,{body:n})),{successLabel:`Updated zone`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let n={};e.enabled!==void 0&&c(n,[`enabled`],e.enabled),u(await p(`Updating zone`,async()=>t.put(`/zones/${e.zoneId}/logs/explorer/datasets/${e.datasetId}`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated zone`})}},le={command:`zones`,describe:`Log Explorer datasets for account-level log analysis and querying`,builder:e=>e.command(ae).command(oe).command(se).command(ce).command(ie).demandCommand(1),handler:()=>{}},ue={command:`log-explorer-datasets`,describe:`Operations for log-explorer-datasets`,builder:e=>e.command(ne).command(le).demandCommand(1),handler:()=>{}},de={command:`query`,describe:`Run a SQL query against account-level datasets.`,builder:e=>e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}),handler:async t=>{if(t.dryRun){let n=e();n&&s(n,`accountId`),d({command:`cf logpush log-explorer-query accounts query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/logs/explorer/query/sql`,pathParams:{},bodyKind:`octet-stream`,body:{body:t.body,file:t.file},validation:`passed`});return}let r=await i(t),a=t.local?f:await n(r);if(t.accountId=a,t.file){let{readFileSync:e}=await import(`node:fs`),{resolve:n}=await import(`node:path`),i=e(n(t.file));u(await p(`Loading account`,async()=>r.post(`/accounts/${a}/logs/explorer/query/sql`,{body:i,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded account`});return}if(t.body){let e=o(t.body,`body`,`binary`);u(await p(`Loading account`,async()=>r.post(`/accounts/${a}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded account`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},fe={command:`accounts`,describe:`Query log data using the Log Explorer query engine`,builder:e=>e.command(de).demandCommand(1),handler:()=>{}},pe={command:`query`,describe:`Run a SQL query against zone-level datasets.`,builder:e=>e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush log-explorer-query zones query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logs/explorer/query/sql`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`octet-stream`,body:{body:e.body,file:e.file},validation:`passed`});return}let t=await i(e);if(e.zoneId=await a({zone:e.zone},t,{quiet:e.quiet}),e.file){let{readFileSync:n}=await import(`node:fs`),{resolve:r}=await import(`node:path`),i=n(r(e.file));u(await p(`Loading zone`,async()=>t.post(`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:i,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded zone`});return}if(e.body){let n=o(e.body,`body`,`binary`);u(await p(`Loading zone`,async()=>t.post(`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded zone`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},$={command:`zones`,describe:`Query log data using the Log Explorer query engine`,builder:e=>e.command(pe).demandCommand(1),handler:()=>{}},me={command:`log-explorer-query`,describe:`Operations for log-explorer-query`,builder:e=>e.command(fe).command($).demandCommand(1),handler:()=>{}},he={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/ownership`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{destinationConf:e.destinationConf,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating ownership`,async()=>n.post(`/zones/${e.zoneId}/logpush/ownership`,{body:t})),{successLabel:`Created ownership`});return}e.destinationConf===void 0&&(e.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let r={};e.destinationConf!==void 0&&c(r,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),u(await p(`Creating ownership`,async()=>n.post(`/zones/${e.zoneId}/logpush/ownership`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created ownership`})}},ge={command:`validate`,describe:`Validates ownership challenge of the destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/ownership/validate`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{destinationConf:e.destinationConf,ownershipChallenge:e.ownershipChallenge,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating ownership`,async()=>n.post(`/zones/${e.zoneId}/logpush/ownership/validate`,{body:t})),{successLabel:`Created ownership`});return}e.destinationConf===void 0&&(e.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),e.ownershipChallenge===void 0&&(e.ownershipChallenge=await t(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let r={};e.destinationConf!==void 0&&c(r,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),e.ownershipChallenge!==void 0&&c(r,[`ownership_challenge`],o(e.ownershipChallenge,`ownershipChallenge`,`text`)),u(await p(`Creating ownership`,async()=>n.post(`/zones/${e.zoneId}/logpush/ownership/validate`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created ownership`})}},_e={command:`ownership`,describe:`Prove ownership of a destination bucket before Cloudflare can push logs to it`,builder:e=>e.command(he).command(ge).demandCommand(1),handler:()=>{}},ve={command:`destination-exists`,describe:`Checks if there is an existing job with a destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush validate destination-exists`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/validate/destination/exists`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{destinationConf:e.destinationConf,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating exist`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/destination/exists`,{body:t})),{successLabel:`Created exist`});return}e.destinationConf===void 0&&(e.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let r={};e.destinationConf!==void 0&&c(r,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),u(await p(`Creating exist`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/destination/exists`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created exist`})}},ye={command:`destination`,describe:`Validates destination.`,builder:e=>e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush validate destination`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/validate/destination`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{destinationConf:e.destinationConf,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating logpush`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/destination`,{body:t})),{successLabel:`Created logpush`});return}e.destinationConf===void 0&&(e.destinationConf=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let r={};e.destinationConf!==void 0&&c(r,[`destination_conf`],o(e.destinationConf,`destinationConf`,`text`)),u(await p(`Creating logpush`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/destination`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created logpush`})}},be={command:`origin`,describe:`Validates logpull origin with logpull_options.`,builder:e=>e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){d({command:`cf logpush validate origin`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logpush/validate/origin`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{logpullOptions:e.logpullOptions,body:e.body},validation:`passed`});return}let n=await i(e);if(e.zoneId=await a({zone:e.zone},n,{quiet:e.quiet}),e.body){let t=l(e.body);u(await p(`Creating logpush`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/origin`,{body:t})),{successLabel:`Created logpush`});return}e.logpullOptions===void 0&&(e.logpullOptions=await t(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let r={};e.logpullOptions!==void 0&&c(r,[`logpull_options`],o(e.logpullOptions,`logpullOptions`,`text`)),u(await p(`Creating logpush`,async()=>n.post(`/zones/${e.zoneId}/logpush/validate/origin`,{body:Object.keys(r).length>0?r:void 0})),{successLabel:`Created logpush`})}},xe={command:`validate`,describe:`Validate destination credentials and connectivity before creating a Logpush job`,builder:e=>e.command(ye).command(ve).command(be).demandCommand(1),handler:()=>{}},Se={command:`logpush`,describe:`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,builder:e=>e.command(_).command(C).command(D).command(N).command(R).command(V).command(K).command(ue).command(me).command(_e).command(xe).demandCommand(1),handler:()=>{}};export{Se as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e,o as t,p as n,t as r,u as i}from"./auth-BHD_B2p9.mjs";import{n as a,r as o}from"./input-validation-BpVQi9rR.mjs";import{n as s,t as c}from"./body-parser-iA3vRFmh.mjs";import{t as l}from"./output-CqGQp2r6.mjs";import{t as u}from"./dry-run-FV0pZwdg.mjs";import{t as d}from"./local-OqhVQbv0.mjs";import{t as f}from"./progress-5sHFvwez.mjs";const p={command:`create`,describe:`Updates CMB config.`,builder:e=>e.option(`allow-out-of-region-access`,{type:`boolean`,description:`Allow out of region access`}).option(`regions`,{type:`string`,description:`Name of the region.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async n=>{if(n.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:{allowOutOfRegionAccess:n.allowOutOfRegionAccess,regions:n.regions,body:n.body},validation:`passed`});return}let i=await r(n),p=n.local?d:await t(i);if(n.accountId=p,n.body){let e=c(n.body);l(await f(`Creating config`,async()=>i.post(`/accounts/${p}/logs/control/cmb/config`,{body:e})),{successLabel:`Created config`});return}let m={};n.allowOutOfRegionAccess!==void 0&&s(m,[`allow_out_of_region_access`],n.allowOutOfRegionAccess),n.regions!==void 0&&s(m,[`regions`],a(n.regions,`regions`,`text`)),l(await f(`Creating config`,async()=>i.post(`/accounts/${p}/logs/control/cmb/config`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created config`})}},m={command:`delete`,describe:`Deletes CMB config.`,builder:e=>e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async i=>{if(i.dryRun){let t=e();t&&o(t,`accountId`),u({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:{body:i.body},validation:`passed`});return}let a=await r(i),s=i.local?d:await t(a);if(i.accountId=s,!await n(`config`,``,{force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}if(i.body){let e=c(i.body);l(await f(`Deleting config`,async()=>a.delete(`/accounts/${s}/logs/control/cmb/config`,{body:e})),{successLabel:`Deleted config`});return}l(await f(`Deleting config`,async()=>a.logs.control.cmb.config.delete(s)),{successLabel:`Deleted config`})}},h={command:`get`,describe:`Gets CMB config.`,builder:e=>e,handler:async e=>{let n=await r(e),i=e.local?d:await t(n);e.accountId=i,l(await f(`Loading config`,async()=>n.logs.control.cmb.config.get(i)),{successLabel:`Loaded config`})}},g={command:`config`,describe:`Log control operations`,builder:e=>e.command(p).command(m).command(h).demandCommand(1),handler:()=>{}},_={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(g).demandCommand(1),handler:()=>{}},v={command:`create`,describe:`Updates log retention flag for Logpull API.`,builder:e=>e.option(`flag`,{type:`boolean`,description:`The log retention flag for Logpull API.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}),handler:async e=>{if(e.dryRun){u({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zoneId??`<zoneId>`}/logs/control/retention/flag`,pathParams:{zoneId:String(e.zoneId??``)},bodyKind:`json`,body:{flag:e.flag,body:e.body},validation:`passed`});return}let t=await r(e);if(e.zoneId=await i({zone:e.zone},t,{quiet:e.quiet}),e.body){let n=c(e.body);l(await f(`Creating retention`,async()=>t.post(`/zones/${e.zoneId}/logs/control/retention/flag`,{body:n})),{successLabel:`Created retention`});return}let n={};e.flag!==void 0&&s(n,[`flag`],e.flag),l(await f(`Creating retention`,async()=>t.post(`/zones/${e.zoneId}/logs/control/retention/flag`,{body:Object.keys(n).length>0?n:void 0})),{successLabel:`Created retention`})}},y={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:e=>e,handler:async e=>{let t=await r(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await f(`Loading retention`,async()=>t.logs.control.retention.get(n)),{successLabel:`Loaded retention`})}},b={command:`retention`,describe:`Log control operations`,builder:e=>e.command(v).command(y).demandCommand(1),handler:()=>{}},x={command:`control`,describe:`Operations for control`,builder:e=>e.command(_).command(b).demandCommand(1),handler:()=>{}},S={command:`get <rayId>`,describe:"The `/rayids` api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique).",builder:e=>e.positional(`rayId`,{type:`string`,description:`Ray identifier.`,demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}),handler:async e=>{o(e.rayId,`rayId`);let t={};e.fields!==void 0&&(t.fields=e.fields),e.timestamps!==void 0&&(t.timestamps=e.timestamps);let n=await r(e),a=await i({zone:e.zone},n,{quiet:e.quiet});e.zoneId=a,l(await f(`Loading rayid`,async()=>n.logs.rayid.get(a,e.rayId,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded rayid`})}},C={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command(S).demandCommand(1),handler:()=>{}},w={command:`get`,describe:`Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions.`,builder:e=>e,handler:async e=>{let t=await r(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await f(`Loading field`,async()=>t.logs.received.fields.get(n)),{successLabel:`Loaded field`})}},T={command:`fields`,describe:`Received log operations`,builder:e=>e.command(w).demandCommand(1),handler:()=>{}},E={command:`get`,describe:'The `/received` api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare\'s central data center. `start` is inclusive, and `end` is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap will be handled properly.',builder:e=>e.option(`start`,{type:`string`,description:`Sets the (inclusive) beginning of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than seven days.`}).option(`end`,{type:`string`,description:"Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. `end` must be at least five minutes earlier than now and must be later than `start`. Difference between `start` and `end` must be not greater than one hour.",demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`sample`,{type:`string`,description:"When `?sample=` is provided, a sample of matching records is returned. If `sample=0.1` then 10% of records will be returned. Sampling is random: repeated calls will not only return different records, but likely will also vary slightly in number of returned records. When `?count=` is also specified, `count` is applied to the number of returned records, not the sampled records. So, with `sample=0.05` and `count=7`, when there is a total of 100 records available, approximately five will be returned. When there are 1000 records, seven will be returned. When there are 10,000 records, seven will be returned."}).option(`count`,{type:`string`,description:"When `?count=` is provided, the response will contain up to `count` results. Since results are not sorted, you are likely to get different data for repeated requests. `count` must be an integer > 0."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}),handler:async e=>{let t={};e.start!==void 0&&(t.start=e.start),e.end!==void 0&&(t.end=e.end),e.fields!==void 0&&(t.fields=e.fields),e.sample!==void 0&&(t.sample=e.sample),e.count!==void 0&&(t.count=e.count),e.timestamps!==void 0&&(t.timestamps=e.timestamps);let n=await r(e),a=await i({zone:e.zone},n,{quiet:e.quiet});e.zoneId=a,l(await f(`Loading received`,async()=>n.logs.received.get(a,Object.keys(t).length>0?t:void 0)),{successLabel:`Loaded received`})}},D={command:`received`,describe:`Received log operations`,builder:e=>e.command(E).command(T).demandCommand(1),handler:()=>{}},O={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(x).command(C).command(D).demandCommand(1),handler:()=>{}};export{O as default};