cf 0.6.0 → 0.7.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 (299) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-CKb6w43K.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-CwFrx-Dr.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/{api-gateway-D9PMVVqL.mjs → api-gateway-D4AIEtUq.mjs} +10 -10
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BvQ9uwuy.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-DX9KnJ0P.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/{cache-CeN5t6_W.mjs → cache-DVhkiIGK.mjs} +4 -4
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-Bvzav4Mj.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/{custom-certificates-CfRj7QZb.mjs → custom-certificates-CWUrPYLP.mjs} +4 -4
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/{custom-hostnames-CcK7_17e.mjs → custom-hostnames-CVQSksqq.mjs} +4 -4
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-BYsNl3qc.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-BzlPv3ro.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-IOg-_s5_.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-BH-4NQOV.mjs +134 -0
  63. package/dist/dns-D7VAaCyO.mjs +29 -0
  64. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  65. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  66. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  67. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  68. package/dist/email-routing-CiDbivcN.mjs +10 -0
  69. package/dist/email-security-BYeAuSc6.mjs +12 -0
  70. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  71. package/dist/{filters-DKs-wEzt.mjs → filters-DZ8YnQ90.mjs} +3 -3
  72. package/dist/firewall-DEd1hs_I.mjs +11 -0
  73. package/dist/flagship-DVw7xGoP.mjs +4 -0
  74. package/dist/{fraud-D8WmLKyH.mjs → fraud-BbGS3FZs.mjs} +2 -2
  75. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  76. package/dist/{healthchecks-BBtW8vRh.mjs → healthchecks-Da9N3ix4.mjs} +3 -3
  77. package/dist/{hostnames-Bh2IFxIw.mjs → hostnames-mimZu2tB.mjs} +2 -2
  78. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  79. package/dist/iam-DGQ-OgRl.mjs +6 -0
  80. package/dist/images-CI6Iy9ho.mjs +7 -0
  81. package/dist/index.mjs +1 -1
  82. package/dist/intel-BDB-aRtU.mjs +3 -0
  83. package/dist/internal-Czlp5Ekb.mjs +2 -0
  84. package/dist/{ips-BE7JbAnc.mjs → ips-B9UuPvsY.mjs} +1 -1
  85. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  86. package/dist/kv-BHerx4dZ.mjs +5 -0
  87. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  88. package/dist/live-Ce7dZW7p.mjs +2 -0
  89. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  90. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  91. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  92. package/dist/logos-CJLhx1go.mjs +3 -0
  93. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  94. package/dist/logs-DMvtchc6.mjs +3 -0
  95. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  96. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  97. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  98. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  99. package/dist/matches-B0yHbQ2I.mjs +2 -0
  100. package/dist/moq-UgBawOXe.mjs +13 -0
  101. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  102. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  103. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  104. package/dist/observability-B-1y36QS.mjs +4 -0
  105. package/dist/organization-Dq3PClZ7.mjs +41 -0
  106. package/dist/organizations-AhsQkHyX.mjs +2 -0
  107. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  108. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  109. package/dist/{origin-tls-client-auth-B30_2_dO.mjs → origin-tls-client-auth-BDw5q-6G.mjs} +3 -3
  110. package/dist/{page-rules-zQJGmTCd.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  111. package/dist/{page-shield-CxQk5k9X.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  112. package/dist/pages-BsXF11Kv.mjs +11 -0
  113. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  114. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  115. package/dist/progress-O88q63Bk.mjs +2 -0
  116. package/dist/{prompt-q3B7sM2A.mjs → prompt-DTAWiEm2.mjs} +1 -1
  117. package/dist/queries-CAE95-OH.mjs +3 -0
  118. package/dist/queues-BBz35Mqd.mjs +6 -0
  119. package/dist/r2-Zp99S5xF.mjs +21 -0
  120. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  121. package/dist/radar-Cij-XVQJ.mjs +2 -0
  122. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  123. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  124. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  125. package/dist/ready-DMpJvyaz.mjs +2 -0
  126. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  127. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  128. package/dist/refute-BGTpr5sy.mjs +2 -0
  129. package/dist/registrar-CXViZlah.mjs +83 -0
  130. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  131. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  132. package/dist/{resolve-DGD57PFH.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  133. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  134. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  135. package/dist/rules-ens3OHme.mjs +4 -0
  136. package/dist/rulesets-bkreZRao.mjs +8 -0
  137. package/dist/rum-CpgXFcwl.mjs +4 -0
  138. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  139. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  140. package/dist/{schema-D8o6HcCr.mjs → schema-DCF4yEp_.mjs} +1 -1
  141. package/dist/{schema-validation-BWNDnnIT.mjs → schema-validation-Ca6o94ts.mjs} +5 -5
  142. package/dist/scim-C4oT8TMc.mjs +4 -0
  143. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  144. package/dist/search-C4T5riPh.mjs +2 -0
  145. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  146. package/dist/security-center-BOvm7xy6.mjs +2 -0
  147. package/dist/{security-txt-CVpmJo29.mjs → security-txt-BCAUBctN.mjs} +2 -2
  148. package/dist/session-B1ARgLG7.mjs +2 -0
  149. package/dist/share-DhmVspmL.mjs +5 -0
  150. package/dist/{shared-DQI8NGja.mjs → shared-Bod3-Exx.mjs} +332 -332
  151. package/dist/signed-url-DA509wgp.mjs +2 -0
  152. package/dist/{smart-shield-BreBC1Ap.mjs → smart-shield-DZm4fn6z.mjs} +2 -2
  153. package/dist/{snippets-BAJoWMSJ.mjs → snippets-oQ0u26-z.mjs} +3 -3
  154. package/dist/{spawn-pmGERpdB.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  155. package/dist/{spectrum-DnIRLY95.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  156. package/dist/speed-DqNnvLBD.mjs +4 -0
  157. package/dist/{src-BQ1dr9xR.mjs → src-By-zTCHz.mjs} +9 -9
  158. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  159. package/dist/state-OsdDJvdj.mjs +2 -0
  160. package/dist/stream-Bud9Os5V.mjs +14 -0
  161. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  162. package/dist/submit-BtP8she2.mjs +2 -0
  163. package/dist/tenant-CMwHa-tU.mjs +2 -0
  164. package/dist/{token-validation-DUvtXWur.mjs → token-validation-BYC7HTok.mjs} +5 -5
  165. package/dist/{tools-CQtA5-cr.mjs → tools-Dru4l8yh.mjs} +1 -1
  166. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  167. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  168. package/dist/turnstile-CP4nScaL.mjs +23 -0
  169. package/dist/{ui-BrNwNHX9.mjs → ui-BNoF0KpD.mjs} +2 -2
  170. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  171. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  172. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  173. package/dist/user-DtefniLc.mjs +11 -0
  174. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  175. package/dist/verify-D7J3F_NZ.mjs +2 -0
  176. package/dist/{versions-NUXxCr0s.mjs → versions-dMW3bLVv.mjs} +1 -1
  177. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  178. package/dist/{web3-n3GW50u-.mjs → web3-Dhw79l4S.mjs} +3 -3
  179. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  180. package/dist/workers-l3zMNOU6.mjs +20 -0
  181. package/dist/workflows-rb7RYBKP.mjs +6 -0
  182. package/dist/{zaraz-9l7KuLqh.mjs → zaraz-CHecMYuo.mjs} +1 -1
  183. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  184. package/dist/zone-BnnqJwW-.mjs +2 -0
  185. package/dist/zones-DpI2YikF.mjs +21 -0
  186. package/package.json +1 -1
  187. package/dist/abuse-reports-DUs4SKVx.mjs +0 -8
  188. package/dist/accounts-BIY8wNGA.mjs +0 -22
  189. package/dist/acm-SqcV8o5o.mjs +0 -3
  190. package/dist/addressing-CygRm0pN.mjs +0 -12
  191. package/dist/ai-BAmEAjN3.mjs +0 -2
  192. package/dist/ai-gateway-BENwPvvB.mjs +0 -8
  193. package/dist/ai-search-Bv_Whw3E.mjs +0 -7
  194. package/dist/ai_gateway-C6WP9oBH.mjs +0 -4
  195. package/dist/alerting-D_qWrsoY.mjs +0 -6
  196. package/dist/analytics_engine-BjV6XLyG.mjs +0 -2
  197. package/dist/argo-DwYGbyld.mjs +0 -2
  198. package/dist/artifacts-DKAjY_n4.mjs +0 -4
  199. package/dist/auth-TYwGydWg.mjs +0 -5
  200. package/dist/billing-CRTlRU88.mjs +0 -2
  201. package/dist/bot-management-DgW--8wM.mjs +0 -5
  202. package/dist/botnet-feed-CIX6ZORT.mjs +0 -3
  203. package/dist/brand-protection-ZikBtl0y.mjs +0 -3
  204. package/dist/browser-rendering-D_ZQVWn8.mjs +0 -4
  205. package/dist/build-Bgw8TV1p.mjs +0 -134
  206. package/dist/calls-Cv0ieVg4.mjs +0 -4
  207. package/dist/certificate-authorities-BzZnWCac.mjs +0 -2
  208. package/dist/client-certificates-BFuzeBrj.mjs +0 -3
  209. package/dist/cloud-connector-D5h8Dzzg.mjs +0 -2
  210. package/dist/cloudforce-one-aqDCIBMp.mjs +0 -21
  211. package/dist/config-B5k-XbwS.mjs +0 -2
  212. package/dist/connectivity-CjkXmEhO.mjs +0 -3
  213. package/dist/connector-interrupts-B7eSface.mjs +0 -2
  214. package/dist/connector-telemetry-events-F3Co8HUf.mjs +0 -2
  215. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +0 -2
  216. package/dist/connectors-YYu_Vx3H.mjs +0 -3
  217. package/dist/content-scanning-BorfRGKT.mjs +0 -4
  218. package/dist/context-C-WbewL6.mjs +0 -2
  219. package/dist/custom-nameservers-BkKx0THn.mjs +0 -3
  220. package/dist/custom-pages-DamGVA75.mjs +0 -4
  221. package/dist/d1-sK0O5THv.mjs +0 -4
  222. package/dist/data-security-DsWpoWiS.mjs +0 -6
  223. package/dist/diagnostics-CH7T2WR3.mjs +0 -3
  224. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +0 -7
  225. package/dist/dist-C6zxsVdY.mjs +0 -306
  226. package/dist/dns-firewall-VmQf3UVP.mjs +0 -57
  227. package/dist/dns-o7hUPMCG.mjs +0 -29
  228. package/dist/durable-objects-DgrTbvoF.mjs +0 -2
  229. package/dist/email-routing-owCvAEpf.mjs +0 -10
  230. package/dist/email-security-Dng3DVuf.mjs +0 -8
  231. package/dist/email-sending-bExMH4lu.mjs +0 -3
  232. package/dist/firewall-BLaTtX3r.mjs +0 -11
  233. package/dist/google-tag-gateway-DyCY43k0.mjs +0 -2
  234. package/dist/hyperdrive-DJm1eD-M.mjs +0 -18
  235. package/dist/iam-apCCcy7R.mjs +0 -6
  236. package/dist/images-Cxe45OHm.mjs +0 -7
  237. package/dist/intel-8V4h6H46.mjs +0 -3
  238. package/dist/keyless-certificates-CfJmXccT.mjs +0 -3
  239. package/dist/kv-Dz6then8.mjs +0 -5
  240. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +0 -3
  241. package/dist/load-balancers-ilsGgudX.mjs +0 -6
  242. package/dist/logpush-BH14TtuA.mjs +0 -4
  243. package/dist/logs-B8-mkf_I.mjs +0 -3
  244. package/dist/magic-cloud-networking-DylCXoG4.mjs +0 -5
  245. package/dist/magic-network-monitoring-DnyrZy77.mjs +0 -4
  246. package/dist/magic-transit-B-kU5e3s.mjs +0 -89
  247. package/dist/managed-transforms-GC9Pq5dg.mjs +0 -3
  248. package/dist/mtls-certificates-BRlhWw_G.mjs +0 -3
  249. package/dist/network-interconnects-DuyoFD9_.mjs +0 -36
  250. package/dist/oauth-B5k80sip.mjs +0 -61
  251. package/dist/observability-9APhqFHo.mjs +0 -4
  252. package/dist/organizations-Dy3kiV_z.mjs +0 -41
  253. package/dist/origin-ca-certificates-2rwPoQdG.mjs +0 -3
  254. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +0 -2
  255. package/dist/pages-5DKLs7CQ.mjs +0 -11
  256. package/dist/pipelines-DfGE44xo.mjs +0 -6
  257. package/dist/progress-CL8I-7YK.mjs +0 -2
  258. package/dist/queues-BoenUGIw.mjs +0 -6
  259. package/dist/r2-Cq_JCjK0.mjs +0 -21
  260. package/dist/r2-data-catalog-eLxltWdO.mjs +0 -14
  261. package/dist/radar-YNOCio6T.mjs +0 -2
  262. package/dist/rate-limits-CcAF3tMl.mjs +0 -5
  263. package/dist/raw-fetch-bIXC9D1m.mjs +0 -2
  264. package/dist/realtime-kit-4bCGviO5.mjs +0 -18
  265. package/dist/registrar-CfHlaOOf.mjs +0 -46
  266. package/dist/request-tracers-DlHawg5l.mjs +0 -2
  267. package/dist/resource-sharing-7FhuboJE.mjs +0 -5
  268. package/dist/resource-tagging-divcugVb.mjs +0 -16
  269. package/dist/rules-CAXkege8.mjs +0 -4
  270. package/dist/rulesets-CBsdc8IV.mjs +0 -8
  271. package/dist/rum-D0hHPNl9.mjs +0 -4
  272. package/dist/scim-CWLli4fi.mjs +0 -3
  273. package/dist/sdk-DhIhH6GB.mjs +0 -5
  274. package/dist/secrets-store-B7_HkE8I.mjs +0 -25
  275. package/dist/security-center-BQT21oiM.mjs +0 -2
  276. package/dist/session-B8r8LNQN.mjs +0 -93
  277. package/dist/speed-UYEVue28.mjs +0 -4
  278. package/dist/ssl-D3Pixs8M.mjs +0 -15
  279. package/dist/stream-BUsuOfQh.mjs +0 -14
  280. package/dist/tenants-BdWJTtcg.mjs +0 -2
  281. package/dist/turnstile-CAKVnS1L.mjs +0 -23
  282. package/dist/url-normalization-DA-RAxs4.mjs +0 -3
  283. package/dist/url-scanner-DmYu43f7.mjs +0 -2
  284. package/dist/user-Bah4wGGN.mjs +0 -10
  285. package/dist/vectorize-DhvVG2By.mjs +0 -4
  286. package/dist/waiting-rooms-DoOkT4Mu.mjs +0 -11
  287. package/dist/workers-D6IaQ_F0.mjs +0 -18
  288. package/dist/workers-builds-DYi0OMMU.mjs +0 -7
  289. package/dist/workflows-DrdXUQ2g.mjs +0 -4
  290. package/dist/zero-trust-D6V9GH2W.mjs +0 -118
  291. package/dist/zero_trust-BzXKAX_x.mjs +0 -3
  292. package/dist/zones-0MTkuaFk.mjs +0 -21
  293. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  294. /package/dist/{cli-types-DGgEbf8K.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  295. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  296. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  297. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  298. /package/dist/{metadata-MPDDi08e.mjs → metadata-Cnyws6iO.mjs} +0 -0
  299. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{r as d,t as f}from"./prompt-q3B7sM2A.mjs";import{t as p}from"./cli-types-DGgEbf8K.mjs";function m(e){return 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.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"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.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"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.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"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.\n- `"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.\n- `"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.\n- `""`: 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)`})}const ee={command:`create`,describe:`Create a new load balancer.`,builder:m,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),networks:t.networks,proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.loadBalancers.create({...e,zone_id:u})),{successLabel:`Created`});return}if(t[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);t[`fallback-pool`]===void 0&&(t[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),t.name===void 0&&(t.name=await d(`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 f=a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),networks:t.networks,proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl});o(await c(`Creating`,async()=>n.loadBalancers.create({...f,zone_id:u})),{successLabel:`Created`})}};function te(e){return e.positional(`load-balancer-id`,{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})}const h={command:`delete <load-balancer-id>`,describe:`Delete a configured load balancer.`,builder:te,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers/${t[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(t[`load-balancer-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"load-balancer-id":String(t[`load-balancer-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await f({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>n.loadBalancers.delete({zone_id:i,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`load-balancer-id`,{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."}).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.`}).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.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).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).`}).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.`}).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`]}).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.'}).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`]}).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`]}).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`]}).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.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"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.\n- `"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.\n- `"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.\n- `""`: 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`]}).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)`})}const _={command:`edit <load-balancer-id>`,describe:`Apply changes to an existing load balancer, overwriting the supplied properties.`,builder:g,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers/${t[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(t[`load-balancer-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"load-balancer-id":String(t[`load-balancer-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),enabled:t.enabled,fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.loadBalancers.edit({...e,zone_id:u,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Updated`});return}let d=a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),enabled:t.enabled,fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl});o(await c(`Updating`,async()=>n.loadBalancers.edit({...d,zone_id:u,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <load-balancer-id>`,describe:`Fetch a single configured load balancer.`,builder:v,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers/${t[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(t[`load-balancer-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"load-balancer-id":String(t[`load-balancer-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.loadBalancers.get({zone_id:i,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List configured load balancers.`,builder:b,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.loadBalancers.list({zone_id:i})),{successLabel:`Loaded`})}};function S(e){return e.option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create`,describe:`Create a new monitor group.`,builder:S,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({description:l(e.description,`description`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:t,account_id:p})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the monitor group`));let m=a({description:l(e.description,`description`,`text`)});o(await c(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:m,account_id:p})),{successLabel:`Created`})}};function w(e){return e.positional(`monitor-group-id`,{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})}const T={command:`delete <monitor-group-id>`,describe:`Delete a configured monitor group.`,builder:w,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await f({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>i.loadBalancers.monitorGroups.delete({account_id:a,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`edit <monitor-group-id>`,describe:`Apply changes to an existing monitor group, overwriting the supplied properties.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({description:l(e.description,`description`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Updating`,async()=>f.loadBalancers.monitorGroups.edit({body:t,account_id:p,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the monitor group`));let m=a({description:l(e.description,`description`,`text`)});o(await c(`Updating`,async()=>f.loadBalancers.monitorGroups.edit({body:m,account_id:p,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Updated`})}};function O(e){return e.positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <monitor-group-id>`,describe:`Fetch a single configured monitor group.`,builder:O,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitorGroups.get({account_id:a,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Loaded`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`List configured monitor groups.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitorGroups.list({account_id:a})),{successLabel:`Loaded`})}};function M(e){return e.option(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Get the list of resources that reference the provided monitor group.`,builder:M,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}/references`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitorGroups.references.list({account_id:a,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Loaded`})}},P={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <monitor-group-id>`,describe:`Modify a configured monitor group.`,builder:F,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitor_groups/${e[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(e[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(e[`monitor-group-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({description:l(e.description,`description`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Updating`,async()=>f.loadBalancers.monitorGroups.update({body:t,account_id:p,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await d(`description`,`A short description of the monitor group`));let m=a({description:l(e.description,`description`,`text`)});o(await c(`Updating`,async()=>f.loadBalancers.monitorGroups.update({body:m,account_id:p,monitor_group_id:e[`monitor-group-id`]})),{successLabel:`Updated`})}},L={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).command(I).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return 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)`})}const z={command:`create`,describe:`Create a configured monitor.`,builder:R,handler:async e=>{if(e.dryRun){s({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:e.body===void 0?a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.loadBalancers.monitors.create({body:t,account_id:f})),{successLabel:`Created`});return}let p=a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)});o(await c(`Creating`,async()=>d.loadBalancers.monitors.create({body:p,account_id:f})),{successLabel:`Created`})}};function B(e){return e.positional(`monitor-id`,{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})}const V={command:`delete <monitor-id>`,describe:`Delete a configured monitor.`,builder:B,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await f({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}o(await c(`Deleting`,async()=>i.loadBalancers.monitors.delete({account_id:a,monitor_id:e[`monitor-id`]})),{successLabel:`Deleted`})}};function H(e){return e.positional(`monitor-id`,{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.`}).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.`}).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.`}).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.`}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`}).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.`}).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.`}).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.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`edit <monitor-id>`,describe:`Apply changes to an existing monitor, overwriting the supplied properties.`,builder:H,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Updating`,async()=>d.loadBalancers.monitors.edit({body:t,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`});return}let p=a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)});o(await c(`Updating`,async()=>d.loadBalancers.monitors.edit({body:p,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`})}};function W(e){return e.positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <monitor-id>`,describe:`List a single configured monitor for an account.`,builder:W,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitors.get({account_id:a,monitor_id:e[`monitor-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List configured monitors for an account.`,builder:K,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitors.list({account_id:a})),{successLabel:`Loaded`})}};function J(e){return e.positional(`monitor-id`,{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)`})}const Y={command:`create <monitor-id>`,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:J,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/preview`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.loadBalancers.monitors.previews.create({body:t,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Created`});return}let p=a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)});o(await c(`Creating`,async()=>d.loadBalancers.monitors.previews.create({body:p,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Created`})}},X={command:`previews`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <monitor-id>`,describe:`Get the list of resources that reference the provided monitor.`,builder:Z,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/references`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.monitors.references.get({account_id:a,monitor_id:e[`monitor-id`]})),{successLabel:`Loaded`})}},ne={command:`references`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`monitor-id`,{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.`}).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.`}).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.`}).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.`}).option(`follow-redirects`,{type:`boolean`,description:`Follow redirects if returned by the origin. This parameter is only valid for HTTP and HTTPS monitors.`}).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.`}).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.`}).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.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`update <monitor-id>`,describe:`Modify a configured monitor.`,builder:re,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Updating`,async()=>d.loadBalancers.monitors.update({body:t,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`});return}let p=a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)});o(await c(`Updating`,async()=>d.loadBalancers.monitors.update({body:p,account_id:f,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`})}},ae={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).command(ie).command(X).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return 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)`})}const se={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:oe,handler:async e=>{if(e.dryRun){s({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:e.body===void 0?a({notification_email:l(e[`notification-email`],`notification-email`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Updating`,async()=>d.loadBalancers.pools.bulkEdit({body:t,account_id:f})),{successLabel:`Updated`});return}let p=a({notification_email:l(e[`notification-email`],`notification-email`,`text`)});o(await c(`Updating`,async()=>d.loadBalancers.pools.bulkEdit({body:p,account_id:f})),{successLabel:`Updated`})}};function ce(e){return 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.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"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.\n- `"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)`})}const le={command:`create`,describe:`Create a new pool.`,builder:ce,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.loadBalancers.pools.create({...t,account_id:p})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let m=a({description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});o(await c(`Creating`,async()=>f.loadBalancers.pools.create({...m,account_id:p})),{successLabel:`Created`})}};function ue(e){return e.positional(`pool-id`,{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})}const de={command:`delete <pool-id>`,describe:`Delete a configured pool.`,builder:ue,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await f({force:!!e.force})){process.stderr.write(`Aborted.
