cf 0.10.0 → 0.12.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 (352) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +13 -5
  3. package/dist/_meta/commands.json +2393 -262
  4. package/dist/_meta/hand-written-commands.json +960 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
  8. package/dist/account-CPbieCZ4.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
  14. package/dist/agent-memory-BrHMIU0E.mjs +6 -0
  15. package/dist/ai-audit-BoZuL84i.mjs +2 -0
  16. package/dist/ai-gateway-DE50Jem1.mjs +13 -0
  17. package/dist/ai-search-Fx7NHCHB.mjs +7 -0
  18. package/dist/ai-security-DyLbY9kv.mjs +4 -0
  19. package/dist/ai-v2fP1r0s.mjs +5 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
  21. package/dist/analytics-BygTfozw.mjs +3 -0
  22. package/dist/analytics_engine-4L-q362P.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
  24. package/dist/argo-TzXPN7tz.mjs +2 -0
  25. package/dist/args-CDgWUP4J.mjs +2 -0
  26. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
  27. package/dist/audit-logs-CqY7zzwv.mjs +2 -0
  28. package/dist/auth-CPLdkOC7.mjs +5 -0
  29. package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
  30. package/dist/billing-DHQuRT8S.mjs +3 -0
  31. package/dist/body-parser-BGVbwPeM.mjs +2 -0
  32. package/dist/bot-management-CfqG79hF.mjs +5 -0
  33. package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
  34. package/dist/brand-protection-DYttrKIM.mjs +3 -0
  35. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
  36. package/dist/browser-run-373D4e1i.mjs +4 -0
  37. package/dist/build-D0ir_S70.mjs +2 -0
  38. package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
  39. package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
  40. package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
  41. package/dist/cf-yPz_IqW6.mjs +18 -0
  42. package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
  44. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
  45. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
  46. package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
  47. package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
  48. package/dist/command-BV87D4tR.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
  50. package/dist/config.d.mts +1451 -1366
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
  53. package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
  54. package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
  55. package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
  56. package/dist/containers-BDBsEs7-.mjs +58 -0
  57. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
  58. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
  59. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
  60. package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
  61. package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
  62. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
  63. package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
  64. package/dist/custom-pages-Buki_Cb8.mjs +3 -0
  65. package/dist/d1-n2in0cSF.mjs +20 -0
  66. package/dist/data-security-DzOQMkv3.mjs +7 -0
  67. package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
  68. package/dist/delegate.mjs +1 -1
  69. package/dist/deploy-BUSz35vq.mjs +2 -0
  70. package/dist/deploy-input-BvD9aRP1.mjs +2 -0
  71. package/dist/dev-DY_DquQx.mjs +4 -0
  72. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
  73. package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
  74. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
  75. package/dist/dist-BBx1io2f.mjs +2 -0
  76. package/dist/dist-Cb9TJ2VV.mjs +9 -0
  77. package/dist/dist-DV7LR38l.mjs +387 -0
  78. package/dist/dist-DvizctjW.mjs +48 -0
  79. package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
  80. package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
  81. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-ILZRVpnp.mjs +2 -0
  84. package/dist/durable-objects-DhDL3San.mjs +2 -0
  85. package/dist/email-auth-BROqK6-C.mjs +2 -0
  86. package/dist/email-routing-BZXHDAOO.mjs +6 -0
  87. package/dist/email-security-DVumybrk.mjs +18 -0
  88. package/dist/email-sending-CDQ3_wyz.mjs +7 -0
  89. package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
  90. package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
  91. package/dist/flagship-fFBiZUz-.mjs +4 -0
  92. package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
  93. package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
  94. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
  95. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
  96. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
  97. package/dist/iam-Bk7K_PPO.mjs +6 -0
  98. package/dist/images-BAEFb9q1.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
  101. package/dist/interactive-CRnq-B5I.mjs +11 -0
  102. package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
  103. package/dist/ips-DU0ti0i0.mjs +2 -0
  104. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
  105. package/dist/keys-DqldTZqH.mjs +2 -0
  106. package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
  107. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
  108. package/dist/load-balancers-Dg4pDad1.mjs +6 -0
  109. package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
  110. package/dist/local-runtime--IQr44qq.mjs +2 -0
  111. package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
  112. package/dist/logo-matches-CWUzxY7G.mjs +2 -0
  113. package/dist/logos-BTfdkDPi.mjs +3 -0
  114. package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
  115. package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
  116. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
  117. package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
  118. package/dist/magic-transit-B5skt0G7.mjs +111 -0
  119. package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
  120. package/dist/matches-DeYaB4I0.mjs +2 -0
  121. package/dist/mcp-ChjBiMx2.mjs +4 -0
  122. package/dist/mesh-DRVAFLBX.mjs +4 -0
  123. package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
  124. package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
  125. package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
  126. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
  127. package/dist/oauth-DAa7SwkM.mjs +14 -0
  128. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
  129. package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
  130. package/dist/observability-DnyI8rPJ.mjs +4 -0
  131. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
  132. package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
  133. package/dist/organizations-B3aU-RCG.mjs +2 -0
  134. package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
  135. package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
  136. package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
  137. package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
  138. package/dist/page-rules-CzbyXbt6.mjs +27 -0
  139. package/dist/pages-CX8yefTI.mjs +14 -0
  140. package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
  141. package/dist/pipelines-BZ1KGupx.mjs +6 -0
  142. package/dist/precursor-D42A9ay5.mjs +4 -0
  143. package/dist/progress-jYW64HY7.mjs +2 -0
  144. package/dist/project-settings-BN7tL0c7.mjs +3 -0
  145. package/dist/prompt-CyATfGUu.mjs +3 -0
  146. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
  147. package/dist/queries-xvETUjUE.mjs +3 -0
  148. package/dist/queues-CpqHDtxF.mjs +6 -0
  149. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
  150. package/dist/r2-jhmLvD1z.mjs +24 -0
  151. package/dist/radar-C2J16wpX.mjs +2 -0
  152. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
  153. package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
  154. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
  155. package/dist/registrar-BI5ewTAk.mjs +23 -0
  156. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
  157. package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
  158. package/dist/reporting-CxsdHAH3.mjs +2 -0
  159. package/dist/request-tracers-DJJCncft.mjs +2 -0
  160. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
  161. package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
  162. package/dist/rules-PpsDU89Q.mjs +4 -0
  163. package/dist/rulesets-DP12Aqik.mjs +5 -0
  164. package/dist/rum-DxvpzJYc.mjs +4 -0
  165. package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
  166. package/dist/schema-flags-CTfQVGCs.mjs +5 -0
  167. package/dist/schemas-BFCBlp_W.mjs +65 -0
  168. package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
  169. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
  170. package/dist/security-center-008FMs_z.mjs +2 -0
  171. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
  172. package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
  173. package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
  174. package/dist/smart-shield-DpFscIk8.mjs +4 -0
  175. package/dist/snippets-CCKgI2ZX.mjs +4 -0
  176. package/dist/spawn-C3_tJ3RB.mjs +526 -0
  177. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
  178. package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
  179. package/dist/src-CEb2fgtT.mjs +108 -0
  180. package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
  181. package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
  182. package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
  183. package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
  184. package/dist/submit-DF2G5CIz.mjs +2 -0
  185. package/dist/tags-nFJJHlLJ.mjs +2 -0
  186. package/dist/tenant-CRLw1oRU.mjs +2 -0
  187. package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
  188. package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
  189. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
  190. package/dist/tunnels-iVA3MrdS.mjs +2 -0
  191. package/dist/turnstile-DQHP6-_b.mjs +23 -0
  192. package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
  193. package/dist/url-info-BVgdb_pf.mjs +2 -0
  194. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
  195. package/dist/url-scanner-DwuDZLPk.mjs +2 -0
  196. package/dist/user-I_MbB_KX.mjs +12 -0
  197. package/dist/values-S-Q7-5o8.mjs +2 -0
  198. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
  199. package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
  200. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
  201. package/dist/web3-CdbfoZ2x.mjs +4 -0
  202. package/dist/workers-DQ9Q7czn.mjs +28 -0
  203. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
  204. package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
  205. package/dist/zaraz-DbKvA_8C.mjs +2 -0
  206. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
  207. package/dist/zone-D2zrbJI2.mjs +2 -0
  208. package/dist/zones-DrpxQ_-A.mjs +21 -0
  209. package/package.json +12 -8
  210. package/dist/account-CYRm3yoN.mjs +0 -2
  211. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  212. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  213. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  214. package/dist/ai-search-BmdskMjR.mjs +0 -7
  215. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  216. package/dist/ai-viHB1tgI.mjs +0 -5
  217. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  218. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  219. package/dist/argo-CQfCgazW.mjs +0 -2
  220. package/dist/args-DlUhyGU0.mjs +0 -2
  221. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  222. package/dist/auth-D0xZxAEa.mjs +0 -5
  223. package/dist/billing-aJgapeRm.mjs +0 -3
  224. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  225. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  226. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  227. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  228. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  229. package/dist/build-DcflwvqN.mjs +0 -2
  230. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  231. package/dist/cf-C7DU4819.mjs +0 -18
  232. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  233. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  234. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  235. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  236. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  237. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  238. package/dist/containers-CKW081JA.mjs +0 -54
  239. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  240. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  241. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  242. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  243. package/dist/d1-BFvMd6-S.mjs +0 -20
  244. package/dist/data-security-Bji4Or_j.mjs +0 -7
  245. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  246. package/dist/deploy-CZ7bgNDu.mjs +0 -2
  247. package/dist/dev-V10MG-Bg.mjs +0 -4
  248. package/dist/dist-CgrMkXFx.mjs +0 -72
  249. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  250. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  251. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  252. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  253. package/dist/email-sending-dn-353Nx.mjs +0 -7
  254. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  255. package/dist/flagship-BusjRNIb.mjs +0 -4
  256. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  257. package/dist/iam-Cj63Kjc6.mjs +0 -6
  258. package/dist/images-CBWXCDhy.mjs +0 -8
  259. package/dist/ips-qs9eGJnI.mjs +0 -2
  260. package/dist/keys-D7N0j4-x.mjs +0 -2
  261. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  262. package/dist/local-runtime-Dh3keC5v.mjs +0 -2
  263. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  264. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  265. package/dist/logos-BS65zN8q.mjs +0 -3
  266. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  267. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  268. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  269. package/dist/matches-InA1hwII.mjs +0 -2
  270. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  271. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  272. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  273. package/dist/oauth-B0ETkNcX.mjs +0 -15
  274. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  275. package/dist/observability-BWE0Gg3V.mjs +0 -4
  276. package/dist/organizations-DLhiRt8g.mjs +0 -2
  277. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  278. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  279. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  280. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  281. package/dist/pages-DVDogxPs.mjs +0 -14
  282. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  283. package/dist/pipelines-BszRk4sM.mjs +0 -6
  284. package/dist/precursor-BPNjQr76.mjs +0 -4
  285. package/dist/progress-CsHIt3Tp.mjs +0 -2
  286. package/dist/prompt-DdegNPpg.mjs +0 -3
  287. package/dist/queries-JL1H1Biz.mjs +0 -3
  288. package/dist/queues-DpkYdRUE.mjs +0 -6
  289. package/dist/r2-CKozthw_.mjs +0 -24
  290. package/dist/radar-C-92vggG.mjs +0 -2
  291. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  292. package/dist/registrar-DKKN0M29.mjs +0 -21
  293. package/dist/reporting-fg_GKXe1.mjs +0 -2
  294. package/dist/request-tracers-CkMya96z.mjs +0 -2
  295. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  296. package/dist/rules-BTmNjDN-.mjs +0 -4
  297. package/dist/rulesets-CsoSM-17.mjs +0 -5
  298. package/dist/rum-DB4iO2q5.mjs +0 -4
  299. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  300. package/dist/security-center-DFKeHq5c.mjs +0 -2
  301. package/dist/session-D6KHthHf.mjs +0 -2
  302. package/dist/shared-VppSAQf4.mjs +0 -2
  303. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  304. package/dist/snippets-DIpc9pb_.mjs +0 -4
  305. package/dist/spawn-O1RS01vr.mjs +0 -523
  306. package/dist/src-D_HETJNy.mjs +0 -108
  307. package/dist/submit--xTzyNPy.mjs +0 -2
  308. package/dist/tags-efICDkah.mjs +0 -2
  309. package/dist/tenant-CerHuToJ.mjs +0 -2
  310. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  311. package/dist/triggers-BEsiiKAf.mjs +0 -2
  312. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  313. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  314. package/dist/url-info-DBCeRWwb.mjs +0 -2
  315. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  316. package/dist/user-bifVEQq5.mjs +0 -12
  317. package/dist/values-OxkdP1tV.mjs +0 -2
  318. package/dist/versions-BVL-Ludh.mjs +0 -2
  319. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  320. package/dist/web3-y_cY91V_.mjs +0 -4
  321. package/dist/workers-jDcq14GH.mjs +0 -24
  322. package/dist/zaraz-27zwjLvv.mjs +0 -2
  323. package/dist/zone-BJix2KQ9.mjs +0 -2
  324. package/dist/zones-Bkj5i92c.mjs +0 -21
  325. /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
  326. /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
  327. /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
  328. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  329. /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
  330. /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
  331. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
  332. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
  333. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
  334. /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
  335. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
  336. /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
  337. /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
  338. /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
  339. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
  340. /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
  341. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
  342. /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
  343. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
  344. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
  345. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
  346. /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
  347. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
  348. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
  349. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  350. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
  351. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
  352. /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u,t as d}from"./input-validation-Bav2M9F-.mjs";import{a as f,n as p}from"./prompt-DdegNPpg.mjs";import{t as m}from"./cli-types-BsTty22w.mjs";import{n as h,t as g}from"./raw-fetch-CteyTOM2.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async l=>{if(l.dryRun){o({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u,t as d}from"./input-validation-1esLElok.mjs";import{a as f,n as p}from"./prompt-CyATfGUu.mjs";import{t as m}from"./cli-types-C3nVfpSG.mjs";import{n as h,t as g}from"./raw-fetch-CNKIypJ7.mjs";function _(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`delete <namespace-id>`,describe:`Remove multiple KV pairs from the namespace. Body should be an array of up to 10,000 keys to be removed.`,builder:_,handler:async l=>{if(l.dryRun){o({command:`cf kv bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the specified keys from the namespace.`})){process.stderr.write(`Aborted.
