cf 0.10.0 → 0.11.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 (342) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +12 -4
  3. package/dist/_meta/commands.json +2249 -262
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-sDBTV0qZ.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-Bz3JG5hI.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-DCuW3xyZ.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-4T8gmZs-.mjs} +1 -1
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-BBfXNfUg.mjs} +1 -1
  26. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  27. package/dist/{auth-MQEamPN9.mjs → auth-D3X9HYhD.mjs} +3 -3
  28. package/dist/auth-DPhNN3Ly.mjs +5 -0
  29. package/dist/billing-B9e4PnvN.mjs +3 -0
  30. package/dist/body-parser-BshbixEq.mjs +2 -0
  31. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  32. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  33. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  34. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  35. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  36. package/dist/build-D0FhOj40.mjs +8 -0
  37. package/dist/{cache-VyWK1SjY.mjs → cache-C6V7PbQM.mjs} +1 -1
  38. package/dist/{calls-BxoRYxs4.mjs → calls-Bye8Tyy-.mjs} +1 -1
  39. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  40. package/dist/cf-Ds4JFovl.mjs +18 -0
  41. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  42. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  43. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  44. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  45. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  46. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  47. package/dist/command-C9VP3xaA.mjs +2 -0
  48. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  49. package/dist/config.d.mts +1460 -1348
  50. package/dist/config.mjs +1 -1
  51. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  52. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  53. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  54. package/dist/{connectors-BqxYMMtQ.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  55. package/dist/{containers-CKW081JA.mjs → containers-BrQtGiNp.mjs} +12 -8
  56. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  57. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  58. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  59. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  60. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  61. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-C0eiGvG9.mjs} +1 -1
  62. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  63. package/dist/custom-pages-DTINMR30.mjs +3 -0
  64. package/dist/d1-sKdExJYF.mjs +20 -0
  65. package/dist/data-security-mV3a6UfW.mjs +7 -0
  66. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  67. package/dist/delegate.mjs +1 -1
  68. package/dist/{deploy-CZ7bgNDu.mjs → deploy-BL59O1O1.mjs} +1 -1
  69. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  70. package/dist/{dev-V10MG-Bg.mjs → dev-BDaavgH1.mjs} +2 -2
  71. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-CJV6qWUA.mjs} +1 -1
  72. package/dist/{directory-BlH6N6Qy.mjs → directory-B5zCMusW.mjs} +1 -1
  73. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  74. package/dist/dist-BHi7UhXO.mjs +72 -0
  75. package/dist/dist-BWpErtDM.mjs +384 -0
  76. package/dist/{dls-BF5iN78p.mjs → dls-t0hnIe_P.mjs} +1 -1
  77. package/dist/{dns-CeCTNqRk.mjs → dns-C8FC2hbh.mjs} +13 -13
  78. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  79. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  80. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  81. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  82. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  83. package/dist/email-routing-CF3_Z957.mjs +6 -0
  84. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  85. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  86. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  87. package/dist/{firewall-CBPGJ43p.mjs → firewall-8YWWy4iB.mjs} +9 -9
  88. package/dist/flagship-C4x0l-8J.mjs +4 -0
  89. package/dist/{fraud-BIhS8pLf.mjs → fraud-HR_SdUx3.mjs} +1 -1
  90. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  91. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-4qOvjrTN.mjs} +1 -1
  92. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-DehdYOMz.mjs} +1 -1
  93. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  94. package/dist/iam-DR72hmii.mjs +6 -0
  95. package/dist/images-CeKc5JPh.mjs +8 -0
  96. package/dist/index.mjs +1 -1
  97. package/dist/{intel-B-9Z_sJs.mjs → intel-DtFix9WL.mjs} +1 -1
  98. package/dist/{interactive-DtsCYfrK.mjs → interactive-C7M55Wxx.mjs} +1 -1
  99. package/dist/ips-CtWCjXAN.mjs +2 -0
  100. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  101. package/dist/keys-BmhG6Kn1.mjs +2 -0
  102. package/dist/{kv-BFDUCnft.mjs → kv-BuVPAuZP.mjs} +1 -1
  103. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  104. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  105. package/dist/{local-D-aVNu6A.mjs → local-Be3lg_9E.mjs} +1 -1
  106. package/dist/{local-runtime-Dh3keC5v.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  107. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  108. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  109. package/dist/logos-DRYjGBDq.mjs +3 -0
  110. package/dist/{logpush-BK34mMQs.mjs → logpush-Dve9jOMp.mjs} +1 -1
  111. package/dist/{logs-CLAqX9h2.mjs → logs-SC86FE89.mjs} +1 -1
  112. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  113. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  114. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  115. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  116. package/dist/matches-Iss9Fo4R.mjs +2 -0
  117. package/dist/mcp-8wxXT6JU.mjs +4 -0
  118. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  119. package/dist/{moq-qmuVPAO0.mjs → moq-ZKMFOeVz.mjs} +1 -1
  120. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  121. package/dist/{network-D74cSy3t.mjs → network-B1lBARU9.mjs} +1 -1
  122. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  123. package/dist/oauth-DuEONNgC.mjs +14 -0
  124. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  125. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  126. package/dist/observability-Jya7-zkl.mjs +4 -0
  127. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  128. package/dist/{organization-NX7yCZrq.mjs → organization-CYxYV4e0.mjs} +6 -6
  129. package/dist/organizations-SacGUW44.mjs +2 -0
  130. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  131. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  132. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  133. package/dist/{output-DrpYYfnB.mjs → output-Ccqw2WOb.mjs} +1 -1
  134. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  135. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  136. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  137. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  138. package/dist/precursor-iwK-1P_d.mjs +4 -0
  139. package/dist/progress-BqQcF5QH.mjs +2 -0
  140. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  141. package/dist/prompt-B0sWIs9c.mjs +3 -0
  142. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  143. package/dist/queries-c7zvnfEQ.mjs +3 -0
  144. package/dist/queues-BU6y16qS.mjs +6 -0
  145. package/dist/r2-Jo3QMahK.mjs +24 -0
  146. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  147. package/dist/radar-DIYAMEof.mjs +2 -0
  148. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-DewOcznT.mjs} +1 -1
  149. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  150. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-cnZEVNDn.mjs} +1 -1
  151. package/dist/registrar-BsWr_aPM.mjs +23 -0
  152. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-BlcpUyIH.mjs} +4 -4
  153. package/dist/{registry-Bck_zFkz.mjs → registry-jifR3_Y6.mjs} +1 -1
  154. package/dist/reporting--1AyTV7k.mjs +2 -0
  155. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  156. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  157. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  158. package/dist/rules-BfjzALMi.mjs +4 -0
  159. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  160. package/dist/rum-CjmIckiR.mjs +4 -0
  161. package/dist/{schema-B34Q9tLF.mjs → schema-1mwmslUV.mjs} +1 -1
  162. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  163. package/dist/{scim-CcSyfKCH.mjs → scim-pApmzA5B.mjs} +1 -1
  164. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  165. package/dist/security-center-Djm06dq-.mjs +2 -0
  166. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  167. package/dist/{share-BuwYUzOL.mjs → share-Dj-MNXrw.mjs} +4 -4
  168. package/dist/shared-BJvq4DkR.mjs +290 -0
  169. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  170. package/dist/snippets-Dyz0PH60.mjs +4 -0
  171. package/dist/{spawn-O1RS01vr.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  172. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  173. package/dist/{speed-cw31yFva.mjs → speed-BKepWBXj.mjs} +1 -1
  174. package/dist/src-gJma71Ec.mjs +108 -0
  175. package/dist/{ssl-CsEhRVTO.mjs → ssl-KdFiY3ev.mjs} +1 -1
  176. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  177. package/dist/{state-Bb5Cbc_L.mjs → state-Cu3cItUg.mjs} +1 -1
  178. package/dist/{stream-DFOao6Gu.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  179. package/dist/submit-BxbKKhBn.mjs +2 -0
  180. package/dist/tags-DA8dq9fx.mjs +2 -0
  181. package/dist/tenant-DLXw48hS.mjs +2 -0
  182. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  183. package/dist/{tools-BHfBOZOU.mjs → tools-x8bj9E6b.mjs} +1 -1
  184. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  185. package/dist/tunnels-CC10EOsU.mjs +2 -0
  186. package/dist/turnstile-CH58hnf4.mjs +23 -0
  187. package/dist/{ui-DE8CNn6c.mjs → ui-CmnnBm_O.mjs} +1 -1
  188. package/dist/url-info-BpCgdUtL.mjs +2 -0
  189. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  190. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  191. package/dist/user-2-NGebfI.mjs +12 -0
  192. package/dist/values-S_bNv819.mjs +2 -0
  193. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  194. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  195. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  196. package/dist/web3-GnUocVYH.mjs +4 -0
  197. package/dist/workers-J1-PLwdl.mjs +28 -0
  198. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-DCHmWOMS.mjs} +1 -1
  199. package/dist/{workflows-B-kGHxFu.mjs → workflows-CArfEI2c.mjs} +1 -1
  200. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  201. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DVdUPtj1.mjs} +67 -66
  202. package/dist/zone-DMAfrDJX.mjs +2 -0
  203. package/dist/zones-CNwxUi7I.mjs +21 -0
  204. package/package.json +10 -7
  205. package/dist/account-CYRm3yoN.mjs +0 -2
  206. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  207. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  208. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  209. package/dist/ai-search-BmdskMjR.mjs +0 -7
  210. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  211. package/dist/ai-viHB1tgI.mjs +0 -5
  212. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  213. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  214. package/dist/argo-CQfCgazW.mjs +0 -2
  215. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  216. package/dist/auth-D0xZxAEa.mjs +0 -5
  217. package/dist/billing-aJgapeRm.mjs +0 -3
  218. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  219. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  220. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  221. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  222. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  223. package/dist/build-DcflwvqN.mjs +0 -2
  224. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  225. package/dist/cf-C7DU4819.mjs +0 -18
  226. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  227. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  228. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  229. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  230. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  231. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  232. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  233. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  234. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  235. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  236. package/dist/d1-BFvMd6-S.mjs +0 -20
  237. package/dist/data-security-Bji4Or_j.mjs +0 -7
  238. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  239. package/dist/deploy-input-CrvuoDGJ.mjs +0 -242
  240. package/dist/dist-CgrMkXFx.mjs +0 -72
  241. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  242. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  243. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  244. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  245. package/dist/email-sending-dn-353Nx.mjs +0 -7
  246. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  247. package/dist/flagship-BusjRNIb.mjs +0 -4
  248. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  249. package/dist/iam-Cj63Kjc6.mjs +0 -6
  250. package/dist/images-CBWXCDhy.mjs +0 -8
  251. package/dist/ips-qs9eGJnI.mjs +0 -2
  252. package/dist/keys-D7N0j4-x.mjs +0 -2
  253. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  254. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  255. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  256. package/dist/logos-BS65zN8q.mjs +0 -3
  257. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  258. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  259. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  260. package/dist/matches-InA1hwII.mjs +0 -2
  261. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  262. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  263. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  264. package/dist/oauth-B0ETkNcX.mjs +0 -15
  265. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  266. package/dist/observability-BWE0Gg3V.mjs +0 -4
  267. package/dist/organizations-DLhiRt8g.mjs +0 -2
  268. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  269. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  270. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  271. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  272. package/dist/pages-DVDogxPs.mjs +0 -14
  273. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  274. package/dist/pipelines-BszRk4sM.mjs +0 -6
  275. package/dist/precursor-BPNjQr76.mjs +0 -4
  276. package/dist/progress-CsHIt3Tp.mjs +0 -2
  277. package/dist/prompt-DdegNPpg.mjs +0 -3
  278. package/dist/queries-JL1H1Biz.mjs +0 -3
  279. package/dist/queues-DpkYdRUE.mjs +0 -6
  280. package/dist/r2-CKozthw_.mjs +0 -24
  281. package/dist/radar-C-92vggG.mjs +0 -2
  282. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  283. package/dist/registrar-DKKN0M29.mjs +0 -21
  284. package/dist/reporting-fg_GKXe1.mjs +0 -2
  285. package/dist/request-tracers-CkMya96z.mjs +0 -2
  286. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  287. package/dist/rules-BTmNjDN-.mjs +0 -4
  288. package/dist/rulesets-CsoSM-17.mjs +0 -5
  289. package/dist/rum-DB4iO2q5.mjs +0 -4
  290. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  291. package/dist/security-center-DFKeHq5c.mjs +0 -2
  292. package/dist/session-D6KHthHf.mjs +0 -2
  293. package/dist/shared-VppSAQf4.mjs +0 -2
  294. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  295. package/dist/snippets-DIpc9pb_.mjs +0 -4
  296. package/dist/src-D_HETJNy.mjs +0 -108
  297. package/dist/submit--xTzyNPy.mjs +0 -2
  298. package/dist/tags-efICDkah.mjs +0 -2
  299. package/dist/tenant-CerHuToJ.mjs +0 -2
  300. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  301. package/dist/triggers-BEsiiKAf.mjs +0 -2
  302. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  303. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  304. package/dist/url-info-DBCeRWwb.mjs +0 -2
  305. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  306. package/dist/user-bifVEQq5.mjs +0 -12
  307. package/dist/values-OxkdP1tV.mjs +0 -2
  308. package/dist/versions-BVL-Ludh.mjs +0 -2
  309. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  310. package/dist/web3-y_cY91V_.mjs +0 -4
  311. package/dist/workers-jDcq14GH.mjs +0 -24
  312. package/dist/zaraz-27zwjLvv.mjs +0 -2
  313. package/dist/zone-BJix2KQ9.mjs +0 -2
  314. package/dist/zones-Bkj5i92c.mjs +0 -21
  315. /package/dist/{alerts-CRmjqOZi.mjs → alerts-15-IW4jE.mjs} +0 -0
  316. /package/dist/{autorag-BD7cu5NU.mjs → autorag-CFwRkEKw.mjs} +0 -0
  317. /package/dist/{brands-BhALBkX2.mjs → brands-BgT1vu9B.mjs} +0 -0
  318. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  319. /package/dist/{clear-BgF8No7D.mjs → clear-BlCK85Me.mjs} +0 -0
  320. /package/dist/{cli-types-BsTty22w.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  321. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-BbpcII3_.mjs} +0 -0
  322. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-DuCiimXl.mjs} +0 -0
  323. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  324. /package/dist/{health-BFNZqiAm.mjs → health-DZFfafkX.mjs} +0 -0
  325. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  326. /package/dist/{internal-BTeSewwB.mjs → internal-BKHC2D1Y.mjs} +0 -0
  327. /package/dist/{live-Dkiyu30_.mjs → live-DwCvDmaH.mjs} +0 -0
  328. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  329. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  330. /package/dist/{ready-TKOkKeRg.mjs → ready-D9H2zHHI.mjs} +0 -0
  331. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  332. /package/dist/{refute-BVz9nMyd.mjs → refute-2W8NLCN4.mjs} +0 -0
  333. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-B8CyM1mi.mjs} +0 -0
  334. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  335. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-CWhta3x7.mjs} +0 -0
  336. /package/dist/{search-DGNc37HK.mjs → search-DZmBQJL9.mjs} +0 -0
  337. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  338. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-C98A0bqq.mjs} +0 -0
  339. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  340. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  341. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  342. /package/dist/{verify-DS1PWAJe.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -1,6 +0,0 @@
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{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";import{t as f}from"./cli-types-BsTty22w.mjs";function p(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:p,handler:async s=>{if(s.dryRun){a({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups/${s[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(s[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(s[`permission-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.permissionGroups.get({account_id:l,permission_group_id:s[`permission-group-id`]})),{successLabel:`Loaded`})}};function ee(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List all the permissions groups for an account.`,builder:ee,handler:async s=>{let c={id:s.id,name:s.name,label:s.label,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups`,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.iam.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},g={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(m).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:_,handler:async d=>{if(d.dryRun){a({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the resource group`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function y(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group 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 b={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.iam.resourceGroups.delete({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.resourceGroups.get({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`List all the resource groups for an account.`,builder:C,handler:async s=>{let c={id:s.id,name:s.name};if(s.dryRun){a({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,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.iam.resourceGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function T(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:T,handler:async u=>{if(u.dryRun){a({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${u[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(u[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(u[`resource-group-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.iam.resourceGroups.update({...e,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`)});i(await o(`Updating`,async()=>d.iam.resourceGroups.update({...p,account_id:f,resource_group_id:u[`resource-group-id`]})),{successLabel:`Updated`})}},D={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:O,handler:async s=>{if(s.dryRun){a({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.iam.sso.beginVerification({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Created`})}};function A(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,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 j={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:A,handler:async d=>{if(d.dryRun){a({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}d[`email-domain`]===void 0&&(d[`email-domain`]=await u(`email-domain`,`Email domain of the new SSO connector`));let m=c({begin_verification:d[`begin-verification`],email_domain:l(d[`email-domain`],`email-domain`,`text`),use_fedramp_language:d[`use-fedramp-language`]});i(await o(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function M(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector 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 N={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:M,handler:async s=>{if(s.dryRun){a({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
4
- `);return}i(await o(`Deleting`,async()=>c.iam.sso.delete({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Deleted`})}};function P(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:P,handler:async s=>{if(s.dryRun){a({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.get({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:I,handler:async s=>{if(s.dryRun){a({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.list({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).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 te={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:R,handler:async l=>{if(l.dryRun){a({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${l[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(l[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(l[`sso-connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Updating`,async()=>u.iam.sso.update({...e,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=c({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]});i(await o(`Updating`,async()=>u.iam.sso.update({...f,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`})}},z={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`create`,describe:`Create a new user group under the specified account.`,builder:B,handler:async d=>{if(d.dryRun){a({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.iam.userGroups.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Name of the User group.`));let m=c({name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.iam.userGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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 U={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:H,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
5
- `);return}i(await o(`Deleting`,async()=>c.iam.userGroups.delete({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:W,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.userGroups.get({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List all the user groups for an account.`,builder:f(K),handler:async s=>{let c={id:s.id,name:s.name,fuzzyName:s[`fuzzy-name`],page:s.page,per_page:s[`per-page`],direction:s.direction};if(s.dryRun){a({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,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.iam.userGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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 Y={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:J,handler:async c=>{if(c.dryRun){a({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.iam.userGroups.members.create({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function X(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group 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 <member-id>`,describe:`Remove a member from User Group`,builder:X,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
6
- `);return}i(await o(`Deleting`,async()=>c.iam.userGroups.members.delete({account_id:l,user_group_id:s[`user-group-id`],member_id:s[`member-id`]})),{successLabel:`Deleted`})}};function Q(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <member-id>`,describe:`Get details of a specific member in a user group.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.userGroups.members.get({account_id:l,user_group_id:s[`user-group-id`],member_id:s[`member-id`]})),{successLabel:`Loaded`})}};function re(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`List all the members attached to a user group.`,builder:f(re),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],fuzzyEmail:s[`fuzzy-email`],direction:s.direction};if(s.dryRun){a({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},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.iam.userGroups.members.list({account_id:u,user_group_id:s[`user-group-id`],...c})),{successLabel:`Loaded`})}};function ae(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group 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:`Set/Replace members to a user group.`})}const oe={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:ae,handler:async c=>{if(c.dryRun){a({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.iam.userGroups.members.update({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{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.`)}},$={command:`members`,describe:`Operations for user-groups.members`,builder:e=>e.command(Y).command(Z).command(ne).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:se,handler:async u=>{if(u.dryRun){a({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${u[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(u[`user-group-id`]))}`,pathParams:{"user-group-id":String(u[`user-group-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.iam.userGroups.update({...e,account_id:f,user_group_id:u[`user-group-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`)});i(await o(`Updating`,async()=>d.iam.userGroups.update({...p,account_id:f,user_group_id:u[`user-group-id`]})),{successLabel:`Updated`})}},le={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(V).command(U).command(G).command(q).command(ce).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ue={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(g).command(D).command(z).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ue as default};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d,t as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,i as m,n as h}from"./prompt-DdegNPpg.mjs";import{t as g}from"./cli-types-BsTty22w.mjs";import{n as _,t as v}from"./raw-fetch-CteyTOM2.mjs";function ee(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,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 te={command:`cloudflareImagesBaseImage <image-id>`,describe:`Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`,builder:ee,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesBaseImage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>v(`/accounts/${i}/images/v1/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?o.toString(`utf-8`):o)}};function y(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`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const b={command:`cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,describe:"Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.",builder:y,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.expiry!==void 0&&e.append(`expiry`,String(d(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesCreateAuthenticatedDirectUploadUrlV2({account_id:u})),{successLabel:`Created`})}};function x(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`cloudflareImagesDeleteImage <image-id>`,describe:`Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`,builder:x,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesDeleteImage`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.images.cloudflareImagesDeleteImage({account_id:l,image_id:r[`image-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`cloudflareImagesImageDetails <image-id>`,describe:`Fetch details for a CF Images image.`,builder:C,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesImageDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.cloudflareImagesImageDetails({account_id:l,image_id:r[`image-id`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`continuation-token`,{type:`string`,description:`Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`cloudflareImagesListImagesV2`,describe:"List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.<field>[<operator>]=<value>` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ```",builder:g(T),handler:async r=>{let i={continuation_token:r[`continuation-token`],per_page:r[`per-page`],sort_order:r[`sort-order`],creator:r.creator};if(r.dryRun){s({command:`cf images cloudflareImagesListImagesV2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.cloudflareImagesListImagesV2({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).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 O={command:`cloudflareImagesUpdateImage <image-id>`,describe:`Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUpdateImage`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.cloudflareImagesUpdateImage({...e,account_id:f,image_id:r[`image-id`]})),{successLabel:`Updated`});return}let p=u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.cloudflareImagesUpdateImage({...p,account_id:f,image_id:r[`image-id`]})),{successLabel:`Updated`})}};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`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const A={command:`cloudflareImagesUploadAnImageViaUrl`,describe:`Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`,builder:k,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUploadAnImageViaUrl`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(d(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesUploadAnImageViaUrl({account_id:u})),{successLabel:`Created`})}};function j(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`deleteImageDelete <imageId>`,describe:`Delete an image.`,builder:j,handler:async r=>{if(r.dryRun){s({command:`cf images deleteImageDelete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>i.images.deleteImageDelete({accountId:l,imageId:r[`image-id`]})),{successLabel:`Deleted`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Get the current transformation flows configuration for a zone.`,builder:N,handler:async i=>{if(i.dryRun){s({command:`cf images flows get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Loading`,async()=>l.images.flows.get({accountId:u,zoneId:d})),{successLabel:`Loaded`})}};function F(e){return e.option(`etag`,{type:`string`,description:`The etag field`}).option(`version`,{type:`number`,description:`The version field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update`,describe:`Replace the entire transformation flows configuration for a zone.`,builder:F,handler:async i=>{if(i.dryRun){s({command:`cf images flows update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`json`,body:i.body===void 0?u({etag:d(i.etag,`etag`,`text`),version:i.version}):l(i.body)});return}let f=await a(i),p=i.local?e:await t();i.accountId=p;let m=await r({zone:i.zone},f,{quiet:i.quiet});if(i.zoneId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>f.images.flows.update({...e,accountId:p,zoneId:m})),{successLabel:`Updated`});return}if(i.version===void 0)throw Error(`--version is required (or pass --body with this field set).`);let h=u({etag:d(i.etag,`etag`,`text`),version:i.version});o(await c(`Updating`,async()=>f.images.flows.update({...h,accountId:p,zoneId:m})),{successLabel:`Updated`})}},L={command:`flows`,describe:`Zone-level transformation flows that control how images are resized and optimized on delivery`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`continuation-token`,{type:`string`,description:`Continuation token for a next page. List images V2 returns continuation_token`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string will return images where creator field is not set`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`getAccountsAccountIdV2Images`,describe:`List images for an account.`,builder:g(R),handler:async r=>{let i={per_page:r[`per-page`],continuation_token:r[`continuation-token`],creator:r.creator,sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf images getAccountsAccountIdV2Images`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.getAccountsAccountIdV2Images({accountId:u,...i})),{successLabel:`Loaded`})}};function B(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`getImageGet <imageId>`,describe:`Get image metadata.`,builder:B,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.getImageGet({accountId:l,imageId:r[`image-id`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,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 U={command:`getImageGetBlob <imageId>`,describe:`Get image as a blob.`,builder:H,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGetBlob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>v(`/accounts/${i}/v1/images/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?o.toString(`utf-8`):o)}};function W(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`create <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:W,handler:async r=>{if(r.dryRun){s({command:`cf images keys create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.keys.create({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Updated`})}};function K(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,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 q={command:`delete <signing-key-name>`,describe:`Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated.`,builder:K,handler:async r=>{if(r.dryRun){s({command:`cf images keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation will delete this signing key. This will invalidate any URLs that are signed with this key.`})){process.stderr.write(`Aborted.
5
- `);return}o(await c(`Deleting`,async()=>i.images.keys.delete({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Deleted`})}};function J(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List your CF Images signing keys.`,builder:J,handler:async r=>{if(r.dryRun){s({command:`cf images keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.keys.list({account_id:l})),{successLabel:`Loaded`})}},X={command:`keys`,describe:`Manage signing keys for generating private image URLs`,builder:e=>e.command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Image creator`}).option(`require-signed-urls`,{type:`boolean`,description:`Required signed url`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`patchImageEdit <imageId>`,describe:`Update an image's metadata.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf images patchImageEdit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.patchImageEdit({...e,accountId:f,imageId:r[`image-id`]})),{successLabel:`Updated`});return}let p=u({creator:d(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.patchImageEdit({...p,accountId:f,imageId:r[`image-id`]})),{successLabel:`Updated`})}};function ne(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`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`})}const re={command:`postDirectUploadLink`,describe:`Create an authenticated direct upload URL for an image.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf images postDirectUploadLink`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.expiry!==void 0&&e.append(`expiry`,String(d(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postDirectUploadLink({accountId:u})),{successLabel:`Created`})}};function ie(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`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const ae={command:`postImageUpload`,describe:`Upload a new image.`,builder:ie,handler:async r=>{if(r.dryRun){s({command:`cf images postImageUpload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(d(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(d(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?d(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(d(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postImageUpload({accountId:u})),{successLabel:`Created`})}};function oe(e){return e.option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`create`,describe:`Create a new migration from an existing source. The migration will import objects from the source bucket into Cloudflare Images.`,builder:oe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({conflictBehaviour:d(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:d(r[`root-directory`],`root-directory`,`text`),sourceId:d(r[`source-id`],`source-id`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.migrations.create({...e,account_id:f})),{successLabel:`Created`});return}r[`source-id`]===void 0&&(r[`source-id`]=await p(`source-id`,`The identifier of the source to migrate from.`));let m=u({conflictBehaviour:d(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:d(r[`root-directory`],`root-directory`,`text`),sourceId:d(r[`source-id`],`source-id`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.migrations.create({...m,account_id:f})),{successLabel:`Created`})}};function ce(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const le={command:`delete <migration-id>`,describe:`Delete an existing migration. Only completed, errored, or aborted migrations can be deleted.`,builder:ce,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
6
- `);return}o(await c(`Deleting`,async()=>i.images.sourcingKit.migrations.delete({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <migration-id>`,describe:`Fetch details for a single migration.`,builder:ue,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.migrations.get({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`abort <migration-id>`,describe:`Abort a running migration. Objects already imported will not be removed.`,builder:fe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle abort`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle/abort`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.sourcingKit.migrations.lifecycle.abort({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Updated`})}};function me(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <migration-id>`,describe:`Get the current progress of a migration including counts of scanned, imported, skipped, and errored objects.`,builder:me,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.migrations.lifecycle.get({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Loaded`})}};function ge(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`logs <migration-id>`,describe:`List log entries for a specific migration.`,builder:ge,handler:async r=>{let i={offset:r.offset,limit:r.limit};if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/logs`,pathParams:{"migration-id":String(r[`migration-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.migrations.lifecycle.logs({account_id:u,migration_id:r[`migration-id`],...i})),{successLabel:`Loaded`})}};function ve(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`start <migration-id>`,describe:`Start a pending migration. The migration will begin importing objects from the configured source.`,builder:ve,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle start`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle/start`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.sourcingKit.migrations.lifecycle.start({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Updated`})}},be={command:`lifecycle`,describe:`Operations for sourcing-kit.migrations.lifecycle`,builder:e=>e.command(pe).command(he).command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List all migrations for the account.`,builder:xe,handler:async r=>{let i={offset:r.offset,limit:r.limit};if(r.dryRun){s({command:`cf images sourcing-kit migrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.migrations.list({account_id:u,...i})),{successLabel:`Loaded`})}},Ce={command:`migrations`,describe:`Operations for sourcing-kit.migrations`,builder:e=>e.command(se).command(le).command(de).command(Se).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`connectivity <source-id>`,describe:`Check the current connectivity status of an existing migration source.`,builder:we,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources connectivity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}/connectivity`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.sources.connectivity({account_id:l,source_id:r[`source-id`]})),{successLabel:`Loaded`})}};function Ee(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).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:`create`,describe:`Create a new migration source by providing storage credentials. The service will verify connectivity to the bucket before accepting the source.`,builder:Ee,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account:d(r.account,`account`,`text`),bucket:d(r.bucket,`bucket`,`text`),name:d(r.name,`name`,`text`),vendor:d(r.vendor,`vendor`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.sources.create({...e,account_id:f})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The name of the storage bucket.`)),r.name===void 0&&(r.name=await p(`name`,`A human-readable name for the source.`)),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let h=u({account:d(r.account,`account`,`text`),bucket:d(r.bucket,`bucket`,`text`),name:d(r.name,`name`,`text`),vendor:d(r.vendor,`vendor`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.sources.create({...h,account_id:f})),{successLabel:`Created`})}};function Oe(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ke={command:`delete <source-id>`,describe:`Delete an existing migration source. Sources with active migrations cannot be deleted.`,builder:Oe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
7
- `);return}o(await c(`Deleting`,async()=>i.images.sourcingKit.sources.delete({account_id:l,source_id:r[`source-id`]})),{successLabel:`Deleted`})}};function Ae(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`get <source-id>`,describe:`Fetch details for a single migration source.`,builder:Ae,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.sources.get({account_id:l,source_id:r[`source-id`]})),{successLabel:`Loaded`})}};function Me(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`name`,{type:`string`,description:`Filter sources by name (partial match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`list`,describe:`List all configured migration sources for the account.`,builder:Me,handler:async r=>{let i={offset:r.offset,limit:r.limit,name:r.name};if(r.dryRun){s({command:`cf images sourcing-kit sources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.sources.list({account_id:u,...i})),{successLabel:`Loaded`})}};function Pe(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`region`,{type:`string`,description:`The region hint for the bucket (S3 only).`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).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 Fe={command:`pre-check`,describe:`Verify connectivity to a storage bucket before creating a source. Returns connectivity status without persisting any state.`,builder:Pe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources pre-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account:d(r.account,`account`,`text`),bucket:d(r.bucket,`bucket`,`text`),region:d(r.region,`region`,`text`),vendor:d(r.vendor,`vendor`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.sources.preCheck({...e,account_id:f})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The name of the storage bucket.`)),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let h=u({account:d(r.account,`account`,`text`),bucket:d(r.bucket,`bucket`,`text`),region:d(r.region,`region`,`text`),vendor:d(r.vendor,`vendor`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.sources.preCheck({...h,account_id:f})),{successLabel:`Created`})}};function Ie(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`Updated name for the source.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Le={command:`update <source-id>`,describe:`Update the name of an existing migration source.`,builder:Ie,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.sourcingKit.sources.update({...e,account_id:f,source_id:r[`source-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await p(`name`,`Updated name for the source.`));let m=u({name:d(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.images.sourcingKit.sources.update({...m,account_id:f,source_id:r[`source-id`]})),{successLabel:`Updated`})}},Re={command:`sources`,describe:`Operations for sourcing-kit.sources`,builder:e=>e.command(Te).command(De).command(ke).command(je).command(Ne).command(Fe).command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ze={command:`sourcing-kit`,describe:`Operations for sourcing-kit`,builder:e=>e.command(Ce).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`stats`,describe:`Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance.`,builder:Be,handler:async r=>{if(r.dryRun){s({command:`cf images stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/stats`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.stats({account_id:l})),{successLabel:`Loaded`})}};function He(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ue={command:`cloudflareImagesListImages`,describe:`List up to 100 images with one request. Use the optional parameters below to get a specific range of images.`,builder:He,handler:async r=>{let i={page:r.page,per_page:r[`per-page`],creator:r.creator};if(r.dryRun){s({command:`cf images v1 cloudflareImagesListImages`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.v1.cloudflareImagesListImages({account_id:u,...i})),{successLabel:`Loaded`})}};function We(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const Ge={command:`upload <imageId>`,describe:`Upload an image to a specific image ID.`,builder:We,handler:async r=>{if(r.dryRun){s({command:`cf images v1 direct-uploads upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=f(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);r.url!==void 0&&e.append(`url`,String(d(r.url,`url`,`text`)??``)),o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/v1/images/${encodeURIComponent(String(r[`image-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(r.body){let e=d(r.body,`body`,`binary`);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/v1/images/${encodeURIComponent(String(r[`image-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>l.images.v1.directUploads.upload({accountId:u,imageId:r[`image-id`]})),{successLabel:`Updated`})}},Ke={command:`direct-uploads`,describe:`Operations for v1.direct-uploads`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`continuation-token`,{type:`string`,description:`Continuation token for a next page. List images V2 returns continuation_token`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string will return images where creator field is not set`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`getImageList`,describe:`List images for an account.`,builder:g(qe),handler:async r=>{let i={per_page:r[`per-page`],continuation_token:r[`continuation-token`],creator:r.creator,sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf images v1 getImageList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.v1.getImageList({accountId:u,...i})),{successLabel:`Loaded`})}};function $(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`get <variant-id>`,describe:`Fetch details for a single variant with properties at the top level of the result.`,builder:$,handler:async r=>{if(r.dryRun){s({command:`cf images v1 variants-flat get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}/flat`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.v1.variantsFlat.get({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Loaded`})}},Xe={command:`variants-flat`,describe:`Operations for v1.variants-flat`,builder:e=>e.command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ze={command:`v1`,describe:`Operations for v1`,builder:e=>e.command(Ue).command(Je).command(Ke).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(e){return e.option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`create`,describe:`Create a CF Images variant that allows you to resize images for different use cases.`,builder:Qe,handler:async r=>{if(r.dryRun){s({command:`cf images variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({id:d(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:d(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:d(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.variants.create({body:e,account_id:f})),{successLabel:`Created`});return}if(r.id===void 0&&(r.id=await p(`id`,`The id field`)),r[`options-fit`]===void 0&&(r[`options-fit`]=await m(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await m(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let h=u({id:d(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:d(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:d(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});o(await c(`Creating`,async()=>i.images.variants.create({body:h,account_id:f})),{successLabel:`Created`})}};function et(e){return e.positional(`variant-id`,{type:`string`,description:`Variant 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 tt={command:`delete <variant-id>`,describe:`Delete a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:et,handler:async r=>{if(r.dryRun){s({command:`cf images variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force,message:`This operation will delete this variant.`})){process.stderr.write(`Aborted.
8
- `);return}o(await c(`Deleting`,async()=>i.images.variants.delete({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Deleted`})}};function nt(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const rt={command:`edit <variant-id>`,describe:`Update a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:nt,handler:async r=>{if(r.dryRun){s({command:`cf images variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:d(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:d(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.variants.edit({...e,account_id:f,variant_id:r[`variant-id`]})),{successLabel:`Updated`});return}if(r[`options-fit`]===void 0&&(r[`options-fit`]=await m(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await m(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let p=u({neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:d(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:d(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});o(await c(`Updating`,async()=>i.images.variants.edit({...p,account_id:f,variant_id:r[`variant-id`]})),{successLabel:`Updated`})}};function it(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const at={command:`get <variant-id>`,describe:`Fetch details for a CF Images variant.`,builder:it,handler:async r=>{if(r.dryRun){s({command:`cf images variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.variants.get({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Loaded`})}};function ot(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const st={command:`list`,describe:`List existing CF Images variants.`,builder:ot,handler:async r=>{if(r.dryRun){s({command:`cf images variants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.variants.list({account_id:l})),{successLabel:`Loaded`})}},ct={command:`variants`,describe:`Manage named resize variants for transforming images on delivery`,builder:e=>e.command($e).command(tt).command(rt).command(at).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},lt={command:`images`,describe:`Store, resize, and deliver optimized images globally — variants, signing keys, and direct uploads`,builder:e=>e.command(te).command(b).command(S).command(w).command(E).command(O).command(A).command(M).command(z).command(V).command(U).command(Q).command(re).command(ae).command(Ve).command(L).command(X).command(ze).command(Ze).command(ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{lt as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./auth-MQEamPN9.mjs";import{t}from"./output-DrpYYfnB.mjs";import{n,t as r}from"./progress-CsHIt3Tp.mjs";function i(e){return e.option(`networks`,{type:`string`,description:"Specified as `jdcloud` to list IPs used by JD Cloud data centers."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.`,builder:i,handler:async i=>{let a={networks:i.networks};if(i.dryRun){n({command:`cf ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/ips`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.ips.list(a)),{successLabel:`Loaded`})}},o={command:`ips`,describe:`ips`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
@@ -1,2 +0,0 @@
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{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";function s(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:s,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/keys`,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.keys.list({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`keys`,describe:`keys`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{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}from"./input-validation-Bav2M9F-.mjs";import{a as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).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(`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 h={command:`create`,describe:`Create a new account or zone-scoped load balancer.`,builder:m,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 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:f.body===void 0?l({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:u(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:u(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},session_affinity:u(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:u(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:u(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(`Creating`,async()=>p.loadBalancers.account.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}if(f[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);f[`fallback-pool`]===void 0&&(f[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),f.name===void 0&&(f.name=await d(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let g=l({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:u(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:u(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},session_affinity:u(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:u(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:u(f[`steering-policy`],`steering-policy`,`text`),ttl:f.ttl});a(await s(`Creating`,async()=>p.loadBalancers.account.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function g(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:g,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 f({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(`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 _={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 d=>{if(d.dryRun){let e=d.zone===void 0?await n():void 0,t=d.zone===void 0?`accounts`:`zones`,r=d.zone??e??`<account-id>`;o({command:`cf load-balancers account edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/load_balancers/${d[`load-balancer-id`]==null?`<load-balancer-id>`:encodeURIComponent(String(d[`load-balancer-id`]))}`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r),"load-balancer-id":String(d[`load-balancer-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({adaptive_routing:{failover_across_pools:d[`adaptive-routing-failover-across-pools`]},default_pools:d[`default-pools`],description:u(d.description,`description`,`text`),enabled:d.enabled,fallback_pool:u(d[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(d[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(d[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(d.name,`name`,`text`),networks:d.networks,proxied:d.proxied,random_steering:{default_weight:d[`random-steering-default-weight`]},session_affinity:u(d[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:d[`session-affinity-attributes-drain-duration`],headers:d[`session-affinity-attributes-headers`],require_all_headers:d[`session-affinity-attributes-require-all-headers`],samesite:u(d[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(d[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(d[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:d[`session-affinity-ttl`],steering_policy:u(d[`steering-policy`],`steering-policy`,`text`),ttl:d.ttl}):c(d.body)});return}let f=await i(d),p=d.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:d.zone},f,{quiet:d.quiet}):d.local?e:await t();if(p===`zones`?d.zoneId=m:d.accountId=m,d.body){let e=c(d.body);a(await s(`Updating`,async()=>f.loadBalancers.account.edit({body:e,account_or_zone:p,account_or_zone_id:m,load_balancer_id:d[`load-balancer-id`]})),{successLabel:`Updated`});return}let h=l({adaptive_routing:{failover_across_pools:d[`adaptive-routing-failover-across-pools`]},default_pools:d[`default-pools`],description:u(d.description,`description`,`text`),enabled:d.enabled,fallback_pool:u(d[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(d[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(d[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(d.name,`name`,`text`),networks:d.networks,proxied:d.proxied,random_steering:{default_weight:d[`random-steering-default-weight`]},session_affinity:u(d[`session-affinity`],`session-affinity`,`text`),session_affinity_attributes:{drain_duration:d[`session-affinity-attributes-drain-duration`],headers:d[`session-affinity-attributes-headers`],require_all_headers:d[`session-affinity-attributes-require-all-headers`],samesite:u(d[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(d[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(d[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:d[`session-affinity-ttl`],steering_policy:u(d[`steering-policy`],`steering-policy`,`text`),ttl:d.ttl});a(await s(`Updating`,async()=>f.loadBalancers.account.edit({body:h,account_or_zone:p,account_or_zone_id:m,load_balancer_id:d[`load-balancer-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <load-balancer-id>`,describe:`Fetch a single configured account or zone-scoped load balancer.`,builder:v,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 b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List configured account or zone-scoped load balancers.`,builder:b,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 S(e){return e.positional(`load-balancer-id`,{type:`string`,description:`Load balancer ID`,demandOption:!0}).option(`adaptive-routing-failover-across-pools`,{type:`boolean`,description:"Extends zero-downtime failover of requests to healthy origins from alternate pools, when no healthy alternate exists in the same pool, according to the failover order defined by traffic and origin steering. When set false (the default) zero-downtime failover will only occur between origins within the same pool. See `session_affinity_attributes` for control over when sessions are broken or reassigned."}).option(`default-pools`,{type:`string`,array:!0,description:`A list of pool IDs ordered by their failover priority. Pools defined here are used by default, or when region_pools are not configured for a given region.`}).option(`description`,{type:`string`,description:`Object description.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) this load balancer.`}).option(`fallback-pool`,{type:`string`,description:`The pool ID to use when all other pools are detected as unhealthy.`}).option(`location-strategy-mode`,{type:`string`,description:'Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.\n- `"pop"`: Use the Cloudflare PoP location.\n- `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.',choices:[`pop`,`resolver_ip`]}).option(`location-strategy-prefer-ecs`,{type:`string`,description:'Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.\n- `"always"`: Always prefer ECS.\n- `"never"`: Never prefer ECS.\n- `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.\n- `"geo"`: Prefer ECS only when `steering_policy="geo"`.',choices:[`always`,`never`,`proximity`,`geo`]}).option(`name`,{type:`string`,description:`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`proxied`,{type:`boolean`,description:`Whether the hostname should be gray clouded (false) or orange clouded (true).`}).option(`random-steering-default-weight`,{type:`number`,description:`The default weight for pools in the load balancer that are not specified in the pool_weights map.`}).option(`session-affinity`,{type:`string`,description:'Specifies the type of session affinity the load balancer should use unless specified as `"none"`. The supported types are: - `"cookie"`: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client\'s ip address. - `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.',choices:[`none`,`cookie`,`ip_cookie`,`header`]}).option(`session-affinity-attributes-drain-duration`,{type:`number`,description:`Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.`}).option(`session-affinity-attributes-headers`,{type:`string`,array:!0,description:'Configures the names of HTTP headers to base session affinity on when header `session_affinity` is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything after the colon is a comma-separated list of cookie names. Providing only `"cookie"` will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.'}).option(`session-affinity-attributes-require-all-headers`,{type:`boolean`,description:'When header `session_affinity` is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - `"true"`: Load balancing requests must contain *all* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created. - `"false"`: Load balancing requests must contain *at least one* of the HTTP headers specified by the `headers` session affinity attribute, otherwise sessions aren\'t created.'}).option(`session-affinity-attributes-samesite`,{type:`string`,description:`Configures the SameSite attribute on session affinity cookie. Value "Auto" will be translated to "Lax" or "None" depending if Always Use HTTPS is enabled. Note: when using value "None", the secure attribute can not be set to "Never".`,choices:[`Auto`,`Lax`,`None`,`Strict`]}).option(`session-affinity-attributes-secure`,{type:`string`,description:`Configures the Secure attribute on session affinity cookie. Value "Always" indicates the Secure attribute will be set in the Set-Cookie header, "Never" indicates the Secure attribute will not be set, and "Auto" will set the Secure attribute depending if Always Use HTTPS is enabled.`,choices:[`Auto`,`Always`,`Never`]}).option(`session-affinity-attributes-zero-downtime-failover`,{type:`string`,description:'Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover takes place for sessions pinned to the origin (default). - `"temporary"`: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - `"sticky"`: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.',choices:[`none`,`temporary`,`sticky`]}).option(`session-affinity-ttl`,{type:`number`,description:'Time, in seconds, until a client\'s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per `session_affinity` policy are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - `"header"`: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven\'t been used for the number of seconds specified.'}).option(`steering-policy`,{type:`string`,description:'Steering Policy for this load balancer.\n- `"off"`: Use `default_pools`.\n- `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.\n- `"random"`: Select a pool randomly.\n- `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).\n- `"proximity"`: Use the pools\' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.\n- `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool\'s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.\n- `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.',choices:[`off`,`geo`,`random`,`dynamic_latency`,`proximity`,`least_outstanding_requests`,`least_connections`]}).option(`ttl`,{type:`number`,description:`Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This only applies to gray-clouded (unproxied) load balancers.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <load-balancer-id>`,describe:`Update a configured account or zone-scoped load balancer.`,builder:S,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 update`,method:`PUT`,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?l({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:u(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:u(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},session_affinity:u(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:u(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:u(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.update({...e,account_or_zone:m,account_or_zone_id:h,load_balancer_id:f[`load-balancer-id`]})),{successLabel:`Updated`});return}if(f[`default-pools`]===void 0)throw Error(`--default-pools is required (or pass --body with this field set).`);f[`fallback-pool`]===void 0&&(f[`fallback-pool`]=await d(`fallback-pool`,`The pool ID to use when all other pools are detected as unhealthy.`)),f.name===void 0&&(f.name=await d(`name`,`The DNS hostname to associate with your Load Balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the Load Balancer will take precedence and the DNS record will not be used.`));let g=l({adaptive_routing:{failover_across_pools:f[`adaptive-routing-failover-across-pools`]},default_pools:f[`default-pools`],description:u(f.description,`description`,`text`),enabled:f.enabled,fallback_pool:u(f[`fallback-pool`],`fallback-pool`,`text`),location_strategy:{mode:u(f[`location-strategy-mode`],`location-strategy-mode`,`text`),prefer_ecs:u(f[`location-strategy-prefer-ecs`],`location-strategy-prefer-ecs`,`text`)},name:u(f.name,`name`,`text`),networks:f.networks,proxied:f.proxied,random_steering:{default_weight:f[`random-steering-default-weight`]},session_affinity:u(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:u(f[`session-affinity-attributes-samesite`],`session-affinity-attributes-samesite`,`text`),secure:u(f[`session-affinity-attributes-secure`],`session-affinity-attributes-secure`,`text`),zero_downtime_failover:u(f[`session-affinity-attributes-zero-downtime-failover`],`session-affinity-attributes-zero-downtime-failover`,`text`)},session_affinity_ttl:f[`session-affinity-ttl`],steering_policy:u(f[`steering-policy`],`steering-policy`,`text`),ttl:f.ttl});a(await s(`Updating`,async()=>p.loadBalancers.account.update({...g,account_or_zone:m,account_or_zone_id:h,load_balancer_id:f[`load-balancer-id`]})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Get current load balancer resource usage counts for an account.`,builder:w,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`})}},E={command:`usage`,describe:`Operations for account.usage`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`account`,describe:`Operations for account`,builder:e=>e.command(h).command(ee).command(_).command(y).command(x).command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create`,describe:`Create a new monitor group.`,builder:O,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?l({description:u(r.description,`description`,`text`)}):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(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:e,account_id:p})),{successLabel:`Created`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Creating`,async()=>f.loadBalancers.monitorGroups.create({body:m,account_id:p})),{successLabel:`Created`})}};function A(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 j={command:`delete <monitor-group-id>`,describe:`Delete a configured monitor group.`,builder:A,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 f({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 M(e){return e.positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`edit <monitor-group-id>`,describe:`Apply changes to an existing monitor group, overwriting the supplied properties.`,builder:M,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?l({description:u(r.description,`description`,`text`)}):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.monitorGroups.edit({body:e,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.edit({body:m,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}};function P(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 F={command:`get <monitor-group-id>`,describe:`Fetch a single configured monitor group.`,builder:P,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 I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List configured monitor groups.`,builder:I,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 R(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 z={command:`list`,describe:`Get the list of resources that reference the provided monitor group.`,builder:R,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`})}},B={command:`references`,describe:`List references to monitor groups used by load balancer pools`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`monitor-group-id`,{type:`string`,description:`Monitor group ID`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the monitor group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`update <monitor-group-id>`,describe:`Modify a configured monitor group.`,builder:V,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?l({description:u(r.description,`description`,`text`)}):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.monitorGroups.update({body:e,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await d(`description`,`A short description of the monitor group`));let m=l({description:u(r.description,`description`,`text`)});a(await s(`Updating`,async()=>f.loadBalancers.monitorGroups.update({body:m,account_id:p,monitor_group_id:r[`monitor-group-id`]})),{successLabel:`Updated`})}},U={command:`monitor-groups`,describe:`Group monitors together for shared configuration and bulk management`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(H).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(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 G={command:`create`,describe:`Create a configured monitor.`,builder:W,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?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):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.loadBalancers.monitors.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>d.loadBalancers.monitors.create({body:p,account_id:f})),{successLabel:`Created`})}};function K(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 q={command:`delete <monitor-id>`,describe:`Delete a configured monitor.`,builder:K,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 f({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 J(e){return e.positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`}).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 Y={command:`edit <monitor-id>`,describe:`Apply changes to an existing monitor, overwriting the supplied properties.`,builder:J,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?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):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(`Updating`,async()=>d.loadBalancers.monitors.edit({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Updating`,async()=>d.loadBalancers.monitors.edit({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`})}};function X(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 Z={command:`get <monitor-id>`,describe:`List a single configured monitor for an account.`,builder:X,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 Q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`List configured monitors for an account.`,builder:Q,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 re(e){return e.positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when monitor use HTTPS. This parameter is currently only valid for HTTP and HTTPS monitors.`,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 ie={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:re,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?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):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.loadBalancers.monitors.previews.create({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Created`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>d.loadBalancers.monitors.previews.create({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Created`})}},ae={command:`previews`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(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 se={command:`get <monitor-id>`,describe:`Get the list of resources that reference the provided monitor.`,builder:oe,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`})}},ce={command:`references`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(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 ue={command:`update <monitor-id>`,describe:`Modify a configured monitor.`,builder:le,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?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):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(`Updating`,async()=>d.loadBalancers.monitors.update({body:e,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Updating`,async()=>d.loadBalancers.monitors.update({body:p,account_id:f,monitor_id:r[`monitor-id`]})),{successLabel:`Updated`})}},de={command:`monitors`,describe:`Health check configurations that probe origin servers and determine pool availability`,builder:e=>e.command(G).command(q).command(Y).command(Z).command(ne).command(ue).command(ae).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(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 pe={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:fe,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?l({notification_email:u(r[`notification-email`],`notification-email`,`text`)}):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(`Updating`,async()=>d.loadBalancers.pools.bulkEdit({body:e,account_id:f})),{successLabel:`Updated`});return}let p=l({notification_email:u(r[`notification-email`],`notification-email`,`text`)});a(await s(`Updating`,async()=>d.loadBalancers.pools.bulkEdit({body:p,account_id:f})),{successLabel:`Updated`})}};function me(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const he={command:`create`,describe:`Create a new pool.`,builder:me,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?l({description:u(r.description,`description`,`text`),enabled:r.enabled,latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):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(`Creating`,async()=>f.loadBalancers.pools.create({...e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await d(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let m=l({description:u(r.description,`description`,`text`),enabled:r.enabled,latitude:r.latitude,load_shedding:{default_percent:r[`load-shedding-default-percent`],default_policy:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Creating`,async()=>f.loadBalancers.pools.create({...m,account_id:p})),{successLabel:`Created`})}};function ge(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 _e={command:`delete <pool-id>`,describe:`Delete a configured pool.`,builder:ge,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 f({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 ve(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ye={command:`edit <pool-id>`,describe:`Apply changes to an existing pool, overwriting the supplied properties.`,builder:ve,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?l({check_regions:r[`check-regions`],description:u(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:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):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(`Updating`,async()=>d.loadBalancers.pools.edit({...e,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Updated`});return}let p=l({check_regions:r[`check-regions`],description:u(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:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Updating`,async()=>d.loadBalancers.pools.edit({...p,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Updated`})}};function be(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 xe={command:`get <pool-id>`,describe:`Fetch a single configured pool.`,builder:be,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 Se(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 Ce={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:Se,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?l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)}):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.loadBalancers.pools.health.create({body:e,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Created`});return}let p=l({allow_insecure:r[`allow-insecure`],consecutive_down:r[`consecutive-down`],consecutive_up:r[`consecutive-up`],description:u(r.description,`description`,`text`),expected_body:u(r[`expected-body`],`expected-body`,`text`),expected_codes:u(r[`expected-codes`],`expected-codes`,`text`),follow_redirects:r[`follow-redirects`],interval:r.interval,method:u(r.method,`method`,`text`),path:u(r.path,`path`,`text`),port:r.port,probe_zone:u(r[`probe-zone`],`probe-zone`,`text`),retries:r.retries,timeout:r.timeout,type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>d.loadBalancers.pools.health.create({body:p,account_id:f,pool_id:r[`pool-id`]})),{successLabel:`Created`})}};function we(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 Te={command:`get <pool-id>`,describe:`Fetch the latest pool health status for a single pool.`,builder:we,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`})}},Ee={command:`health`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(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 Oe={command:`list`,describe:`List configured pools.`,builder:De,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 ke(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 Ae={command:`get <pool-id>`,describe:`Get the list of resources that reference the provided pool.`,builder:ke,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`})}},je={command:`references`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Me(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ne={command:`update <pool-id>`,describe:`Modify a configured pool.`,builder:Me,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?l({check_regions:r[`check-regions`],description:u(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:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):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.update({...e,account_id:p,pool_id:r[`pool-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await d(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let m=l({check_regions:r[`check-regions`],description:u(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:u(r[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:r[`load-shedding-session-percent`],session_policy:u(r[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:r.longitude,minimum_origins:r[`minimum-origins`],monitor:u(r.monitor,`monitor`,`text`),monitor_group:u(r[`monitor-group`],`monitor-group`,`text`),name:u(r.name,`name`,`text`),notification_email:u(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:u(r[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Updating`,async()=>f.loadBalancers.pools.update({...m,account_id:p,pool_id:r[`pool-id`]})),{successLabel:`Updated`})}},Pe={command:`pools`,describe:`Origin server pools with weighted traffic distribution, health thresholds, and geographic preferences`,builder:e=>e.command(pe).command(he).command(_e).command(ye).command(xe).command(Oe).command(Ne).command(Ee).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(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 Fe={command:`get <preview-id>`,describe:`Get the result of a previous preview operation using the provided preview_id.`,builder:$,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`})}},Ie={command:`previews`,describe:`Preview the result of a health check monitor configuration before applying it`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(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 Re={command:`get <region-id>`,describe:`Get a single region mapping.`,builder:Le,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 ze(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 Be={command:`list`,describe:`List all region mappings.`,builder:ze,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`})}},Ve={command:`regions`,describe:`Geographic regions used for regional pool steering and traffic policies`,builder:e=>e.command(Re).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function He(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 Ue={command:`list`,describe:`Search for Load Balancing resources.`,builder:p(He),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`})}},We={command:`searches`,describe:`Search across all load balancer resources (pools, monitors, load balancers) by name or reference`,builder:e=>e.command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ge={command:`load-balancers`,describe:`Distribute traffic across origin pools with health monitoring, geo-steering, and failover`,builder:e=>e.command(D).command(U).command(de).command(Pe).command(Ie).command(Ve).command(We).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ge as default};
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d,t as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,n as m}from"./prompt-DdegNPpg.mjs";function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={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:h,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 _(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are ingested.
3
- If provided, replaces the dataset's default filter entirely.
4
- See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
5
- for syntax and examples.
6
- `}).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 v={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:_,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?u({dataset:d(i.dataset,`dataset`,`text`),filter:d(i.filter,`filter`,`text`)}):l(i.body)});return}let f=await a(i),m=i.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:i.zone},f,{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(`Creating`,async()=>f.logexplorer.account.datasets.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}i.dataset===void 0&&(i.dataset=await p(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let g=u({dataset:d(i.dataset,`dataset`,`text`),filter:d(i.filter,`filter`,`text`)});o(await c(`Creating`,async()=>f.logexplorer.account.datasets.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function y(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 b={command:`delete <dataset-id>`,describe:`Deletes a Log Explorer dataset for the account or zone. Dataset deletion must not be protected.`,builder:y,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 m({force:!!i.force,message:`This operation deletes a Log Explorer dataset for the account.`})){process.stderr.write(`Aborted.
7
- `);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 x(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 S={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the account or zone.`,builder:x,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 C(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 w={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:C,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 T(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(`filter`,{type:`string`,description:`Optional Logpush filter predicate to restrict which events are
8
- ingested. If omitted, the existing filter is left unchanged. Set
9
- to an empty string (\`""\`) to clear the filter. Otherwise,
10
- replaces the dataset's filter entirely.
11
- See [Logpush filters](https://developers.cloudflare.com/logs/reference/filters/)
12
- for syntax and examples.
13
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account or zone dataset.`,builder:T,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?u({deletion_protection:i[`deletion-protection`],enabled:i.enabled,filter:d(i.filter,`filter`,`text`)}):l(i.body)});return}let f=await a(i),p=i.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:i.zone},f,{quiet:i.quiet}):i.local?e:await t();if(p===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=l(i.body);o(await c(`Updating`,async()=>f.logexplorer.account.datasets.update({...e,account_or_zone:p,account_or_zone_id:m,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 h=u({deletion_protection:i[`deletion-protection`],enabled:i.enabled,filter:d(i.filter,`filter`,`text`)});o(await c(`Updating`,async()=>f.logexplorer.account.datasets.update({...h,account_or_zone:p,account_or_zone_id:m,dataset_id:i[`dataset-id`]})),{successLabel:`Updated`})}},D={command:`datasets`,describe:`Operations for account.datasets`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(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 k={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:O,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),p=l.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();if(p===`zones`?l.zoneId=m:l.accountId=m,l.file){let e=f(l.file);o(await c(`Loading`,async()=>i(u,`POST`,`/${p}/${m}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(l.body){let e=d(l.body,`body`,`binary`);o(await c(`Loading`,async()=>i(u,`POST`,`/${p}/${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:p,account_or_zone_id:m})),{successLabel:`Loaded`})}},A={command:`account`,describe:`Operations for account`,builder:e=>e.command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`logexplorer`,describe:`logexplorer`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};