cf 0.5.0 → 0.6.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 (247) hide show
  1. package/dist/{abuse-reports-Ina5TlsU.mjs → abuse-reports-DUs4SKVx.mjs} +2 -2
  2. package/dist/accounts-BIY8wNGA.mjs +22 -0
  3. package/dist/acm-SqcV8o5o.mjs +3 -0
  4. package/dist/addressing-CygRm0pN.mjs +12 -0
  5. package/dist/{agent-context-DMPfi54f.mjs → agent-context-CKb6w43K.mjs} +1 -1
  6. package/dist/ai-BAmEAjN3.mjs +2 -0
  7. package/dist/ai-gateway-BENwPvvB.mjs +8 -0
  8. package/dist/ai-search-Bv_Whw3E.mjs +7 -0
  9. package/dist/ai_gateway-C6WP9oBH.mjs +4 -0
  10. package/dist/alerting-D_qWrsoY.mjs +6 -0
  11. package/dist/{analytics-DSSRDZz8.mjs → analytics-CwFrx-Dr.mjs} +1 -1
  12. package/dist/analytics_engine-BjV6XLyG.mjs +2 -0
  13. package/dist/api-gateway-D9PMVVqL.mjs +33 -0
  14. package/dist/argo-DwYGbyld.mjs +2 -0
  15. package/dist/artifacts-DKAjY_n4.mjs +4 -0
  16. package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BvQ9uwuy.mjs} +1 -1
  17. package/dist/{auth-CSC4yhEJ.mjs → auth-DX9KnJ0P.mjs} +3 -3
  18. package/dist/{auth-D5hNsOFq.mjs → auth-TYwGydWg.mjs} +1 -1
  19. package/dist/billing-CRTlRU88.mjs +2 -0
  20. package/dist/bot-management-DgW--8wM.mjs +5 -0
  21. package/dist/botnet-feed-CIX6ZORT.mjs +3 -0
  22. package/dist/brand-protection-ZikBtl0y.mjs +3 -0
  23. package/dist/browser-rendering-D_ZQVWn8.mjs +4 -0
  24. package/dist/build-Bgw8TV1p.mjs +134 -0
  25. package/dist/cache-CeN5t6_W.mjs +5 -0
  26. package/dist/calls-Cv0ieVg4.mjs +4 -0
  27. package/dist/{certificate-authorities-CtqzAtxQ.mjs → certificate-authorities-BzZnWCac.mjs} +1 -1
  28. package/dist/client-certificates-BFuzeBrj.mjs +3 -0
  29. package/dist/{cloud-connector-BA5IRZUP.mjs → cloud-connector-D5h8Dzzg.mjs} +1 -1
  30. package/dist/cloudforce-one-aqDCIBMp.mjs +21 -0
  31. package/dist/{completions-DOeHPdCG.mjs → completions-Bvzav4Mj.mjs} +1 -1
  32. package/dist/connectivity-CjkXmEhO.mjs +3 -0
  33. package/dist/connector-interrupts-B7eSface.mjs +2 -0
  34. package/dist/connector-telemetry-events-F3Co8HUf.mjs +2 -0
  35. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +2 -0
  36. package/dist/connectors-YYu_Vx3H.mjs +3 -0
  37. package/dist/content-scanning-BorfRGKT.mjs +4 -0
  38. package/dist/{context-jpewmual.mjs → context-C-WbewL6.mjs} +1 -1
  39. package/dist/custom-certificates-CfRj7QZb.mjs +5 -0
  40. package/dist/{custom-hostnames-CtuTdFcX.mjs → custom-hostnames-CcK7_17e.mjs} +4 -4
  41. package/dist/custom-nameservers-BkKx0THn.mjs +3 -0
  42. package/dist/custom-pages-DamGVA75.mjs +4 -0
  43. package/dist/d1-sK0O5THv.mjs +4 -0
  44. package/dist/data-security-DsWpoWiS.mjs +6 -0
  45. package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-BYsNl3qc.mjs} +1 -1
  46. package/dist/{deploy-dVrgDUOp.mjs → deploy-BzlPv3ro.mjs} +1 -1
  47. package/dist/{dev-C01_Lby6.mjs → dev-IOg-_s5_.mjs} +1 -1
  48. package/dist/diagnostics-CH7T2WR3.mjs +3 -0
  49. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +7 -0
  50. package/dist/dist-B7hsuvbF.mjs +57 -0
  51. package/dist/dns-firewall-VmQf3UVP.mjs +57 -0
  52. package/dist/dns-o7hUPMCG.mjs +29 -0
  53. package/dist/durable-objects-DgrTbvoF.mjs +2 -0
  54. package/dist/email-routing-owCvAEpf.mjs +10 -0
  55. package/dist/email-security-Dng3DVuf.mjs +8 -0
  56. package/dist/email-sending-bExMH4lu.mjs +3 -0
  57. package/dist/filters-DKs-wEzt.mjs +4 -0
  58. package/dist/{firewall-DYZcTtIC.mjs → firewall-BLaTtX3r.mjs} +10 -10
  59. package/dist/{fraud-C03MtdZb.mjs → fraud-D8WmLKyH.mjs} +1 -1
  60. package/dist/google-tag-gateway-DyCY43k0.mjs +2 -0
  61. package/dist/healthchecks-BBtW8vRh.mjs +4 -0
  62. package/dist/hostnames-Bh2IFxIw.mjs +3 -0
  63. package/dist/hyperdrive-DJm1eD-M.mjs +18 -0
  64. package/dist/iam-apCCcy7R.mjs +6 -0
  65. package/dist/images-Cxe45OHm.mjs +7 -0
  66. package/dist/index.mjs +1 -1
  67. package/dist/intel-8V4h6H46.mjs +3 -0
  68. package/dist/{ips-nv9INuWZ.mjs → ips-BE7JbAnc.mjs} +1 -1
  69. package/dist/keyless-certificates-CfJmXccT.mjs +3 -0
  70. package/dist/kv-Dz6then8.mjs +5 -0
  71. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +3 -0
  72. package/dist/load-balancers-ilsGgudX.mjs +6 -0
  73. package/dist/logpush-BH14TtuA.mjs +4 -0
  74. package/dist/logs-B8-mkf_I.mjs +3 -0
  75. package/dist/magic-cloud-networking-DylCXoG4.mjs +5 -0
  76. package/dist/magic-network-monitoring-DnyrZy77.mjs +4 -0
  77. package/dist/magic-transit-B-kU5e3s.mjs +89 -0
  78. package/dist/managed-transforms-GC9Pq5dg.mjs +3 -0
  79. package/dist/mtls-certificates-BRlhWw_G.mjs +3 -0
  80. package/dist/network-interconnects-DuyoFD9_.mjs +36 -0
  81. package/dist/oauth-B5k80sip.mjs +61 -0
  82. package/dist/observability-9APhqFHo.mjs +4 -0
  83. package/dist/{organizations-BqJHyvMK.mjs → organizations-Dy3kiV_z.mjs} +6 -6
  84. package/dist/origin-ca-certificates-2rwPoQdG.mjs +3 -0
  85. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +2 -0
  86. package/dist/origin-tls-client-auth-B30_2_dO.mjs +4 -0
  87. package/dist/{page-rules-EZHJePmn.mjs → page-rules-zQJGmTCd.mjs} +5 -5
  88. package/dist/{page-shield-CXJioWPs.mjs → page-shield-CxQk5k9X.mjs} +5 -5
  89. package/dist/pages-5DKLs7CQ.mjs +11 -0
  90. package/dist/pipelines-DfGE44xo.mjs +6 -0
  91. package/dist/{progress-DrDErV9w.mjs → progress-CL8I-7YK.mjs} +1 -1
  92. package/dist/prompt-q3B7sM2A.mjs +3 -0
  93. package/dist/queues-BoenUGIw.mjs +6 -0
  94. package/dist/r2-Cq_JCjK0.mjs +21 -0
  95. package/dist/r2-data-catalog-eLxltWdO.mjs +14 -0
  96. package/dist/{radar-D986zPJr.mjs → radar-YNOCio6T.mjs} +1 -1
  97. package/dist/rate-limits-CcAF3tMl.mjs +5 -0
  98. package/dist/{raw-fetch-_n0lMAnD.mjs → raw-fetch-bIXC9D1m.mjs} +1 -1
  99. package/dist/realtime-kit-4bCGviO5.mjs +18 -0
  100. package/dist/{registrar-CDIwTz3G.mjs → registrar-CfHlaOOf.mjs} +6 -6
  101. package/dist/request-tracers-DlHawg5l.mjs +2 -0
  102. package/dist/resource-sharing-7FhuboJE.mjs +5 -0
  103. package/dist/resource-tagging-divcugVb.mjs +16 -0
  104. package/dist/rules-CAXkege8.mjs +4 -0
  105. package/dist/rulesets-CBsdc8IV.mjs +8 -0
  106. package/dist/rum-D0hHPNl9.mjs +4 -0
  107. package/dist/{schema-BR31o4P6.mjs → schema-D8o6HcCr.mjs} +1 -1
  108. package/dist/schema-validation-BWNDnnIT.mjs +24 -0
  109. package/dist/scim-CWLli4fi.mjs +3 -0
  110. package/dist/{secrets-store-BAK9G12O.mjs → secrets-store-B7_HkE8I.mjs} +19 -19
  111. package/dist/security-center-BQT21oiM.mjs +2 -0
  112. package/dist/security-txt-CVpmJo29.mjs +3 -0
  113. package/dist/{session-DHYCE-PM.mjs → session-B8r8LNQN.mjs} +1 -1
  114. package/dist/{build-HuS9-R0V.mjs → shared-DQI8NGja.mjs} +324 -388
  115. package/dist/smart-shield-BreBC1Ap.mjs +3 -0
  116. package/dist/snippets-BAJoWMSJ.mjs +4 -0
  117. package/dist/{spawn-CCGzKlC4.mjs → spawn-pmGERpdB.mjs} +1 -1
  118. package/dist/{spectrum-pVGxb7u5.mjs → spectrum-DnIRLY95.mjs} +6 -6
  119. package/dist/speed-UYEVue28.mjs +4 -0
  120. package/dist/{src-DU7FBCOX.mjs → src-BQ1dr9xR.mjs} +4 -4
  121. package/dist/ssl-D3Pixs8M.mjs +15 -0
  122. package/dist/stream-BUsuOfQh.mjs +14 -0
  123. package/dist/{tenants-HLGUazms.mjs → tenants-BdWJTtcg.mjs} +1 -1
  124. package/dist/token-validation-DUvtXWur.mjs +10 -0
  125. package/dist/{tools-D_hfUU_Z.mjs → tools-CQtA5-cr.mjs} +1 -1
  126. package/dist/turnstile-CAKVnS1L.mjs +23 -0
  127. package/dist/{ui-erjBdVKL.mjs → ui-BrNwNHX9.mjs} +1 -1
  128. package/dist/url-normalization-DA-RAxs4.mjs +3 -0
  129. package/dist/url-scanner-DmYu43f7.mjs +2 -0
  130. package/dist/user-Bah4wGGN.mjs +10 -0
  131. package/dist/vectorize-DhvVG2By.mjs +4 -0
  132. package/dist/{versions-CBHwWPAM.mjs → versions-NUXxCr0s.mjs} +1 -1
  133. package/dist/{waiting-rooms-u6KwrzWd.mjs → waiting-rooms-DoOkT4Mu.mjs} +6 -6
  134. package/dist/web3-n3GW50u-.mjs +4 -0
  135. package/dist/workers-D6IaQ_F0.mjs +18 -0
  136. package/dist/workers-builds-DYi0OMMU.mjs +7 -0
  137. package/dist/workflows-DrdXUQ2g.mjs +4 -0
  138. package/dist/zaraz-9l7KuLqh.mjs +2 -0
  139. package/dist/zero-trust-D6V9GH2W.mjs +118 -0
  140. package/dist/zero_trust-BzXKAX_x.mjs +3 -0
  141. package/dist/{zones-BXtdwt6E.mjs → zones-0MTkuaFk.mjs} +8 -8
  142. package/package.json +3 -1
  143. package/dist/accounts-B_joQcMi.mjs +0 -22
  144. package/dist/acm-_kIHqYME.mjs +0 -3
  145. package/dist/addressing-CaFlw8y1.mjs +0 -12
  146. package/dist/ai-CqnhNb_c.mjs +0 -2
  147. package/dist/ai-gateway-pgYGI519.mjs +0 -8
  148. package/dist/ai-search-eqQMPQol.mjs +0 -7
  149. package/dist/ai_gateway--vuVLnOm.mjs +0 -4
  150. package/dist/alerting-CPxHiYHb.mjs +0 -6
  151. package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
  152. package/dist/api-gateway-BXXGFCVR.mjs +0 -33
  153. package/dist/argo-aC6A3JyX.mjs +0 -2
  154. package/dist/artifacts-HD4V2xpK.mjs +0 -4
  155. package/dist/billing-COaghyxl.mjs +0 -2
  156. package/dist/bot-management-DmEzeV1Y.mjs +0 -5
  157. package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
  158. package/dist/brand-protection-dPrGe8sL.mjs +0 -3
  159. package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
  160. package/dist/cache-CY-7Lt71.mjs +0 -5
  161. package/dist/calls-wOQGDWPl.mjs +0 -4
  162. package/dist/client-certificates-CRf41xLe.mjs +0 -3
  163. package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
  164. package/dist/connectivity-Bx3MgTHX.mjs +0 -3
  165. package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
  166. package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
  167. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
  168. package/dist/connectors-DRt4e6d_.mjs +0 -3
  169. package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
  170. package/dist/custom-certificates-DYE-9epx.mjs +0 -5
  171. package/dist/custom-nameservers-CWqA51in.mjs +0 -3
  172. package/dist/custom-pages-DeUKEFGe.mjs +0 -4
  173. package/dist/d1-DvWY9Gp4.mjs +0 -4
  174. package/dist/data-security-BPo6dIWu.mjs +0 -6
  175. package/dist/diagnostics-6nKPmVgz.mjs +0 -3
  176. package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
  177. package/dist/dist-t_YrL25p.mjs +0 -82
  178. package/dist/dns-ClciFGxx.mjs +0 -29
  179. package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
  180. package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
  181. package/dist/email-routing-CGXhFqF5.mjs +0 -10
  182. package/dist/email-security-D5viPq8S.mjs +0 -8
  183. package/dist/email-sending-C2jpc3gh.mjs +0 -3
  184. package/dist/filters-bzsFcWt0.mjs +0 -4
  185. package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
  186. package/dist/healthchecks-DRoAlWgr.mjs +0 -4
  187. package/dist/hostnames-CFgIVI3s.mjs +0 -3
  188. package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
  189. package/dist/iam-DqVPzGrb.mjs +0 -6
  190. package/dist/images-BYfl4YgR.mjs +0 -7
  191. package/dist/intel-duTEPIHc.mjs +0 -3
  192. package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
  193. package/dist/kv-CZoV4tiv.mjs +0 -5
  194. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
  195. package/dist/load-balancers--OMg0HNt.mjs +0 -6
  196. package/dist/logpush-C0_lZTyY.mjs +0 -4
  197. package/dist/logs-BtpWZQfV.mjs +0 -3
  198. package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
  199. package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
  200. package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
  201. package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
  202. package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
  203. package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
  204. package/dist/oauth-Bk-F-tIO.mjs +0 -52
  205. package/dist/observability-BynRbTF4.mjs +0 -4
  206. package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
  207. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
  208. package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
  209. package/dist/pages-D4aYteKk.mjs +0 -11
  210. package/dist/pipelines-G8Iusxq-.mjs +0 -6
  211. package/dist/queues-DEkbKqZX.mjs +0 -6
  212. package/dist/r2-CV0IkCAW.mjs +0 -21
  213. package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
  214. package/dist/rate-limits-B2wRsUX1.mjs +0 -5
  215. package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
  216. package/dist/request-tracers-D7SFMDik.mjs +0 -2
  217. package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
  218. package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
  219. package/dist/rules-DHjLP5Kx.mjs +0 -4
  220. package/dist/rulesets-q4QABpKs.mjs +0 -8
  221. package/dist/rum-SmT4HZmM.mjs +0 -4
  222. package/dist/schema-validation-vVetgC_P.mjs +0 -24
  223. package/dist/scim-ChOkZpNx.mjs +0 -3
  224. package/dist/security-center-eScuYDKP.mjs +0 -2
  225. package/dist/security-txt-x7R4gmQu.mjs +0 -3
  226. package/dist/shared-BAjo72Lz.mjs +0 -2
  227. package/dist/smart-shield-CWlSsNi8.mjs +0 -3
  228. package/dist/snippets-DrlgYJYp.mjs +0 -4
  229. package/dist/speed-ZFrMWDgd.mjs +0 -4
  230. package/dist/ssl-9JY05sYt.mjs +0 -15
  231. package/dist/stream-tRU39b8K.mjs +0 -14
  232. package/dist/token-validation-_VdamKpz.mjs +0 -10
  233. package/dist/turnstile-BRzXd28B.mjs +0 -23
  234. package/dist/url-normalization-D-NxuLtN.mjs +0 -3
  235. package/dist/url-scanner-BzzR6iDx.mjs +0 -2
  236. package/dist/user-C4omq__w.mjs +0 -10
  237. package/dist/vectorize-By6EqcNR.mjs +0 -4
  238. package/dist/web3-DQ5dmE9W.mjs +0 -4
  239. package/dist/workers-D8Be7_as.mjs +0 -18
  240. package/dist/workers-builds-BE3W3qNk.mjs +0 -7
  241. package/dist/workflows-BWWufqFA.mjs +0 -4
  242. package/dist/zaraz-Bsa9AvVL.mjs +0 -2
  243. package/dist/zero-trust-UNVZFnKu.mjs +0 -118
  244. package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
  245. /package/dist/{cli-types-BeyOc81z.mjs → cli-types-DGgEbf8K.mjs} +0 -0
  246. /package/dist/{metadata-OOwvpR8m.mjs → metadata-MPDDi08e.mjs} +0 -0
  247. /package/dist/{resolve-C3h-mwp7.mjs → resolve-DGD57PFH.mjs} +0 -0
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import{i as e,n as t}from"./auth-DX9KnJ0P.mjs";import{n,r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{n as l,r as u,t as d}from"./prompt-q3B7sM2A.mjs";import{t as f}from"./cli-types-DGgEbf8K.mjs";function ee(e){return e.option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`export`,{type:`boolean`,description:`Indicates that this request is an export of logs in CSV format.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-ip`,{type:`string`,description:`Filters by the IP address of the request that made the change by specific IP address or valid CIDR Range.`}).option(`actor-email`,{type:`string`,description:`Filters by the email address of the actor that made the change.`}).option(`since`,{type:`string`,description:"Limits the returned results to logs newer than the specified date. A `full-date` that conforms to RFC3339."}).option(`before`,{type:`string`,description:"Limits the returned results to logs older than the specified date. A `full-date` that conforms to RFC3339."}).option(`zone-name`,{type:`string`,description:`Filters by the name of the zone associated to the change.`}).option(`direction`,{type:`string`,description:`Changes the direction of the chronological sorting.`,choices:[`desc`,`asc`]}).option(`per-page`,{type:`number`,description:`Sets the number of results to return per page.`}).option(`page`,{type:`number`,description:`Defines which page of results to return.`}).option(`hide-user-logs`,{type:`boolean`,description:`Indicates whether or not to hide user level audit logs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`list`,describe:`Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.`,builder:f(ee),handler:async e=>{let n={id:e.id,export:e.export,"action.type":e[`action-type`],"actor.ip":e[`actor-ip`],"actor.email":e[`actor-email`],since:e.since,before:e.before,"zone.name":e[`zone-name`],direction:e.direction,per_page:e[`per-page`],page:e.page,hide_user_logs:e[`hide-user-logs`]};if(e.dryRun){o({command:`cf user audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/audit_logs`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.auditLogs.list(n)),{successLabel:`Loaded`})}},p={command:`audit-logs`,describe:`Review a chronological record of actions performed by or on behalf of your user`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(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(`order`,{type:`string`,description:`Field to order billing history by.`,choices:[`type`,`occurred_at`,`action`]}).option(`occurred-at`,{type:`string`,description:`When the billing item was created.`}).option(`type`,{type:`string`,description:`The billing item type.`}).option(`action`,{type:`string`,description:`The billing item action.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`Accesses your billing history object.`,builder:f(m),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,occurred_at:e[`occurred-at`],type:e.type,action:e.action};if(e.dryRun){o({command:`cf user billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/billing/history`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.billing.history.list(n)),{successLabel:`Loaded`})}},g={command:`history`,describe:`View billing history and payment profile for your user (deprecated — prefer account-level billing)`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Accesses your billing profile object.`,builder:_,handler:async e=>{if(e.dryRun){o({command:`cf user billing profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/billing/profile`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.billing.profile.get()),{successLabel:`Loaded`})}},y={command:`profile`,describe:`View billing history and payment profile for your user (deprecated — prefer account-level billing)`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(g).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`country`,{type:`string`,description:`The country in which the user lives.`}).option(`first-name`,{type:`string`,description:`User's first name`}).option(`last-name`,{type:`string`,description:`User's last name`}).option(`telephone`,{type:`string`,description:`User's telephone number`}).option(`zipcode`,{type:`string`,description:`The zipcode or postal code where the user lives.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit`,describe:`Edit part of your user details.`,builder:x,handler:async e=>{if(e.dryRun){o({command:`cf user edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/user`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({country:c(e.country,`country`,`text`),first_name:c(e[`first-name`],`first-name`,`text`),last_name:c(e[`last-name`],`last-name`,`text`),telephone:c(e.telephone,`telephone`,`text`),zipcode:c(e.zipcode,`zipcode`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.edit({...t})),{successLabel:`Updated`});return}let l=i({country:c(e.country,`country`,`text`),first_name:c(e[`first-name`],`first-name`,`text`),last_name:c(e[`last-name`],`last-name`,`text`),telephone:c(e.telephone,`telephone`,`text`),zipcode:c(e.zipcode,`zipcode`,`text`)});a(await s(`Updating`,async()=>r.user.edit({...l})),{successLabel:`Updated`})}};function C(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Creates a new IP Access rule for all zones owned by the current user. Note: To create an IP Access rule that applies to a specific zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.`,builder:C,handler:async e=>{if(e.dryRun){o({command:`cf user firewall access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({configuration:{target:c(e[`configuration-target`],`configuration-target`,`text`),value:c(e[`configuration-value`],`configuration-value`,`text`)},mode:c(e.mode,`mode`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.firewall.accessRules.create({...t})),{successLabel:`Created`});return}e.mode===void 0&&(e.mode=await l(`mode`,`The action to apply to a matched request.`,[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]));let u=i({configuration:{target:c(e[`configuration-target`],`configuration-target`,`text`),value:c(e[`configuration-value`],`configuration-value`,`text`)},mode:c(e.mode,`mode`,`text`)});a(await s(`Creating`,async()=>r.user.firewall.accessRules.create({...u})),{successLabel:`Created`})}};function T(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <rule-id>`,describe:`Deletes an IP Access rule at the user level. Note: Deleting a user-level rule will affect all zones owned by the user.`,builder:T,handler:async e=>{if(e.dryRun){o({command:`cf user firewall access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>n.user.firewall.accessRules.delete({rule_id:e[`rule-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`notes`,{type:`string`,description:`An informative summary of the rule, typically used as a reminder or explanation.`}).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:`edit <rule-id>`,describe:"Updates an IP Access rule defined at the user level. You can only update the rule action (`mode` parameter) and notes.",builder:D,handler:async e=>{if(e.dryRun){o({command:`cf user firewall access-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({mode:c(e.mode,`mode`,`text`),notes:c(e.notes,`notes`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.firewall.accessRules.edit({...t,rule_id:e[`rule-id`]})),{successLabel:`Updated`});return}let l=i({mode:c(e.mode,`mode`,`text`),notes:c(e.notes,`notes`,`text`)});a(await s(`Updating`,async()=>r.user.firewall.accessRules.edit({...l,rule_id:e[`rule-id`]})),{successLabel:`Updated`})}};function k(e){return e.option(`mode`,{type:`string`,description:`The action to apply to a matched request.`,choices:[`block`,`challenge`,`whitelist`,`js_challenge`,`managed_challenge`]}).option(`configuration-target`,{type:`string`,description:`Defines the target to search in existing rules.`,choices:[`ip`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:"Defines the target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code."}).option(`notes`,{type:`string`,description:`Defines the string to search for in the notes of existing IP Access rules.
4
+ Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.`}).option(`match`,{type:`string`,description:"Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Defines the requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Defines the maximum number of results requested.`}).option(`order`,{type:`string`,description:`Defines the field used to sort returned rules.`,choices:[`configuration.target`,`configuration.value`,`mode`]}).option(`direction`,{type:`string`,description:`Defines the direction used to sort returned rules.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Fetches IP Access rules of the user. You can filter the results using several optional parameters.`,builder:f(k),handler:async e=>{let n={mode:e.mode,"configuration.target":e[`configuration-target`],"configuration.value":e[`configuration-value`],notes:e.notes,match:e.match,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){o({command:`cf user firewall access-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.firewall.accessRules.list(n)),{successLabel:`Loaded`})}},j={command:`access-rules`,describe:`Firewall operations`,builder:e=>e.command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`firewall`,describe:`Operations for firewall`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};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:`Retrieves detailed information about the currently authenticated user, including email, name, and account memberships.`,builder:N,handler:async e=>{if(e.dryRun){o({command:`cf user get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.get()),{successLabel:`Loaded`})}};function F(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 I={command:`create`,describe:`Create a configured monitor.`,builder:F,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.loadBalancers.monitors.create({...t})),{successLabel:`Created`});return}let l=i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)});a(await s(`Creating`,async()=>r.user.loadBalancers.monitors.create({...l})),{successLabel:`Created`})}};function L(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 R={command:`delete <monitor-id>`,describe:`Delete a configured monitor.`,builder:L,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
5
+ `);return}a(await s(`Deleting`,async()=>n.user.loadBalancers.monitors.delete({monitor_id:e[`monitor-id`]})),{successLabel:`Deleted`})}};function z(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 B={command:`edit <monitor-id>`,describe:`Apply changes to an existing monitor, overwriting the supplied properties.`,builder:z,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.loadBalancers.monitors.edit({body:t,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`});return}let l=i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)});a(await s(`Updating`,async()=>r.user.loadBalancers.monitors.edit({body:l,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`})}};function V(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 H={command:`get <monitor-id>`,describe:`List a single configured monitor for a user.`,builder:V,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.monitors.get({monitor_id:e[`monitor-id`]})),{successLabel:`Loaded`})}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`List configured monitors for a user.`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.monitors.list()),{successLabel:`Loaded`})}};function G(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 K={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:G,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors preview create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/preview`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.loadBalancers.monitors.preview.create({body:t,monitor_id:e[`monitor-id`]})),{successLabel:`Created`});return}let l=i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)});a(await s(`Creating`,async()=>r.user.loadBalancers.monitors.preview.create({body:l,monitor_id:e[`monitor-id`]})),{successLabel:`Created`})}},q={command:`preview`,describe:`Load Balancers operations`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`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 Y={command:`list`,describe:`Get the list of resources that reference the provided monitor.`,builder:J,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}/references`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.monitors.references.list({monitor_id:e[`monitor-id`]})),{successLabel:`Loaded`})}},X={command:`references`,describe:`Load Balancers operations`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`monitor-id`,{type:`string`,description:`Monitor ID`,demandOption:!0}).option(`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 Q={command:`update <monitor-id>`,describe:`Modify a configured monitor.`,builder:Z,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers monitors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/monitors/${e[`monitor-id`]==null?`<monitor-id>`:encodeURIComponent(String(e[`monitor-id`]))}`,pathParams:{"monitor-id":String(e[`monitor-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.loadBalancers.monitors.update({body:t,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`});return}let l=i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)});a(await s(`Updating`,async()=>r.user.loadBalancers.monitors.update({body:l,monitor_id:e[`monitor-id`]})),{successLabel:`Updated`})}},ne={command:`monitors`,describe:`Load Balancers operations`,builder:e=>e.command(I).command(R).command(B).command(H).command(W).command(Q).command(q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`,default:``}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`,default:!0}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`,default:0}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`],default:`random`}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`,default:0}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`],default:`hash`}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`,default:1}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`,default:``}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`,default:!1}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`],default:`random`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`create`,describe:`Create a new pool.`,builder:re,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),networks:e.networks,notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.loadBalancers.pools.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await u(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let l=i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),networks:e.networks,notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Creating`,async()=>r.user.loadBalancers.pools.create({...l})),{successLabel:`Created`})}};function ae(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const oe={command:`delete <pool-id>`,describe:`Delete a configured pool.`,builder:ae,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
6
+ `);return}a(await s(`Deleting`,async()=>n.user.loadBalancers.pools.delete({pool_id:e[`pool-id`]})),{successLabel:`Deleted`})}};function se(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`]}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`pool <pool-id>`,describe:`Apply changes to an existing pool, overwriting the supplied properties.`,builder:se,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools edit pools pool`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.loadBalancers.pools.edit.pools.pool({...t,pool_id:e[`pool-id`]})),{successLabel:`Updated`});return}let l=i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Updating`,async()=>r.user.loadBalancers.pools.edit.pools.pool({...l,pool_id:e[`pool-id`]})),{successLabel:`Updated`})}};function le(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 ue={command:`pools`,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:le,handler:async l=>{if(l.dryRun){o({command:`cf user load-balancers pools edit pools pools`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools`,pathParams:{},bodyKind:`json`,body:l.body===void 0?i({notification_email:c(l[`notification-email`],`notification-email`,`text`)}):n(l.body)});return}let u=await t(l);if(l.body){let t=n(l.body);a(await s(`Updating`,async()=>e(u,`PATCH`,`/user/load_balancers/pools`,{body:t})),{successLabel:`Updated`});return}let d={};l[`notification-email`]!==void 0&&r(d,[`notification_email`],c(l[`notification-email`],`notification-email`,`text`)),a(await s(`Updating`,async()=>e(u,`PATCH`,`/user/load_balancers/pools`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},de={command:`pools`,describe:`Load Balancers operations`,builder:e=>e.command(ce).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`edit`,describe:`Operations for load-balancers.pools.edit`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(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 me={command:`get <pool-id>`,describe:`Fetch a single configured pool.`,builder:pe,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.pools.get({pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}};function he(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 ge={command:`get <pool-id>`,describe:`Fetch the latest pool health status for a single pool.`,builder:he,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools health get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/health`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.pools.health.get({pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}},_e={command:`health`,describe:`Load Balancers operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(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 ye={command:`list`,describe:`List configured pools.`,builder:ve,handler:async e=>{let n={monitor:e.monitor};if(e.dryRun){o({command:`cf user load-balancers pools list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.loadBalancers.pools.list(n)),{successLabel:`Loaded`})}};function be(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 xe={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:be,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools preview create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/preview`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.loadBalancers.pools.preview.create({body:t,pool_id:e[`pool-id`]})),{successLabel:`Created`});return}let l=i({allow_insecure:e[`allow-insecure`],consecutive_down:e[`consecutive-down`],consecutive_up:e[`consecutive-up`],description:c(e.description,`description`,`text`),expected_body:c(e[`expected-body`],`expected-body`,`text`),expected_codes:c(e[`expected-codes`],`expected-codes`,`text`),follow_redirects:e[`follow-redirects`],interval:e.interval,method:c(e.method,`method`,`text`),path:c(e.path,`path`,`text`),port:e.port,probe_zone:c(e[`probe-zone`],`probe-zone`,`text`),retries:e.retries,timeout:e.timeout,type:c(e.type,`type`,`text`)});a(await s(`Creating`,async()=>r.user.loadBalancers.pools.preview.create({body:l,pool_id:e[`pool-id`]})),{successLabel:`Created`})}},Se={command:`preview`,describe:`Load Balancers operations`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.option(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`Get the list of resources that reference the provided pool.`,builder:Ce,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools references list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}/references`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.pools.references.list({pool_id:e[`pool-id`]})),{successLabel:`Loaded`})}},Te={command:`references`,describe:`Load Balancers operations`,builder:e=>e.command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.positional(`pool-id`,{type:`string`,description:`Pool ID`,demandOption:!0}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means every Cloudflare data center.`}).option(`description`,{type:`string`,description:`A human-readable description of the pool.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable (the default) or disable this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any).`}).option(`latitude`,{type:`number`,description:`The latitude of the data center containing the origins used in this pool in decimal degrees. If this is set, longitude must also be set.`}).option(`load-shedding-default-percent`,{type:`number`,description:`The percent of traffic to shed from the pool, according to the default policy. Applies to new sessions and traffic without session affinity.`}).option(`load-shedding-default-policy`,{type:`string`,description:`The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.`,choices:[`random`,`hash`]}).option(`load-shedding-session-percent`,{type:`number`,description:`The percent of existing sessions to shed from the pool, according to the session policy.`}).option(`load-shedding-session-policy`,{type:`string`,description:`Only the hash policy is supported for existing sessions (to avoid exponential decay).`,choices:[`hash`]}).option(`longitude`,{type:`number`,description:`The longitude of the data center containing the origins used in this pool in decimal degrees. If this is set, latitude must also be set.`}).option(`minimum-origins`,{type:`number`,description:`The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and will failover to the next available pool.`}).option(`monitor`,{type:`string`,description:`The ID of the Monitor to use for checking the health of origins within this pool.`}).option(`monitor-group`,{type:`string`,description:`The ID of the Monitor Group to use for checking the health of origins within this pool.`}).option(`name`,{type:`string`,description:`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`}).option(`networks`,{type:`string`,array:!0,description:`List of networks where Load Balancer or Pool is enabled.`}).option(`notification-email`,{type:`string`,description:`This field is now deprecated. It has been moved to Cloudflare's Centralized Notification service https://developers.cloudflare.com/fundamentals/notifications/. The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.`}).option(`notification-filter-origin-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-origin-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`notification-filter-pool-disable`,{type:`boolean`,description:`If set true, disable notifications for this type of resource (pool or origin).`}).option(`notification-filter-pool-healthy`,{type:`boolean`,description:`If present, send notifications only for this health status (e.g. false for only DOWN events). Use null to reset (all events).`}).option(`origin-steering-policy`,{type:`string`,description:'The type of origin steering policy to use.\n- `"random"`: Select an origin randomly.\n- `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.\n- `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.\n- `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin\'s number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.',choices:[`random`,`hash`,`least_outstanding_requests`,`least_connections`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`update <pool-id>`,describe:`Modify a configured pool.`,builder:Ee,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers pools update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/pools/${e[`pool-id`]==null?`<pool-id>`:encodeURIComponent(String(e[`pool-id`]))}`,pathParams:{"pool-id":String(e[`pool-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),networks:e.networks,notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.loadBalancers.pools.update({...t,pool_id:e[`pool-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await u(`name`,`A short name (tag) for the pool. Only alphanumeric characters, hyphens, and underscores are allowed.`));let l=i({check_regions:e[`check-regions`],description:c(e.description,`description`,`text`),enabled:e.enabled,latitude:e.latitude,load_shedding:{default_percent:e[`load-shedding-default-percent`],default_policy:c(e[`load-shedding-default-policy`],`load-shedding-default-policy`,`text`),session_percent:e[`load-shedding-session-percent`],session_policy:c(e[`load-shedding-session-policy`],`load-shedding-session-policy`,`text`)},longitude:e.longitude,minimum_origins:e[`minimum-origins`],monitor:c(e.monitor,`monitor`,`text`),monitor_group:c(e[`monitor-group`],`monitor-group`,`text`),name:c(e.name,`name`,`text`),networks:e.networks,notification_email:c(e[`notification-email`],`notification-email`,`text`),notification_filter:{origin:{disable:e[`notification-filter-origin-disable`],healthy:e[`notification-filter-origin-healthy`]},pool:{disable:e[`notification-filter-pool-disable`],healthy:e[`notification-filter-pool-healthy`]}},origin_steering:{policy:c(e[`origin-steering-policy`],`origin-steering-policy`,`text`)}});a(await s(`Updating`,async()=>r.user.loadBalancers.pools.update({...l,pool_id:e[`pool-id`]})),{successLabel:`Updated`})}},Oe={command:`pools`,describe:`Load Balancers operations`,builder:e=>e.command(ie).command(oe).command(me).command(ye).command(De).command(fe).command(_e).command(Se).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.positional(`preview-id`,{type:`string`,description:`Preview ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <preview-id>`,describe:`Get the result of a previous preview operation using the provided preview_id.`,builder:ke,handler:async e=>{if(e.dryRun){o({command:`cf user load-balancers preview get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancers/preview/${e[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(e[`preview-id`]))}`,pathParams:{"preview-id":String(e[`preview-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.loadBalancers.preview.get({preview_id:e[`preview-id`]})),{successLabel:`Loaded`})}},je={command:`preview`,describe:`Load Balancers operations`,builder:e=>e.command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Me={command:`load-balancers`,describe:`Operations for load-balancers`,builder:e=>e.command(ne).command(Oe).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.option(`until`,{type:`string`,description:`End date and time of requesting data period in the ISO8601 format.`}).option(`pool-name`,{type:`string`,description:`The name for the pool to filter.`}).option(`origin-healthy`,{type:`boolean`,description:`If true, filter events where the origin status is healthy. If false, filter events where the origin status is unhealthy.`}).option(`pool-id`,{type:`string`,description:`Pool ID`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in the ISO8601 format.`}).option(`origin-name`,{type:`string`,description:`The name for the origin to filter.`}).option(`pool-healthy`,{type:`boolean`,description:`If true, filter events where the pool status is healthy. If false, filter events where the pool status is unhealthy.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`list`,describe:`List origin health changes.`,builder:Ne,handler:async e=>{let n={until:e.until,pool_name:e[`pool-name`],origin_healthy:e[`origin-healthy`],pool_id:e[`pool-id`],since:e.since,origin_name:e[`origin-name`],pool_healthy:e[`pool-healthy`]};if(e.dryRun){o({command:`cf user load-balancing-analytics events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/load_balancing_analytics/events`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.loadBalancingAnalytics.events.list(n)),{successLabel:`Loaded`})}},Fe={command:`events`,describe:`Load Balancing Analytics operations`,builder:e=>e.command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`load-balancing-analytics`,describe:`Operations for load-balancing-analytics`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.positional(`identifier`,{type:`string`,description:`Subscription 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 Re={command:`delete <identifier>`,describe:`Deletes a user's subscription.`,builder:Le,handler:async e=>{if(e.dryRun){o({command:`cf user subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/user/subscriptions/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let n=await t(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
7
+ `);return}a(await s(`Deleting`,async()=>n.user.subscriptions.delete({identifier:e.identifier})),{successLabel:`Deleted`})}};function ze(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`get`,describe:`Lists all of a user's subscriptions.`,builder:ze,handler:async e=>{if(e.dryRun){o({command:`cf user subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/subscriptions`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.subscriptions.get()),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`update <identifier>`,describe:`Updates a user's subscriptions.`,builder:Ve,handler:async e=>{if(e.dryRun){o({command:`cf user subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/subscriptions/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?i({app:{install_id:c(e[`app-install-id`],`app-install-id`,`text`)},frequency:c(e.frequency,`frequency`,`text`),rate_plan:{currency:c(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:c(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:c(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.subscriptions.update({body:t,identifier:e.identifier})),{successLabel:`Updated`});return}let l=i({app:{install_id:c(e[`app-install-id`],`app-install-id`,`text`)},frequency:c(e.frequency,`frequency`,`text`),rate_plan:{currency:c(e[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:e[`rate-plan-externally-managed`],id:c(e[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:e[`rate-plan-is-contract`],public_name:c(e[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:c(e[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:e[`rate-plan-sets`]}});a(await s(`Updating`,async()=>r.user.subscriptions.update({body:l,identifier:e.identifier})),{successLabel:`Updated`})}},Ue={command:`subscriptions`,describe:`View and manage zone-level plan subscriptions owned by your user`,builder:e=>e.command(Re).command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`Retrieves list of tenants the authenticated user / method has access to.`,builder:We,handler:async e=>{if(e.dryRun){o({command:`cf user tenants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/tenants`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.tenants.list()),{successLabel:`Loaded`})}},Ke={command:`tenants`,describe:`Operations for tenants`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).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 Je={command:`create`,describe:`Create a new access token.`,builder:qe,handler:async e=>{if(e.dryRun){o({command:`cf user tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/user/tokens`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({condition:{request_ip:{in:e[`condition-request-ip-in`],not_in:e[`condition-request-ip-not-in`]}},expires_on:c(e[`expires-on`],`expires-on`,`text`),name:c(e.name,`name`,`text`),not_before:c(e[`not-before`],`not-before`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Creating`,async()=>r.user.tokens.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await u(`name`,`Token name.`));let l=i({condition:{request_ip:{in:e[`condition-request-ip-in`],not_in:e[`condition-request-ip-not-in`]}},expires_on:c(e[`expires-on`],`expires-on`,`text`),name:c(e.name,`name`,`text`),not_before:c(e[`not-before`],`not-before`,`text`)});a(await s(`Creating`,async()=>r.user.tokens.create({...l})),{successLabel:`Created`})}};function Ye(e){return e.positional(`token-id`,{type:`string`,description:`Token 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 Xe={command:`delete <token-id>`,describe:`Destroy a token.`,builder:Ye,handler:async e=>{if(e.dryRun){o({command:`cf user tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/user/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
8
+ `);return}a(await s(`Deleting`,async()=>n.user.tokens.delete({token_id:e[`token-id`]})),{successLabel:`Deleted`})}};function Ze(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qe={command:`get <token-id>`,describe:`Get information about a specific token.`,builder:Ze,handler:async e=>{if(e.dryRun){o({command:`cf user tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.tokens.get({token_id:e[`token-id`]})),{successLabel:`Loaded`})}};function $e(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`include-expired`,{type:`boolean`,description:`When true, includes recently-expired tokens in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`list`,describe:`List all access tokens you created. Results include active, disabled, and recently-expired tokens when include_expired is set to true.`,builder:f($e),handler:async e=>{let n={page:e.page,per_page:e[`per-page`],direction:e.direction,include_expired:e[`include-expired`]};if(e.dryRun){o({command:`cf user tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/tokens`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.tokens.list(n)),{successLabel:`Loaded`})}};function tt(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
9
+ The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
10
+ The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Find all available permission groups for API Tokens.`,builder:tt,handler:async e=>{let n={name:e.name,scope:e.scope};if(e.dryRun){o({command:`cf user tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/tokens/permission_groups`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e);a(await s(`Loading`,async()=>r.user.tokens.permissionGroups.list(n)),{successLabel:`Loaded`})}},nt={command:`permission-groups`,describe:`Create and manage personal API tokens scoped to your user for programmatic API access`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).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 it={command:`update <token-id>`,describe:`Update an existing token.`,builder:rt,handler:async e=>{if(e.dryRun){o({command:`cf user tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({condition:{request_ip:{in:e[`condition-request-ip-in`],not_in:e[`condition-request-ip-not-in`]}},expires_on:c(e[`expires-on`],`expires-on`,`text`),name:c(e.name,`name`,`text`),not_before:c(e[`not-before`],`not-before`,`text`),status:c(e.status,`status`,`text`)}):n(e.body)});return}let r=await t(e);if(e.body){let t=n(e.body);a(await s(`Updating`,async()=>r.user.tokens.update({body:t,token_id:e[`token-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await u(`name`,`Token name.`));let l=i({condition:{request_ip:{in:e[`condition-request-ip-in`],not_in:e[`condition-request-ip-not-in`]}},expires_on:c(e[`expires-on`],`expires-on`,`text`),name:c(e.name,`name`,`text`),not_before:c(e[`not-before`],`not-before`,`text`),status:c(e.status,`status`,`text`)});a(await s(`Updating`,async()=>r.user.tokens.update({body:l,token_id:e[`token-id`]})),{successLabel:`Updated`})}};function at(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`update <token-id>`,describe:`Roll the token secret.`,builder:at,handler:async e=>{if(e.dryRun){o({command:`cf user tokens value update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/tokens/${e[`token-id`]==null?`<token-id>`:encodeURIComponent(String(e[`token-id`]))}/value`,pathParams:{"token-id":String(e[`token-id`]??``)},bodyKind:`none`});return}let n=await t(e);a(await s(`Updating`,async()=>n.user.tokens.value.update({token_id:e[`token-id`]})),{successLabel:`Updated`})}},st={command:`value`,describe:`Create and manage personal API tokens scoped to your user for programmatic API access`,builder:e=>e.command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ct(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lt={command:`verify`,describe:`Test whether a token works.`,builder:ct,handler:async e=>{if(e.dryRun){o({command:`cf user tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/tokens/verify`,pathParams:{},bodyKind:`none`});return}let n=await t(e);a(await s(`Loading`,async()=>n.user.tokens.verify()),{successLabel:`Loaded`})}},ut={command:`tokens`,describe:`Create and manage personal API tokens scoped to your user for programmatic API access`,builder:e=>e.command(Je).command(Xe).command(Qe).command(et).command(it).command(lt).command(nt).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},dt={command:`user`,describe:`Your Cloudflare user profile, invitations, organizations, billing, and personal API tokens`,builder:e=>e.command(S).command(P).command(p).command(b).command(M).command(Me).command(Ie).command(Ue).command(Ke).command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{dt as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{i as n,n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l,t as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.mjs";import{n as f,r as p,t as m}from"./prompt-q3B7sM2A.mjs";function h(e){return e.option(`config-dimensions`,{type:`number`,description:`Specifies the number of dimensions for the index`}).option(`config-metric`,{type:`string`,description:`Specifies the type of metric to use calculating distance.`,choices:[`cosine`,`euclidean`,`dot-product`]}).option(`config-preset`,{type:`string`,description:`Specifies the preset to use for the index.`,choices:[`@cf/baai/bge-small-en-v1.5`,`@cf/baai/bge-base-en-v1.5`,`@cf/baai/bge-large-en-v1.5`,`openai/text-embedding-ada-002`,`cohere/embed-multilingual-v2.0`]}).option(`description`,{type:`string`,description:`Specifies the description of the index.`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-dimensions`,[`config-preset`]).implies(`config-dimensions`,[`config-metric`]).conflicts(`config-metric`,[`config-preset`]).implies(`config-metric`,[`config-dimensions`]).conflicts(`config-preset`,[`config-dimensions`,`config-metric`])}const g={command:`create`,describe:`Creates and returns a new Vectorize Index.`,builder:h,handler:async n=>{if(n.dryRun){s({command:`cf vectorize create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({config:{dimensions:n[`config-dimensions`],metric:l(n[`config-metric`],`config-metric`,`text`),preset:l(n[`config-preset`],`config-preset`,`text`)},description:l(n.description,`description`,`text`),name:l(n.name,`name`,`text`)}):i(n.body)});return}let u=await r(n),f=n.local?d:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.vectorize.create({body:e,account_id:f})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await p(`name`,`The name field`));let m=a({config:{dimensions:n[`config-dimensions`],metric:l(n[`config-metric`],`config-metric`,`text`),preset:l(n[`config-preset`],`config-preset`,`text`)},description:l(n.description,`description`,`text`),name:l(n.name,`name`,`text`)});o(await c(`Creating`,async()=>u.vectorize.create({body:m,account_id:f})),{successLabel:`Created`})}};function _(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`A list of vector identifiers to delete from the index indicated by the path.`}).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:`delete-by-ids <index-name>`,describe:`Delete a set of vectors from an index by their vector identifiers.`,builder:_,handler:async n=>{if(n.dryRun){s({command:`cf vectorize delete-by-ids`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/delete_by_ids`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({ids:n.ids}):i(n.body)});return}let l=await r(n),u=n.local?d:await e();if(n.accountId=u,n.body){let e=i(n.body);o(await c(`Creating`,async()=>l.vectorize.deleteByIds({body:e,account_id:u,index_name:n[`index-name`]})),{successLabel:`Created`});return}let f=a({ids:n.ids});o(await c(`Creating`,async()=>l.vectorize.deleteByIds({body:f,account_id:u,index_name:n[`index-name`]})),{successLabel:`Created`})}};function y(e){return e.positional(`index-name`,{type:`string`,description:`Index 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 b={command:`delete <index-name>`,describe:`Deletes the specified Vectorize Index.`,builder:y,handler:async n=>{if(n.dryRun){s({command:`cf vectorize delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();if(n.accountId=a,!await m({force:!!n.force})){process.stderr.write(`Aborted.
3
+ `);return}o(await c(`Deleting`,async()=>i.vectorize.delete({account_id:a,index_name:n[`index-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`ids`,{type:`string`,array:!0,description:`A list of vector identifiers to retrieve from the index indicated by the path.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`get-by-ids <index-name>`,describe:`Get a set of vectors from an index by their vector identifiers.`,builder:x,handler:async n=>{if(n.dryRun){s({command:`cf vectorize get-by-ids`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/get_by_ids`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({ids:n.ids}):i(n.body)});return}let l=await r(n),u=n.local?d:await e();if(n.accountId=u,n.body){let e=i(n.body);o(await c(`Creating`,async()=>l.vectorize.getByIds({body:e,account_id:u,index_name:n[`index-name`]})),{successLabel:`Created`});return}let f=a({ids:n.ids});o(await c(`Creating`,async()=>l.vectorize.getByIds({body:f,account_id:u,index_name:n[`index-name`]})),{successLabel:`Created`})}};function C(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <index-name>`,describe:`Returns the specified Vectorize Index.`,builder:C,handler:async n=>{if(n.dryRun){s({command:`cf vectorize get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.vectorize.get({account_id:a,index_name:n[`index-name`]})),{successLabel:`Loaded`})}};function T(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`info <index-name>`,describe:`Get information about a vectorize index.`,builder:T,handler:async n=>{if(n.dryRun){s({command:`cf vectorize info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/info`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.vectorize.info({account_id:a,index_name:n[`index-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`unparsable-behavior`,{type:`string`,description:`Behavior for ndjson parse failures.`,choices:[`error`,`discard`]}).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 O={command:`insert <index-name>`,describe:`Inserts vectors into the specified index and returns a mutation id corresponding to the vectors enqueued for insertion.`,builder:D,handler:async i=>{let a={"unparsable-behavior":i[`unparsable-behavior`]};if(i.dryRun){s({command:`cf vectorize insert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${i[`index-name`]==null?`<index-name>`:encodeURIComponent(String(i[`index-name`]))}/insert`,pathParams:{"index-name":String(i[`index-name`]??``)},query:a,bodyKind:`octet-stream`,body:i.body});return}let f=await r(i),p=i.local?d:await e();if(i.accountId=p,i.file){let e=u(i.file);o(await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/vectorize/v2/indexes/${encodeURIComponent(String(i[`index-name`]))}/insert`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(i.body){let e=l(i.body,`body`,`binary`),t=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();o(await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/vectorize/v2/indexes/${encodeURIComponent(String(i[`index-name`]))}/insert${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function k(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`count`,{type:`number`,description:`Maximum number of vectors to return`}).option(`cursor`,{type:`string`,description:`Cursor for pagination to get the next page of results`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list-vectors <index-name>`,describe:`Returns a paginated list of vector identifiers from the specified index.`,builder:k,handler:async n=>{let i={count:n.count,cursor:n.cursor};if(n.dryRun){s({command:`cf vectorize list-vectors`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/list`,pathParams:{"index-name":String(n[`index-name`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?d:await e();n.accountId=l,o(await c(`Loading`,async()=>a.vectorize.listVectors({account_id:l,index_name:n[`index-name`],...i})),{successLabel:`Loaded`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Returns a list of Vectorize Indexes`,builder:j,handler:async n=>{if(n.dryRun){s({command:`cf vectorize list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes`,pathParams:{},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.vectorize.list({account_id:a})),{successLabel:`Loaded`})}};function N(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`index-type`,{type:`string`,description:`Specifies the type of metadata property to index.`,choices:[`string`,`number`,`boolean`]}).option(`property-name`,{type:`string`,description:`Specifies the metadata property to index.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <index-name>`,describe:`Enable metadata filtering based on metadata property. Limited to 10 properties.`,builder:N,handler:async n=>{if(n.dryRun){s({command:`cf vectorize metadata-index create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/metadata_index/create`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({indexType:l(n[`index-type`],`index-type`,`text`),propertyName:l(n[`property-name`],`property-name`,`text`)}):i(n.body)});return}let u=await r(n),m=n.local?d:await e();if(n.accountId=m,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.vectorize.metadataIndex.create({...e,account_id:m,index_name:n[`index-name`]})),{successLabel:`Created`});return}n[`index-type`]===void 0&&(n[`index-type`]=await f(`index-type`,`Specifies the type of metadata property to index.`,[`string`,`number`,`boolean`])),n[`property-name`]===void 0&&(n[`property-name`]=await p(`property-name`,`Specifies the metadata property to index.`));let h=a({indexType:l(n[`index-type`],`index-type`,`text`),propertyName:l(n[`property-name`],`property-name`,`text`)});o(await c(`Creating`,async()=>u.vectorize.metadataIndex.create({...h,account_id:m,index_name:n[`index-name`]})),{successLabel:`Created`})}};function F(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`property-name`,{type:`string`,description:`Specifies the metadata property for which the index must be deleted.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`delete <index-name>`,describe:`Allow Vectorize to delete the specified metadata index.`,builder:F,handler:async n=>{if(n.dryRun){s({command:`cf vectorize metadata-index delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/metadata_index/delete`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({propertyName:l(n[`property-name`],`property-name`,`text`)}):i(n.body)});return}let u=await r(n),f=n.local?d:await e();if(n.accountId=f,!await m({force:!!n.force,message:`This operation deletes a metadata index destructively.`})){process.stderr.write(`Aborted.
4
+ `);return}if(n.body){let e=i(n.body);o(await c(`Deleting`,async()=>u.vectorize.metadataIndex.delete({...e,account_id:f,index_name:n[`index-name`]})),{successLabel:`Deleted`});return}n[`property-name`]===void 0&&(n[`property-name`]=await p(`property-name`,`Specifies the metadata property for which the index must be deleted.`));let h=a({propertyName:l(n[`property-name`],`property-name`,`text`)});o(await c(`Deleting`,async()=>u.vectorize.metadataIndex.delete({...h,account_id:f,index_name:n[`index-name`]})),{successLabel:`Deleted`})}};function L(e){return e.option(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List Metadata Indexes for the specified Vectorize Index.`,builder:L,handler:async n=>{if(n.dryRun){s({command:`cf vectorize metadata-index list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/metadata_index/list`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.vectorize.metadataIndex.list({account_id:a,index_name:n[`index-name`]})),{successLabel:`Loaded`})}},z={command:`metadata-index`,describe:`Metadata indexes for filtered vector search`,builder:e=>e.command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`return-metadata`,{type:`string`,description:`Whether to return no metadata, indexed metadata or all metadata associated with the closest vectors.`,choices:[`none`,`indexed`,`all`],default:`none`}).option(`return-values`,{type:`boolean`,description:`Whether to return the values associated with the closest vectors.`,default:!1}).option(`top-k`,{type:`number`,description:`The number of nearest neighbors to find.`,default:5}).option(`vector`,{type:`string`,array:!0,description:`The search vector that will be used to find the nearest neighbors.`}).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:`query <index-name>`,describe:`Finds vectors closest to a given vector in an index.`,builder:B,handler:async n=>{if(n.dryRun){s({command:`cf vectorize query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${n[`index-name`]==null?`<index-name>`:encodeURIComponent(String(n[`index-name`]))}/query`,pathParams:{"index-name":String(n[`index-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({returnMetadata:l(n[`return-metadata`],`return-metadata`,`text`),returnValues:n[`return-values`],topK:n[`top-k`],vector:n.vector}):i(n.body)});return}let u=await r(n),f=n.local?d:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Loading`,async()=>u.vectorize.query({...e,account_id:f,index_name:n[`index-name`]})),{successLabel:`Loaded`});return}if(n.vector===void 0)throw Error(`--vector is required (or pass --body with this field set).`);let p=a({returnMetadata:l(n[`return-metadata`],`return-metadata`,`text`),returnValues:n[`return-values`],topK:n[`top-k`],vector:n.vector});o(await c(`Loading`,async()=>u.vectorize.query({...p,account_id:f,index_name:n[`index-name`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`index-name`,{type:`string`,description:`Index name`,demandOption:!0}).option(`unparsable-behavior`,{type:`string`,description:`Behavior for ndjson parse failures.`,choices:[`error`,`discard`]}).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 U={command:`upsert <index-name>`,describe:`Upserts vectors into the specified index, creating them if they do not exist and returns a mutation id corresponding to the vectors enqueued for upsertion.`,builder:H,handler:async i=>{let a={"unparsable-behavior":i[`unparsable-behavior`]};if(i.dryRun){s({command:`cf vectorize upsert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/vectorize/v2/indexes/${i[`index-name`]==null?`<index-name>`:encodeURIComponent(String(i[`index-name`]))}/upsert`,pathParams:{"index-name":String(i[`index-name`]??``)},query:a,bodyKind:`octet-stream`,body:i.body});return}let f=await r(i),p=i.local?d:await e();if(i.accountId=p,i.file){let e=u(i.file);o(await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/vectorize/v2/indexes/${encodeURIComponent(String(i[`index-name`]))}/upsert`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(i.body){let e=l(i.body,`body`,`binary`),t=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();o(await c(`Creating`,async()=>n(f,`POST`,`/accounts/${p}/vectorize/v2/indexes/${encodeURIComponent(String(i[`index-name`]))}/upsert${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/x-ndjson`}})),{successLabel:`Created`});return}if(i.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},W={command:`vectorize`,describe:`Globally distributed vector database for building semantic search, recommendations, and RAG applications on Workers`,builder:e=>e.command(g).command(b).command(v).command(w).command(S).command(E).command(O).command(M).command(A).command(V).command(U).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,t}from"./shared-BAjo72Lz.mjs";function n(t){return e(t).option(`preview-alias`,{type:`string`,description:`Preview alias for this Worker Version`,requiresArg:!0})}const r={command:`upload`,describe:`Upload a new Worker Version without deploying it`,builder:n,handler:async e=>{await t(e,{command:`Version upload`})}},i={command:`versions`,describe:`Manage Worker Versions`,builder:e=>e.command(r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{i as default};
2
+ import{n as e,t}from"./shared-DQI8NGja.mjs";function n(t){return e(t).option(`preview-alias`,{type:`string`,description:`Preview alias for this Worker Version`,requiresArg:!0})}const r={command:`upload`,describe:`Upload a new Worker Version without deploying it`,builder:n,handler:async e=>{await t(e,{command:`Version upload`})}},i={command:`versions`,describe:`Manage Worker Versions`,builder:e=>e.command(r).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{i as default};