cf 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-CKb6w43K.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-CwFrx-Dr.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/{api-gateway-D9PMVVqL.mjs → api-gateway-D4AIEtUq.mjs} +10 -10
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BvQ9uwuy.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-DX9KnJ0P.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/{cache-CeN5t6_W.mjs → cache-DVhkiIGK.mjs} +4 -4
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-Bvzav4Mj.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/{custom-certificates-CfRj7QZb.mjs → custom-certificates-CWUrPYLP.mjs} +4 -4
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/{custom-hostnames-CcK7_17e.mjs → custom-hostnames-CVQSksqq.mjs} +4 -4
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-BYsNl3qc.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-BzlPv3ro.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-IOg-_s5_.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-BH-4NQOV.mjs +134 -0
  63. package/dist/dns-D7VAaCyO.mjs +29 -0
  64. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  65. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  66. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  67. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  68. package/dist/email-routing-CiDbivcN.mjs +10 -0
  69. package/dist/email-security-BYeAuSc6.mjs +12 -0
  70. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  71. package/dist/{filters-DKs-wEzt.mjs → filters-DZ8YnQ90.mjs} +3 -3
  72. package/dist/firewall-DEd1hs_I.mjs +11 -0
  73. package/dist/flagship-DVw7xGoP.mjs +4 -0
  74. package/dist/{fraud-D8WmLKyH.mjs → fraud-BbGS3FZs.mjs} +2 -2
  75. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  76. package/dist/{healthchecks-BBtW8vRh.mjs → healthchecks-Da9N3ix4.mjs} +3 -3
  77. package/dist/{hostnames-Bh2IFxIw.mjs → hostnames-mimZu2tB.mjs} +2 -2
  78. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  79. package/dist/iam-DGQ-OgRl.mjs +6 -0
  80. package/dist/images-CI6Iy9ho.mjs +7 -0
  81. package/dist/index.mjs +1 -1
  82. package/dist/intel-BDB-aRtU.mjs +3 -0
  83. package/dist/internal-Czlp5Ekb.mjs +2 -0
  84. package/dist/{ips-BE7JbAnc.mjs → ips-B9UuPvsY.mjs} +1 -1
  85. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  86. package/dist/kv-BHerx4dZ.mjs +5 -0
  87. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  88. package/dist/live-Ce7dZW7p.mjs +2 -0
  89. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  90. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  91. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  92. package/dist/logos-CJLhx1go.mjs +3 -0
  93. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  94. package/dist/logs-DMvtchc6.mjs +3 -0
  95. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  96. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  97. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  98. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  99. package/dist/matches-B0yHbQ2I.mjs +2 -0
  100. package/dist/moq-UgBawOXe.mjs +13 -0
  101. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  102. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  103. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  104. package/dist/observability-B-1y36QS.mjs +4 -0
  105. package/dist/organization-Dq3PClZ7.mjs +41 -0
  106. package/dist/organizations-AhsQkHyX.mjs +2 -0
  107. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  108. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  109. package/dist/{origin-tls-client-auth-B30_2_dO.mjs → origin-tls-client-auth-BDw5q-6G.mjs} +3 -3
  110. package/dist/{page-rules-zQJGmTCd.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  111. package/dist/{page-shield-CxQk5k9X.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  112. package/dist/pages-BsXF11Kv.mjs +11 -0
  113. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  114. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  115. package/dist/progress-O88q63Bk.mjs +2 -0
  116. package/dist/{prompt-q3B7sM2A.mjs → prompt-DTAWiEm2.mjs} +1 -1
  117. package/dist/queries-CAE95-OH.mjs +3 -0
  118. package/dist/queues-BBz35Mqd.mjs +6 -0
  119. package/dist/r2-Zp99S5xF.mjs +21 -0
  120. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  121. package/dist/radar-Cij-XVQJ.mjs +2 -0
  122. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  123. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  124. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  125. package/dist/ready-DMpJvyaz.mjs +2 -0
  126. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  127. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  128. package/dist/refute-BGTpr5sy.mjs +2 -0
  129. package/dist/registrar-CXViZlah.mjs +83 -0
  130. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  131. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  132. package/dist/{resolve-DGD57PFH.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  133. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  134. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  135. package/dist/rules-ens3OHme.mjs +4 -0
  136. package/dist/rulesets-bkreZRao.mjs +8 -0
  137. package/dist/rum-CpgXFcwl.mjs +4 -0
  138. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  139. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  140. package/dist/{schema-D8o6HcCr.mjs → schema-DCF4yEp_.mjs} +1 -1
  141. package/dist/{schema-validation-BWNDnnIT.mjs → schema-validation-Ca6o94ts.mjs} +5 -5
  142. package/dist/scim-C4oT8TMc.mjs +4 -0
  143. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  144. package/dist/search-C4T5riPh.mjs +2 -0
  145. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  146. package/dist/security-center-BOvm7xy6.mjs +2 -0
  147. package/dist/{security-txt-CVpmJo29.mjs → security-txt-BCAUBctN.mjs} +2 -2
  148. package/dist/session-B1ARgLG7.mjs +2 -0
  149. package/dist/share-DhmVspmL.mjs +5 -0
  150. package/dist/{shared-DQI8NGja.mjs → shared-Bod3-Exx.mjs} +332 -332
  151. package/dist/signed-url-DA509wgp.mjs +2 -0
  152. package/dist/{smart-shield-BreBC1Ap.mjs → smart-shield-DZm4fn6z.mjs} +2 -2
  153. package/dist/{snippets-BAJoWMSJ.mjs → snippets-oQ0u26-z.mjs} +3 -3
  154. package/dist/{spawn-pmGERpdB.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  155. package/dist/{spectrum-DnIRLY95.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  156. package/dist/speed-DqNnvLBD.mjs +4 -0
  157. package/dist/{src-BQ1dr9xR.mjs → src-By-zTCHz.mjs} +9 -9
  158. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  159. package/dist/state-OsdDJvdj.mjs +2 -0
  160. package/dist/stream-Bud9Os5V.mjs +14 -0
  161. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  162. package/dist/submit-BtP8she2.mjs +2 -0
  163. package/dist/tenant-CMwHa-tU.mjs +2 -0
  164. package/dist/{token-validation-DUvtXWur.mjs → token-validation-BYC7HTok.mjs} +5 -5
  165. package/dist/{tools-CQtA5-cr.mjs → tools-Dru4l8yh.mjs} +1 -1
  166. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  167. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  168. package/dist/turnstile-CP4nScaL.mjs +23 -0
  169. package/dist/{ui-BrNwNHX9.mjs → ui-BNoF0KpD.mjs} +2 -2
  170. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  171. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  172. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  173. package/dist/user-DtefniLc.mjs +11 -0
  174. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  175. package/dist/verify-D7J3F_NZ.mjs +2 -0
  176. package/dist/{versions-NUXxCr0s.mjs → versions-dMW3bLVv.mjs} +1 -1
  177. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  178. package/dist/{web3-n3GW50u-.mjs → web3-Dhw79l4S.mjs} +3 -3
  179. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  180. package/dist/workers-l3zMNOU6.mjs +20 -0
  181. package/dist/workflows-rb7RYBKP.mjs +6 -0
  182. package/dist/{zaraz-9l7KuLqh.mjs → zaraz-CHecMYuo.mjs} +1 -1
  183. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  184. package/dist/zone-BnnqJwW-.mjs +2 -0
  185. package/dist/zones-DpI2YikF.mjs +21 -0
  186. package/package.json +1 -1
  187. package/dist/abuse-reports-DUs4SKVx.mjs +0 -8
  188. package/dist/accounts-BIY8wNGA.mjs +0 -22
  189. package/dist/acm-SqcV8o5o.mjs +0 -3
  190. package/dist/addressing-CygRm0pN.mjs +0 -12
  191. package/dist/ai-BAmEAjN3.mjs +0 -2
  192. package/dist/ai-gateway-BENwPvvB.mjs +0 -8
  193. package/dist/ai-search-Bv_Whw3E.mjs +0 -7
  194. package/dist/ai_gateway-C6WP9oBH.mjs +0 -4
  195. package/dist/alerting-D_qWrsoY.mjs +0 -6
  196. package/dist/analytics_engine-BjV6XLyG.mjs +0 -2
  197. package/dist/argo-DwYGbyld.mjs +0 -2
  198. package/dist/artifacts-DKAjY_n4.mjs +0 -4
  199. package/dist/auth-TYwGydWg.mjs +0 -5
  200. package/dist/billing-CRTlRU88.mjs +0 -2
  201. package/dist/bot-management-DgW--8wM.mjs +0 -5
  202. package/dist/botnet-feed-CIX6ZORT.mjs +0 -3
  203. package/dist/brand-protection-ZikBtl0y.mjs +0 -3
  204. package/dist/browser-rendering-D_ZQVWn8.mjs +0 -4
  205. package/dist/build-Bgw8TV1p.mjs +0 -134
  206. package/dist/calls-Cv0ieVg4.mjs +0 -4
  207. package/dist/certificate-authorities-BzZnWCac.mjs +0 -2
  208. package/dist/client-certificates-BFuzeBrj.mjs +0 -3
  209. package/dist/cloud-connector-D5h8Dzzg.mjs +0 -2
  210. package/dist/cloudforce-one-aqDCIBMp.mjs +0 -21
  211. package/dist/config-B5k-XbwS.mjs +0 -2
  212. package/dist/connectivity-CjkXmEhO.mjs +0 -3
  213. package/dist/connector-interrupts-B7eSface.mjs +0 -2
  214. package/dist/connector-telemetry-events-F3Co8HUf.mjs +0 -2
  215. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +0 -2
  216. package/dist/connectors-YYu_Vx3H.mjs +0 -3
  217. package/dist/content-scanning-BorfRGKT.mjs +0 -4
  218. package/dist/context-C-WbewL6.mjs +0 -2
  219. package/dist/custom-nameservers-BkKx0THn.mjs +0 -3
  220. package/dist/custom-pages-DamGVA75.mjs +0 -4
  221. package/dist/d1-sK0O5THv.mjs +0 -4
  222. package/dist/data-security-DsWpoWiS.mjs +0 -6
  223. package/dist/diagnostics-CH7T2WR3.mjs +0 -3
  224. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +0 -7
  225. package/dist/dist-C6zxsVdY.mjs +0 -306
  226. package/dist/dns-firewall-VmQf3UVP.mjs +0 -57
  227. package/dist/dns-o7hUPMCG.mjs +0 -29
  228. package/dist/durable-objects-DgrTbvoF.mjs +0 -2
  229. package/dist/email-routing-owCvAEpf.mjs +0 -10
  230. package/dist/email-security-Dng3DVuf.mjs +0 -8
  231. package/dist/email-sending-bExMH4lu.mjs +0 -3
  232. package/dist/firewall-BLaTtX3r.mjs +0 -11
  233. package/dist/google-tag-gateway-DyCY43k0.mjs +0 -2
  234. package/dist/hyperdrive-DJm1eD-M.mjs +0 -18
  235. package/dist/iam-apCCcy7R.mjs +0 -6
  236. package/dist/images-Cxe45OHm.mjs +0 -7
  237. package/dist/intel-8V4h6H46.mjs +0 -3
  238. package/dist/keyless-certificates-CfJmXccT.mjs +0 -3
  239. package/dist/kv-Dz6then8.mjs +0 -5
  240. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +0 -3
  241. package/dist/load-balancers-ilsGgudX.mjs +0 -6
  242. package/dist/logpush-BH14TtuA.mjs +0 -4
  243. package/dist/logs-B8-mkf_I.mjs +0 -3
  244. package/dist/magic-cloud-networking-DylCXoG4.mjs +0 -5
  245. package/dist/magic-network-monitoring-DnyrZy77.mjs +0 -4
  246. package/dist/magic-transit-B-kU5e3s.mjs +0 -89
  247. package/dist/managed-transforms-GC9Pq5dg.mjs +0 -3
  248. package/dist/mtls-certificates-BRlhWw_G.mjs +0 -3
  249. package/dist/network-interconnects-DuyoFD9_.mjs +0 -36
  250. package/dist/oauth-B5k80sip.mjs +0 -61
  251. package/dist/observability-9APhqFHo.mjs +0 -4
  252. package/dist/organizations-Dy3kiV_z.mjs +0 -41
  253. package/dist/origin-ca-certificates-2rwPoQdG.mjs +0 -3
  254. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +0 -2
  255. package/dist/pages-5DKLs7CQ.mjs +0 -11
  256. package/dist/pipelines-DfGE44xo.mjs +0 -6
  257. package/dist/progress-CL8I-7YK.mjs +0 -2
  258. package/dist/queues-BoenUGIw.mjs +0 -6
  259. package/dist/r2-Cq_JCjK0.mjs +0 -21
  260. package/dist/r2-data-catalog-eLxltWdO.mjs +0 -14
  261. package/dist/radar-YNOCio6T.mjs +0 -2
  262. package/dist/rate-limits-CcAF3tMl.mjs +0 -5
  263. package/dist/raw-fetch-bIXC9D1m.mjs +0 -2
  264. package/dist/realtime-kit-4bCGviO5.mjs +0 -18
  265. package/dist/registrar-CfHlaOOf.mjs +0 -46
  266. package/dist/request-tracers-DlHawg5l.mjs +0 -2
  267. package/dist/resource-sharing-7FhuboJE.mjs +0 -5
  268. package/dist/resource-tagging-divcugVb.mjs +0 -16
  269. package/dist/rules-CAXkege8.mjs +0 -4
  270. package/dist/rulesets-CBsdc8IV.mjs +0 -8
  271. package/dist/rum-D0hHPNl9.mjs +0 -4
  272. package/dist/scim-CWLli4fi.mjs +0 -3
  273. package/dist/sdk-DhIhH6GB.mjs +0 -5
  274. package/dist/secrets-store-B7_HkE8I.mjs +0 -25
  275. package/dist/security-center-BQT21oiM.mjs +0 -2
  276. package/dist/session-B8r8LNQN.mjs +0 -93
  277. package/dist/speed-UYEVue28.mjs +0 -4
  278. package/dist/ssl-D3Pixs8M.mjs +0 -15
  279. package/dist/stream-BUsuOfQh.mjs +0 -14
  280. package/dist/tenants-BdWJTtcg.mjs +0 -2
  281. package/dist/turnstile-CAKVnS1L.mjs +0 -23
  282. package/dist/url-normalization-DA-RAxs4.mjs +0 -3
  283. package/dist/url-scanner-DmYu43f7.mjs +0 -2
  284. package/dist/user-Bah4wGGN.mjs +0 -10
  285. package/dist/vectorize-DhvVG2By.mjs +0 -4
  286. package/dist/waiting-rooms-DoOkT4Mu.mjs +0 -11
  287. package/dist/workers-D6IaQ_F0.mjs +0 -18
  288. package/dist/workers-builds-DYi0OMMU.mjs +0 -7
  289. package/dist/workflows-DrdXUQ2g.mjs +0 -4
  290. package/dist/zero-trust-D6V9GH2W.mjs +0 -118
  291. package/dist/zero_trust-BzXKAX_x.mjs +0 -3
  292. package/dist/zones-0MTkuaFk.mjs +0 -21
  293. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  294. /package/dist/{cli-types-DGgEbf8K.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  295. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  296. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  297. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  298. /package/dist/{metadata-MPDDi08e.mjs → metadata-Cnyws6iO.mjs} +0 -0
  299. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DTAWiEm2.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new Pipeline.`,builder:p,handler:async u=>{if(u.dryRun){i({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Pipeline.`)),u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=c({name:l(u.name,`name`,`text`),sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,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 g={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:h,handler:async s=>{if(s.dryRun){i({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}r(await a(`Deleting`,async()=>c.pipelines.delete({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.get({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).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:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...e,account_id:m})),{successLabel:`Created`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Creating`,async()=>p.pipelines.legacyCreate({...h,account_id:m})),{successLabel:`Created`})}};function x(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
4
+ `);return}r(await a(`Deleting`,async()=>c.pipelines.legacyDelete({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async s=>{if(s.dryRun){i({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.legacyGet({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:T,handler:async s=>{let c={search:s.search,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...c})),{successLabel:`Loaded`})}};function D(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).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:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async f=>{if(f.dryRun){i({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/${f[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(f[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(f[`pipeline-name`]??``)},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...e,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});r(await a(`Updating`,async()=>p.pipelines.legacyUpdate({...h,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`})}};function k(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:k,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],name:s.name};if(s.dryRun){i({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).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-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --schema-* flag is set`)}return!0})}const M={command:`create`,describe:`Create a new Sink.`,builder:j,handler:async f=>{if(f.dryRun){i({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`Defines the name of the Sink.`)),f.type===void 0&&(f.type=await u(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:l(f[`format-type`],`format-type`,`text`),compression:l(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{format:{decimal_encoding:l(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:l(f[`schema-format-type`],`schema-format-type`,`text`),compression:l(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)});r(await a(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:N,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
5
+ `);return}r(await a(`Deleting`,async()=>l.pipelines.sinks.delete({account_id:u,sink_id:s[`sink-id`],...c})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:F,handler:async s=>{if(s.dryRun){i({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.sinks.get({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List/Filter Sinks in Account.`,builder:L,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...c})),{successLabel:`Loaded`})}},z={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).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(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --schema-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const V={command:`create`,describe:`Create a new Stream.`,builder:B,handler:async u=>{if(u.dryRun){i({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Stream.`));let m=c({format:{decimal_encoding:l(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:l(u[`format-type`],`format-type`,`text`),compression:l(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:l(u.name,`name`,`text`),schema:{format:{decimal_encoding:l(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:l(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:l(u[`schema-format-type`],`schema-format-type`,`text`),compression:l(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}});r(await a(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:H,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await f({force:!!s.force})){process.stderr.write(`Aborted.
6
+ `);return}r(await a(`Deleting`,async()=>l.pipelines.streams.delete({account_id:u,stream_id:s[`stream-id`],...c})),{successLabel:`Deleted`})}};function W(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:W,handler:async s=>{if(s.dryRun){i({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.pipelines.streams.get({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).option(`name`,{type:`string`,description:`Filters streams by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List/Filter Streams in Account.`,builder:K,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.pipelines.streams.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).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)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const Y={command:`update <stream-id>`,describe:`Update a Stream.`,builder:J,handler:async l=>{if(l.dryRun){i({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/streams/${l[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(l[`stream-id`]))}`,pathParams:{"stream-id":String(l[`stream-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}}):s(l.body)});return}let u=await n(l),d=l.local?o:await t();if(l.accountId=d,l.body){let e=s(l.body);r(await a(`Updating`,async()=>u.pipelines.streams.update({...e,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`});return}let f=c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}});r(await a(`Updating`,async()=>u.pipelines.streams.update({...f,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`})}},X={command:`streams`,describe:`Operations for streams`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).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:`validate-sql`,describe:`Validates that the Pipelines SQL is correct.`,builder:Z,handler:async u=>{if(u.dryRun){i({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({sql:l(u.sql,`sql`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);r(await a(`Creating`,async()=>f.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL to validate.`));let m=c({sql:l(u.sql,`sql`,`text`)});r(await a(`Creating`,async()=>f.pipelines.validateSql({...m,account_id:p})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(Q).command(z).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{a as e,t}from"./session-B1ARgLG7.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-B7hsuvbF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e,y as t}from"./session-B8r8LNQN.mjs";import{n,t as r}from"./theme-DbNbIY4d.mjs";import{S as i,f as a}from"./oauth-B5k80sip.mjs";import{i as o,o as s,r as c,t as l}from"./dist-B7hsuvbF.mjs";function u(){e(t)}async function d(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
2
+ import{a as e,t}from"./session-B1ARgLG7.mjs";import{n,t as r}from"./theme-DbNbIY4d.mjs";import{C as i,p as a}from"./oauth-DBJ5GSFk.mjs";import{i as o,o as s,r as c,t as l}from"./dist-B7hsuvbF.mjs";function u(){t(e)}async function d(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
3
3
  `)?t.slice(0,-1):t}async function f(e,t,n){let r=n?.kind??`text`;if(a()){if(r===`secret`){let t=await d();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let o=`Enter value for --${e}`,l=t||n?.question||o;u();let f=r===`secret`?await c({message:l,mask:`•`,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`}):await s({message:l,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`});return(i(f)||typeof f!=`string`)&&process.exit(130),f}async function p(e,t,n){if(a())throw Error(`--${e} is required (one of: ${n.join(`, `)}). Pass --${e} <value> or run interactively.`);let r=`Select value for --${e}`,s=t||r;u();let c=await o({message:s,options:n.map(e=>({value:e,label:e}))});return(i(c)||typeof c!=`string`)&&process.exit(130),c}async function m(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(a()){let e=n();return process.stderr.write(`${e.hex(r.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}u();let o=await l({message:t,initialValue:!1});return i(o)&&process.exit(130),o===!0}export{p as n,f as r,m as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{t as u}from"./prompt-DTAWiEm2.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:d,handler:async c=>{if(c.dryRun){i({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await n(c),u=c.local?o:await t();if(c.accountId=u,c.body){let e=s(c.body);r(await a(`Creating`,async()=>l.queries.bulk.create({...e,account_id:u})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>l.queries.bulk.create({account_id:u})),{successLabel:`Created`})}},p={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).option(`max-time`,{type:`string`,description:`The max_time field`}).option(`min-time`,{type:`string`,description:`The min_time field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Return a success message after creating new saved string queries`,builder:m,handler:async u=>{let d={id:u.id,tag:u.tag,scan:u.scan};if(u.dryRun){i({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:d,bodyKind:`json`,body:u.body===void 0?c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)}):s(u.body)});return}let f=await n(u),p=u.local?o:await t();if(u.accountId=p,u.body){let e=s(u.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...e,account_id:p,...d})),{successLabel:`Created`});return}let m=c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`)});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r(await a(`Creating`,async()=>f.queries.create({...m,account_id:p,...d})),{successLabel:`Created`})}};function g(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).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 _={command:`delete`,describe:`Return a success message after deleting saved string queries by ID`,builder:g,handler:async s=>{let c={id:s.id,tag:s.tag,scan:s.scan};if(s.dryRun){i({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),d=s.local?o:await t();if(s.accountId=d,!await u({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}r(await a(`Deleting`,async()=>l.queries.delete({account_id:d,...c})),{successLabel:`Deleted`})}},v={command:`queries`,describe:`queries`,builder:e=>e.command(h).command(_).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{n as d,r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function h(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const ee={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)}):c(n.body)});return}let p=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}n.type===void 0&&(n.type=await d(`type`,`The type field`,[`worker`,`http_pull`])),n.type===`worker`&&n[`script-name`]===void 0&&(n[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)});i(await o(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>c.queues.consumers.delete({account_id:l,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:v,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.get({account_id:l,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Returns the consumers for a Queue`,builder:b,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.list({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const C={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:S,handler:async n=>{if(n.dryRun){a({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/consumers/${n[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(n[`consumer-id`]))}`,pathParams:{"consumer-id":String(n[`consumer-id`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)}):c(n.body)});return}let p=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Updated`});return}n.type===void 0&&(n.type=await d(`type`,`The type field`,[`worker`,`http_pull`])),n.type===`worker`&&n[`script-name`]===void 0&&(n[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(n[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(n[`script-name`],`script-name`,`text`),settings:{batch_size:n[`settings-batch-size`],max_concurrency:n[`settings-max-concurrency`],max_retries:n[`settings-max-retries`],max_wait_time_ms:n[`settings-max-wait-time-ms`],retry_delay:n[`settings-retry-delay`],visibility_timeout_ms:n[`settings-visibility-timeout-ms`]},type:u(n.type,`type`,`text`)});i(await o(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:n[`queue-id`],consumer_id:n[`consumer-id`]})),{successLabel:`Updated`})}},w={command:`consumers`,describe:`Operations for consumers`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`queue-name`,{type:`string`,description:`The queue_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)`})}const E={command:`create`,describe:`Create a new queue`,builder:T,handler:async n=>{if(n.dryRun){a({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({queue_name:u(n[`queue-name`],`queue-name`,`text`)}):c(n.body)});return}let d=await r(n),p=n.local?s:await t();if(n.accountId=p,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.queues.create({...e,account_id:p})),{successLabel:`Created`});return}n[`queue-name`]===void 0&&(n[`queue-name`]=await f(`queue-name`,`The queue_name field`));let m=l({queue_name:u(n[`queue-name`],`queue-name`,`text`)});i(await o(`Creating`,async()=>d.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:D,handler:async n=>{if(n.dryRun){a({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
4
+ `);return}i(await o(`Deleting`,async()=>c.queues.delete({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:k,handler:async n=>{if(n.dryRun){a({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.queues.edit({body:e,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>d.queues.edit({body:p,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:j,handler:async n=>{if(n.dryRun){a({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.get({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the queues owned by an account.`,builder:N,handler:async n=>{if(n.dryRun){a({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:F,handler:async n=>{if(n.dryRun){a({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:c(n.body)});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.queues.messages.ackPreview({...e,account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.queues.messages.ackPreview({account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function L(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:L,handler:async n=>{if(n.dryRun){a({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:c(n.body)});return}let l=await r(n),u=n.local?s:await t();if(n.accountId=u,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.queues.messages.ack({...e,account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.queues.messages.ack({account_id:u,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).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:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:z,handler:async n=>{if(n.dryRun){a({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delay_seconds:n[`delay-seconds`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.bulkPush({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:n[`delay-seconds`]});i(await o(`Creating`,async()=>u.queues.messages.bulkPush({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`extendLeases <queue-id>`,describe:"Extend the lease on a message. This creates a new lease ID on your message without incrementing the message's `attempts` counter.",builder:V,handler:async n=>{if(n.dryRun){a({command:`cf queues messages extendLeases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({visibility_timeout_ms:n[`visibility-timeout-ms`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.extendLeases({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({visibility_timeout_ms:n[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>u.queues.messages.extendLeases({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`peek <queue-id>`,describe:`Peek messages from a Queue without leasing them. Messages remain available for subsequent peek or pull operations.`,builder:U,handler:async n=>{if(n.dryRun){a({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.peek({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:n[`batch-size`]});i(await o(`Creating`,async()=>u.queues.messages.peek({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function W(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:W,handler:async n=>{if(n.dryRun){a({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Loading`,async()=>u.queues.messages.preview({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Loaded`});return}let f=l({batch_size:n[`batch-size`]});i(await o(`Loading`,async()=>u.queues.messages.preview({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).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:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:K,handler:async n=>{if(n.dryRun){a({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({batch_size:n[`batch-size`],visibility_timeout_ms:n[`visibility-timeout-ms`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.pull({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:n[`batch-size`],visibility_timeout_ms:n[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>u.queues.messages.pull({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`purge <queue-id>`,describe:`Delete peeked messages from a Queue by their ref. Purged messages aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:J,handler:async l=>{if(l.dryRun){a({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await r(l),d=l.local?s:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>u.queues.messages.purge({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>n(u,`POST`,`/accounts/${d}/queues/${encodeURIComponent(String(l[`queue-id`]))}/messages/purge`)),{successLabel:`Created`})}};function X(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:X,handler:async n=>{if(n.dryRun){a({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/messages`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delay_seconds:n[`delay-seconds`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Creating`,async()=>u.queues.messages.push({body:e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:n[`delay-seconds`]});i(await o(`Creating`,async()=>u.queues.messages.push({body:f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Created`})}},Q={command:`messages`,describe:`Operations for messages`,builder:e=>e.command(R).command(I).command(B).command(H).command(te).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).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 re={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:ne,handler:async n=>{if(n.dryRun){a({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/purge`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({delete_messages_permanently:n[`delete-messages-permanently`]}):c(n.body)});return}let u=await r(n),d=n.local?s:await t();if(n.accountId=d,!await p({force:!!n.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
5
+ `);return}if(n.body){let e=c(n.body);i(await o(`Deleting`,async()=>u.queues.purge.start({...e,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Deleted`});return}let f=l({delete_messages_permanently:n[`delete-messages-permanently`]});i(await o(`Deleting`,async()=>u.queues.purge.start({...f,account_id:d,queue_id:n[`queue-id`]})),{successLabel:`Deleted`})}};function ie(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:ie,handler:async n=>{if(n.dryRun){a({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}/purge`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.purge.status({account_id:l,queue_id:n[`queue-id`]})),{successLabel:`Loaded`})}},oe={command:`purge`,describe:`Operations for purge`,builder:e=>e.command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workers.script`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-script-tag`,{type:`string`,description:`Tag of the Worker script`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).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(`source-model-name`,[`source-worker-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-script-tag`,[`source-model-name`,`source-worker-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`,`source-script-tag`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const ce={command:`create`,describe:`Create a new event subscription for a queue`,builder:se,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`),source:{type:u(n[`source-type`],`source-type`,`text`),model_name:u(n[`source-model-name`],`source-model-name`,`text`),worker_name:u(n[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(n[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(n[`source-workflow-name`],`source-workflow-name`,`text`)}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>d.queues.subscriptions.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`),source:{type:u(n[`source-type`],`source-type`,`text`),model_name:u(n[`source-model-name`],`source-model-name`,`text`),worker_name:u(n[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(n[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(n[`source-workflow-name`],`source-workflow-name`,`text`)}});i(await o(`Creating`,async()=>d.queues.subscriptions.create({...p,account_id:f})),{successLabel:`Created`})}};function le(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ue={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:le,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions/${n[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(n[`subscription-id`]))}`,pathParams:{"subscription-id":String(n[`subscription-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
6
+ `);return}i(await o(`Deleting`,async()=>c.queues.subscriptions.delete({account_id:l,subscription_id:n[`subscription-id`]})),{successLabel:`Deleted`})}};function de(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:de,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions/${n[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(n[`subscription-id`]))}`,pathParams:{"subscription-id":String(n[`subscription-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.queues.subscriptions.get({account_id:l,subscription_id:n[`subscription-id`]})),{successLabel:`Loaded`})}};function pe(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:m(pe),handler:async n=>{let c={page:n.page,per_page:n[`per-page`],order:n.order,direction:n.direction};if(n.dryRun){a({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.queues.subscriptions.list({account_id:u,...c})),{successLabel:`Loaded`})}};function me(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).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)`}).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const he={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:me,handler:async n=>{if(n.dryRun){a({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_subscriptions/subscriptions/${n[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(n[`subscription-id`]))}`,pathParams:{"subscription-id":String(n[`subscription-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`)}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.queues.subscriptions.update({...e,account_id:f,subscription_id:n[`subscription-id`]})),{successLabel:`Updated`});return}let p=l({destination:{queue_id:u(n[`destination-queue-id`],`destination-queue-id`,`text`),type:u(n[`destination-type`],`destination-type`,`text`)},enabled:n.enabled,events:n.events,name:u(n.name,`name`,`text`)});i(await o(`Updating`,async()=>d.queues.subscriptions.update({...p,account_id:f,subscription_id:n[`subscription-id`]})),{successLabel:`Updated`})}},ge={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(ce).command(ue).command(fe).command($).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:_e,handler:async n=>{if(n.dryRun){a({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}}):c(n.body)});return}let d=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Updating`,async()=>d.queues.update({body:e,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(n[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:n[`settings-delivery-delay`],delivery_paused:n[`settings-delivery-paused`],message_retention_period:n[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>d.queues.update({body:p,account_id:f,queue_id:n[`queue-id`]})),{successLabel:`Updated`})}},ye={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(ve).command(w).command(Q).command(oe).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ye as default};
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 g={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:h,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:_,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function te(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:te,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){a({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await r(l),f=l.local?s:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},y={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(g).command(ee).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`location-hint`,{type:`string`,description:`Location of the bucket.`,choices:[`apac`,`eeur`,`enam`,`weur`,`wnam`,`oc`]}).option(`name`,{type:`string`,description:`Name of the bucket.`}).option(`storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,choices:[`Standard`,`InfrequentAccess`],default:`Standard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new R2 bucket.`,builder:b,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({locationHint:d(f[`location-hint`],`location-hint`,`text`),name:d(f.name,`name`,`text`),storageClass:d(f[`storage-class`],`storage-class`,`text`)}):c(f.body)});return}let h=await r(f),g=f.local?s:await t();if(f.accountId=g,f.body){let e=c(f.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await p(`name`,`Name of the bucket.`));let _={};f[`location-hint`]!==void 0&&l(_,[`locationHint`],d(f[`location-hint`],`location-hint`,`text`)),f.name!==void 0&&l(_,[`name`],d(f.name,`name`,`text`)),f[`storage-class`]!==void 0&&l(_,[`storageClass`],d(f[`storage-class`],`storage-class`,`text`)),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function S(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:S,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
+ `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function w(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`domain`,{type:`string`,description:`Name of the custom domain to be added.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`zone-id`,{type:`string`,description:`Zone ID of the custom domain.`}).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 T={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:w,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,domain:d(f.domain,`domain`,`text`),enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`),zoneId:d(f[`zone-id`],`zone-id`,`text`)}):c(f.body)});return}let h=await r(f),g=f.local?s:await t();if(f.accountId=g,f.body){let e=c(f.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}if(f.domain===void 0&&(f.domain=await p(`domain`,`Name of the custom domain to be added.`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f[`zone-id`]===void 0&&(f[`zone-id`]=await p(`zone-id`,`Zone ID of the custom domain.`));let _={};f.ciphers!==void 0&&l(_,[`ciphers`],f.ciphers),f.domain!==void 0&&l(_,[`domain`],d(f.domain,`domain`,`text`)),f.enabled!==void 0&&l(_,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(_,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),f[`zone-id`]!==void 0&&l(_,[`zoneId`],d(f[`zone-id`],`zone-id`,`text`)),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function E(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 D={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:E,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
5
+ `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function O(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:O,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:A,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function M(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the specified custom domain.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:M,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${f.domain==null?`<domain>`:encodeURIComponent(String(f.domain))}`,pathParams:{"bucket-name":String(f[`bucket-name`]??``),domain:String(f.domain??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`)}):c(f.body)});return}let m=await r(f),h=f.local?s:await t();if(f.accountId=h,f.body){let e=c(f.body);i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.ciphers!==void 0&&l(g,[`ciphers`],f.ciphers),f.enabled!==void 0&&l(g,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(g,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},P={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:F,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function L(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the r2.dev domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:L,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){a({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({enabled:d.enabled}):c(d.body)});return}let p=await r(d),m=d.local?s:await t();if(d.accountId=m,d.body){let e=c(d.body);i(await o(`Updating`,async()=>n(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}if(d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};d.enabled!==void 0&&l(h,[`enabled`],d.enabled),i(await o(`Updating`,async()=>n(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},z={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(P).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:V,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){a({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Updating`,async()=>n(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rule-ids`,{type:`string`,array:!0,description:`Array of rule ids to delete.`}).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 W={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:U,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){a({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_notifications/r2/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}`,pathParams:{"queue-id":String(d[`queue-id`]??``),"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({ruleIds:d[`rule-ids`]}):c(d.body)});return}let p=await r(d),h=d.local?s:await t();if(d.accountId=h,!await m({force:!!d.force})){process.stderr.write(`Aborted.
6
+ `);return}if(d.body){let e=c(d.body);i(await o(`Deleting`,async()=>n(p,`DELETE`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`});return}let g={};d[`rule-ids`]!==void 0&&l(g,[`ruleIds`],d[`rule-ids`]),i(await o(`Deleting`,async()=>n(p,`DELETE`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`})}};function G(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`The bucket jurisdiction.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <queue-id>`,describe:`Get a single event notification rule.`,builder:G,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_notifications/r2/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}`,pathParams:{"queue-id":String(c[`queue-id`]??``),"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(c[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function q(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List all event notification rules for a bucket.`,builder:q,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_notifications/r2/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`update <queue-id>`,describe:`Create event notification rule.`,builder:Y,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){a({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_notifications/r2/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}`,pathParams:{"queue-id":String(l[`queue-id`]??``),"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await r(l),f=l.local?s:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(l[`queue-id`]))}`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(l[`queue-id`]))}`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},Z={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <bucket-name>`,describe:`Gets properties of an existing R2 bucket.`,builder:Q,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function re(e){return e.positional(`job-id`,{type:`string`,description:`Identifier returned when the background job was submitted.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <job-id>`,describe:"Gets the current status of a background job for an R2 bucket. Poll this endpoint with the job identifier returned when the operation was submitted until the status is `COMPLETED`, `FAILED`, or `CANCELLED`.",builder:re,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"job-id":String(c[`job-id`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs/${encodeURIComponent(String(c[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ae(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`job-type`,{type:`string`,description:`Restricts results to jobs of the specified type.`,choices:[`prefixDelete`]}).option(`status`,{type:`string`,description:"Restricts results to jobs with the specified status. `jobType` is required when this parameter is provided.",choices:[`ENQUEUED`,`RUNNING`,`COMPLETED`,`FAILED`,`CANCELLED`]}).option(`max-keys`,{type:`number`,description:`Maximum number of jobs to return.`}).option(`continuation-token`,{type:`string`,description:"Pagination token received as `nextContinuationToken` in the previous response."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Lists background jobs for an R2 bucket. Use this endpoint to poll jobs returned by asynchronous operations such as deleting objects by prefix or emptying a bucket.`,builder:ae,handler:async c=>{let l={jobType:c[`job-type`],status:c.status,maxKeys:c[`max-keys`],continuationToken:c[`continuation-token`]},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await r(c),f=c.local?s:await t();c.accountId=f,i(await o(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}},se={command:`jobs`,describe:`Operations for buckets.jobs`,builder:e=>e.command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get <bucket-name>`,describe:`Get object lifecycle rules for a bucket.`,builder:ce,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ue(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 <bucket-name>`,describe:`Set the object lifecycle rules for a bucket.`,builder:ue,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){a({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await r(l),f=l.local?s:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},fe={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(le).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`name-contains`,{type:`string`,description:`Bucket names to filter by. Only buckets with this phrase in their name will be returned.`}).option(`start-after`,{type:`string`,description:`Bucket name to start searching after. Buckets are ordered lexicographically.`}).option(`per-page`,{type:`number`,description:`Maximum number of buckets to return in a single call.`}).option(`order`,{type:`string`,description:`Field to order buckets by.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`Direction to order buckets.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor received during the last List Buckets call. R2 buckets are paginated using cursors instead of page numbers.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Lists all R2 buckets on your account.`,builder:pe,handler:async c=>{let l={name_contains:c[`name-contains`],start_after:c[`start-after`],per_page:c[`per-page`],order:c.order,direction:c.direction,cursor:c.cursor},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets`,pathParams:{},query:l,bodyKind:`none`});return}let d=await r(c),f=c.local?s:await t();c.accountId=f,i(await o(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}};function he(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get <bucket-name>`,describe:`Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:he,handler:async n=>{if(n.dryRun){a({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.r2.buckets.localUploads.get({account_id:l,bucket_name:n[`bucket-name`]})),{successLabel:`Loaded`})}};function _e(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <bucket-name>`,describe:`Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:_e,handler:async n=>{if(n.dryRun){a({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?u({enabled:n.enabled}):c(n.body)});return}let l=await r(n),d=n.local?s:await t();if(n.accountId=d,n.body){let e=c(n.body);i(await o(`Updating`,async()=>l.r2.buckets.localUploads.update({...e,account_id:d,bucket_name:n[`bucket-name`]})),{successLabel:`Updated`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=u({enabled:n.enabled});i(await o(`Updating`,async()=>l.r2.buckets.localUploads.update({...f,account_id:d,bucket_name:n[`bucket-name`]})),{successLabel:`Updated`})}},ye={command:`local-uploads`,describe:`Operations for buckets.local-uploads`,builder:e=>e.command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <bucket-name>`,describe:`Get lock rules for a bucket.`,builder:be,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Se(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ce={command:`update <bucket-name>`,describe:`Set lock rules for a bucket.`,builder:Se,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){a({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await r(l),f=l.local?s:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},we={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(xe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`list`,describe:`Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`,builder:Te,handler:async n=>{if(n.dryRun){a({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.r2.buckets.metrics.list({account_id:l})),{successLabel:`Loaded`})}},De={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ke={command:`delete <bucket-name>`,describe:`Disables Sippy on this bucket.`,builder:Oe,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
7
+ `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function Ae(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`get <bucket-name>`,describe:`Gets configuration for Sippy for an existing R2 bucket.`,builder:Ae,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Me(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`destination-access-key-id`,{type:`string`,description:`ID of a Cloudflare API token.
8
+ This is the value labelled "Access Key ID" when creating an API.
9
+ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
10
+
11
+ Sippy will use this token when writing objects to R2, so it is
12
+ best to scope this token to the bucket you're enabling Sippy for.
13
+ `}).option(`destination-provider`,{type:`string`,description:`The destination.provider field`,choices:[`r2`]}).option(`destination-secret-access-key`,{type:`string`,description:`Value of a Cloudflare API token.
14
+ This is the value labelled "Secret Access Key" when creating an API.
15
+ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
16
+
17
+ Sippy will use this token when writing objects to R2, so it is
18
+ best to scope this token to the bucket you're enabling Sippy for.
19
+ `}).option(`source-access-key-id`,{type:`string`,description:`Access Key ID of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-bucket`,{type:`string`,description:`Name of the AWS S3 bucket.`}).option(`source-provider`,{type:`string`,description:`The source.provider field`,choices:[`aws`,`gcs`,`s3`,`azure`]}).option(`source-region`,{type:`string`,description:`Name of the AWS availability zone.`}).option(`source-secret-access-key`,{type:`string`,description:`Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-client-email`,{type:`string`,description:`Client email of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-private-key`,{type:`string`,description:`Private Key of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-bucket-url`,{type:`string`,description:`URL to the S3-compatible API of the bucket.`}).option(`source-account-key`,{type:`string`,description:`Access key for the Azure Storage account. Mutually exclusive with sasToken.`}).option(`source-account-name`,{type:`string`,description:`Name of the Azure Storage account.`}).option(`source-container`,{type:`string`,description:`Name of the Azure Blob Storage container.`}).option(`source-sas-token`,{type:`string`,description:`Shared Access Signature token for the Azure Storage account. Mutually exclusive with accountKey.`}).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(`source-bucket`,[`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-region`,[`source-client-email`,`source-private-key`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-client-email`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-private-key`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-bucket-url`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-account-key`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-account-name`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-container`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-sas-token`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`])}const Ne={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Me,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({destination:{accessKeyId:d(f[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:d(f[`destination-provider`],`destination-provider`,`text`),secretAccessKey:d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:d(f[`source-access-key-id`],`source-access-key-id`,`text`),bucket:d(f[`source-bucket`],`source-bucket`,`text`),provider:d(f[`source-provider`],`source-provider`,`text`),region:d(f[`source-region`],`source-region`,`text`),secretAccessKey:d(f[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:d(f[`source-client-email`],`source-client-email`,`text`),privateKey:d(f[`source-private-key`],`source-private-key`,`text`),bucketUrl:d(f[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:d(f[`source-account-key`],`source-account-key`,`text`),accountName:d(f[`source-account-name`],`source-account-name`,`text`),container:d(f[`source-container`],`source-container`,`text`),sasToken:d(f[`source-sas-token`],`source-sas-token`,`text`)}}):c(f.body)});return}let m=await r(f),h=f.local?s:await t();if(f.accountId=h,f.body){let e=c(f.body);i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f[`destination-access-key-id`]!==void 0&&l(g,[`destination`,`accessKeyId`],d(f[`destination-access-key-id`],`destination-access-key-id`,`text`)),f[`destination-provider`]!==void 0&&l(g,[`destination`,`provider`],d(f[`destination-provider`],`destination-provider`,`text`)),f[`destination-secret-access-key`]!==void 0&&l(g,[`destination`,`secretAccessKey`],d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),f[`source-access-key-id`]!==void 0&&l(g,[`source`,`accessKeyId`],d(f[`source-access-key-id`],`source-access-key-id`,`text`)),f[`source-bucket`]!==void 0&&l(g,[`source`,`bucket`],d(f[`source-bucket`],`source-bucket`,`text`)),f[`source-provider`]!==void 0&&l(g,[`source`,`provider`],d(f[`source-provider`],`source-provider`,`text`)),f[`source-region`]!==void 0&&l(g,[`source`,`region`],d(f[`source-region`],`source-region`,`text`)),f[`source-secret-access-key`]!==void 0&&l(g,[`source`,`secretAccessKey`],d(f[`source-secret-access-key`],`source-secret-access-key`,`text`)),f[`source-client-email`]!==void 0&&l(g,[`source`,`clientEmail`],d(f[`source-client-email`],`source-client-email`,`text`)),f[`source-private-key`]!==void 0&&l(g,[`source`,`privateKey`],d(f[`source-private-key`],`source-private-key`,`text`)),f[`source-bucket-url`]!==void 0&&l(g,[`source`,`bucketUrl`],d(f[`source-bucket-url`],`source-bucket-url`,`text`)),f[`source-account-key`]!==void 0&&l(g,[`source`,`accountKey`],d(f[`source-account-key`],`source-account-key`,`text`)),f[`source-account-name`]!==void 0&&l(g,[`source`,`accountName`],d(f[`source-account-name`],`source-account-name`,`text`)),f[`source-container`]!==void 0&&l(g,[`source`,`container`],d(f[`source-container`],`source-container`,`text`)),f[`source-sas-token`]!==void 0&&l(g,[`source`,`sasToken`],d(f[`source-sas-token`],`source-sas-token`,`text`)),i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Pe={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fe={command:`buckets`,describe:`Operations for buckets`,builder:e=>e.command(x).command(C).command(H).command(ne).command(me).command(y).command(B).command(Z).command(se).command(fe).command(ye).command(we).command(De).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`keys`,{type:`string`,array:!0,description:`The keys field`}).option(`path-prefix`,{type:`string`,description:`The pathPrefix field`}).option(`region`,{type:`string`,description:`The region field`}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`secret-client-email`,{type:`string`,description:`The secret.clientEmail field`}).option(`secret-private-key`,{type:`string`,description:`The secret.privateKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).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(`endpoint`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`region`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`secret-access-key-id`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-secret-access-key`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-client-email`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`secret-private-key`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`jurisdiction`,[`endpoint`,`region`,`secret-client-email`,`secret-private-key`])}const Le={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:Ie,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({bucket:d(n.bucket,`bucket`,`text`),endpoint:d(n.endpoint,`endpoint`,`text`),keys:n.keys,pathPrefix:d(n[`path-prefix`],`path-prefix`,`text`),region:d(n.region,`region`,`text`),secret:{accessKeyId:d(n[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(n[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(n[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(n[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(n.vendor,`vendor`,`text`),jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`)}):c(n.body)});return}let l=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:m})),{successLabel:`Updated`});return}n.bucket===void 0&&(n.bucket=await p(`bucket`,`The bucket field`)),n.vendor===void 0&&(n.vendor=await f(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let h=u({bucket:d(n.bucket,`bucket`,`text`),endpoint:d(n.endpoint,`endpoint`,`text`),keys:n.keys,pathPrefix:d(n[`path-prefix`],`path-prefix`,`text`),region:d(n.region,`region`,`text`),secret:{accessKeyId:d(n[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(n[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(n[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(n[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(n.vendor,`vendor`,`text`),jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`)});i(await o(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:h,account_id:m})),{successLabel:`Updated`})}};function Re(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ze={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:Re,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({bucket:d(n.bucket,`bucket`,`text`),jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(n[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(n[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(n.vendor,`vendor`,`text`)}):c(n.body)});return}let l=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:m})),{successLabel:`Updated`});return}n.bucket===void 0&&(n.bucket=await p(`bucket`,`The bucket field`)),n[`secret-access-key-id`]===void 0&&(n[`secret-access-key-id`]=await p(`secret-access-key-id`,`The secret.accessKeyId field`)),n[`secret-secret-access-key`]===void 0&&(n[`secret-secret-access-key`]=await p(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),n.vendor===void 0&&(n.vendor=await f(`vendor`,`The vendor field`,[`r2`]));let h=u({bucket:d(n.bucket,`bucket`,`text`),jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(n[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(n[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(n.vendor,`vendor`,`text`)});i(await o(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:h,account_id:m})),{successLabel:`Updated`})}},Be={command:`connectivity-precheck`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const He={command:`abort-all`,describe:`Cancels all running R2 Super Slurper migration jobs for the account. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:Ve,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
20
+ `);return}i(await o(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})}};function Ue(e){return e.positional(`job-id`,{type:`string`,description:`Job 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 We={command:`abort <job-id>`,describe:`Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:Ue,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}/abort`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();if(n.accountId=l,!await m({force:!!n.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
21
+ `);return}i(await o(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:n[`job-id`]})),{successLabel:`Deleted`})}};function Ge(e){return e.option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`fedramp`]}).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0)){let t=[`source-bucket`,`source-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0}).check(e=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --target-* flag is set`)}return!0})}const Ke={command:`create`,describe:`Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`,builder:Ge,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({overwrite:n.overwrite,source:{bucket:d(n[`source-bucket`],`source-bucket`,`text`),endpoint:d(n[`source-endpoint`],`source-endpoint`,`text`),keys:n[`source-keys`],pathPrefix:d(n[`source-path-prefix`],`source-path-prefix`,`text`),region:d(n[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(n[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(n[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(n[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(n[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(n[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(n[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(n[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(n[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(n[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(n[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(n[`target-vendor`],`target-vendor`,`text`)}}):c(n.body)});return}let l=await r(n),f=n.local?s:await t();if(n.accountId=f,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.r2.superSlurper.jobs.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({overwrite:n.overwrite,source:{bucket:d(n[`source-bucket`],`source-bucket`,`text`),endpoint:d(n[`source-endpoint`],`source-endpoint`,`text`),keys:n[`source-keys`],pathPrefix:d(n[`source-path-prefix`],`source-path-prefix`,`text`),region:d(n[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(n[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(n[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(n[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(n[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(n[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(n[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(n[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(n[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(n[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(n[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(n[`target-vendor`],`target-vendor`,`text`)}});i(await o(`Creating`,async()=>l.r2.superSlurper.jobs.create({...p,account_id:f})),{successLabel:`Created`})}};function qe(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:qe,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.r2.superSlurper.jobs.get({account_id:l,job_id:n[`job-id`]})),{successLabel:`Loaded`})}};function $(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:$,handler:async n=>{let c={limit:n.limit,offset:n.offset};if(n.dryRun){a({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.r2.superSlurper.jobs.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Xe(e){return e.option(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:Xe,handler:async n=>{let c={limit:n.limit,offset:n.offset};if(n.dryRun){a({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}/logs`,pathParams:{"job-id":String(n[`job-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(n),u=n.local?s:await t();n.accountId=u,i(await o(`Loading`,async()=>l.r2.superSlurper.jobs.logs.list({account_id:u,job_id:n[`job-id`],...c})),{successLabel:`Loaded`})}},Qe={command:`logs`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $e(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:$e,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}/pause`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.r2.superSlurper.jobs.pause({account_id:l,job_id:n[`job-id`]})),{successLabel:`Updated`})}};function tt(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const nt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:tt,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}/progress`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Loading`,async()=>c.r2.superSlurper.jobs.progress({account_id:l,job_id:n[`job-id`]})),{successLabel:`Loaded`})}};function rt(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:rt,handler:async n=>{if(n.dryRun){a({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/slurper/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}/resume`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let c=await r(n),l=n.local?s:await t();n.accountId=l,i(await o(`Updating`,async()=>c.r2.superSlurper.jobs.resume({account_id:l,job_id:n[`job-id`]})),{successLabel:`Updated`})}},at={command:`jobs`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(We).command(He).command(Ke).command(Je).command(Ye).command(et).command(nt).command(it).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ot={command:`super-slurper`,describe:`Operations for super-slurper`,builder:e=>e.command(Be).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`The parent access key id to use for signing.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`How long the credentials will live for in seconds.`,default:900}).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 ct={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:st,handler:async n=>{if(n.dryRun){a({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:n.body===void 0?u({bucket:d(n.bucket,`bucket`,`text`),objects:n.objects,parentAccessKeyId:d(n[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:d(n.permission,`permission`,`text`),prefixes:n.prefixes,ttlSeconds:n[`ttl-seconds`]}):c(n.body)});return}let l=await r(n),m=n.local?s:await t();if(n.accountId=m,n.body){let e=c(n.body);i(await o(`Creating`,async()=>l.r2.temporaryCredentials.create({...e,account_id:m})),{successLabel:`Created`});return}if(n.bucket===void 0&&(n.bucket=await p(`bucket`,`Name of the R2 bucket.`)),n[`parent-access-key-id`]===void 0&&(n[`parent-access-key-id`]=await p(`parent-access-key-id`,`The parent access key id to use for signing.`)),n.permission===void 0&&(n.permission=await f(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),n[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let h=u({bucket:d(n.bucket,`bucket`,`text`),objects:n.objects,parentAccessKeyId:d(n[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:d(n.permission,`permission`,`text`),prefixes:n.prefixes,ttlSeconds:n[`ttl-seconds`]});i(await o(`Creating`,async()=>l.r2.temporaryCredentials.create({...h,account_id:m})),{successLabel:`Created`})}},lt={command:`temporary-credentials`,describe:`Operations for temporary-credentials`,builder:e=>e.command(ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ut={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(Fe).command(ot).command(lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ut as default};
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async d=>{if(d.dryRun){i({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({token:l(d.token,`token`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}d.token===void 0&&(d.token=await u(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=c({token:l(d.token,`token`,`text`)});r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Operations for credentials`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:h,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
3
+ `);return}r(await a(`Deleting`,async()=>l.r2DataCatalog.delete({account_id:u,bucket_name:s[`bucket-name`],...c})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
4
+ `);return}r(await a(`Deleting`,async()=>c.r2DataCatalog.disable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.r2DataCatalog.enable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Created`})}};function x(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:C,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.list({account_id:l})),{successLabel:`Loaded`})}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.maintenanceConfigs.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const O={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:D,handler:async u=>{if(u.dryRun){i({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`});return}let p=c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}});r(await a(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`})}},k={command:`maintenance-configs`,describe:`Operations for maintenance-configs`,builder:e=>e.command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
5
+ Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.
6
+ Defaults to 100, maximum 1000.`}).option(`parent`,{type:`string`,description:`Parent namespace to filter by. Only returns direct children of this namespace.
7
+ For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics").
8
+ Omit this parameter to list top-level namespaces.`}).option(`return-uuids`,{type:`boolean`,description:`Whether to include namespace UUIDs in the response.
9
+ Set to true to receive the namespace_uuids array.`}).option(`return-details`,{type:`boolean`,description:`Whether to include additional metadata (timestamps).
10
+ When true, response includes created_at and updated_at arrays.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Returns a list of namespaces in the specified R2 catalog. Supports hierarchical filtering and pagination for efficient traversal of large namespace hierarchies.`,builder:A,handler:async s=>{let c={page_token:s[`page-token`],page_size:s[`page-size`],parent:s.parent,return_uuids:s[`return-uuids`],return_details:s[`return-details`]};if(s.dryRun){i({command:`cf r2-data-catalog namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/namespaces`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.r2DataCatalog.namespaces.list({account_id:u,bucket_name:s[`bucket-name`],...c})),{successLabel:`Loaded`})}};function M(e){return e.positional(`table-name`,{type:`string`,description:`The table name within the given namespace.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier.
11
+ For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics").`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <table-name>`,describe:"Returns full Apache Iceberg metadata for a single table: schema, partition specs, sort orders, properties, and recent snapshot history. Designed for catalog introspection UIs that need per-table details without holding R2 credentials. The `metadata.snapshots`, `metadata.snapshot-log`, and `metadata.metadata-log` arrays are pruned to the most recent 10 entries by `timestamp-ms`. Use `total_snapshots` and `returned_snapshots` to surface the truncation to end users.",builder:M,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog namespaces tables get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/tables/${s[`table-name`]==null?`<table-name>`:encodeURIComponent(String(s[`table-name`]))}`,pathParams:{"bucket-name":String(s[`bucket-name`]??``),namespace:String(s.namespace??``),"table-name":String(s[`table-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.namespaces.tables.get({account_id:l,bucket_name:s[`bucket-name`],namespace:s.namespace,table_name:s[`table-name`]})),{successLabel:`Loaded`})}};function P(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier.
12
+ For nested namespaces, use %1F as separator (e.g., "bronze%1Fanalytics").`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
13
+ Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of tables to return per page.
14
+ Defaults to 100, maximum 1000.`}).option(`return-uuids`,{type:`boolean`,description:`Whether to include table UUIDs in the response.
15
+ Set to true to receive the table_uuids array.`}).option(`return-details`,{type:`boolean`,description:`Whether to include additional metadata (timestamps, locations).
16
+ When true, response includes created_at, updated_at, metadata_locations, and locations arrays.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Returns a list of tables in the specified namespace within an R2 catalog. Supports pagination for efficient traversal of large table collections.`,builder:P,handler:async s=>{let c={page_token:s[`page-token`],page_size:s[`page-size`],return_uuids:s[`return-uuids`],return_details:s[`return-details`]};if(s.dryRun){i({command:`cf r2-data-catalog namespaces tables list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/tables`,pathParams:{"bucket-name":String(s[`bucket-name`]??``),namespace:String(s.namespace??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.r2DataCatalog.namespaces.tables.list({account_id:u,bucket_name:s[`bucket-name`],namespace:s.namespace,...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`table-name`,{type:`string`,description:`The table name.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier (use %1F as separator for nested namespaces).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <table-name>`,describe:`Retrieve the maintenance configuration for a specific table, including compaction settings.`,builder:I,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog namespaces tables maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/tables/${s[`table-name`]==null?`<table-name>`:encodeURIComponent(String(s[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(s[`bucket-name`]??``),namespace:String(s.namespace??``),"table-name":String(s[`table-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.namespaces.tables.maintenanceConfigs.get({account_id:l,bucket_name:s[`bucket-name`],namespace:s.namespace,table_name:s[`table-name`]})),{successLabel:`Loaded`})}};function R(e){return e.positional(`table-name`,{type:`string`,description:`The table name.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`The namespace identifier (use %1F as separator for nested namespaces).`,demandOption:!0}).option(`compaction-state`,{type:`string`,description:`Specifies the state of maintenance operations.`,choices:[`enabled`,`disabled`]}).option(`compaction-target-size-mb`,{type:`string`,description:`Sets the target file size for compaction in megabytes. Defaults to "128".`,choices:[`64`,`128`,`256`,`512`]}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update table maintenance configuration.`})}const z={command:`update <table-name>`,describe:`Update the maintenance configuration for a specific table. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:R,handler:async u=>{if(u.dryRun){i({command:`cf r2-data-catalog namespaces tables maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/namespaces/${u.namespace==null?`<namespace>`:encodeURIComponent(String(u.namespace))}/tables/${u[`table-name`]==null?`<table-name>`:encodeURIComponent(String(u[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(u[`bucket-name`]??``),namespace:String(u.namespace??``),"table-name":String(u[`table-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({compaction:{state:l(u[`compaction-state`],`compaction-state`,`text`),target_size_mb:l(u[`compaction-target-size-mb`],`compaction-target-size-mb`,`text`)},snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Creating`,async()=>d.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...e,account_id:f,bucket_name:u[`bucket-name`],namespace:u.namespace,table_name:u[`table-name`]})),{successLabel:`Created`});return}let p=c({compaction:{state:l(u[`compaction-state`],`compaction-state`,`text`),target_size_mb:l(u[`compaction-target-size-mb`],`compaction-target-size-mb`,`text`)},snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}});r(await a(`Creating`,async()=>d.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...p,account_id:f,bucket_name:u[`bucket-name`],namespace:u.namespace,table_name:u[`table-name`]})),{successLabel:`Created`})}},B={command:`maintenance-configs`,describe:`Operations for namespaces.tables.maintenance-configs`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`tables`,describe:`Operations for namespaces.tables`,builder:e=>e.command(N).command(F).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(j).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`r2-data-catalog`,describe:`Iceberg-compatible data catalog for R2 — organize objects into tables and namespaces for SQL query engines`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).command(m).command(k).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};