cf 0.13.0 → 0.15.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 (455) hide show
  1. package/dist/_meta/commands.json +6724 -3970
  2. package/dist/_meta/hand-written-commands.json +150 -32
  3. package/dist/_meta/schemas.json +2083 -2159
  4. package/dist/abuse-reports-BAQR1w79.mjs +26 -0
  5. package/dist/access-C8KMplzp.mjs +27 -0
  6. package/dist/account-B-KQSR0L.mjs +12 -0
  7. package/dist/account-tags-EncLJpLc.mjs +15 -0
  8. package/dist/accounts-BA4Mp3A_.mjs +132 -0
  9. package/dist/acm-ByxUJcqF.mjs +15 -0
  10. package/dist/addressing-C-ym0h0G.mjs +93 -0
  11. package/dist/agent-memory-CkPSiZDI.mjs +34 -0
  12. package/dist/ai-DkE_Q64s.mjs +31 -0
  13. package/dist/ai-audit-pPcjYWI5.mjs +6 -0
  14. package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
  15. package/dist/ai-search-DLD_kDS1.mjs +79 -0
  16. package/dist/ai-security-jyZcBl9g.mjs +10 -0
  17. package/dist/alerting-DOROjm8E.mjs +56 -0
  18. package/dist/analytics-rQ-h-plT.mjs +21 -0
  19. package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
  20. package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  21. package/dist/api-security-B8p8vp8u.mjs +154 -0
  22. package/dist/argo-g8SjUb_t.mjs +10 -0
  23. package/dist/artifacts-B1PaeF5h.mjs +43 -0
  24. package/dist/audit-logs-DmU_PHy_.mjs +4 -0
  25. package/dist/auth-CZqics6E.mjs +2 -0
  26. package/dist/auth-Cp7gT-AF.mjs +8 -0
  27. package/dist/billing-CvTbUg-H.mjs +23 -0
  28. package/dist/bot-management-z53tbcbH.mjs +9 -0
  29. package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
  30. package/dist/brand-protection-DzV211IQ.mjs +27 -0
  31. package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
  32. package/dist/browser-run-DYQvMAyo.mjs +46 -0
  33. package/dist/build-BPIp8J5F.mjs +2 -0
  34. package/dist/build-OC77a1zq.mjs +2 -0
  35. package/dist/builds-CwKRqjQ5.mjs +71 -0
  36. package/dist/cache-CugNPPsJ.mjs +45 -0
  37. package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
  38. package/dist/cf-oadujOtC.mjs +18 -0
  39. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  40. package/dist/chunk-DL5FNmn1.mjs +2 -0
  41. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  42. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  43. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  44. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  45. package/dist/client-certificates-DZUIqBTB.mjs +13 -0
  46. package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
  47. package/dist/cloud-connector-avpf86kG.mjs +6 -0
  48. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  49. package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
  50. package/dist/command-B2Qe-WUa.mjs +2 -0
  51. package/dist/command-CF0giIIc.mjs +3 -0
  52. package/dist/command-D45NW-R3.mjs +2 -0
  53. package/dist/command-DIvPLK8x.mjs +2 -0
  54. package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
  55. package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
  56. package/dist/config.d.mts +1 -1729
  57. package/dist/config.mjs +1 -1
  58. package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
  59. package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
  60. package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
  61. package/dist/connectors-BSmhzNB7.mjs +15 -0
  62. package/dist/containers-B5vDcFzo.mjs +78 -0
  63. package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
  64. package/dist/content-scan-CeLZAcbT.mjs +14 -0
  65. package/dist/cps-BlI_Od72.mjs +6 -0
  66. package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
  67. package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
  68. package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
  69. package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
  70. package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
  71. package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
  72. package/dist/custom-pages-BgfhGksj.mjs +21 -0
  73. package/dist/d1-P2kWbdID.mjs +45 -0
  74. package/dist/data-security-pBIozmRL.mjs +71 -0
  75. package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
  76. package/dist/delegate-GctF_lrq.mjs +2 -0
  77. package/dist/delegate.mjs +1 -1
  78. package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
  79. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
  80. package/dist/dev-PPUBjWcm.mjs +4 -0
  81. package/dist/diagnostics-C62habGQ.mjs +15 -0
  82. package/dist/dialog-C_ccBiZp.mjs +2 -0
  83. package/dist/dist-B4pQ4CXK.mjs +48 -0
  84. package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
  85. package/dist/dist-dc4E1u01.mjs +272 -0
  86. package/dist/dls-CpkcyQ8C.mjs +17 -0
  87. package/dist/dns-DG1X4Wap.mjs +135 -0
  88. package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
  89. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  90. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  91. package/dist/durable-objects-D214VhxH.mjs +8 -0
  92. package/dist/email-auth-Ba4ONan2.mjs +6 -0
  93. package/dist/email-routing-BlqKnqNM.mjs +45 -0
  94. package/dist/email-security-Dl1E1Dko.mjs +160 -0
  95. package/dist/email-sending-DIRSSRIz.mjs +47 -0
  96. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  97. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  98. package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
  99. package/dist/firewall-DdsDh8GD.mjs +56 -0
  100. package/dist/flagship-CkUIVW7c.mjs +28 -0
  101. package/dist/fraud-BUpZgvQT.mjs +22 -0
  102. package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
  103. package/dist/healthchecks-DjQWb3EM.mjs +22 -0
  104. package/dist/hostnames-ClBLPbct.mjs +11 -0
  105. package/dist/hyperdrive-U54xZsWU.mjs +37 -0
  106. package/dist/iam-T-wWmOep.mjs +52 -0
  107. package/dist/images-ia5UG1GW.mjs +71 -0
  108. package/dist/index.mjs +1 -1
  109. package/dist/intel-BhswZLMI.mjs +76 -0
  110. package/dist/interactive-B6woOLo-.mjs +32 -0
  111. package/dist/interactive-DnUvQHjc.mjs +2 -0
  112. package/dist/ips-Dad_EvhM.mjs +4 -0
  113. package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
  114. package/dist/keys-DjIPvqj4.mjs +4 -0
  115. package/dist/kv-DzXVnK94.mjs +21 -0
  116. package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
  117. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  118. package/dist/load-balancers-3wGHPsYz.mjs +76 -0
  119. package/dist/local-B6b2OIBW.mjs +2 -0
  120. package/dist/local-BrfySqnx.mjs +2 -0
  121. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  122. package/dist/login-CEQbOgBM.mjs +5 -0
  123. package/dist/login-DEWvGuaU.mjs +2 -0
  124. package/dist/logo-matches-YGRPstPi.mjs +6 -0
  125. package/dist/logos-BirufUgo.mjs +7 -0
  126. package/dist/logpush-BlNbUHyV.mjs +46 -0
  127. package/dist/logs-DmFlVF9q.mjs +48 -0
  128. package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
  129. package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
  130. package/dist/magic-transit-CBVOK2aa.mjs +387 -0
  131. package/dist/managed-defense-BdW6s483.mjs +18 -0
  132. package/dist/managed-transforms-BIeiofIS.mjs +9 -0
  133. package/dist/matches-CAnwci0P.mjs +6 -0
  134. package/dist/mcp-BfhOMGFE.mjs +32 -0
  135. package/dist/mesh-CxUL2Wf-.mjs +26 -0
  136. package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
  137. package/dist/network-C68psMbz.mjs +50 -0
  138. package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
  139. package/dist/oauth-D4bkeMAw.mjs +14 -0
  140. package/dist/oauth-DouM-qz0.mjs +2 -0
  141. package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
  142. package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
  143. package/dist/observability-DpYxkFeZ.mjs +80 -0
  144. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
  145. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  146. package/dist/organization-Dg55Xfz7.mjs +75 -0
  147. package/dist/organizations-QnyzGjB2.mjs +4 -0
  148. package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
  149. package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
  150. package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
  151. package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
  152. package/dist/page-rules--D3eXrCf.mjs +39 -0
  153. package/dist/pages-Ce8DDgNr.mjs +60 -0
  154. package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
  155. package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
  156. package/dist/pipelines-CAqCgBLh.mjs +44 -0
  157. package/dist/precursor-DBnn4Q35.mjs +4 -0
  158. package/dist/previews-y_nSqWK5.mjs +4 -0
  159. package/dist/progress-Bi02B6v4.mjs +2 -0
  160. package/dist/project-settings-DSXevRvj.mjs +3 -0
  161. package/dist/prompt-Bx2PB-tt.mjs +3 -0
  162. package/dist/queries-dg-CVXjf.mjs +9 -0
  163. package/dist/queues-C_ilLbRI.mjs +63 -0
  164. package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
  165. package/dist/r2-hZAkra-l.mjs +127 -0
  166. package/dist/radar-BO9b0aZy.mjs +300 -0
  167. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
  168. package/dist/realtime-eSavuSeE.mjs +172 -0
  169. package/dist/registrar-Ct30kOXZ.mjs +43 -0
  170. package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
  171. package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
  172. package/dist/reporting-B-F5aWUJ.mjs +14 -0
  173. package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
  174. package/dist/request-tracers-CaubpUFV.mjs +4 -0
  175. package/dist/resolve-BXemCSyA.mjs +2 -0
  176. package/dist/resolve-CUDKxUrW.mjs +2 -0
  177. package/dist/resource-sharing-6Snv-b69.mjs +40 -0
  178. package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
  179. package/dist/rules-C26eyeA5.mjs +18 -0
  180. package/dist/rulesets-BKzIwVtJ.mjs +37 -0
  181. package/dist/rum-Xdw5hyWY.mjs +30 -0
  182. package/dist/run-BBBMrSrs.mjs +2 -0
  183. package/dist/run-BRucX7Rz.mjs +2 -0
  184. package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
  185. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
  186. package/dist/scim-odJTXiIe.mjs +18 -0
  187. package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
  188. package/dist/secrets-store-RYpWWzaw.mjs +24 -0
  189. package/dist/security-center-B3D95vCa.mjs +30 -0
  190. package/dist/security-txt-BSytVv-9.mjs +9 -0
  191. package/dist/shared-D67owd9x.mjs +2 -0
  192. package/dist/smart-shield-C83Sfnf4.mjs +24 -0
  193. package/dist/snippets-B6oE9WIa.mjs +20 -0
  194. package/dist/source-BR4_k2ad.mjs +6 -0
  195. package/dist/spawn-CKqJ9J4_.mjs +523 -0
  196. package/dist/spectrum-CfxY--X_.mjs +83 -0
  197. package/dist/speed-DzK-kiWt.mjs +24 -0
  198. package/dist/src-B3h6tKMt.mjs +108 -0
  199. package/dist/ssl-dnjzPcSB.mjs +45 -0
  200. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  201. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  202. package/dist/state-BxCejn42.mjs +2 -0
  203. package/dist/state-DSzkxXML.mjs +2 -0
  204. package/dist/stream-oFyhS4Wi.mjs +102 -0
  205. package/dist/submit-4f-ravmC.mjs +4 -0
  206. package/dist/tags-DrIP6Uiq.mjs +4 -0
  207. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  208. package/dist/telemetry-Ds4epd3D.mjs +2 -0
  209. package/dist/telemetry-mKEb8lYB.mjs +2 -0
  210. package/dist/tenant-C-gc3NWv.mjs +12 -0
  211. package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
  212. package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
  213. package/dist/tunnels-D0QYsskp.mjs +29 -0
  214. package/dist/turnstile-C6Q3spRB.mjs +33 -0
  215. package/dist/ui-DH95w1Qk.mjs +5 -0
  216. package/dist/undici-DTSBJHNS.mjs +96 -0
  217. package/dist/update-check-BBS1K1jt.mjs +2 -0
  218. package/dist/update-check-CTLoakFV.mjs +2 -0
  219. package/dist/update-check-worker.mjs +2 -0
  220. package/dist/url-info-Cs0V89qq.mjs +4 -0
  221. package/dist/url-normalization-DaEQYy5h.mjs +9 -0
  222. package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
  223. package/dist/user-BV1VY3Kl.mjs +112 -0
  224. package/dist/values-qDS63E43.mjs +4 -0
  225. package/dist/vectorize-NFzD3mP5.mjs +32 -0
  226. package/dist/version-W6_TN_kN.mjs +2 -0
  227. package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
  228. package/dist/web-assets-Gd6z8dbt.mjs +64 -0
  229. package/dist/web3-DCJx4NRp.mjs +28 -0
  230. package/dist/workers-B-j-1ygi.mjs +36 -0
  231. package/dist/workers-builds-DPrNKjZW.mjs +14 -0
  232. package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
  233. package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
  234. package/dist/workflows-C2KKIJjl.mjs +43 -0
  235. package/dist/zaraz-CVLCs1IX.mjs +22 -0
  236. package/dist/zero-trust-BtJi4OXF.mjs +795 -0
  237. package/dist/zone-hKgt0WzO.mjs +4 -0
  238. package/dist/zones-CCNyaD3J.mjs +124 -0
  239. package/package.json +15 -12
  240. package/dist/_meta/agent-context.json +0 -193
  241. package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
  242. package/dist/access-D6Xz892p.mjs +0 -11
  243. package/dist/account-DvxcqeaK.mjs +0 -2
  244. package/dist/account-tags-CeqfEWpz.mjs +0 -9
  245. package/dist/accounts-Bx-8BMH9.mjs +0 -30
  246. package/dist/acm--0opdSGE.mjs +0 -3
  247. package/dist/addressing-BS1ynzLA.mjs +0 -13
  248. package/dist/agent-context-BPhyrSns.mjs +0 -8
  249. package/dist/agent-memory-DczzpEw5.mjs +0 -6
  250. package/dist/ai-CDdCTcQl.mjs +0 -5
  251. package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
  252. package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
  253. package/dist/ai-search-DRQj1aMu.mjs +0 -7
  254. package/dist/ai-security-C_Rb0lGT.mjs +0 -4
  255. package/dist/alerting-BAR9eFs2.mjs +0 -6
  256. package/dist/analytics-BaUZwNc5.mjs +0 -4
  257. package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
  258. package/dist/api-security-jA0lOk6a.mjs +0 -50
  259. package/dist/argo-Cz4pDagx.mjs +0 -2
  260. package/dist/artifacts-BcLTGfAv.mjs +0 -5
  261. package/dist/audit-logs-DbIv4n6u.mjs +0 -2
  262. package/dist/auth-rW5d3jtr.mjs +0 -5
  263. package/dist/auth-tvDdC1J-.mjs +0 -8
  264. package/dist/billing-Md87QjqW.mjs +0 -3
  265. package/dist/bot-management-VHMo4hpU.mjs +0 -5
  266. package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
  267. package/dist/brand-protection-HUeR6Pof.mjs +0 -3
  268. package/dist/browser-extension-199oZg3X.mjs +0 -3
  269. package/dist/browser-run-DDasyux-.mjs +0 -4
  270. package/dist/build-0QlYUfFS.mjs +0 -2
  271. package/dist/builds-B-lXn6JR.mjs +0 -9
  272. package/dist/cache-CevKpiTM.mjs +0 -9
  273. package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
  274. package/dist/cf-C11NGkjx.mjs +0 -18
  275. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  276. package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
  277. package/dist/chunk-vbHwaUoU.mjs +0 -2
  278. package/dist/client-certificates-Bay7oPLE.mjs +0 -3
  279. package/dist/client-side-security-CbU9xn0k.mjs +0 -37
  280. package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
  281. package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
  282. package/dist/command-CMzMsll4.mjs +0 -2
  283. package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
  284. package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
  285. package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
  286. package/dist/connectors-CEAy30E-.mjs +0 -3
  287. package/dist/containers-BsbDqbSn.mjs +0 -58
  288. package/dist/content-scan-BdK936iO.mjs +0 -4
  289. package/dist/cps-oP97-qkm.mjs +0 -2
  290. package/dist/csamScanner-DUNN4INg.mjs +0 -6
  291. package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
  292. package/dist/custom-certificates-DYspvjo4.mjs +0 -5
  293. package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
  294. package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
  295. package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
  296. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  297. package/dist/d1-JBEqjJoj.mjs +0 -20
  298. package/dist/data-security-CIktWnXt.mjs +0 -7
  299. package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
  300. package/dist/dev-CAubuxCc.mjs +0 -4
  301. package/dist/diagnostics-B0DRh714.mjs +0 -3
  302. package/dist/dist-12KzRsBM.mjs +0 -387
  303. package/dist/dist-BCVqQpg2.mjs +0 -2
  304. package/dist/dist-Cp3uJN1x.mjs +0 -48
  305. package/dist/dist-S9K_8gq9.mjs +0 -9
  306. package/dist/dls-CFzTHcZM.mjs +0 -3
  307. package/dist/dns-Dw6u-NV1.mjs +0 -29
  308. package/dist/dns-firewall-CIPptslp.mjs +0 -57
  309. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  310. package/dist/durable-objects-CCkeqqBq.mjs +0 -2
  311. package/dist/email-auth-kdxO51Oz.mjs +0 -2
  312. package/dist/email-routing-BLggZdQq.mjs +0 -6
  313. package/dist/email-security-DjADlgdM.mjs +0 -18
  314. package/dist/email-sending-Cz7E7GoP.mjs +0 -7
  315. package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
  316. package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
  317. package/dist/firewall-5t6OBIOl.mjs +0 -8
  318. package/dist/flagship-CzG_VoNR.mjs +0 -4
  319. package/dist/fraud-UOg_69Ob.mjs +0 -20
  320. package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
  321. package/dist/healthchecks-BkHZGTp1.mjs +0 -4
  322. package/dist/hostnames-EUYOZm21.mjs +0 -3
  323. package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
  324. package/dist/iam-BQ2xSgYN.mjs +0 -6
  325. package/dist/images-CkEq6ScP.mjs +0 -8
  326. package/dist/intel-DDWEdGyl.mjs +0 -8
  327. package/dist/interactive-B2E03Fs-.mjs +0 -11
  328. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  329. package/dist/ips-54Qmy-Uw.mjs +0 -2
  330. package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
  331. package/dist/keys-rvI4TC3Z.mjs +0 -2
  332. package/dist/kv-CAeN1zBy.mjs +0 -5
  333. package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
  334. package/dist/load-balancers-BFwdwAIU.mjs +0 -6
  335. package/dist/local-C6XsFD_W.mjs +0 -2
  336. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  337. package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
  338. package/dist/logos-BN8SvJhS.mjs +0 -3
  339. package/dist/logpush-BnLA4WVm.mjs +0 -4
  340. package/dist/logs-CDo7Y5sA.mjs +0 -3
  341. package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
  342. package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
  343. package/dist/magic-transit-6tvVOECW.mjs +0 -111
  344. package/dist/managed-defense-AYwBOYIH.mjs +0 -2
  345. package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
  346. package/dist/matches-Dp91L3dL.mjs +0 -2
  347. package/dist/mcp-P7pcieiT.mjs +0 -4
  348. package/dist/mesh-DjFrk6PL.mjs +0 -4
  349. package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
  350. package/dist/network-7cd1U6-I.mjs +0 -6
  351. package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
  352. package/dist/oauth-DH3kMXSs.mjs +0 -14
  353. package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
  354. package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
  355. package/dist/observability-M1DnLhMR.mjs +0 -10
  356. package/dist/organization-cUE7GDCt.mjs +0 -45
  357. package/dist/organizations-C-Hcpd0w.mjs +0 -2
  358. package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
  359. package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
  360. package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
  361. package/dist/page-rules-B-zq1EUb.mjs +0 -27
  362. package/dist/pages-B6YpkPos.mjs +0 -14
  363. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  364. package/dist/pipelines-BJc_RylD.mjs +0 -6
  365. package/dist/precursor-CLQu7suY.mjs +0 -4
  366. package/dist/progress-V6SZV3Ux.mjs +0 -2
  367. package/dist/prompt-DjRTpML4.mjs +0 -3
  368. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  369. package/dist/queries-DSrrket-.mjs +0 -3
  370. package/dist/queues-Tf7kPBpn.mjs +0 -7
  371. package/dist/r2-DmKNnxtC.mjs +0 -25
  372. package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
  373. package/dist/radar-Csk7Ab-b.mjs +0 -2
  374. package/dist/realtime-CDehZVhV.mjs +0 -20
  375. package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
  376. package/dist/registrar-vflzeNQ9.mjs +0 -43
  377. package/dist/reporting-BaPZ1PHN.mjs +0 -2
  378. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  379. package/dist/request-tracers-C_UVBexV.mjs +0 -2
  380. package/dist/resolve-B8CyM1mi.mjs +0 -2
  381. package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
  382. package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
  383. package/dist/rules-4O8076_s.mjs +0 -4
  384. package/dist/rulesets-C84MxTYo.mjs +0 -5
  385. package/dist/rum-Bvwkrntx.mjs +0 -4
  386. package/dist/run-CRfinkSe.mjs +0 -2
  387. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  388. package/dist/scim-BvxQmde6.mjs +0 -4
  389. package/dist/secrets-store-DOKWiC-j.mjs +0 -7
  390. package/dist/security-center-Bhy_aC-w.mjs +0 -2
  391. package/dist/security-txt-L7HJ9tq5.mjs +0 -3
  392. package/dist/smart-shield-COMXuQ1S.mjs +0 -4
  393. package/dist/snippets-DffQhlKt.mjs +0 -4
  394. package/dist/spawn-C1AISA2V.mjs +0 -526
  395. package/dist/spectrum-Cmf7SqQE.mjs +0 -63
  396. package/dist/speed-m8cdhLFS.mjs +0 -4
  397. package/dist/src-C8phrg-8.mjs +0 -109
  398. package/dist/ssl-D4ffsdSw.mjs +0 -15
  399. package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
  400. package/dist/state-CHif8Y5I.mjs +0 -2
  401. package/dist/stream-DPF5fojV.mjs +0 -16
  402. package/dist/submit-Br8hfP0_.mjs +0 -2
  403. package/dist/tags-Bnt4JuxQ.mjs +0 -2
  404. package/dist/telemetry-Ch1vCICm.mjs +0 -2
  405. package/dist/tenant-D8u0CxoC.mjs +0 -2
  406. package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
  407. package/dist/tunnels-BkNPpTHa.mjs +0 -5
  408. package/dist/turnstile-MgwRECJv.mjs +0 -23
  409. package/dist/ui-DQSZeaG5.mjs +0 -5
  410. package/dist/url-info-Ddp7MgcI.mjs +0 -2
  411. package/dist/url-normalization-3ptK9ntV.mjs +0 -3
  412. package/dist/url-scanner-Psb9ollR.mjs +0 -2
  413. package/dist/user-DWdshcIu.mjs +0 -12
  414. package/dist/values-CDKQL1z2.mjs +0 -2
  415. package/dist/vectorize-CTYYUyQj.mjs +0 -4
  416. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  417. package/dist/web-assets-CpDwDEx8.mjs +0 -8
  418. package/dist/web3-YsjDyAzH.mjs +0 -4
  419. package/dist/workers-BKKxaZcz.mjs +0 -6
  420. package/dist/workers-builds-BWo5vUA9.mjs +0 -2
  421. package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
  422. package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
  423. package/dist/workflows-KrIFI9ns.mjs +0 -5
  424. package/dist/zaraz-DglXbVzZ.mjs +0 -2
  425. package/dist/zero-trust-RilTdSjX.mjs +0 -91
  426. package/dist/zone-DsBtVkvT.mjs +0 -2
  427. package/dist/zones-BFxvWFQW.mjs +0 -44
  428. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
  429. /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
  430. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  431. /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
  432. /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
  433. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  434. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  435. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  436. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  437. /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
  438. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  439. /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
  440. /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
  441. /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
  442. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  443. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  444. /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
  445. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  446. /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
  447. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  448. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  449. /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
  450. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  451. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  452. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  453. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  454. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  455. /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p,t as m}from"./input-validation-BxchZ9jE.mjs";import{a as h,i as g,n as _}from"./prompt-DjRTpML4.mjs";import{n as ee,t as te}from"./raw-fetch-BVYQR6C5.mjs";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(`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 y={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:v,handler:async l=>c({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function b(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 x={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:b,handler:async l=>c({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};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(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:S,handler:async p=>c({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},w={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(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.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`create-by-name <bucket-name>`,describe:"Creates a new R2 bucket using the name from the URL path. Similar to `r2-create-bucket` (POST), but the bucket name comes from the path and the optional storage class is supplied via the `cf-r2-storage-class` header. There is no request body. Unlike the POST variant, this endpoint does not accept a location hint — the bucket is placed in the R2 region for the caller's edge colo. Use the POST variant if you need to set a `locationHint`.",builder:T,handler:async l=>c({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function D(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 O={command:`create`,describe:`Creates a new R2 bucket.`,builder:D,handler:async d=>c({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({locationHint:p(d[`location-hint`],`location-hint`,`text`),name:p(d.name,`name`,`text`),storageClass:p(d[`storage-class`],`storage-class`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await h(`name`,`Name of the bucket.`));let _={};d[`location-hint`]!==void 0&&l(_,[`locationHint`],p(d[`location-hint`],`location-hint`,`text`)),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d[`storage-class`]!==void 0&&l(_,[`storageClass`],p(d[`storage-class`],`storage-class`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function k(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 A={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:k,handler:async l=>c({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function j(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 M={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:j,handler:async d=>c({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,domain:p(d.domain,`domain`,`text`),enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`),zoneId:p(d[`zone-id`],`zone-id`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(d.domain===void 0&&(d.domain=await h(`domain`,`Name of the custom domain to be added.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`zone-id`]===void 0&&(d[`zone-id`]=await h(`zone-id`,`Zone ID of the custom domain.`));let _={};d.ciphers!==void 0&&l(_,[`ciphers`],d.ciphers),d.domain!==void 0&&l(_,[`domain`],p(d.domain,`domain`,`text`)),d.enabled!==void 0&&l(_,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(_,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),d[`zone-id`]!==void 0&&l(_,[`zoneId`],p(d[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function N(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 P={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:N,handler:async l=>c({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
5
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function F(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 I={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:F,handler:async l=>c({command:`r2 buckets domains custom get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function L(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 R={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:L,handler:async l=>c({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function z(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 B={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:z,handler:async d=>c({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${d.domain==null?`<domain>`:encodeURIComponent(String(d.domain))}`,pathParams:{"bucket-name":String(d[`bucket-name`]??``),domain:String(d.domain??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d.ciphers!==void 0&&l(g,[`ciphers`],d.ciphers),d.enabled!==void 0&&l(g,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(g,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},V={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(M).command(P).command(I).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(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 U={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:H,handler:async l=>c({command:`r2 buckets domains managed list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};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(`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 G={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:W,handler:async d=>c({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?f({enabled:d.enabled}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(c).length>0?c: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),a(await s(`Updating`,async()=>r(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(c).length>0?c:void 0})),{successLabel:`Updated`})})},K={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(V).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(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 Y={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:J,handler:async l=>c({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function X(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 Z={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:X,handler:async d=>c({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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?f({ruleIds:d[`rule-ids`]}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,!await _({force:!!d.force})){process.stderr.write(`Aborted.
6
- `);return}if(d.body){let e=u(d.body);a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`});return}let h={};d[`rule-ids`]!==void 0&&l(h,[`ruleIds`],d[`rule-ids`]),a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Q(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})}const ne={command:`get <queue-id>`,describe:`Get a single event notification rule.`,builder:Q,handler:async l=>c({command:`r2 buckets event-notifications get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(l[`queue-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function re(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 ie={command:`list`,describe:`List all event notification rules for a bucket.`,builder:re,handler:async l=>c({command:`r2 buckets event-notifications list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function ae(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(`rules`,{type:`string`,description:`Array of rules to drive notifications. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`update <queue-id>`,describe:`Create event notification rule.`,builder:ae,handler:async p=>c({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${p[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(p[`queue-id`]))}`,pathParams:{"queue-id":String(p[`queue-id`]??``),"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(p[`queue-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}if(p.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(p[`queue-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},se={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(Z).command(ne).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:`Gets properties of an existing R2 bucket.`,builder:ce,handler:async l=>c({command:`r2 buckets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function ue(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 de={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:ue,handler:async l=>c({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"job-id":String(l[`job-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/jobs/${encodeURIComponent(String(l[`job-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function fe(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 pe={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:fe,handler:async l=>c({command:`r2 buckets jobs list`,classification:{safeFlags:[`job-type`,`status`,`dry-run`]}},l,async()=>{let c={jobType:l[`job-type`],status:l.status,maxKeys:l[`max-keys`],continuationToken:l[`continuation-token`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/jobs`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},me={command:`jobs`,describe:`Inspect background jobs for an R2 bucket`,builder:e=>e.command(de).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(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 ge={command:`get <bucket-name>`,describe:`Get object lifecycle rules for a bucket.`,builder:he,handler:async l=>c({command:`r2 buckets lifecycle get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function _e(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(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <bucket-name>`,describe:`Set the object lifecycle rules for a bucket.`,builder:_e,handler:async p=>c({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},ye={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(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 xe={command:`list`,describe:`Lists all R2 buckets on your account.`,builder:be,handler:async l=>c({command:`r2 buckets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},l,async()=>{let c={name_contains:l[`name-contains`],start_after:l[`start-after`],per_page:l[`per-page`],order:l.order,direction:l.direction,cursor:l.cursor},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})};function Se(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 Ce={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:Se,handler:async r=>c({command:`r2 buckets local-uploads get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.localUploads.get({account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Loaded`})})};function we(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 Te={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:we,handler:async r=>c({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({enabled:r.enabled}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...e,account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=f({enabled:r.enabled});a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...d,account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`})})},Ee={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(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 Oe={command:`delete <bucket-name>`,describe:`Delete all lock rules for a bucket.`,builder:De,handler:async l=>c({command:`r2 buckets locks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets locks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
7
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function ke(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 Ae={command:`get <bucket-name>`,describe:`Get lock rules for a bucket.`,builder:ke,handler:async l=>c({command:`r2 buckets locks get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function je(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(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Me={command:`update <bucket-name>`,describe:`Set lock rules for a bucket.`,builder:je,handler:async p=>c({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lock`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lock`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},Ne={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(Oe).command(Ae).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={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:Pe,handler:async r=>c({command:`r2 buckets metrics list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.metrics.list({account_id:l})),{successLabel:`Loaded`})})},Ie={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`prefix`,{type:`string`,description:"When present, switches the operation to prefix-delete mode. A non-empty value must\nend in `/` and deletes keys beginning with that prefix. Preserve an empty value\n(`?prefix=`) to empty the entire bucket. Omitting this parameter instead selects\ndelete-by-list mode and requires a JSON request body."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-data-catalog-check`,{type:`string`,description:`Set this header to reject the operation when R2 Data Catalog is enabled for the bucket.`}).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:'Required for "delete by list" mode (when `prefix` query parameter is omitted). A JSON array of object keys to delete. Ignored when `prefix` is provided. '})}const Re={command:`bulk-delete`,describe:"Deletes objects from an R2 bucket. Three modes are supported: 1. **Delete by list** (default): Provide a JSON array of object keys in the request body. All listed objects are deleted; per-key errors are reported in the response. 2. **Delete by prefix**: Provide a non-empty `prefix` query parameter and no request body to delete every object whose key begins with that prefix. 3. **Empty bucket**: Provide the `prefix` query parameter with an empty value (`?prefix=`) and no request body to delete all objects in the bucket. Prefix and empty-bucket requests return a job descriptor. Small jobs can finish synchronously and return `COMPLETED`; larger jobs continue in the background. Poll the returned `id` with the Get Bucket Job endpoint. Objects uploaded after a background job starts are not deleted by that job. Abort active multipart uploads before submitting the request; a synchronously completed job does not abort them. Avoid writing objects or starting multipart uploads while a bucket-emptying job is in progress. Each repeated or concurrent request creates a distinct job. The number of active jobs is limited per bucket; wait for an existing job to finish before retrying a request rejected with HTTP 429. A bucket cannot be emptied while event notifications are configured. Remove the event notification rules and retry requests rejected with HTTP 409 / error code 10034. To protect a bucket with R2 Data Catalog enabled, send the `cf-r2-data-catalog-check` header; a conflict is returned with HTTP 409 / error code 10081. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.",builder:Le,handler:async l=>c({command:`r2 buckets objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={prefix:l.prefix},d={};if(l[`cf-r2-jurisdiction`]!==void 0&&(d[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-data-catalog-check`]!==void 0&&(d[`cf-r2-data-catalog-check`]=String(l[`cf-r2-data-catalog-check`])),l.dryRun){o({command:`cf r2 buckets objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let f=await i(l),p=l.local?e:await t();if(l.accountId=p,!await _({force:!!l.force})){process.stderr.write(`Aborted.
8
- `);return}if(l.body){let e=u(l.body),t=new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Deleting`,async()=>r(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects${t?`?`+t:``}`,{body:e,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Deleted`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function ze(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) of the object to delete. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",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 Be={command:`delete <object-key>`,describe:`Deletes an object from an R2 bucket. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:ze,handler:async l=>c({command:`r2 buckets objects delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects/${l[`object-key`]==null?`<object-key>`:encodeURIComponent(String(l[`object-key`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"object-key":String(l[`object-key`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
9
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Ve(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) of the object to retrieve. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",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(`if-none-match`,{type:`string`,description:`Returns the object only if its ETag does not match the given value.`}).option(`if-modified-since`,{type:`string`,description:"Returns the object only if it has been modified since the specified time.\nMust be formatted as an HTTP-date (RFC 7231), e.g. `Tue, 15 Jan 2024 10:30:00 GMT`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const He={command:`get <object-key>`,describe:`Retrieves an object from an R2 bucket. Returns the object body along with metadata headers. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Ve,handler:async r=>c({command:`r2 buckets objects get`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{let a={};if(r[`cf-r2-jurisdiction`]!==void 0&&(a[`cf-r2-jurisdiction`]=String(r[`cf-r2-jurisdiction`])),r[`if-none-match`]!==void 0&&(a[`If-None-Match`]=String(r[`if-none-match`])),r[`if-modified-since`]!==void 0&&(a[`If-Modified-Since`]=String(r[`if-modified-since`])),r.dryRun){o({command:`cf r2 buckets objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/objects/${r[`object-key`]==null?`<object-key>`:encodeURIComponent(String(r[`object-key`]))}`,pathParams:{"bucket-name":String(r[`bucket-name`]??``),"object-key":String(r[`object-key`]??``)},bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=await s(`Loading`,async()=>te(`/accounts/${c}/r2/buckets/${encodeURIComponent(String(r[`bucket-name`]))}/objects/${encodeURIComponent(String(r[`object-key`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?l.toString(`utf-8`):l)})};function Ue(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Maximum number of objects to return per page.`}).option(`prefix`,{type:`string`,description:`Restricts results to only those objects whose keys begin with the specified prefix.`}).option(`delimiter`,{type:`string`,description:`A single character used to group keys. All keys that contain the delimiter between the prefix and the first occurrence of the delimiter after the prefix are grouped under a single result element.`}).option(`cursor`,{type:`string`,description:`Pagination cursor received from a previous List Objects call. Used to retrieve the next page of results.`}).option(`start-after`,{type:`string`,description:`Returns objects with keys that come after the specified key in lexicographic order.`}).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 We={command:`list`,describe:`Lists objects in an R2 bucket. Returns object metadata including key, size, etag, last modified date, HTTP metadata, and custom metadata. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Ue,handler:async l=>c({command:`r2 buckets objects list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={per_page:l[`per-page`],prefix:l.prefix,delimiter:l.delimiter,cursor:l.cursor,start_after:l[`start-after`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})};function Ge(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) to assign to the object. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",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(`content-type`,{type:`string`,description:`The MIME type of the object being uploaded.`}).option(`content-length`,{type:`string`,description:`The size of the object body in bytes.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for this object. Overrides the bucket default.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The object body to upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Ke={command:`upload <object-key>`,describe:`Uploads an object to an R2 bucket. The object body is provided as the request body. Returns metadata about the uploaded object. The maximum upload size for this endpoint is 300 MB. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Ge,handler:async l=>c({command:`r2 buckets objects upload`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`content-type`]!==void 0&&(c[`Content-Type`]=String(l[`content-type`])),l[`content-length`]!==void 0&&(c[`Content-Length`]=String(l[`content-length`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets objects upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects/${l[`object-key`]==null?`<object-key>`:encodeURIComponent(String(l[`object-key`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"object-key":String(l[`object-key`]??``)},bodyKind:`octet-stream`,body:l.body});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.file){let e=m(l.file);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...Object.keys(c).length>0?c:void 0}})),{successLabel:`Updated`});return}if(l.body){let e=p(l.body,`body`,`binary`);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...c}})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},qe={command:`objects`,describe:`Operations for buckets.objects`,builder:e=>e.command(Re).command(Be).command(He).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(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 Ye={command:`delete <bucket-name>`,describe:`Disables Sippy on this bucket.`,builder:Je,handler:async l=>c({command:`r2 buckets sippy delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
10
- `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/sippy`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Xe(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 Ze={command:`get <bucket-name>`,describe:`Gets configuration for Sippy for an existing R2 bucket.`,builder:Xe,handler:async l=>c({command:`r2 buckets sippy get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/sippy`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function Qe(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.
11
- This is the value labelled "Access Key ID" when creating an API.
12
- token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
13
-
14
- Sippy will use this token when writing objects to R2, so it is
15
- best to scope this token to the bucket you're enabling Sippy for.
16
- `}).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.
17
- This is the value labelled "Secret Access Key" when creating an API.
18
- token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
19
-
20
- Sippy will use this token when writing objects to R2, so it is
21
- best to scope this token to the bucket you're enabling Sippy for.
22
- `}).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 $e={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Qe,handler:async d=>c({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({destination:{accessKeyId:p(d[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:p(d[`destination-provider`],`destination-provider`,`text`),secretAccessKey:p(d[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:p(d[`source-access-key-id`],`source-access-key-id`,`text`),bucket:p(d[`source-bucket`],`source-bucket`,`text`),provider:p(d[`source-provider`],`source-provider`,`text`),region:p(d[`source-region`],`source-region`,`text`),secretAccessKey:p(d[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:p(d[`source-client-email`],`source-client-email`,`text`),privateKey:p(d[`source-private-key`],`source-private-key`,`text`),bucketUrl:p(d[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:p(d[`source-account-key`],`source-account-key`,`text`),accountName:p(d[`source-account-name`],`source-account-name`,`text`),container:p(d[`source-container`],`source-container`,`text`),sasToken:p(d[`source-sas-token`],`source-sas-token`,`text`)}}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d[`destination-access-key-id`]!==void 0&&l(g,[`destination`,`accessKeyId`],p(d[`destination-access-key-id`],`destination-access-key-id`,`text`)),d[`destination-provider`]!==void 0&&l(g,[`destination`,`provider`],p(d[`destination-provider`],`destination-provider`,`text`)),d[`destination-secret-access-key`]!==void 0&&l(g,[`destination`,`secretAccessKey`],p(d[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),d[`source-access-key-id`]!==void 0&&l(g,[`source`,`accessKeyId`],p(d[`source-access-key-id`],`source-access-key-id`,`text`)),d[`source-bucket`]!==void 0&&l(g,[`source`,`bucket`],p(d[`source-bucket`],`source-bucket`,`text`)),d[`source-provider`]!==void 0&&l(g,[`source`,`provider`],p(d[`source-provider`],`source-provider`,`text`)),d[`source-region`]!==void 0&&l(g,[`source`,`region`],p(d[`source-region`],`source-region`,`text`)),d[`source-secret-access-key`]!==void 0&&l(g,[`source`,`secretAccessKey`],p(d[`source-secret-access-key`],`source-secret-access-key`,`text`)),d[`source-client-email`]!==void 0&&l(g,[`source`,`clientEmail`],p(d[`source-client-email`],`source-client-email`,`text`)),d[`source-private-key`]!==void 0&&l(g,[`source`,`privateKey`],p(d[`source-private-key`],`source-private-key`,`text`)),d[`source-bucket-url`]!==void 0&&l(g,[`source`,`bucketUrl`],p(d[`source-bucket-url`],`source-bucket-url`,`text`)),d[`source-account-key`]!==void 0&&l(g,[`source`,`accountKey`],p(d[`source-account-key`],`source-account-key`,`text`)),d[`source-account-name`]!==void 0&&l(g,[`source`,`accountName`],p(d[`source-account-name`],`source-account-name`,`text`)),d[`source-container`]!==void 0&&l(g,[`source`,`container`],p(d[`source-container`],`source-container`,`text`)),d[`source-sas-token`]!==void 0&&l(g,[`source`,`sasToken`],p(d[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},et={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ye).command(Ze).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(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-storage-class`,{type:`string`,description:`The destinationStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).option(`job-type`,{type:`string`,description:`The jobType field`,choices:[`storageClassMigration`]}).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Creates a storage-class migration background job. Direction fields must be provided together and must differ. Omitting both defaults to InfrequentAccess to Standard. `})}const nt={command:`create <bucket-name>`,describe:`Creates a storage-class migration background job for an R2 bucket.`,builder:tt,handler:async d=>c({command:`r2 buckets storage-class-migration-jobs create`,classification:{safeFlags:[`destination-storage-class`,`job-type`,`source-storage-class`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({destinationStorageClass:p(d[`destination-storage-class`],`destination-storage-class`,`text`),jobType:p(d[`job-type`],`job-type`,`text`),sourceStorageClass:p(d[`source-storage-class`],`source-storage-class`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d[`job-type`]===void 0&&(d[`job-type`]=await g(`job-type`,`The jobType field`,[`storageClassMigration`]));let _={};d[`destination-storage-class`]!==void 0&&l(_,[`destinationStorageClass`],p(d[`destination-storage-class`],`destination-storage-class`,`text`)),d[`job-type`]!==void 0&&l(_,[`jobType`],p(d[`job-type`],`job-type`,`text`)),d[`source-storage-class`]!==void 0&&l(_,[`sourceStorageClass`],p(d[`source-storage-class`],`source-storage-class`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function rt(e){return e.positional(`job-id`,{type:`string`,description:`Identifier returned when the migration 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 it={command:`get <job-id>`,describe:`Gets the current status of a storage-class migration job.`,builder:rt,handler:async l=>c({command:`r2 buckets storage-class-migration-jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"job-id":String(l[`job-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs/${encodeURIComponent(String(l[`job-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function at(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`status`,{type:`string`,description:`Restricts results to jobs with the specified status.`,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 ot={command:`list`,describe:`Lists storage-class migration jobs for an R2 bucket.`,builder:at,handler:async l=>c({command:`r2 buckets storage-class-migration-jobs list`,classification:{safeFlags:[`status`,`dry-run`]}},l,async()=>{let c={status:l.status,maxKeys:l[`max-keys`],continuationToken:l[`continuation-token`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},st={command:`storage-class-migration-jobs`,describe:`Operations for buckets.storage-class-migration-jobs`,builder:e=>e.command(nt).command(it).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ct={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(O).command(E).command(A).command(Y).command(le).command(xe).command(w).command(q).command(se).command(me).command(ye).command(Ee).command(Ne).command(Ie).command(qe).command(et).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lt(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`,`us`,`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 ut={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:lt,handler:async r=>c({command:`r2 super-slurper connectivity-precheck source`,classification:{safeFlags:[`vendor`,`jurisdiction`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),endpoint:p(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:p(r[`path-prefix`],`path-prefix`,`text`),region:p(r.region,`region`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:p(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:p(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:l})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await h(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await g(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let d=f({bucket:p(r.bucket,`bucket`,`text`),endpoint:p(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:p(r[`path-prefix`],`path-prefix`,`text`),region:p(r.region,`region`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:p(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:p(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:d,account_id:l})),{successLabel:`Updated`})})};function dt(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`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 ft={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:dt,handler:async r=>c({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:l})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await h(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await h(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await h(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await g(`vendor`,`The vendor field`,[`r2`]));let d=f({bucket:p(r.bucket,`bucket`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:d,account_id:l})),{successLabel:`Updated`})})},pt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(ut).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mt(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 ht={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:mt,handler:async r=>c({command:`r2 super-slurper jobs abort-all`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
23
- `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})})};function gt(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 _t={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:gt,handler:async r=>c({command:`r2 super-slurper jobs abort`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/abort`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
24
- `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})})};function vt(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`,`us`,`fedramp`]}).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`us`,`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 yt={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:vt,handler:async r=>c({command:`r2 super-slurper jobs create`,classification:{safeFlags:[`overwrite`,`source-vendor`,`source-jurisdiction`,`target-jurisdiction`,`target-vendor`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({overwrite:r.overwrite,source:{bucket:p(r[`source-bucket`],`source-bucket`,`text`),endpoint:p(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:p(r[`source-path-prefix`],`source-path-prefix`,`text`),region:p(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:p(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:p(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:p(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:p(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:p(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:p(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:p(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:p(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:p(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:p(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:p(r[`target-vendor`],`target-vendor`,`text`)}}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...e,account_id:l})),{successLabel:`Created`});return}let d=f({overwrite:r.overwrite,source:{bucket:p(r[`source-bucket`],`source-bucket`,`text`),endpoint:p(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:p(r[`source-path-prefix`],`source-path-prefix`,`text`),region:p(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:p(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:p(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:p(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:p(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:p(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:p(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:p(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:p(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:p(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:p(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:p(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...d,account_id:l})),{successLabel:`Created`})})};function bt(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 xt={command:`delete <job-id>`,describe:`Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`,builder:bt,handler:async r=>c({command:`r2 super-slurper jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
25
- `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.delete({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})})};function St(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 Ct={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:St,handler:async r=>c({command:`r2 super-slurper jobs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.get({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})})};function wt(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 Tt={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:wt,handler:async r=>c({command:`r2 super-slurper jobs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Et(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 $={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:Et,handler:async r=>c({command:`r2 super-slurper jobs logs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/logs`,pathParams:{"job-id":String(r[`job-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.logs.list({account_id:u,job_id:r[`job-id`],...c})),{successLabel:`Loaded`})})},Dt={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ot(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 kt={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:Ot,handler:async r=>c({command:`r2 super-slurper jobs pause`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/pause`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.pause({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})})};function At(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 jt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:At,handler:async r=>c({command:`r2 super-slurper jobs progress`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/progress`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.progress({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})})};function Mt(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:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:Mt,handler:async r=>c({command:`r2 super-slurper jobs resume`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/resume`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.resume({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})})},Pt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(_t).command(ht).command(yt).command(xt).command(Ct).command(Tt).command(kt).command(jt).command(Nt).command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ft={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(pt).command(Pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function It(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 Lt={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:It,handler:async r=>c({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:p(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:p(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.bucket===void 0&&(r.bucket=await h(`bucket`,`Name of the R2 bucket.`)),r[`parent-access-key-id`]===void 0&&(r[`parent-access-key-id`]=await h(`parent-access-key-id`,`The parent access key id to use for signing.`)),r.permission===void 0&&(r.permission=await g(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),r[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let d=f({bucket:p(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:p(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:p(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]});a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...d,account_id:l})),{successLabel:`Created`})})},Rt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},zt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(ct).command(Ft).command(Rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{zt as default};
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,t as l}from"./body-parser-DIlfApuJ.mjs";import{n as u}from"./input-validation-BxchZ9jE.mjs";import{a as d,n as f}from"./prompt-DjRTpML4.mjs";import{t as p}from"./cli-types-CrSoSMPF.mjs";function m(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 h={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:m,handler:async f=>s({command:`r2-data-catalog credentials create`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?l({token:u(f.token,`token`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`});return}f.token===void 0&&(f.token=await d(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=l({token:u(f.token,`token`,`text`)});i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`})})},g={command:`credentials`,describe:`Catalog access credentials for external query engines (Spark, Trino, etc.)`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`cascade`,{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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={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:_,handler:async c=>s({command:`r2-data-catalog delete`,classification:{safeFlags:[`cascade`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={force:c.cascade};if(c.dryRun){a({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await f({force:!!c.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>l.r2DataCatalog.delete({account_id:u,bucket_name:c[`bucket-name`],...s})),{successLabel:`Deleted`})})};function y(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 b={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:y,handler:async c=>s({command:`r2-data-catalog disable`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.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}i(await o(`Deleting`,async()=>s.r2DataCatalog.disable({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Deleted`})})};function x(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 S={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:x,handler:async c=>s({command:`r2-data-catalog enable`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.r2DataCatalog.enable({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Created`})})};function C(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 w={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:C,handler:async c=>s({command:`r2-data-catalog get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.get({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Loaded`})})};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`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:T,handler:async c=>s({command:`r2-data-catalog list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.list({account_id:l})),{successLabel:`Loaded`})})};function D(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 O={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:D,handler:async c=>s({command:`r2-data-catalog maintenance-configs get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.maintenanceConfigs.get({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Loaded`})})};function k(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 A={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:k,handler:async d=>s({command:`r2-data-catalog maintenance-configs update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?l({snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}let p=l({snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}});i(await o(`Creating`,async()=>s.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})})},j={command:`maintenance-configs`,describe:`Table maintenance settings — compaction schedules and snapshot expiration policies`,builder:e=>e.command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(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 N={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:M,handler:async c=>s({command:`r2-data-catalog namespaces list`,classification:{safeFlags:[`return-uuids`,`return-details`,`dry-run`]}},c,async()=>{let s={page_token:c[`page-token`],page_size:c[`page-size`],parent:c.parent,return_uuids:c[`return-uuids`],return_details:c[`return-details`]};if(c.dryRun){a({command:`cf r2-data-catalog namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/namespaces`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.r2DataCatalog.namespaces.list({account_id:u,bucket_name:c[`bucket-name`],...s})),{successLabel:`Loaded`})})};function P(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 F={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:P,handler:async c=>s({command:`r2-data-catalog namespaces tables get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog namespaces tables get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tables/${c[`table-name`]==null?`<table-name>`:encodeURIComponent(String(c[`table-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),namespace:String(c.namespace??``),"table-name":String(c[`table-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.namespaces.tables.get({account_id:l,bucket_name:c[`bucket-name`],namespace:c.namespace,table_name:c[`table-name`]})),{successLabel:`Loaded`})})};function I(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 L={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:I,handler:async c=>s({command:`r2-data-catalog namespaces tables list`,classification:{safeFlags:[`return-uuids`,`return-details`,`dry-run`]}},c,async()=>{let s={page_token:c[`page-token`],page_size:c[`page-size`],return_uuids:c[`return-uuids`],return_details:c[`return-details`]};if(c.dryRun){a({command:`cf r2-data-catalog namespaces tables list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tables`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),namespace:String(c.namespace??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.r2DataCatalog.namespaces.tables.list({account_id:u,bucket_name:c[`bucket-name`],namespace:c.namespace,...s})),{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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <table-name>`,describe:`Retrieve the maintenance configuration for a specific table, including compaction settings.`,builder:R,handler:async c=>s({command:`r2-data-catalog namespaces tables maintenance-configs get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog namespaces tables maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tables/${c[`table-name`]==null?`<table-name>`:encodeURIComponent(String(c[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),namespace:String(c.namespace??``),"table-name":String(c[`table-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.namespaces.tables.maintenanceConfigs.get({account_id:l,bucket_name:c[`bucket-name`],namespace:c.namespace,table_name:c[`table-name`]})),{successLabel:`Loaded`})})};function B(e){return e.positional(`configuration-type`,{type:`string`,description:`Configuration type`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace`,demandOption:!0}).option(`table-name`,{type:`string`,description:`Table name`,demandOption:!0}).option(`request-id`,{type:`string`,description:`The request_id 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 V={command:`queue <configuration-type>`,describe:`Queue maintenance for normal polling. This request does not start a run.`,builder:p(B),handler:async d=>s({command:`r2-data-catalog namespaces tables maintenance-configs queue`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf r2-data-catalog namespaces tables maintenance-configs queue`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/namespaces/${d.namespace==null?`<namespace>`:encodeURIComponent(String(d.namespace))}/tables/${d[`table-name`]==null?`<table-name>`:encodeURIComponent(String(d[`table-name`]))}/maintenance-configs/${d[`configuration-type`]==null?`<configuration-type>`:encodeURIComponent(String(d[`configuration-type`]))}/queue`,pathParams:{"bucket-name":String(d[`bucket-name`]??``),namespace:String(d.namespace??``),"table-name":String(d[`table-name`]??``),"configuration-type":String(d[`configuration-type`]??``)},bodyKind:`json`,body:d.body===void 0?l({request_id:u(d[`request-id`],`request-id`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.r2DataCatalog.namespaces.tables.maintenanceConfigs.queue({...e,account_id:f,bucket_name:d[`bucket-name`],namespace:d.namespace,table_name:d[`table-name`],configuration_type:d[`configuration-type`]})),{successLabel:`Created`});return}let p=l({request_id:u(d[`request-id`],`request-id`,`text`)});i(await o(`Creating`,async()=>s.r2DataCatalog.namespaces.tables.maintenanceConfigs.queue({...p,account_id:f,bucket_name:d[`bucket-name`],namespace:d.namespace,table_name:d[`table-name`],configuration_type:d[`configuration-type`]})),{successLabel:`Created`})})};function H(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 U={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:H,handler:async d=>s({command:`r2-data-catalog namespaces tables maintenance-configs update`,classification:{safeFlags:[`compaction-state`,`compaction-target-size-mb`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf r2-data-catalog namespaces tables maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/namespaces/${d.namespace==null?`<namespace>`:encodeURIComponent(String(d.namespace))}/tables/${d[`table-name`]==null?`<table-name>`:encodeURIComponent(String(d[`table-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(d[`bucket-name`]??``),namespace:String(d.namespace??``),"table-name":String(d[`table-name`]??``)},bodyKind:`json`,body:d.body===void 0?l({compaction:{state:u(d[`compaction-state`],`compaction-state`,`text`),target_size_mb:u(d[`compaction-target-size-mb`],`compaction-target-size-mb`,`text`)},snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...e,account_id:f,bucket_name:d[`bucket-name`],namespace:d.namespace,table_name:d[`table-name`]})),{successLabel:`Created`});return}let p=l({compaction:{state:u(d[`compaction-state`],`compaction-state`,`text`),target_size_mb:u(d[`compaction-target-size-mb`],`compaction-target-size-mb`,`text`)},snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}});i(await o(`Creating`,async()=>s.r2DataCatalog.namespaces.tables.maintenanceConfigs.update({...p,account_id:f,bucket_name:d[`bucket-name`],namespace:d.namespace,table_name:d[`table-name`]})),{successLabel:`Created`})})},W={command:`maintenance-configs`,describe:`Operations for namespaces.tables.maintenance-configs`,builder:e=>e.command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace`,demandOption:!0}).option(`table-name`,{type:`string`,description:`Table name`,demandOption:!0}).option(`page-size`,{type:`number`,description:`Page size`}).option(`page-token`,{type:`string`,description:`Page token`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`Retrieves recent table maintenance runs for the current table.`,builder:G,handler:async c=>s({command:`r2-data-catalog namespaces tables maintenance-runs list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page_size:c[`page-size`],page_token:c[`page-token`]};if(c.dryRun){a({command:`cf r2-data-catalog namespaces tables maintenance-runs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tables/${c[`table-name`]==null?`<table-name>`:encodeURIComponent(String(c[`table-name`]))}/maintenance-runs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),namespace:String(c.namespace??``),"table-name":String(c[`table-name`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.r2DataCatalog.namespaces.tables.maintenanceRuns.list({account_id:u,bucket_name:c[`bucket-name`],namespace:c.namespace,table_name:c[`table-name`],...s})),{successLabel:`Loaded`})})},q={command:`maintenance-runs`,describe:`Operations for namespaces.tables.maintenance-runs`,builder:e=>e.command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`tables`,describe:`Operations for namespaces.tables`,builder:e=>e.command(F).command(L).command(W).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Y={command:`namespaces`,describe:`Logical namespaces that group related tables within the data catalog`,builder:e=>e.command(N).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},X={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(v).command(b).command(S).command(w).command(E).command(g).command(j).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{X as default};