3
3
  `);return}if(l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),n=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);n=await s(`Deleting: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>r(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:a}))}a(n,{successLabel:`Deleted`});return}a(await s(`Deleting`,async()=>r(u,`POST`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk/delete`,{body:e})),{successLabel:`Deleted`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`keys`,{type:`string`,array:!0,description:`Array of keys to retrieve (maximum of 100).`}).option(`type`,{type:`string`,description:`Whether to parse JSON values in the response.`,choices:[`text`,`json`],default:`text`}).option(`with-metadata`,{type:`boolean`,description:`Whether to include metadata in the response.`,default:!1}).option(`dry-run`,{type:`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:`get <namespace-id>`,describe:"Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based values. JSON values can optionally be parsed instead of being returned as a string value. Metadata can be included if `withMetadata` is true.",builder:y,handler:async r=>{if(r.dryRun){o({command:`cf kv bulk get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/bulk/get`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({keys:r.keys,type:u(r.type,`type`,`text`),withMetadata:r[`with-metadata`]}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.kv.bulk.get({...e,account_id:f,namespace_id:r[`namespace-id`]})),{successLabel:`Created`});return}if(r.keys===void 0)throw Error(`--keys is required (or pass --body with this field set).`);let p=l({keys:r.keys,type:u(r.type,`type`,`text`),withMetadata:r[`with-metadata`]});a(await s(`Creating`,async()=>d.kv.bulk.get({...p,account_id:f,namespace_id:r[`namespace-id`]})),{successLabel:`Created`})}};function x(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <namespace-id>`,describe:"Write multiple keys and values at once. Body should be an array of up to 10,000 key-value pairs to be stored, along with optional expiration information. Existing values and expirations will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored. The entire request size must be 100 megabytes or less.",builder:x,handler:async l=>{if(l.dryRun){o({command:`cf kv bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${l[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(l[`namespace-id`]))}/bulk`,pathParams:{"namespace-id":String(l[`namespace-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);if(Array.isArray(e)&&e.length>1e4){let t=Math.ceil(e.length/1e4),n=null;for(let i=0;i<e.length;i+=1e4){let a=e.slice(i,i+1e4);n=await s(`Updating: batch ${Math.floor(i/1e4)+1}/${t}`,async()=>r(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:a}))}a(n,{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/storage/kv/namespaces/${encodeURIComponent(String(l[`namespace-id`]))}/bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},C={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <key-name>`,describe:"Remove a KV pair from the namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:w,handler:async r=>{if(r.dryRun){o({command:`cf kv keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/values/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>c.kv.keys.delete({account_id:l,namespace_id:r[`namespace-id`],key_name:r[`key-name`]})),{successLabel:`Deleted`})}};function E(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const D={command:`get <key-name>`,describe:"Returns the value associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. If the KV-pair is set to expire at some point, the expiration time as measured in seconds since the UNIX epoch will be returned in the `expiration` response header.",builder:E,handler:async r=>{if(r.dryRun){o({command:`cf kv keys get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/values/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}await i(r);let a=r.local?e:await t();r.accountId=a;let c=await s(`Loading`,async()=>g(`/accounts/${a}/storage/kv/namespaces/${encodeURIComponent(String(r[`namespace-id`]))}/values/${encodeURIComponent(String(r[`key-name`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?c.toString(`utf-8`):c)}};function O(e){return e.option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limits the number of keys returned in the response. The cursor attribute may be used to iterate over the next batch of keys if there are more than the limit.`}).option(`prefix`,{type:`string`,description:`Filters returned keys by a name prefix. Exact matches and any key names that begin with the prefix will be returned.`}).option(`cursor`,{type:`string`,description:"Opaque token indicating the position from which to continue when requesting the next set of records if the amount of list results was limited by the limit parameter. A valid value for the cursor can be obtained from the `cursors` object in the `result_info` structure."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists a namespace's keys.`,builder:O,handler:async r=>{let c={limit:r.limit,prefix:r.prefix,cursor:r.cursor};if(r.dryRun){o({command:`cf kv keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/keys`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.kv.keys.list({account_id:u,namespace_id:r[`namespace-id`],...c})),{successLabel:`Loaded`})}};function A(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`expiration`,{type:`number`,description:`Expires the key at a certain time, measured in number of seconds since the UNIX epoch.`}).option(`expiration-ttl`,{type:`number`,description:`Expires the key after a number of seconds. Must be at least 60.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A byte sequence to be stored, up to 25 MiB in length.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`metadata`,{type:`string`,description:`The metadata`})}const j={command:`update <key-name>`,describe:"Write a value identified by a key. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name. Body should be the value to be stored. If JSON metadata to be associated with the key/value pair is needed, use `multipart/form-data` content type for your PUT request (see dropdown below in `REQUEST BODY SCHEMA`). Existing values, expirations, and metadata will be overwritten. If neither `expiration` nor `expiration_ttl` is specified, the key-value pair will never expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.",builder:A,handler:async c=>{let l={expiration:c.expiration,expiration_ttl:c[`expiration-ttl`]};if(c.dryRun){o({command:`cf kv keys update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${c[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(c[`namespace-id`]))}/values/${c[`key-name`]==null?`<key-name>`:encodeURIComponent(String(c[`key-name`]))}`,pathParams:{"key-name":String(c[`key-name`]??``),"namespace-id":String(c[`namespace-id`]??``)},query:l,bodyKind:c.metadata===void 0?`octet-stream`:`multipart`,body:c.metadata===void 0?c.body:{body:c.body,file:c.file,metadata:c.metadata}});return}let f=await i(c),p=c.local?e:await t();if(c.accountId=p,c.metadata!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`value`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`value`,c.body);c.metadata!==void 0&&e.append(`metadata`,String(u(c.metadata,`metadata`,`text`)??``)),a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e})),{successLabel:`Updated`});return}if(c.file){let e=d(c.file);a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(c.body){let e=u(c.body,`body`,`binary`),t=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/storage/kv/namespaces/${encodeURIComponent(String(c[`namespace-id`]))}/values/${encodeURIComponent(String(c[`key-name`]))}${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/octet-stream`}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},M={command:`keys`,describe:`Operations for keys`,builder:e=>e.command(T).command(D).command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`key-name`,{type:`string`,description:`A key's name. The name may be at most 512 bytes. All printable, non-whitespace characters are valid. Use percent-encoding to define key names as part of a URL.`,demandOption:!0}).option(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <key-name>`,describe:"Returns the metadata associated with the given key in the given namespace. Use URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key name.",builder:N,handler:async r=>{if(r.dryRun){o({command:`cf kv metadata get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}/metadata/${r[`key-name`]==null?`<key-name>`:encodeURIComponent(String(r[`key-name`]))}`,pathParams:{"key-name":String(r[`key-name`]??``),"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.kv.metadata.get({account_id:l,namespace_id:r[`namespace-id`],key_name:r[`key-name`]})),{successLabel:`Loaded`})}},F={command:`metadata`,describe:`Operations for metadata`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`jurisdiction`,{type:`string`,description:`Specify the jurisdiction to restrict the KV namespace to durably store data within. Can only be set at namespace creation time.`,choices:[`eu`,`fedramp`,`us`]}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).option(`dry-run`,{type:`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 L={command:`create`,describe:"Creates a namespace under the given title. A `400` is returned if the account already owns a namespace with this title. A namespace must be explicitly deleted to be replaced.",builder:I,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),title:u(r.title,`title`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.kv.namespaces.create({...e,account_id:p})),{successLabel:`Created`});return}r.title===void 0&&(r.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),title:u(r.title,`title`,`text`)});a(await s(`Creating`,async()=>d.kv.namespaces.create({...m,account_id:p})),{successLabel:`Created`})}};function R(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const z={command:`delete <namespace-id>`,describe:`Deletes the namespace corresponding to the given ID.`,builder:R,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>c.kv.namespaces.delete({account_id:l,namespace_id:r[`namespace-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <namespace-id>`,describe:`Get the namespace corresponding to the given ID.`,builder:B,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.kv.namespaces.get({account_id:l,namespace_id:r[`namespace-id`]})),{successLabel:`Loaded`})}};function H(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`id`,`title`]}).option(`direction`,{type:`string`,description:`Direction to order namespaces.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Returns the namespaces owned by an account.`,builder:m(H),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf kv namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.kv.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function W(e){return e.positional(`namespace-id`,{type:`string`,description:`Namespace identifier tag.`,demandOption:!0}).option(`title`,{type:`string`,description:`A human-readable string name for a Namespace.`}).option(`dry-run`,{type:`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:`update <namespace-id>`,describe:`Modifies a namespace's title.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf kv namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/storage/kv/namespaces/${r[`namespace-id`]==null?`<namespace-id>`:encodeURIComponent(String(r[`namespace-id`]))}`,pathParams:{"namespace-id":String(r[`namespace-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({title:u(r.title,`title`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.kv.namespaces.update({...e,account_id:p,namespace_id:r[`namespace-id`]})),{successLabel:`Updated`});return}r.title===void 0&&(r.title=await f(`title`,`A human-readable string name for a Namespace.`));let m=l({title:u(r.title,`title`,`text`)});a(await s(`Updating`,async()=>d.kv.namespaces.update({...m,account_id:p,namespace_id:r[`namespace-id`]})),{successLabel:`Updated`})}},K={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(L).command(z).command(V).command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`kv`,describe:`kv`,builder:e=>e.command(C).command(M).command(F).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";import{n as c}from"./prompt-DdegNPpg.mjs";function l(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const u={command:`create`,describe:'Create a detection location for credentials that the default scan locations do not cover, using Rules language expressions such as `lookup_json_string(http.request.body.raw, "user")`. Only the username expression is required, and Leaked Credential Checks must be enabled on the zone.',builder:l,handler:async c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function d(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <detection-id>`,describe:`Delete a user-defined detection location, identified by its detection ID. Incoming requests are then scanned using only the default scan locations and the detection locations that remain.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force,message:`This operation deletes a Leaked Credential Checks custom detection location.`})){process.stderr.write(`Aborted.
2
+ import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{n as c}from"./prompt-CyATfGUu.mjs";function l(e){return e.option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const u={command:`create`,describe:'Create a detection location for credentials that the default scan locations do not cover, using Rules language expressions such as `lookup_json_string(http.request.body.raw, "user")`. Only the username expression is required, and Leaked Credential Checks must be enabled on the zone.',builder:l,handler:async c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Creating`,async()=>l.leakedCredentialChecks.detections.create({body:d,zone_id:u})),{successLabel:`Created`})}};function d(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const f={command:`delete <detection-id>`,describe:`Delete a user-defined detection location, identified by its detection ID. Incoming requests are then scanned using only the default scan locations and the detection locations that remain.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force,message:`This operation deletes a Leaked Credential Checks custom detection location.`})){process.stderr.write(`Aborted.
3
3
  `);return}n(await i(`Deleting`,async()=>o.leakedCredentialChecks.detections.delete({zone_id:s,detection_id:a[`detection-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <detection-id>`,describe:`Get the username and password expressions of a single user-defined detection location, identified by its detection ID.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections/${a[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(a[`detection-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"detection-id":String(a[`detection-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.get({zone_id:s,detection_id:a[`detection-id`]})),{successLabel:`Loaded`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List the user-defined detection locations configured for Leaked Credential Checks, each with its own identifier. A custom detection location tells the WAF where to find the username and password in requests to your application.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks detections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks/detections`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.detections.list({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.positional(`detection-id`,{type:`string`,description:`Defines the unique ID for this custom detection.`,demandOption:!0}).option(`password`,{type:`string`,description:`Defines ehe ruleset expression to use in matching the password in a request.`}).option(`username`,{type:`string`,description:`Defines the ruleset expression to use in matching the username in a request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines a custom set of username/password expressions to match Leaked Credential Checks on.`})}const v={command:`update <detection-id>`,describe:`Update the username and password expressions of an existing detection location, identified by its detection ID. Both expressions are overwritten, so omitting the password expression clears it.`,builder:_,handler:async c=>{if(c.dryRun){r({command:`cf leaked-credential-checks detections update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/leaked-credential-checks/detections/${c[`detection-id`]==null?`<detection-id>`:encodeURIComponent(String(c[`detection-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"detection-id":String(c[`detection-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:e,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`});return}let d=o({password:s(c.password,`password`,`text`),username:s(c.username,`username`,`text`)});n(await i(`Updating`,async()=>l.leakedCredentialChecks.detections.update({body:d,zone_id:u,detection_id:c[`detection-id`]})),{successLabel:`Updated`})}},y={command:`detections`,describe:`Custom detection locations that tell the WAF where to find usernames and passwords in requests`,builder:e=>e.command(u).command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Get the current Leaked Credential Checks status for the zone. While enabled, Cloudflare scans incoming requests for usernames and passwords that were exposed in known data breaches.`,builder:b,handler:async a=>{if(a.dryRun){r({command:`cf leaked-credential-checks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.leakedCredentialChecks.get({zone_id:s})),{successLabel:`Loaded`})}};function S(e){return e.option(`enabled`,{type:`boolean`,description:`Determines whether or not Leaked Credential Checks are enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Defines the overall status for Leaked Credential Checks.`})}const C={command:`update`,describe:"Update the Leaked Credential Checks status for the zone, enabling or disabling the detection. While enabled, the detection populates the `cf.waf.credential_check.*` fields, which you can reference in custom rules and rate limiting rules to challenge or block requests carrying compromised credentials.",builder:S,handler:async s=>{if(s.dryRun){r({command:`cf leaked-credential-checks update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/leaked-credential-checks`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled}):a(s.body)});return}let l=await t(s),u=await e({zone:s.zone},l,{quiet:s.quiet});if(s.zoneId=u,!await c({force:!!s.force,message:`This operation toggles Leaked Credential Checks for a zone.`})){process.stderr.write(`Aborted.
4
4
  `);return}if(s.body){let e=a(s.body);n(await i(`Deleting`,async()=>l.leakedCredentialChecks.update({body:e,zone_id:u})),{successLabel:`Deleted`});return}let d=o({enabled:s.enabled});n(await i(`Deleting`,async()=>l.leakedCredentialChecks.update({body:d,zone_id:u})),{successLabel:`Deleted`})}},w={command:`leaked-credential-checks`,describe:`Detect compromised credentials in login requests by checking against known breach databases`,builder:e=>e.command(x).command(C).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,n as p}from"./prompt-CyATfGUu.mjs";import{t as m}from"./cli-types-C3nVfpSG.mjs";function h(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."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`,default:!0}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\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).`,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.`}).option(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).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.'}).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`],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 g={command:`create`,describe:`Create a new account or zone-scoped load balancer.`,builder:h,handler:async p=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf load-balancers account create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?u({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:d(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:d(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:l(p.rules,`rules`),session_affinity:d(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:d(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:d(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl}):c(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=c(p.body);a(await s(`Creating`,async()=>m.loadBalancers.account.create({...e,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`});return}if(p[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);p[`fallback-pool`]===void 0&&(p[`fallback-pool`]=await f(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),p.name===void 0&&(p.name=await f(`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 _=u({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:d(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:d(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:l(p.rules,`rules`),session_affinity:d(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:d(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:d(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl});a(await s(`Creating`,async()=>m.loadBalancers.account.create({..._,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`})}};function _(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 ee={command:`delete <load-balancer-id>`,describe:`Delete a configured account or zone-scoped load balancer.`,builder:_,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf load-balancers account delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers/${c[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(c[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"load-balancer-id":String(c[`load-balancer-id`]??``)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await p({force:!!c.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>l.loadBalancers.account.delete({account_or_zone:u,account_or_zone_id:d,load_balancer_id:c[`load-balancer-id`]})),{successLabel:`Deleted`})}};function te(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(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).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:"The editable properties shared by load balancer create, update, and patch requests. Operations layer their own `required` constraints on top via `allOf`."})}const v={command:`edit <load-balancer-id>`,describe:`Apply changes to an existing account or zone-scoped load balancer, overwriting the supplied properties.`,builder:te,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf load-balancers account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers/${f[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(f[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"load-balancer-id":String(f[`load-balancer-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:d(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:d(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},rules:l(f.rules,`rules`),session_affinity:d(f[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:f[`session-affinity-attributes-drain-duration`],headers:f[`session-affinity-attributes-headers`],require_all_headers:f[`session-affinity-attributes-require-all-headers`],samesite:d(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:d(f[`steering-policy`],`steering-policy`,`text`),ttl:f.ttl}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>p.loadBalancers.account.edit({body:e,account_or_zone:m,account_or_zone_id:h,load_balancer_id:f[`load-balancer-id`]})),{successLabel:`Updated`});return}let g=u({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:d(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:d(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},rules:l(f.rules,`rules`),session_affinity:d(f[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:f[`session-affinity-attributes-drain-duration`],headers:f[`session-affinity-attributes-headers`],require_all_headers:f[`session-affinity-attributes-require-all-headers`],samesite:d(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:d(f[`steering-policy`],`steering-policy`,`text`),ttl:f.ttl});a(await s(`Updating`,async()=>p.loadBalancers.account.edit({body:g,account_or_zone:m,account_or_zone_id:h,load_balancer_id:f[`load-balancer-id`]})),{successLabel:`Updated`})}};function y(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 b={command:`get <load-balancer-id>`,describe:`Fetch a single configured account or zone-scoped load balancer.`,builder:y,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf load-balancers account get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers/${c[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(c[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"load-balancer-id":String(c[`load-balancer-id`]??``)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.loadBalancers.account.get({account_or_zone:u,account_or_zone_id:d,load_balancer_id:c[`load-balancer-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 S={command:`list`,describe:`List configured account or zone-scoped load balancers.`,builder:x,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf load-balancers account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.loadBalancers.account.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function C(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(`rules`,{type:`string`,description:`BETA Field Not General Access: A list of rules for this load balancer to execute. Provide as a JSON array of objects or @path/to/file.json.`}).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 w={command:`update <load-balancer-id>`,describe:`Update a configured account or zone-scoped load balancer.`,builder:C,handler:async p=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf load-balancers account update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers/${p[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(p[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"load-balancer-id":String(p[`load-balancer-id`]??``)},bodyKind:`json`,body:p.body===void 0?u({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:d(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:d(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:l(p.rules,`rules`),session_affinity:d(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:d(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:d(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl}):c(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=c(p.body);a(await s(`Updating`,async()=>m.loadBalancers.account.update({...e,account_or_zone:h,account_or_zone_id:g,load_balancer_id:p[`load-balancer-id`]})),{successLabel:`Updated`});return}if(p[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);p[`fallback-pool`]===void 0&&(p[`fallback-pool`]=await f(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),p.name===void 0&&(p.name=await f(`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 _=u({adaptive_routing:{failover_across_pools:p[`adaptive-routing-failover-across-pools`]},default_pools:p[`default-pools`],description:d(p.description,`description`,`text`),enabled:p.enabled,fallback_pool:d(p[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:d(p[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:d(p[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:d(p.name,`name`,`text`),networks:p.networks,proxied:p.proxied,random_steering:{default_weight:p[`random-steering-default-weight`]},rules:l(p.rules,`rules`),session_affinity:d(p[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:p[`session-affinity-attributes-drain-duration`],headers:p[`session-affinity-attributes-headers`],require_all_headers:p[`session-affinity-attributes-require-all-headers`],samesite:d(p[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:d(p[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:d(p[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:p[`session-affinity-ttl`],steering_policy:d(p[`steering-policy`],`steering-policy`,`text`),ttl:p.ttl});a(await s(`Updating`,async()=>m.loadBalancers.account.update({..._,account_or_zone:h,account_or_zone_id:g,load_balancer_id:p[`load-balancer-id`]})),{successLabel:`Updated`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`Get current load balancer resource usage counts for an account.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers account usage list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/usage`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.account.usage.list({account_id:l})),{successLabel:`Loaded`})}},D={command:`usage`,describe:`Operations for account.usage`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`account`,describe:`Operations for account`,builder:e=>e.command(g).command(ee).command(v).command(b).command(S).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Create a new monitor group.`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.loadBalancers.monitorGroups.create({body:e,account_id:m})),{successLabel:`Created`});return}if(r.description===void 0&&(r.description=await f(`description`,`A short description of the monitor group`)),r.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)});a(await s(`Creating`,async()=>p.loadBalancers.monitorGroups.create({body:h,account_id:m})),{successLabel:`Created`})}};function j(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 M={command:`delete <monitor-group-id>`,describe:`Delete a configured monitor group.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
4
+ `);return}a(await s(`Deleting`,async()=>c.loadBalancers.monitorGroups.delete({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Deleted`})}};function N(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(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`edit <monitor-group-id>`,describe:`Apply changes to an existing monitor group, overwriting the supplied properties.`,builder:N,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.loadBalancers.monitorGroups.edit({body:e,account_id:m,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}if(r.description===void 0&&(r.description=await f(`description`,`A short description of the monitor group`)),r.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)});a(await s(`Updating`,async()=>p.loadBalancers.monitorGroups.edit({body:h,account_id:m,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}};function F(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 I={command:`get <monitor-group-id>`,describe:`Fetch a single configured monitor group.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.get({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List configured monitor groups.`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.list({account_id:l})),{successLabel:`Loaded`})}};function z(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 B={command:`list`,describe:`Get the list of resources that reference the provided monitor group.`,builder:z,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}/references`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitorGroups.references.list({account_id:l,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Loaded`})}},V={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(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(`members`,{type:`string`,description:`List of monitors in this group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`update <monitor-group-id>`,describe:`Modify a configured monitor group.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitor-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitor_groups/${r[`monitor-group-id`]==null?`<monitor-group-id>`:encodeURIComponent(String(r[`monitor-group-id`]))}`,pathParams:{"monitor-group-id":String(r[`monitor-group-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.loadBalancers.monitorGroups.update({body:e,account_id:m,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}if(r.description===void 0&&(r.description=await f(`description`,`A short description of the monitor group`)),r.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let h=u({description:d(r.description,`description`,`text`),members:l(r.members,`members`)});a(await s(`Updating`,async()=>p.loadBalancers.monitorGroups.update({body:h,account_id:m,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}},W={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(A).command(M).command(P).command(I).command(R).command(U).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(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 K={command:`create`,describe:`Create a configured monitor.`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.loadBalancers.monitors.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)});a(await s(`Creating`,async()=>l.loadBalancers.monitors.create({body:p,account_id:f})),{successLabel:`Created`})}};function q(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 J={command:`delete <monitor-id>`,describe:`Delete a configured monitor.`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
5
+ `);return}a(await s(`Deleting`,async()=>c.loadBalancers.monitors.delete({account_id:l,monitor_id:r[`monitor-id`]})),{successLabel:`Deleted`})}};function Y(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 X={command:`edit <monitor-id>`,describe:`Apply changes to an existing monitor, overwriting the supplied properties.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.loadBalancers.monitors.edit({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`});return}let p=u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)});a(await s(`Updating`,async()=>l.loadBalancers.monitors.edit({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`})}};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:`List a single configured monitor for an account.`,builder:Z,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.get({account_id:l,monitor_id:r[`monitor-id`]})),{successLabel:`Loaded`})}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`list`,describe:`List configured monitors for an account.`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.list({account_id:l})),{successLabel:`Loaded`})}};function ie(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 ae={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:ie,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}/preview`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.loadBalancers.monitors.previews.create({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Created`});return}let p=u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)});a(await s(`Creating`,async()=>l.loadBalancers.monitors.previews.create({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Created`})}},oe={command:`previews`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(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 ce={command:`get <monitor-id>`,describe:`Get the list of resources that reference the provided monitor.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}/references`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.monitors.references.get({account_id:l,monitor_id:r[`monitor-id`]})),{successLabel:`Loaded`})}},le={command:`references`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(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 de={command:`update <monitor-id>`,describe:`Modify a configured monitor.`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/monitors/${r[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(r[`monitor-id`]))}`,pathParams:{"monitor-id":String(r[`monitor-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.loadBalancers.monitors.update({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`});return}let p=u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)});a(await s(`Updating`,async()=>l.loadBalancers.monitors.update({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`})}},fe={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).command(de).command(oe).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(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 me={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:pe,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({notification_email:d(r[`notification-email`],`notification-email`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.loadBalancers.pools.bulkEdit({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({notification_email:d(r[`notification-email`],`notification-email`,`text`)});a(await s(`Updating`,async()=>l.loadBalancers.pools.bulkEdit({body:p,account_id:f})),{successLabel:`Updated`})}};function he(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.`}).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.`,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).`}).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(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`create`,describe:`Create a new pool.`,builder:he,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),enabled:r.enabled,latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.loadBalancers.pools.create({...e,account_id:m})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await f(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),r.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let h=u({description:d(r.description,`description`,`text`),enabled:r.enabled,latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)});a(await s(`Creating`,async()=>p.loadBalancers.pools.create({...h,account_id:m})),{successLabel:`Created`})}};function _e(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 ve={command:`delete <pool-id>`,describe:`Delete a configured pool.`,builder:_e,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
6
+ `);return}a(await s(`Deleting`,async()=>c.loadBalancers.pools.delete({account_id:l,pool_id:r[`pool-id`]})),{successLabel:`Deleted`})}};function ye(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(`health-sources`,{type:`string`,array:!0,description:`A list of health sources, ordered from highest to lowest priority, used to evaluate individual origin health and overall pool health. The load balancer uses the first source that has data and falls back to the next. Currently accepted values are null or the exact array ["regional", "global"]; any other combination is rejected. Null (the default) behaves like ["local", "global"]. ["regional", "global"] makes each region steer on its own health, falling back to the global decision when a region has no fresh data. Setting regional requires at least one region in check_regions.`}).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(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`edit <pool-id>`,describe:`Apply changes to an existing pool, overwriting the supplied properties.`,builder:ye,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({check_regions:r[`check-regions`],description:d(r.description,`description`,`text`),enabled:r.enabled,health_sources:r[`health-sources`],latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.loadBalancers.pools.edit({...e,account_id:p,pool_id:r[`pool-id`]})),{successLabel:`Updated`});return}let m=u({check_regions:r[`check-regions`],description:d(r.description,`description`,`text`),enabled:r.enabled,health_sources:r[`health-sources`],latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)});a(await s(`Updating`,async()=>f.loadBalancers.pools.edit({...m,account_id:p,pool_id:r[`pool-id`]})),{successLabel:`Updated`})}};function xe(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 Se={command:`get <pool-id>`,describe:`Fetch a single configured pool.`,builder:xe,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.get({account_id:l,pool_id:r[`pool-id`]})),{successLabel:`Loaded`})}};function Ce(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 we={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:Ce,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools health create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}/preview`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.loadBalancers.pools.health.create({body:e,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Created`});return}let p=u({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:d(r.description,`description`,`text`),expected_body:d(r[`expected-body`],`expected-body`,`text`),expected_codes:d(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:d(r.method,`method`,`text`),path:d(r.path,`path`,`text`),port:r.port,probe_zone:d(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:d(r.type,`type`,`text`)});a(await s(`Creating`,async()=>l.loadBalancers.pools.health.create({body:p,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Created`})}};function Te(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 Ee={command:`get <pool-id>`,describe:`Fetch the latest pool health status for a single pool.`,builder:Te,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools health get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}/health`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.health.get({account_id:l,pool_id:r[`pool-id`]})),{successLabel:`Loaded`})}},De={command:`health`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(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 ke={command:`list`,describe:`List configured pools.`,builder:Oe,handler:async r=>{let c={monitor:r.monitor};if(r.dryRun){o({command:`cf load-balancers pools list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.pools.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ae(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 je={command:`get <pool-id>`,describe:`Get the list of resources that reference the provided pool.`,builder:Ae,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools references get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}/references`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.pools.references.get({account_id:l,pool_id:r[`pool-id`]})),{successLabel:`Loaded`})}},Me={command:`references`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(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(`health-sources`,{type:`string`,array:!0,description:`A list of health sources, ordered from highest to lowest priority, used to evaluate individual origin health and overall pool health. The load balancer uses the first source that has data and falls back to the next. Currently accepted values are null or the exact array ["regional", "global"]; any other combination is rejected. Null (the default) behaves like ["local", "global"]. ["regional", "global"] makes each region steer on its own health, falling back to the global decision when a region has no fresh data. Setting regional requires at least one region in check_regions.`}).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(`origins`,{type:`string`,description:`The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`update <pool-id>`,describe:`Modify a configured pool.`,builder:Ne,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/pools/${r[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(r[`pool-id`]))}`,pathParams:{"pool-id":String(r[`pool-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({check_regions:r[`check-regions`],description:d(r.description,`description`,`text`),enabled:r.enabled,health_sources:r[`health-sources`],latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.loadBalancers.pools.update({...e,account_id:m,pool_id:r[`pool-id`]})),{successLabel:`Updated`});return}if(r.name===void 0&&(r.name=await f(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`)),r.origins===void 0)throw Error(`--origins is required (or pass --body with this field set).`);let h=u({check_regions:r[`check-regions`],description:d(r.description,`description`,`text`),enabled:r.enabled,health_sources:r[`health-sources`],latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:d(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:d(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:d(r.monitor,`monitor`,`text`),monitor_group:d(r[`monitor-group`],`monitor-group`,`text`),name:d(r.name,`name`,`text`),notification_email:d(r[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:r[`notification-filter-origin-disable`],healthy:r[`notification-filter-origin-healthy`]},pool:{disable:r[`notification-filter-pool-disable`],healthy:r[`notification-filter-pool-healthy`]}},origin_steering:{policy:d(r[`origin-steering-policy`],`origin-steering-policy`,`text`)},origins:l(r.origins,`origins`)});a(await s(`Updating`,async()=>p.loadBalancers.pools.update({...h,account_id:m,pool_id:r[`pool-id`]})),{successLabel:`Updated`})}},$={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(me).command(ge).command(ve).command(be).command(Se).command(ke).command(Pe).command(De).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(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 Ie={command:`get <preview-id>`,describe:`Get the result of a previous preview operation using the provided preview_id.`,builder:Fe,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/preview/${r[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(r[`preview-id`]))}`,pathParams:{"preview-id":String(r[`preview-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.previews.get({account_id:l,preview_id:r[`preview-id`]})),{successLabel:`Loaded`})}},Le={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Re(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 ze={command:`get <region-id>`,describe:`Get a single region mapping.`,builder:Re,handler:async r=>{if(r.dryRun){o({command:`cf load-balancers regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/regions/${r[`region-id`]==null?`<region-id>`:encodeURIComponent(String(r[`region-id`]))}`,pathParams:{"region-id":String(r[`region-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.loadBalancers.regions.get({account_id:l,region_id:r[`region-id`]})),{successLabel:`Loaded`})}};function Be(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 Ve={command:`list`,describe:`List all region mappings.`,builder:Be,handler:async r=>{let c={subdivision_code:r[`subdivision-code`],subdivision_code_a2:r[`subdivision-code-a2`],country_code_a2:r[`country-code-a2`]};if(r.dryRun){o({command:`cf load-balancers regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/regions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.regions.list({account_id:u,...c})),{successLabel:`Loaded`})}},He={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ue(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 We={command:`list`,describe:`Search for Load Balancing resources.`,builder:m(Ue),handler:async r=>{let c={query:r.query,references:r.references,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf load-balancers searches list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/load_balancers/search`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.loadBalancers.searches.list({account_id:u,...c})),{successLabel:`Loaded`})}},Ge={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ke={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(O).command(W).command(fe).command($).command(Le).command(He).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ke as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./chunk-vbHwaUoU.mjs";var t=e({LOCAL_ACCOUNT_ID:()=>o,NO_LOCAL_EQUIVALENT:()=>n,createLocalFetch:()=>a,disposeLocalRuntime:()=>i});const n=`This command has no local equivalent. Re-run without --local to use the Cloudflare API.`;let r;async function i(){let e=r;r=void 0,await e?.()}function a(e={}){return async function(t,n){let{dispatchLocal:i,disposeLocalSession:a}=await import(`./local-runtime-Dh3keC5v.mjs`);return r=a,i(new Request(t,n),e.persistTo,e.apiBaseUrl)}}const o=`local`;export{t as a,i,n,a as r,o as t};
2
+ import{n as e}from"./chunk-vbHwaUoU.mjs";var t=e({LOCAL_ACCOUNT_ID:()=>o,NO_LOCAL_EQUIVALENT:()=>n,createLocalFetch:()=>a,disposeLocalRuntime:()=>i});const n=`This command has no local equivalent. Re-run without --local to use the Cloudflare API.`;let r;async function i(){let e=r;r=void 0,await e?.()}function a(e={}){return async function(t,n){let{dispatchLocal:i,disposeLocalSession:a}=await import(`./local-runtime--IQr44qq.mjs`);return r=a,i(new Request(t,n),e.persistTo,e.apiBaseUrl)}}const o=`local`;export{t as a,i,n,a as r,o as t};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{n as e}from"./local-DGiIS1uM.mjs";import{i as t}from"./cf-yPz_IqW6.mjs";import{n}from"./registry-5-I2XLwF.mjs";import{mkdtempSync as r,rmSync as i,statSync as a}from"node:fs";import{join as o,resolve as s}from"node:path";import{tmpdir as c}from"node:os";import{randomUUID as l}from"node:crypto";import{Miniflare as u}from"miniflare";const d=/^\/accounts\/[^/]+/;function f(e){let n=e!==void 0&&e!==``?o(s(process.cwd(),e),`v3`):o(t(),`state`,`v3`);try{if(!a(n).isDirectory())throw Error(`Local persistence path must be a directory: ${n}`)}catch(e){let t=e.code;if(t===`ENOENT`)return n;throw t===`ENOTDIR`?Error(`Local persistence path must be a directory: ${n}`):e}return n}let p;function m(e){let t=n(),a=r(o(c(),`cf-local-isolated-${process.pid}-`));try{return{mf:new u({unsafeLocalExplorer:!0,cf:!1,resourcePersistencePath:e,unsafeEnableSharedStorage:!0,isolatedResourcePersistencePath:a,unsafeDevRegistryPath:t,workers:[{config:{name:`cf-local-${l()}`,compatibilityDate:`2026-08-15`,manifest:{mainModule:`cf-local.mjs`,modules:{"cf-local.mjs":{type:`esm`,contents:`export default { fetch() { return new Response(null, { status: 404 }); } };`}}}}}]}),isolatedPersistRoot:a}}catch(e){throw i(a,{recursive:!0,force:!0}),e}}async function h(t,n,r){let i=new URL(t.url),a=new URL(r??`https://api.cloudflare.com/client/v4`).pathname.replace(/\/+$/,``),o=`http://localhost/cdn-cgi/local/explorer/api${i.pathname.slice(a.length).replace(d,``)||`/`}${i.search}`,s=new Headers(t.headers);s.delete(`Authorization`),s.set(`Host`,`localhost`);let c;try{c=p??=m(f(n))}catch(e){return g(500,`Could not start the local runtime: ${_(e)}`)}let l;try{let e={method:t.method,headers:[...s],redirect:`manual`,signal:t.signal};t.body!==null&&(e.body=t.body,e.duplex=`half`),l=await c.mf.dispatchFetch(o,e)}catch(e){return g(500,`The local runtime failed to answer: ${_(e)}`)}if(l.status===404&&l.headers.get(`content-type`)?.includes(`json`)!==!0){await l.body?.cancel();let n=new URL(o).pathname.replace(/^.*\/explorer\/api/,``);return g(404,`${e} The local explorer API does not implement ${t.method} ${n}.`)}return l}function g(e,t){return new Response(JSON.stringify({success:!1,errors:[{message:t}],messages:[],result:null}),{status:e,headers:{"content-type":`application/json`}})}function _(e){return e instanceof Error?e.message:String(e)}async function v(){let e=p;if(p=void 0,e!==void 0)try{let{mf:t,isolatedPersistRoot:n}=e;await t.dispose().finally(()=>i(n,{recursive:!0,force:!0}))}catch{}}export{h as dispatchLocal,v as disposeLocalSession};
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,n as h}from"./prompt-CyATfGUu.mjs";function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`available`,describe:`Returns all dataset types that this account or 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 or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error.`,builder:g,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets available`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/available`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.logexplorer.account.datasets.available({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function v(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`fields`,{type:`string`,description:`Controls which fields the API ingests. Defaults to all available
3
+ fields when absent.
4
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are ingested.
5
+ If provided, replaces the dataset's default filter entirely.
6
+ See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
7
+ for syntax and examples.
8
+ `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:"Create a new Log Explorer dataset for the account or zone. List available account or zone datasets to see the dataset types and fields you can use. The `fields` property is optional. If not specified, all available fields will be enabled. For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:v,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?d({dataset:f(i.dataset,`dataset`,`text`),fields:u(i.fields,`fields`),filter:f(i.filter,`filter`,`text`)}):l(i.body)});return}let p=await a(i),h=i.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:i.zone},p,{quiet:i.quiet}):i.local?e:await t();if(h===`zones`?i.zoneId=g:i.accountId=g,i.body){let e=l(i.body);o(await c(`Creating`,async()=>p.logexplorer.account.datasets.create({...e,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`});return}i.dataset===void 0&&(i.dataset=await m(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let _=d({dataset:f(i.dataset,`dataset`,`text`),fields:u(i.fields,`fields`),filter:f(i.filter,`filter`,`text`)});o(await c(`Creating`,async()=>p.logexplorer.account.datasets.create({..._,account_or_zone:h,account_or_zone_id:g})),{successLabel:`Created`})}};function b(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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <dataset-id>`,describe:`Deletes a Log Explorer dataset for the account or zone. Dataset deletion must not be protected.`,builder:b,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=d:i.accountId=d,!await h({force:!!i.force,message:`This operation deletes a Log Explorer dataset for the account.`})){process.stderr.write(`Aborted.
9
+ `);return}o(await c(`Deleting`,async()=>l.logexplorer.account.datasets.delete({account_or_zone:u,account_or_zone_id:d,dataset_id:i[`dataset-id`]})),{successLabel:`Deleted`})}};function S(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 C={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the account or zone.`,builder:S,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.logexplorer.account.datasets.get({account_or_zone:u,account_or_zone_id:d,dataset_id:i[`dataset-id`]})),{successLabel:`Loaded`})}};function w(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 T={command:`list`,describe:"Returns all Log Explorer datasets configured for the account or zone. Pass `include_zones=true` to also include zone-level datasets that belong to this account or zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:w,handler:async i=>{let l={include_zones:i[`include-zones`]};if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.logexplorer.account.datasets.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function E(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`deletion-protection`,{type:`boolean`,description:"Set to `false` to allow deletion of this dataset."}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).option(`fields`,{type:`string`,description:`Controls which fields the API ingests after the update. Defaults
10
+ to all available fields when absent.
11
+ . Provide as a JSON array of objects or @path/to/file.json.`}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are
12
+ ingested. If omitted, the existing filter is left unchanged. Set
13
+ to an empty string (\`""\`) to clear the filter. Otherwise,
14
+ replaces the dataset's filter entirely.
15
+ See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
16
+ for syntax and examples.
17
+ `}).option(`dry-run`,{type:`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:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account or zone dataset.`,builder:E,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf logexplorer account datasets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/datasets/${i[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(i[`dataset-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"dataset-id":String(i[`dataset-id`]??``)},bodyKind:`json`,body:i.body===void 0?d({deletion_protection:i[`deletion-protection`],enabled:i.enabled,fields:u(i.fields,`fields`),filter:f(i.filter,`filter`,`text`)}):l(i.body)});return}let p=await a(i),m=i.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:i.zone},p,{quiet:i.quiet}):i.local?e:await t();if(m===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=l(i.body);o(await c(`Updating`,async()=>p.logexplorer.account.datasets.update({...e,account_or_zone:m,account_or_zone_id:h,dataset_id:i[`dataset-id`]})),{successLabel:`Updated`});return}if(i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let g=d({deletion_protection:i[`deletion-protection`],enabled:i.enabled,fields:u(i.fields,`fields`),filter:f(i.filter,`filter`,`text`)});o(await c(`Updating`,async()=>p.logexplorer.account.datasets.update({...g,account_or_zone:m,account_or_zone_id:h,dataset_id:i[`dataset-id`]})),{successLabel:`Updated`})}},O={command:`datasets`,describe:`Operations for account.datasets`,builder:e=>e.command(_).command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const A={command:`query`,describe:`Run a SQL query against account or 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' List configured account or zone datasets to see enabled account or zone-level datasets. Zone-level datasets will not appear here. List available account or zone datasets to inspect their schemas and timestamp fields. For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:k,handler:async l=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;s({command:`cf logexplorer account query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/logs/explorer/query/sql`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`octet-stream`,body:l.body});return}let u=await a(l),d=l.zone===void 0?`accounts`:`zones`,m=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();if(d===`zones`?l.zoneId=m:l.accountId=m,l.file){let e=p(l.file);o(await c(`Loading`,async()=>i(u,`POST`,`/${d}/${m}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(l.body){let e=f(l.body,`body`,`binary`);o(await c(`Loading`,async()=>i(u,`POST`,`/${d}/${m}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}o(await c(`Loading`,async()=>u.logexplorer.account.query({account_or_zone:d,account_or_zone_id:m})),{successLabel:`Loaded`})}},j={command:`account`,describe:`Operations for account`,builder:e=>e.command(A).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`logexplorer`,describe:`logexplorer`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{M as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";function s(e){return e.option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for logo queries based on ID`,builder:s,handler:async s=>{let c={logo_id:s[`logo-id`],offset:s.offset,limit:s.limit};if(s.dryRun){a({command:`cf logo-matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`logo-id`,{type:`string`,description:`Logo ID`}).option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for logo queries based on ID`,builder:u,handler:async s=>{let c={logo_id:s[`logo-id`],offset:s.offset,limit:s.limit};if(s.dryRun){a({command:`cf logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logo-matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.logoMatches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`logo-matches`,describe:`logo-matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./input-validation-1esLElok.mjs";import{n as u}from"./prompt-CyATfGUu.mjs";function d(e){return e.option(`tag`,{type:`string`,description:`Tag`}).option(`match-type`,{type:`string`,description:`Match type`}).option(`threshold`,{type:`number`,description:`Threshold`}).option(`dry-run`,{type:`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 f={command:`create`,describe:`Return new saved logo queries created from image files`,builder:d,handler:async u=>{let d={tag:u.tag,match_type:u[`match-type`],threshold:u.threshold};if(u.dryRun){o({command:`cf logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos`,pathParams:{},query:d,bodyKind:`octet-stream`,body:u.body});return}let f=await i(u),p=u.local?e:await t();if(u.accountId=p,u.file){let e=l(u.file);a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(u.body){let e=c(u.body,`body`,`binary`),t=new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Creating`,async()=>r(f,`POST`,`/accounts/${p}/brand-protection/logos${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/x-www-form-urlencoded`}})),{successLabel:`Created`});return}if(u.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function p(e){return e.positional(`logo-id`,{type:`string`,description:`Logo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <logo-id>`,describe:`Return a success message after deleting saved logo queries by ID`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/logos/${r[`logo-id`]==null?`<logo-id>`:encodeURIComponent(String(r[`logo-id`]))}`,pathParams:{"logo-id":String(r[`logo-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await u({force:!!r.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>c.logos.delete({account_id:l,logo_id:r[`logo-id`]})),{successLabel:`Deleted`})}},h={command:`logos`,describe:`logos`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};