6
- `);return}o(await c(`Deleting`,async()=>i.loadBalancers.pools.delete({account_id:a,pool_id:e[`pool-id`]})),{successLabel:`Deleted`})}};function fe(e){return e.positional(`pool-id`,{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.`}).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).`}).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.`}).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`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`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.`}).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.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).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).`}).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.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"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.\n- `"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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const pe={command:`edit <pool-id>`,describe:`Apply changes to an existing pool, overwriting the supplied properties.`,builder:fe,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({check_regions:e[`check-regions`],description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Updating`,async()=>d.loadBalancers.pools.edit({...t,account_id:f,pool_id:e[`pool-id`]})),{successLabel:`Updated`});return}let p=a({check_regions:e[`check-regions`],description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});o(await c(`Updating`,async()=>d.loadBalancers.pools.edit({...p,account_id:f,pool_id:e[`pool-id`]})),{successLabel:`Updated`})}};function me(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <pool-id>`,describe:`Fetch a single configured pool.`,builder:me,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.pools.get({account_id:a,pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}};function ge(e){return e.positional(`pool-id`,{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)`})}const _e={command:`create <pool-id>`,describe:`Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.`,builder:ge,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools health create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/preview`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Creating`,async()=>d.loadBalancers.pools.health.create({body:t,account_id:f,pool_id:e[`pool-id`]})),{successLabel:`Created`});return}let p=a({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:l(e.description,`description`,`text`),expected_body:l(e[`expected-body`],`expected-body`,`text`),expected_codes:l(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:l(e.method,`method`,`text`),path:l(e.path,`path`,`text`),port:e.port,probe_zone:l(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:l(e.type,`type`,`text`)});o(await c(`Creating`,async()=>d.loadBalancers.pools.health.create({body:p,account_id:f,pool_id:e[`pool-id`]})),{successLabel:`Created`})}};function ve(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get <pool-id>`,describe:`Fetch the latest pool health status for a single pool.`,builder:ve,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools health get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/health`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.pools.health.get({account_id:a,pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}},be={command:`health`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`monitor`,{type:`string`,description:`The ID of the Monitor 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})}const Se={command:`list`,describe:`List configured pools.`,builder:xe,handler:async e=>{let i={monitor:e.monitor};if(e.dryRun){s({command:`cf load-balancers pools list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.loadBalancers.pools.list({account_id:l,...i})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <pool-id>`,describe:`Get the list of resources that reference the provided pool.`,builder:Ce,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/references`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.pools.references.get({account_id:a,pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}},Te={command:`references`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.positional(`pool-id`,{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.`}).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).`}).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.`}).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`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`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.`}).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.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).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).`}).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.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"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.\n- `"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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`update <pool-id>`,describe:`Modify a configured pool.`,builder:Ee,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({check_regions:e[`check-regions`],description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Updating`,async()=>f.loadBalancers.pools.update({...t,account_id:p,pool_id:e[`pool-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await d(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let m=a({check_regions:e[`check-regions`],description:l(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:l(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:l(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:l(e.monitor,`monitor`,`text`),monitor_group:l(e[`monitor-group`],`monitor-group`,`text`),name:l(e.name,`name`,`text`),notification_email:l(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:l(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});o(await c(`Updating`,async()=>f.loadBalancers.pools.update({...m,account_id:p,pool_id:e[`pool-id`]})),{successLabel:`Updated`})}},Oe={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(se).command(le).command(de).command(pe).command(he).command(Se).command(De).command(be).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.positional(`preview-id`,{type:`string`,description:`Preview ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <preview-id>`,describe:`Get the result of a previous preview operation using the provided preview_id.`,builder:ke,handler:async e=>{if(e.dryRun){s({command:`cf load-balancers previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/preview/${e[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(e[`preview-id`]))}`,pathParams:{"preview-id":String(e[`preview-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.previews.get({account_id:a,preview_id:e[`preview-id`]})),{successLabel:`Loaded`})}},je={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(e){return e.positional(`region-id`,{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}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get <region-id>`,describe:`Get a single region mapping.`,builder:p(Me),handler:async e=>{if(e.dryRun){s({command:`cf load-balancers regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/regions/${e[`region-id`]==null?`<region-id>`:encodeURIComponent(String(e[`region-id`]))}`,pathParams:{"region-id":String(e[`region-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.loadBalancers.regions.get({account_id:a,region_id:e[`region-id`]})),{successLabel:`Loaded`})}};function Pe(e){return 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.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`List all region mappings.`,builder:Pe,handler:async e=>{let i={subdivision_code:e[`subdivision-code`],subdivision_code_a2:e[`subdivision-code-a2`],country_code_a2:e[`country-code-a2`]};if(e.dryRun){s({command:`cf load-balancers regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/regions`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.loadBalancers.regions.list({account_id:l,...i})),{successLabel:`Loaded`})}},Fe={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command(Ne).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return 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`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`list`,describe:`Search for Load Balancing resources.`,builder:p(Ie),handler:async e=>{let i={query:e.query,references:e.references,page:e.page,per_page:e[`per-page`]};if(e.dryRun){s({command:`cf load-balancers searches list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/load_balancers/search`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(e),l=e.local?u:await t();e.accountId=l,o(await c(`Loading`,async()=>a.loadBalancers.searches.list({account_id:l,...i})),{successLabel:`Loaded`})}},Re={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.positional(`load-balancer-id`,{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."}).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.`}).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.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).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).`}).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.`}).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`]}).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.'}).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`]}).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`]}).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`]}).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.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"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.\n- `"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.\n- `"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.\n- `""`: 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`]}).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)`})}const Be={command:`update <load-balancer-id>`,describe:`Update a configured load balancer.`,builder:ze,handler:async t=>{if(t.dryRun){s({command:`cf load-balancers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/load_balancers/${t[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(t[`load-balancer-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"load-balancer-id":String(t[`load-balancer-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),enabled:t.enabled,fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),networks:t.networks,proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.loadBalancers.update({...e,zone_id:u,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Updated`});return}if(t[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);t[`fallback-pool`]===void 0&&(t[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),t.name===void 0&&(t.name=await d(`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 f=a({adaptive_routing:{failover_across_pools:t[`adaptive-routing-failover-across-pools`]},default_pools:t[`default-pools`],description:l(t.description,`description`,`text`),enabled:t.enabled,fallback_pool:l(t[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:l(t[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:l(t[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:l(t.name,`name`,`text`),networks:t.networks,proxied:t.proxied,random_steering:{default_weight:t[`random-steering-default-weight`]},session_affinity:l(t[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:t[`session-affinity-attributes-drain-duration`],headers:t[`session-affinity-attributes-headers`],require_all_headers:t[`session-affinity-attributes-require-all-headers`],samesite:l(t[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:l(t[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:l(t[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:t[`session-affinity-ttl`],steering_policy:l(t[`steering-policy`],`steering-policy`,`text`),ttl:t.ttl});o(await c(`Updating`,async()=>n.loadBalancers.update({...f,zone_id:u,load_balancer_id:t[`load-balancer-id`]})),{successLabel:`Updated`})}},Ve={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(ee).command(h).command(_).command(y).command(x).command(Be).command(L).command(ae).command(Oe).command(je).command(Fe).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ve as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{r as d,t as f}from"./prompt-q3B7sM2A.mjs";import{t as p}from"./cli-types-DGgEbf8K.mjs";function m(e){return e.positional(`dataset-id`,{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}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <dataset-id>`,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:p(m),handler:async e=>{if(e.dryRun){s({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.logpush.accountDatasets.fields.get({account_id:a,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},h={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`dataset-id`,{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}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:p(g),handler:async e=>{if(e.dryRun){s({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.logpush.accountDatasets.jobs.get({account_id:a,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return 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.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.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)`})}const x={command:`create`,describe:`Creates a new Logpush job for an account.`,builder:b,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({dataset:l(e.dataset,`dataset`,`text`),destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:l(e.filter,`filter`,`text`),frequency:l(e.frequency,`frequency`,`text`),kind:l(e.kind,`kind`,`text`),logpull_options:l(e[`logpull-options`],`logpull-options`,`text`),name:l(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:l(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:l(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:l(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountJobs.create({...t,account_id:p})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`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 m=a({dataset:l(e.dataset,`dataset`,`text`),destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:l(e.filter,`filter`,`text`),frequency:l(e.frequency,`frequency`,`text`),kind:l(e.kind,`kind`,`text`),logpull_options:l(e[`logpull-options`],`logpull-options`,`text`),name:l(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:l(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:l(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:l(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountJobs.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`job-id`,{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})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(S),handler:async e=>{if(e.dryRun){s({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();if(e.accountId=a,!await f({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.logpush.accountJobs.delete({account_id:a,job_id:e[`job-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`job-id`,{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})}const T={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(w),handler:async e=>{if(e.dryRun){s({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.logpush.accountJobs.get({account_id:a,job_id:e[`job-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Lists Logpush jobs for an account.`,builder:E,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`none`});return}let i=await r(e),a=e.local?u:await t();e.accountId=a,o(await c(`Loading`,async()=>i.logpush.accountJobs.list({account_id:a})),{successLabel:`Loaded`})}};function O(e){return e.positional(`job-id`,{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.`}).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`]}).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`]}).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)`})}const k={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(O),handler:async e=>{if(e.dryRun){s({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:l(e.filter,`filter`,`text`),frequency:l(e.frequency,`frequency`,`text`),kind:l(e.kind,`kind`,`text`),logpull_options:l(e[`logpull-options`],`logpull-options`,`text`),name:l(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:l(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:l(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:l(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)}):i(e.body)});return}let d=await r(e),f=e.local?u:await t();if(e.accountId=f,e.body){let t=i(e.body);o(await c(`Updating`,async()=>d.logpush.accountJobs.update({...t,account_id:f,job_id:e[`job-id`]})),{successLabel:`Updated`});return}let p=a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:l(e.filter,`filter`,`text`),frequency:l(e.frequency,`frequency`,`text`),kind:l(e.kind,`kind`,`text`),logpull_options:l(e[`logpull-options`],`logpull-options`,`text`),name:l(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:l(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:l(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:l(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Updating`,async()=>d.logpush.accountJobs.update({...p,account_id:f,job_id:e[`job-id`]})),{successLabel:`Updated`})}},A={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return 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)`})}const M={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:j,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/ownership`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountOwnership.create({...t,account_id:p})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`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 m=a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountOwnership.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return 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)`})}const P={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:N,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/ownership/validate`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountOwnership.validate.create({...t,account_id:p})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`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[`ownership-challenge`]===void 0&&(e[`ownership-challenge`]=await d(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let m=a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:l(e[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountOwnership.validate.create({...m,account_id:p})),{successLabel:`Created`})}},F={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return 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)`})}const R={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:L,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/validate/destination/exists`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountValidate.destinationExistsDelete({...t,account_id:p})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`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 m=a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountValidate.destinationExistsDelete({...m,account_id:p})),{successLabel:`Created`})}};function z(e){return 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)`})}const B={command:`delete`,describe:`Validates destination.`,builder:z,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/validate/destination`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountValidate.destination.delete({...t,account_id:p})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await d(`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 m=a({destination_conf:l(e[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountValidate.destination.delete({...m,account_id:p})),{successLabel:`Created`})}},V={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return 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)`})}const U={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:H,handler:async e=>{if(e.dryRun){s({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logpush/validate/origin`,pathParams:{},bodyKind:`json`,body:e.body===void 0?a({logpull_options:l(e[`logpull-options`],`logpull-options`,`text`)}):i(e.body)});return}let f=await r(e),p=e.local?u:await t();if(e.accountId=p,e.body){let t=i(e.body);o(await c(`Creating`,async()=>f.logpush.accountValidate.origin.create({...t,account_id:p})),{successLabel:`Created`});return}e[`logpull-options`]===void 0&&(e[`logpull-options`]=await d(`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 m=a({logpull_options:l(e[`logpull-options`],`logpull-options`,`text`)});o(await c(`Creating`,async()=>f.logpush.accountValidate.origin.create({...m,account_id:p})),{successLabel:`Created`})}},W={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(R).command(V).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`dataset-id`,{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}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <dataset-id>`,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:p(K),handler:async t=>{if(t.dryRun){s({command:`cf logpush datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(t[`dataset-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.logpush.datasets.fields.get({zone_id:i,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}},J={command:`fields`,describe:`Operations for datasets.fields`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`dataset-id`,{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}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <dataset-id>`,describe:`Lists Logpush jobs for a zone for a dataset.`,builder:p(Y),handler:async t=>{if(t.dryRun){s({command:`cf logpush datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(t[`dataset-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.logpush.datasets.jobs.get({zone_id:i,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}},te={command:`jobs`,describe:`Operations for datasets.jobs`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(J).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return 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)`})}const ne={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:Q,handler:async t=>{if(t.dryRun){s({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({fields:l(t.fields,`fields`,`text`),filter:l(t.filter,`filter`,`text`),sample:t.sample}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.edge.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=a({fields:l(t.fields,`fields`,`text`),filter:l(t.filter,`filter`,`text`),sample:t.sample});o(await c(`Creating`,async()=>n.logpush.edge.create({...d,zone_id:u})),{successLabel:`Created`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:re,handler:async t=>{if(t.dryRun){s({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.logpush.edge.get({zone_id:i})),{successLabel:`Loaded`})}},ae={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return 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.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.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)`})}const se={command:`create`,describe:`Creates a new Logpush job for a zone.`,builder:oe,handler:async t=>{if(t.dryRun){s({command:`cf logpush jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({dataset:l(t.dataset,`dataset`,`text`),destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:l(t.filter,`filter`,`text`),frequency:l(t.frequency,`frequency`,`text`),kind:l(t.kind,`kind`,`text`),logpull_options:l(t[`logpull-options`],`logpull-options`,`text`),name:l(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:l(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:l(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:l(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.jobs.create({...e,zone_id:u})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await d(`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 f=a({dataset:l(t.dataset,`dataset`,`text`),destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:l(t.filter,`filter`,`text`),frequency:l(t.frequency,`frequency`,`text`),kind:l(t.kind,`kind`,`text`),logpull_options:l(t[`logpull-options`],`logpull-options`,`text`),name:l(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:l(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:l(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:l(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Creating`,async()=>n.logpush.jobs.create({...f,zone_id:u})),{successLabel:`Created`})}};function ce(e){return e.positional(`job-id`,{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})}const le={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(ce),handler:async t=>{if(t.dryRun){s({command:`cf logpush jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=i,!await f({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>n.logpush.jobs.delete({zone_id:i,job_id:t[`job-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`job-id`,{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})}const de={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(ue),handler:async t=>{if(t.dryRun){s({command:`cf logpush jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.logpush.jobs.get({zone_id:i,job_id:t[`job-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Lists Logpush jobs for a zone.`,builder:fe,handler:async t=>{if(t.dryRun){s({command:`cf logpush jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,o(await c(`Loading`,async()=>n.logpush.jobs.list({zone_id:i})),{successLabel:`Loaded`})}};function me(e){return e.positional(`job-id`,{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.`}).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`]}).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`]}).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)`})}const he={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(me),handler:async t=>{if(t.dryRun){s({command:`cf logpush jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:l(t.filter,`filter`,`text`),frequency:l(t.frequency,`frequency`,`text`),kind:l(t.kind,`kind`,`text`),logpull_options:l(t[`logpull-options`],`logpull-options`,`text`),name:l(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:l(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:l(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:l(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Updating`,async()=>n.logpush.jobs.update({...e,zone_id:u,job_id:t[`job-id`]})),{successLabel:`Updated`});return}let d=a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:l(t.filter,`filter`,`text`),frequency:l(t.frequency,`frequency`,`text`),kind:l(t.kind,`kind`,`text`),logpull_options:l(t[`logpull-options`],`logpull-options`,`text`),name:l(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:l(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:l(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:l(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:l(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:l(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:l(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:l(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:l(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:l(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Updating`,async()=>n.logpush.jobs.update({...d,zone_id:u,job_id:t[`job-id`]})),{successLabel:`Updated`})}},ge={command:`jobs`,describe:`Operations for jobs`,builder:e=>e.command(se).command(le).command(de).command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return 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)`})}const ve={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:_e,handler:async t=>{if(t.dryRun){s({command:`cf logpush ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/ownership`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.ownership.create({...e,zone_id:u})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await d(`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 f=a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>n.logpush.ownership.create({...f,zone_id:u})),{successLabel:`Created`})}};function ye(e){return 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)`})}const be={command:`validate`,describe:`Validates ownership challenge of the destination.`,builder:ye,handler:async t=>{if(t.dryRun){s({command:`cf logpush ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/ownership/validate`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.ownership.validate({...e,zone_id:u})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await d(`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`})),t[`ownership-challenge`]===void 0&&(t[`ownership-challenge`]=await d(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let f=a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:l(t[`ownership-challenge`],`ownership-challenge`,`text`)});o(await c(`Creating`,async()=>n.logpush.ownership.validate({...f,zone_id:u})),{successLabel:`Created`})}},$={command:`ownership`,describe:`Operations for ownership`,builder:e=>e.command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return 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)`})}const Se={command:`destination-exists`,describe:`Checks if there is an existing job with a destination.`,builder:xe,handler:async t=>{if(t.dryRun){s({command:`cf logpush validate destination-exists`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/destination/exists`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.validate.destinationExists({...e,zone_id:u})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await d(`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 f=a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>n.logpush.validate.destinationExists({...f,zone_id:u})),{successLabel:`Created`})}};function Ce(e){return 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)`})}const we={command:`destination`,describe:`Validates destination.`,builder:Ce,handler:async t=>{if(t.dryRun){s({command:`cf logpush validate destination`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/destination`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.validate.destination({...e,zone_id:u})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await d(`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 f=a({destination_conf:l(t[`destination-conf`],`destination-conf`,`text`)});o(await c(`Creating`,async()=>n.logpush.validate.destination({...f,zone_id:u})),{successLabel:`Created`})}};function Te(e){return 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)`})}const Ee={command:`origin`,describe:`Validates logpull origin with logpull_options.`,builder:Te,handler:async t=>{if(t.dryRun){s({command:`cf logpush validate origin`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/origin`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({logpull_options:l(t[`logpull-options`],`logpull-options`,`text`)}):i(t.body)});return}let n=await r(t),u=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=i(t.body);o(await c(`Creating`,async()=>n.logpush.validate.origin({...e,zone_id:u})),{successLabel:`Created`});return}t[`logpull-options`]===void 0&&(t[`logpull-options`]=await d(`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 f=a({logpull_options:l(t[`logpull-options`],`logpull-options`,`text`)});o(await c(`Creating`,async()=>n.logpush.validate.origin({...f,zone_id:u})),{successLabel:`Created`})}},De={command:`validate`,describe:`Operations for validate`,builder:e=>e.command(we).command(Se).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`logpush`,describe:`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,builder:e=>e.command(y).command(A).command(I).command(G).command(Z).command(ae).command(ge).command($).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Oe as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{N as e,O as t,P as n}from"./oauth-B5k80sip.mjs";import{i as r,n as i}from"./auth-DX9KnJ0P.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-CL8I-7YK.mjs";import{n as u,t as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{r as p,t as m}from"./prompt-q3B7sM2A.mjs";import{t as h}from"./cli-types-DGgEbf8K.mjs";function ee(e){return 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)`})}const g={command:`create`,describe:`Updates CMB config.`,builder:ee,handler:async e=>{if(e.dryRun){c({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({allow_out_of_region_access:e[`allow-out-of-region-access`],regions:u(e.regions,`regions`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.logs.control.cmb.config.create({body:t,account_id:d})),{successLabel:`Created`});return}let p=o({allow_out_of_region_access:e[`allow-out-of-region-access`],regions:u(e.regions,`regions`,`text`)});s(await l(`Creating`,async()=>r.logs.control.cmb.config.create({body:p,account_id:d})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Deletes CMB config.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();if(e.accountId=a,!await m({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}s(await l(`Deleting`,async()=>r.logs.control.cmb.config.delete({account_id:a})),{successLabel:`Deleted`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Gets CMB config.`,builder:y,handler:async e=>{if(e.dryRun){c({command:`cf logs control cmb config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.logs.control.cmb.config.get({account_id:a})),{successLabel:`Loaded`})}},x={command:`config`,describe:`Log control operations`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return 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)`})}const w={command:`create`,describe:`Updates log retention flag for Logpull API.`,builder:C,handler:async t=>{if(t.dryRun){c({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({flag:t.flag}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.logs.control.retention.create({body:e,zone_id:r})),{successLabel:`Created`});return}let u=o({flag:t.flag});s(await l(`Creating`,async()=>n.logs.control.retention.create({body:u,zone_id:r})),{successLabel:`Created`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:T,handler:async t=>{if(t.dryRun){c({command:`cf logs control retention get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.logs.control.retention.get({zone_id:r})),{successLabel:`Loaded`})}},D={command:`retention`,describe:`Log control operations`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`control`,describe:`Operations for control`,builder:e=>e.command(S).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`limit`,{type:`number`,description:`Maximum number of results to return.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:k,handler:async e=>{let a={start:e.start,end:e.end,bucket:e.bucket,prefix:e.prefix,limit:e.limit},o={};if(e[`r2-access-key-id`]!==void 0&&(o[`R2-Access-Key-Id`]=String(e[`r2-access-key-id`])),e[`r2-secret-access-key`]!==void 0&&(o[`R2-Secret-Access-Key`]=String(e[`r2-secret-access-key`])),e.dryRun){c({command:`cf logs list get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/list`,pathParams:{},query:a,bodyKind:`none`});return}let u=await i(e),d=e.local?f:await t();e.accountId=d,s(await l(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/logs/list`,{query:a,headers:Object.keys(o).length>0?o:void 0})),{successLabel:`Loaded`})}},j={command:`list`,describe:`Operations for list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={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:M,handler:async e=>{if(e.dryRun){c({command:`cf logs log-explorer datasets accounts available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/datasets/available`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.logs.logExplorer.datasets.accounts.available.list({account_id:a})),{successLabel:`Loaded`})}},P={command:`available`,describe:`Operations for log-explorer.datasets.accounts.available`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return 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)`})}const I={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. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:F,handler:async e=>{if(e.dryRun){c({command:`cf logs log-explorer datasets accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({dataset:u(e.dataset,`dataset`,`text`)}):a(e.body)});return}let r=await i(e),d=e.local?f:await t();if(e.accountId=d,e.body){let t=a(e.body);s(await l(`Creating`,async()=>r.logs.logExplorer.datasets.accounts.create({body:t,account_id:d})),{successLabel:`Created`});return}e.dataset===void 0&&(e.dataset=await p(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let m=o({dataset:u(e.dataset,`dataset`,`text`)});s(await l(`Creating`,async()=>r.logs.logExplorer.datasets.accounts.create({body:m,account_id:d})),{successLabel:`Created`})}};function L(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the account.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf logs log-explorer datasets accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?f:await t();e.accountId=a,s(await l(`Loading`,async()=>r.logs.logExplorer.datasets.accounts.get({account_id:a,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}};function z(e){return e.option(`include-zones`,{type:`boolean`,description:`Set to true to include zone-scoped datasets belonging to this account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={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:z,handler:async e=>{let r={include_zones:e[`include-zones`]};if(e.dryRun){c({command:`cf logs log-explorer datasets accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?f:await t();e.accountId=o,s(await l(`Loading`,async()=>a.logs.logExplorer.datasets.accounts.list({account_id:o,...r})),{successLabel:`Loaded`})}};function V(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).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)`})}const H={command:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account dataset.`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf logs log-explorer datasets accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled}):a(e.body)});return}let r=await i(e),u=e.local?f:await t();if(e.accountId=u,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.logs.logExplorer.datasets.accounts.update({body:t,account_id:u,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=o({enabled:e.enabled});s(await l(`Updating`,async()=>r.logs.logExplorer.datasets.accounts.update({body:d,account_id:u,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`})}},U={command:`accounts`,describe:`Operations for log-explorer.datasets.accounts`,builder:e=>e.command(I).command(R).command(B).command(H).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={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:te,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer datasets zones available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets/available`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.logs.logExplorer.datasets.zones.available.list({zone_id:r})),{successLabel:`Loaded`})}},G={command:`available`,describe:`Operations for log-explorer.datasets.zones.available`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return 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)`})}const q={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. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:K,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer datasets zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({dataset:u(t.dataset,`dataset`,`text`)}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.logs.logExplorer.datasets.zones.create({body:e,zone_id:r})),{successLabel:`Created`});return}t.dataset===void 0&&(t.dataset=await p(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let d=o({dataset:u(t.dataset,`dataset`,`text`)});s(await l(`Creating`,async()=>n.logs.logExplorer.datasets.zones.create({body:d,zone_id:r})),{successLabel:`Created`})}};function J(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the zone.`,builder:J,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer datasets zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.logs.logExplorer.datasets.zones.get({zone_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={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:X,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer datasets zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.logs.logExplorer.datasets.zones.list({zone_id:r})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).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)`})}const ne={command:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of a zone dataset.`,builder:Q,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer datasets zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({enabled:t.enabled}):a(t.body)});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.logs.logExplorer.datasets.zones.update({body:e,zone_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:t.enabled});s(await l(`Updating`,async()=>n.logs.logExplorer.datasets.zones.update({body:u,zone_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`})}},re={command:`zones`,describe:`Operations for log-explorer.datasets.zones`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`datasets`,describe:`Operations for log-explorer.datasets`,builder:e=>e.command(U).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const oe={command:`sql`,describe:`Run a SQL query against account-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /accounts/{account_id}/logs/explorer/datasets to see enabled account level datasets. Zone-level datasets will not appear here. Check /accounts/{account_id}/logs/explorer/datasets/available for the schemas, and the name of the timestamp fields. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ae,handler:async e=>{if(e.dryRun){c({command:`cf logs log-explorer query accounts sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/explorer/query/sql`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let a=await i(e),o=e.local?f:await t();if(e.accountId=o,e.file){let t=d(e.file);s(await l(`Creating`,async()=>r(a,`POST`,`/accounts/${o}/logs/explorer/query/sql`,{body:t,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let t=u(e.body,`body`,`binary`);s(await l(`Creating`,async()=>r(a,`POST`,`/accounts/${o}/logs/explorer/query/sql`,{body:t,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>a.logs.logExplorer.query.accounts.sql({account_id:o})),{successLabel:`Created`})}},se={command:`accounts`,describe:`Operations for log-explorer.query.accounts`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const le={command:`sql`,describe:`Run a SQL query against zone-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /zones/{zone_id}/logs/explorer/datasets to see enabled zone level datasets. Check /zones/{zone_id}/logs/explorer/datasets/available for the schemas and the name of the timestamp fields. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ce,handler:async t=>{if(t.dryRun){c({command:`cf logs log-explorer query zones sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/query/sql`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`octet-stream`,body:t.body});return}let n=await i(t),a=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=a,t.file){let e=d(t.file);s(await l(`Creating`,async()=>r(n,`POST`,`/zones/${t.zoneId}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(t.body){let e=u(t.body,`body`,`binary`);s(await l(`Creating`,async()=>r(n,`POST`,`/zones/${t.zoneId}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>n.logs.logExplorer.query.zones.sql({zone_id:a})),{successLabel:`Created`})}},ue={command:`zones`,describe:`Operations for log-explorer.query.zones`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`query`,describe:`Operations for log-explorer.query`,builder:e=>e.command(se).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`log-explorer`,describe:`Operations for log-explorer`,builder:e=>e.command(ie).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`ray-id`,{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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <ray-id>`,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:h(pe),handler:async t=>{let n={fields:t.fields,timestamps:t.timestamps};if(t.dryRun){c({command:`cf logs rayid get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/rayids/${t[`ray-id`]==null?`<ray-id>`:encodeURIComponent(String(t[`ray-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"ray-id":String(t[`ray-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.logs.rayid.get({zone_id:a,ray_id:t[`ray-id`],...n})),{successLabel:`Loaded`})}},me={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={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:he,handler:async t=>{if(t.dryRun){c({command:`cf logs received fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/received/fields`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await i(t),r=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=r,s(await l(`Loading`,async()=>n.logs.received.fields.get({zone_id:r})),{successLabel:`Loaded`})}},_e={command:`fields`,describe:`Received log operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return 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:`number`,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:`number`,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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={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:h(ve),handler:async t=>{let n={start:t.start,end:t.end,fields:t.fields,sample:t.sample,count:t.count,timestamps:t.timestamps};if(t.dryRun){c({command:`cf logs received get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/received`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let r=await i(t),a=await e({zone:t.zone},r,{quiet:t.quiet});t.zoneId=a,s(await l(`Loading`,async()=>r.logs.received.get({zone_id:a,...n})),{successLabel:`Loaded`})}},be={command:`received`,describe:`Received log operations`,builder:e=>e.command(ye).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:xe,handler:async e=>{let a={start:e.start,end:e.end,bucket:e.bucket,prefix:e.prefix},o={};if(e[`r2-access-key-id`]!==void 0&&(o[`R2-Access-Key-Id`]=String(e[`r2-access-key-id`])),e[`r2-secret-access-key`]!==void 0&&(o[`R2-Secret-Access-Key`]=String(e[`r2-secret-access-key`])),e.dryRun){c({command:`cf logs retrieve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n()??`<account-id>`}/logs/retrieve`,pathParams:{},query:a,bodyKind:`none`});return}let u=await i(e),d=e.local?f:await t();e.accountId=d,s(await l(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/logs/retrieve`,{query:a,headers:Object.keys(o).length>0?o:void 0})),{successLabel:`Loaded`})}},Ce={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(O).command(j).command(fe).command(me).command(be).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{we as default};