cf 1.0.0-beta.17 → 1.0.0-beta.19

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 (319) hide show
  1. package/README.md +7 -0
  2. package/dist/_meta/commands.json +9122 -6086
  3. package/dist/_meta/hand-written-commands.json +6 -0
  4. package/dist/_meta/schemas.json +8392 -5576
  5. package/dist/{abuse-reports-C4LxDvUM.mjs → abuse-reports-DhgunVFo.mjs} +6 -6
  6. package/dist/{access-DnWW2AAT.mjs → access-BDoDq_WZ.mjs} +1 -1
  7. package/dist/{accounts-8UcHNm3S.mjs → accounts-DLTCzZJg.mjs} +17 -13
  8. package/dist/{acm-qRM3iy4Z.mjs → acm-DS1CosYq.mjs} +1 -1
  9. package/dist/{addressing-CAb8z2Dq.mjs → addressing-DFeYj8TY.mjs} +19 -19
  10. package/dist/{agent-memory-oIUP4ZV5.mjs → agent-memory-DXjQ8N0g.mjs} +6 -6
  11. package/dist/{ai-DnhytGdc.mjs → ai-V5YopMkS.mjs} +4 -4
  12. package/dist/{ai-audit-B7_5EOcN.mjs → ai-audit-yg8D0azz.mjs} +2 -2
  13. package/dist/{ai-gateway-b3FFu6UV.mjs → ai-gateway--dkH9qGz.mjs} +42 -42
  14. package/dist/ai-search-BRtsUaUI.mjs +79 -0
  15. package/dist/{ai-security-KUs94UW-.mjs → ai-security-DRJCcLpF.mjs} +5 -5
  16. package/dist/{alerting-CCmyEPzN.mjs → alerting-8DsyMKGG.mjs} +30 -30
  17. package/dist/{analytics-BAvBj6qx.mjs → analytics-BpYUZTtQ.mjs} +7 -7
  18. package/dist/{analytics-engine-DAJp89gM.mjs → analytics-engine-CT2E0Dkw.mjs} +1 -1
  19. package/dist/{api-security-BItVQymb.mjs → api-security-CBhWZE8z.mjs} +26 -26
  20. package/dist/{argo-DsJCvfml.mjs → argo-B0u2N3Dh.mjs} +1 -1
  21. package/dist/{artifacts-DzHXeah6.mjs → artifacts-B6XzjMiM.mjs} +1 -1
  22. package/dist/{audit-logs-D9XxsVZm.mjs → audit-logs-59fCc1aw.mjs} +1 -1
  23. package/dist/auth-5cgi8ePZ.mjs +2 -0
  24. package/dist/auth-BaUNb1Ed.mjs +2 -0
  25. package/dist/auth-ChYOc_rS.mjs +2 -0
  26. package/dist/{auth-token-Cw4c0y89.mjs → auth-token-B1pP2jaK.mjs} +1 -1
  27. package/dist/{autoconfig-9po_tqsS.mjs → autoconfig-Cdm2IFLM.mjs} +20 -20
  28. package/dist/{basin-catalog-DcMiZV9J.mjs → basin-catalog-CV05WlA4.mjs} +1 -1
  29. package/dist/{billing-COgAWTYh.mjs → billing-Ad-rK-JH.mjs} +6 -6
  30. package/dist/{blocks-Bat9A8V_.mjs → blocks-CKb_aLWN.mjs} +1 -1
  31. package/dist/body-parser-ChnyBsfm.mjs +2 -0
  32. package/dist/{bot-management-Dx3lh9Fi.mjs → bot-management-CGpfjQ4w.mjs} +4 -4
  33. package/dist/{botnet-feed-C8496Nhl.mjs → botnet-feed-CMrF6ZGq.mjs} +1 -1
  34. package/dist/{brand-protection-B0p8Sv6s.mjs → brand-protection-CP73_yX8.mjs} +5 -5
  35. package/dist/browser-run-OpUfawh_.mjs +42 -0
  36. package/dist/{build-i8l2qGVZ.mjs → build-CMPlf8mh.mjs} +1 -1
  37. package/dist/build-DQZ2w_dQ.mjs +2 -0
  38. package/dist/builds-DsRNlILV.mjs +71 -0
  39. package/dist/{cache-BUh85NRr.mjs → cache-RppXjxXA.mjs} +3 -3
  40. package/dist/{cf-Bq4pA4n6.mjs → cf-PISMdEje.mjs} +11 -11
  41. package/dist/{chunk-2HLTAS5V-D7COzUOd.mjs → chunk-2HLTAS5V-B92NbX1j.mjs} +1 -1
  42. package/dist/{chunk-2K52M2W5-CYxfQXUq.mjs → chunk-2K52M2W5-c__08AOB.mjs} +7 -7
  43. package/dist/chunk-DSGVRFIS-DfQO1boa.mjs +2 -0
  44. package/dist/{cli-DJhpXf38.mjs → cli-Dd1n2YAJ.mjs} +1 -1
  45. package/dist/{client-side-security-km3-4L_4.mjs → client-side-security-BYfwOkUo.mjs} +1 -1
  46. package/dist/{cloud-connector-BoKFprDD.mjs → cloud-connector-CQZUqAMQ.mjs} +2 -2
  47. package/dist/{cloudflared-By8BzYXc.mjs → cloudflared-C1SdXpYv.mjs} +1 -1
  48. package/dist/cloudforce-one-C1xdpspb.mjs +395 -0
  49. package/dist/{command-RC9WM5jq.mjs → command-BioiZMm9.mjs} +1 -1
  50. package/dist/{command-rx0Kb5pn.mjs → command-C0nJ2LRd.mjs} +1 -1
  51. package/dist/{command-CiApsRql.mjs → command-C5ARgURy.mjs} +1 -1
  52. package/dist/{command-CCq-Z2Ua.mjs → command-C7NIRU-u.mjs} +1 -1
  53. package/dist/{command-B694oLDo.mjs → command-C8DV-x_C.mjs} +1 -1
  54. package/dist/{command-Bmee6uwe.mjs → command-CFV1cqfR.mjs} +1 -1
  55. package/dist/{command-CbQFbfps.mjs → command-ChQXv0jP.mjs} +1 -1
  56. package/dist/{command-DCQgsd2U.mjs → command-D203VrTG.mjs} +1 -1
  57. package/dist/{command-DZfKHiru.mjs → command-D5BUzDX8.mjs} +1 -1
  58. package/dist/{command-CAs3SxlI.mjs → command-DWE7YdeC.mjs} +1 -1
  59. package/dist/{command-C6w1OdoC.mjs → command-DlB10kIb.mjs} +1 -1
  60. package/dist/{command-D1JR8Fb7.mjs → command-DmPQXNRg.mjs} +1 -1
  61. package/dist/{command-Bgb-3yPg.mjs → command-F0jlqvKr.mjs} +1 -1
  62. package/dist/{command-DppVezAB.mjs → command-FOQNhNqP.mjs} +1 -1
  63. package/dist/{command-DerHAjQL.mjs → command-yAXk5NXh.mjs} +1 -1
  64. package/dist/{completions-11latun5.mjs → completions-Bh0Hz-hA.mjs} +3 -3
  65. package/dist/{connector-interrupts-wvQcZsO1.mjs → connector-interrupts-Bd949WX0.mjs} +1 -1
  66. package/dist/{connector-telemetry-events-C0GGCIQk.mjs → connector-telemetry-events-Dw8iIg5Q.mjs} +1 -1
  67. package/dist/{connector-telemetry-snapshots-ZXzsFgea.mjs → connector-telemetry-snapshots-DqEIaz99.mjs} +1 -1
  68. package/dist/{connectors-DXIUG4Zi.mjs → connectors-RUEU1QDB.mjs} +1 -1
  69. package/dist/containers-xU-0EhLO.mjs +78 -0
  70. package/dist/{containers-WMWKhLkp.mjs → containers-yUOvm-4V.mjs} +211 -211
  71. package/dist/{content-scan-CRDmR7rD.mjs → content-scan-Cm2-Xhqo.mjs} +2 -2
  72. package/dist/{context-q-6bMSL-.mjs → context-BQ6KeMgq.mjs} +2 -2
  73. package/dist/cps-CgPduy0H.mjs +6 -0
  74. package/dist/csam-scanner-B0Ra6fXL.mjs +10 -0
  75. package/dist/{custom-csrs-BV017SqE.mjs → custom-csrs-6lfu1-RR.mjs} +1 -1
  76. package/dist/custom-hostnames-Dzov_CPw.mjs +27 -0
  77. package/dist/{custom-nameservers-BLoE8VGG.mjs → custom-nameservers-Bfhv_9_k.mjs} +1 -1
  78. package/dist/custom-pages-DxVD_f10.mjs +21 -0
  79. package/dist/{d1-Dbs8HItA.mjs → d1-D7p4uJ-e.mjs} +17 -19
  80. package/dist/delegate.mjs +1 -1
  81. package/dist/{deploy-5utIiOMN.mjs → deploy-BjWvVZol.mjs} +1 -1
  82. package/dist/deploy-context-C-ZdGP0Z.mjs +56 -0
  83. package/dist/{deploy-input-KK6yyBN_.mjs → deploy-input-B8Nq6Eh6.mjs} +1 -1
  84. package/dist/{dev-CnoMHxf4.mjs → dev-D20UkcYT.mjs} +1 -1
  85. package/dist/{diagnostics-C9B07eJY.mjs → diagnostics-DdhTemYB.mjs} +2 -2
  86. package/dist/{dialog-D4Y9ocuF.mjs → dialog-BnIgdgWi.mjs} +1 -1
  87. package/dist/discover-DEjUARkU.mjs +2 -0
  88. package/dist/{dist-DZRTPMMA.mjs → dist-CnKd5XoR.mjs} +19 -19
  89. package/dist/{dist-uRuGmkMB.mjs → dist-DAeCUX-u.mjs} +3 -3
  90. package/dist/{dls-lbM3i4x-.mjs → dls-BBODA9Rk.mjs} +1 -1
  91. package/dist/{dns-QTMPGYMa.mjs → dns-CK_hyn5q.mjs} +22 -22
  92. package/dist/{dns-firewall-Bfv0S44I.mjs → dns-firewall-DbvX9R-7.mjs} +9 -9
  93. package/dist/{docs-bV3hPwQL.mjs → docs-BDTijwM3.mjs} +1 -1
  94. package/dist/{dot-prop-IITUZ2XW-BnPfnQkb.mjs → dot-prop-IITUZ2XW-C4pkmT-K.mjs} +1 -1
  95. package/dist/{dotenv-usOKkeW7.mjs → dotenv-Ck-6V1hm.mjs} +1 -1
  96. package/dist/{dry-run-C2KjGX10.mjs → dry-run-DQmFkNK_.mjs} +1 -1
  97. package/dist/{durable-objects-0JvGTV27.mjs → durable-objects-DcFbd1Ka.mjs} +1 -1
  98. package/dist/{email-auth-PzRqG0ex.mjs → email-auth-BEgDxU-g.mjs} +1 -1
  99. package/dist/{email-routing-BgHL0Rbz.mjs → email-routing-DKWmPOVo.mjs} +13 -13
  100. package/dist/{email-security-CSTKIecn.mjs → email-security-RWbAp8qa.mjs} +44 -44
  101. package/dist/{email-sending-BSwuAir8.mjs → email-sending-BbJy_vl8.mjs} +18 -18
  102. package/dist/error-sanitization-Byb-_IS9.mjs +2 -0
  103. package/dist/{error-sanitization-pOyzm2F1.mjs → error-sanitization-DWJ5ka7h.mjs} +1 -1
  104. package/dist/{field-extractors-B_lFnwaL.mjs → field-extractors-Bob6udAc.mjs} +2 -2
  105. package/dist/{firewall-BsZxVitA.mjs → firewall-DziiEsR8.mjs} +20 -20
  106. package/dist/{flagship-qBohOZaM.mjs → flagship-xOtgddUK.mjs} +11 -11
  107. package/dist/{fraud-vGNdrSm-.mjs → fraud-BUS7i5Yh.mjs} +1 -1
  108. package/dist/generate-D6V4Q58z.mjs +2 -0
  109. package/dist/get-BTisquA3.mjs +2 -0
  110. package/dist/{google-tag-gateway-BHdOg4VW.mjs → google-tag-gateway-DgSzyeK-.mjs} +1 -1
  111. package/dist/{gt-3bcLGJ7V.mjs → gt-D6YemCLh.mjs} +1 -1
  112. package/dist/healthchecks-CbD2PsnM.mjs +22 -0
  113. package/dist/{hyperdrive-CXTqaIqk.mjs → hyperdrive-Cs_cfSXU.mjs} +1 -1
  114. package/dist/{iam-Dl_n_Lqq.mjs → iam-DvsCztqU.mjs} +9 -9
  115. package/dist/{images-vMtXk2Rf.mjs → images-BipVjHNw.mjs} +37 -37
  116. package/dist/index.mjs +1 -1
  117. package/dist/init-LvFgCsNX.mjs +43 -0
  118. package/dist/{intel-Bq4GGXv-.mjs → intel-D1LPkkBM.mjs} +31 -41
  119. package/dist/{interactive-BW9T1D1q.mjs → interactive-d_lFnSev.mjs} +3 -3
  120. package/dist/interactive-pjVqirHx.mjs +2 -0
  121. package/dist/{ips-BcvZS46g.mjs → ips-2iUGs8ws.mjs} +1 -1
  122. package/dist/{k2-DL4hrVTj.mjs → k2-DGzRm3NJ.mjs} +2 -2
  123. package/dist/{kv-BLo9wMgb.mjs → kv-BW-s9MJY.mjs} +4 -4
  124. package/dist/{lazy-command-CRcT6Dx-.mjs → lazy-command-Bq-rWPQe.mjs} +1 -1
  125. package/dist/{leaked-credential-checks-Dx4RXMyN.mjs → leaked-credential-checks-CnY6ih6p.mjs} +1 -1
  126. package/dist/load-balancers-CtnusAzP.mjs +76 -0
  127. package/dist/{local-Dil4fTWX.mjs → local-B4sZZTRA.mjs} +1 -1
  128. package/dist/local-DCnFIgLJ.mjs +2 -0
  129. package/dist/{local-runtime-B7TKFu6E.mjs → local-runtime-DoBuyriC.mjs} +1 -1
  130. package/dist/login-CqZJgUF1.mjs +5 -0
  131. package/dist/{login-Du_W6b9o.mjs → login-DR60WiAY.mjs} +1 -1
  132. package/dist/{logo-matches-C-1J0Oc3.mjs → logo-matches-C1-6KOkZ.mjs} +1 -1
  133. package/dist/{logos-BuhvSu_H.mjs → logos-Yzhd-VKb.mjs} +2 -2
  134. package/dist/logpush-JYG4gXZ-.mjs +46 -0
  135. package/dist/{logs-CaKOk-1v.mjs → logs-DLblEjK0.mjs} +3 -3
  136. package/dist/{magic-cloud-networking-CKxXYT8r.mjs → magic-cloud-networking-CblQwsQr.mjs} +13 -13
  137. package/dist/{magic-network-monitoring-BykFGQCz.mjs → magic-network-monitoring-D2px4Ep4.mjs} +9 -9
  138. package/dist/{magic-transit-DYULsrUP.mjs → magic-transit-Bnwsi0UQ.mjs} +170 -170
  139. package/dist/{managed-defense-DIb_uN25.mjs → managed-defense-CTtNoxzW.mjs} +9 -9
  140. package/dist/{managed-transforms-an3wQ0DW.mjs → managed-transforms-B92mJi5i.mjs} +2 -2
  141. package/dist/{matches-DkLSWb5X.mjs → matches-CzbL1XD-.mjs} +1 -1
  142. package/dist/{mcp-BcV1XqE8.mjs → mcp-Cic_aMer.mjs} +10 -10
  143. package/dist/{mesh-CSSlZ-0F.mjs → mesh-DZTgD16C.mjs} +14 -14
  144. package/dist/{migrate-DerOyuv2.mjs → migrate-DtNDRcAI.mjs} +1 -1
  145. package/dist/{monetization-B-nJ0SyI.mjs → monetization-DCQ2_niU.mjs} +4 -4
  146. package/dist/{network-ZzxQ_Dcz.mjs → network-BqMqD2qn.mjs} +27 -25
  147. package/dist/{network-interconnects-CI9NXQpe.mjs → network-interconnects-BFQ1yARl.mjs} +2 -2
  148. package/dist/o11y-CS5q1vSh.mjs +93 -0
  149. package/dist/oauth-DPLYUvRl.mjs +2 -0
  150. package/dist/oauth-DdYSPYoE.mjs +4 -0
  151. package/dist/{oauth-clients-BA30rTEl.mjs → oauth-clients-9BPswYm_.mjs} +1 -1
  152. package/dist/{oauth-scopes-hseWES1v.mjs → oauth-scopes-CLOKfQi2.mjs} +1 -1
  153. package/dist/{open-PCXX3ZDZ-5J5IU2MX-CKla-jDt.mjs → open-PCXX3ZDZ-5J5IU2MX-DFe2CQkm.mjs} +1 -1
  154. package/dist/{open-PCXX3ZDZ-D55O2jpQ.mjs → open-PCXX3ZDZ-BD2iNJqn.mjs} +1 -1
  155. package/dist/organization-DFRN2g6z.mjs +75 -0
  156. package/dist/{organizations-CcgZPmFl.mjs → organizations-yiGopnKf.mjs} +1 -1
  157. package/dist/{origin-post-quantum-encryption-BhdlaolV.mjs → origin-post-quantum-encryption-n9gsxikn.mjs} +1 -1
  158. package/dist/output-O6b9MR9R.mjs +2 -0
  159. package/dist/{page-rules-DFfqfllI.mjs → page-rules-F1Jdxx6A.mjs} +4 -4
  160. package/dist/pages-CezC0YrR.mjs +54 -0
  161. package/dist/pay-per-crawl-fZ-kTBbN.mjs +38 -0
  162. package/dist/{pay-per-use-C_HxhpM4.mjs → pay-per-use-B14BTKVI.mjs} +8 -8
  163. package/dist/pipelines-BN7ydBHl.mjs +44 -0
  164. package/dist/precursor-B88RDDZT.mjs +4 -0
  165. package/dist/previews-CiqRIq_k.mjs +7 -0
  166. package/dist/process-DiXf4VPi.mjs +2 -0
  167. package/dist/{progress-DaQ4MzBI.mjs → progress-CdlDthXA.mjs} +1 -1
  168. package/dist/{prompt-KWYZvJWM.mjs → prompt-1AC-qwxS.mjs} +1 -1
  169. package/dist/{queries-DoyhspQf.mjs → queries-C2sgUI9j.mjs} +3 -3
  170. package/dist/{queues-BPxTU2rU.mjs → queues-DCP5x-PZ.mjs} +17 -17
  171. package/dist/{r2-CQt4S7o7.mjs → r2-D7UhzWR7.mjs} +21 -21
  172. package/dist/{radar-CALpR1vq.mjs → radar-osOiFeY_.mjs} +1 -1
  173. package/dist/{raw-fetch-Cy09TjHc.mjs → raw-fetch-1VlXDwwX.mjs} +1 -1
  174. package/dist/{realtime-BiHKBoI4.mjs → realtime-DCnqxiWo.mjs} +90 -87
  175. package/dist/registrar-DAFYjjRa.mjs +43 -0
  176. package/dist/{registrar-sandbox-BttFwYqE.mjs → registrar-sandbox-zeNHABZ0.mjs} +11 -9
  177. package/dist/{registry-CRnk93ur.mjs → registry-DG4ZiuN9.mjs} +1 -1
  178. package/dist/{reporting-8aRJD5HX.mjs → reporting-KehV_PXm.mjs} +1 -1
  179. package/dist/{request-headers-CqfJOkpO.mjs → request-headers-ojAw3pQO.mjs} +1 -1
  180. package/dist/request-tracers-BStCgh6m.mjs +4 -0
  181. package/dist/resolve-BGNMAcGR.mjs +2 -0
  182. package/dist/{resource-sharing-uVVpMW0w.mjs → resource-sharing-3xtSgWG7.mjs} +19 -19
  183. package/dist/{rules-CFOuN3t2.mjs → rules-7F-G2Bg_.mjs} +6 -6
  184. package/dist/{rulesets-DkhV2Hny.mjs → rulesets-B0YtS2br.mjs} +20 -20
  185. package/dist/{rum-BnMW0Tlb.mjs → rum-B3V6tqS-.mjs} +6 -6
  186. package/dist/{run-Clc3P2u7.mjs → run-B_07PrkW.mjs} +1 -1
  187. package/dist/run-D6AJfZT-.mjs +2 -0
  188. package/dist/{schema-S3pUZwpI.mjs → schema-C-tyhSnb.mjs} +1 -1
  189. package/dist/{schema-flags-b096XMpt.mjs → schema-flags-DY3OKCvr.mjs} +4 -4
  190. package/dist/{scim-tvZm6A-r.mjs → scim-CQ9TdajH.mjs} +6 -6
  191. package/dist/{secrets-store-DuNxSh1_.mjs → secrets-store-Dl2hDxXu.mjs} +2 -2
  192. package/dist/{security-insights-C17c9ZYZ.mjs → security-insights-BsLMdo1r.mjs} +2 -2
  193. package/dist/{security-txt-D4pRk7-w.mjs → security-txt-pCAiHvys.mjs} +1 -1
  194. package/dist/session-BsNzFtPi.mjs +2 -0
  195. package/dist/shared-CWBjMZDR.mjs +2 -0
  196. package/dist/smart-shield-BTXQsVxz.mjs +24 -0
  197. package/dist/{snippets-BIcZ6vSW.mjs → snippets-CYVieyc3.mjs} +3 -3
  198. package/dist/source-AlTrHNem.mjs +6 -0
  199. package/dist/{spawn-BW2bJmKO.mjs → spawn-Bdznd0EB.mjs} +2 -2
  200. package/dist/{spectrum-DjDX0geK.mjs → spectrum-DLRr4Q03.mjs} +14 -14
  201. package/dist/{speed-DiPoFJMm.mjs → speed-BJfaDYxz.mjs} +13 -13
  202. package/dist/sql-DQ4xrdc2.mjs +4 -0
  203. package/dist/src-BnMvFE3q.mjs +125 -0
  204. package/dist/ssl-CL1B69Pw.mjs +139 -0
  205. package/dist/startup-profile-DuaJFX1y.mjs +2 -0
  206. package/dist/startup-profile-HMblAiBi.mjs +29 -0
  207. package/dist/{state-Boubf1X6.mjs → state-DN9yfd2C.mjs} +1 -1
  208. package/dist/state-DePlO0Kv.mjs +2 -0
  209. package/dist/{stream-uhn_Zsni.mjs → stream-DrMZOO5u.mjs} +55 -55
  210. package/dist/{submit-C3suIDBX.mjs → submit-DjlLoVk2.mjs} +1 -1
  211. package/dist/tags-DY7Ur1k-.mjs +23 -0
  212. package/dist/{telemetry-DYjsavEr.mjs → telemetry-BG3kcYsV.mjs} +1 -1
  213. package/dist/telemetry-Dpm6GfZD.mjs +2 -0
  214. package/dist/{tenant-DK88yQM4.mjs → tenant-BEMfNMjO.mjs} +1 -1
  215. package/dist/{tenant-custom-nameservers-BZ1JD1Yf.mjs → tenant-custom-nameservers-CCRbb0ch.mjs} +1 -1
  216. package/dist/{tools-BCCRUENY.mjs → tools-ZffhHUDd.mjs} +1 -1
  217. package/dist/tunnels-_JXe-UgM.mjs +29 -0
  218. package/dist/{turnstile-DXrbEy2A.mjs → turnstile-DXEfneQq.mjs} +5 -5
  219. package/dist/ui-CY79jlGZ.mjs +2 -0
  220. package/dist/update-check-DfbYVefm.mjs +2 -0
  221. package/dist/{update-check-BhhtSXVZ.mjs → update-check-atcehhBC.mjs} +1 -1
  222. package/dist/update-check-worker.mjs +1 -1
  223. package/dist/{url-info-a0mY4UsC.mjs → url-info-B1kL9asc.mjs} +1 -1
  224. package/dist/{url-normalization-DiwpDIhc.mjs → url-normalization-CUHKRKJh.mjs} +1 -1
  225. package/dist/url-scanner-OnZP_-jm.mjs +16 -0
  226. package/dist/{user-DDH9lxf5.mjs → user-BBBuFNj4.mjs} +59 -59
  227. package/dist/{vectorize-DaT3amFV.mjs → vectorize-DcctB8bw.mjs} +17 -17
  228. package/dist/version-CLgSHoNm.mjs +2 -0
  229. package/dist/{waiting-rooms-BGMpu9gS.mjs → waiting-rooms-JaFE5wP1.mjs} +13 -13
  230. package/dist/{web-assets-NqNglLSI.mjs → web-assets-Cu0swUPe.mjs} +35 -35
  231. package/dist/{web3-UnCUuIfB.mjs → web3-C67z4OtQ.mjs} +6 -6
  232. package/dist/workers-ClTP0Ysl.mjs +43 -0
  233. package/dist/workers-builds-C5wKhvKe.mjs +14 -0
  234. package/dist/{workers-for-platforms-JscCHivQ.mjs → workers-for-platforms-rxwkYyb3.mjs} +25 -22
  235. package/dist/{workers-vpc-FDZQBqOu.mjs → workers-vpc-B4vyvr1W.mjs} +1 -1
  236. package/dist/{workflows-Dq-k81hU.mjs → workflows-COJ5jwvk.mjs} +24 -24
  237. package/dist/wrangler-migration-Cp546RDG.mjs +946 -0
  238. package/dist/zaraz-BkZ7yW05.mjs +22 -0
  239. package/dist/{zero-trust-CZ685QhO.mjs → zero-trust-lUFLYuL1.mjs} +509 -454
  240. package/dist/{zone-DcZIUTWt.mjs → zone-CC1_qxt-.mjs} +1 -1
  241. package/dist/{zones-BVdvYUCv.mjs → zones-BRiLlTmW.mjs} +45 -36
  242. package/package.json +14 -14
  243. package/dist/account-tags-zvHRQZxb.mjs +0 -15
  244. package/dist/ai-search-CtfW5fzl.mjs +0 -79
  245. package/dist/auth-C530fHKQ.mjs +0 -2
  246. package/dist/auth-Ccm5viK_.mjs +0 -2
  247. package/dist/auth-MNz2D-PD.mjs +0 -2
  248. package/dist/body-parser-DkHKPkJ7.mjs +0 -2
  249. package/dist/browser-run-ChXohmNG.mjs +0 -42
  250. package/dist/build-BRJnyeu8.mjs +0 -2
  251. package/dist/builds-DmEFTQTa.mjs +0 -71
  252. package/dist/certificate-authorities-BTLdA7EQ.mjs +0 -6
  253. package/dist/chunk-DSGVRFIS-C5SqiTOz.mjs +0 -2
  254. package/dist/client-certificates-B3UxH_Au.mjs +0 -13
  255. package/dist/cloudforce-one-DN5N3C3w.mjs +0 -405
  256. package/dist/containers-DCH6MFjY.mjs +0 -78
  257. package/dist/cps-Due0P5IW.mjs +0 -6
  258. package/dist/csam-scanner-DvLrPw45.mjs +0 -10
  259. package/dist/ct-alerting-BtEGkRJi.mjs +0 -5
  260. package/dist/custom-certificates-CMLXTTEc.mjs +0 -17
  261. package/dist/custom-hostnames-DI_dFaof.mjs +0 -27
  262. package/dist/custom-pages-ubava9Qm.mjs +0 -21
  263. package/dist/dcv-delegation-sGGt6UU_.mjs +0 -4
  264. package/dist/deploy-context-C0iVbWRG.mjs +0 -56
  265. package/dist/discover-DIDEGKo3.mjs +0 -2
  266. package/dist/error-sanitization-CIQOep3I.mjs +0 -2
  267. package/dist/generate-D80-1GnZ.mjs +0 -2
  268. package/dist/get-By1q8YlI.mjs +0 -2
  269. package/dist/healthchecks-DAYYLZ6u.mjs +0 -22
  270. package/dist/hostnames-CLlaMqHu.mjs +0 -11
  271. package/dist/init-_7djeBVw.mjs +0 -43
  272. package/dist/interactive-DGUWZ2Gk.mjs +0 -2
  273. package/dist/keyless-certificates-0pzjkZb6.mjs +0 -13
  274. package/dist/keys-BSV5IXdU.mjs +0 -4
  275. package/dist/load-balancers-CCCWoQXv.mjs +0 -76
  276. package/dist/local-DxWDQDnG.mjs +0 -2
  277. package/dist/login-DT6Q1UJw.mjs +0 -5
  278. package/dist/logpush-DgZtF9vG.mjs +0 -46
  279. package/dist/mtls-certificates-ukwDz6Lc.mjs +0 -13
  280. package/dist/o11y-LG6Y9LUZ.mjs +0 -93
  281. package/dist/oauth-Bx693Af5.mjs +0 -2
  282. package/dist/oauth-CP82E1_0.mjs +0 -4
  283. package/dist/organization-DMr_z6n4.mjs +0 -71
  284. package/dist/origin-ca-certificates-BZxUbB5N.mjs +0 -11
  285. package/dist/origin-tls-client-auth-DzbZvtmi.mjs +0 -30
  286. package/dist/output-Co4xdFf6.mjs +0 -2
  287. package/dist/pages-BkcL5rC4.mjs +0 -54
  288. package/dist/pay-per-crawl-Dulm7Xy5.mjs +0 -38
  289. package/dist/pipelines-DUMIVwof.mjs +0 -44
  290. package/dist/precursor-DsGbA_YJ.mjs +0 -4
  291. package/dist/previews-Cma3-M7K.mjs +0 -7
  292. package/dist/process-2wmDCy17.mjs +0 -2
  293. package/dist/registrar-gERQ3b85.mjs +0 -43
  294. package/dist/request-tracers-DcnwQg3K.mjs +0 -4
  295. package/dist/resolve-BpgXeklt.mjs +0 -2
  296. package/dist/resource-tagging-SlsUtLsq.mjs +0 -4
  297. package/dist/run-CHNyLZLG.mjs +0 -2
  298. package/dist/session-Cq3YNLoI.mjs +0 -2
  299. package/dist/shared-zePemxHi.mjs +0 -2
  300. package/dist/smart-shield-2egm1Vaw.mjs +0 -24
  301. package/dist/source-mXUcrTVw.mjs +0 -6
  302. package/dist/sql-DLjCt_R3.mjs +0 -4
  303. package/dist/src-CutrsNl4.mjs +0 -125
  304. package/dist/ssl-vNzK0c9S.mjs +0 -45
  305. package/dist/startup-profile-BOaseXnO.mjs +0 -29
  306. package/dist/startup-profile-BwEZFVGS.mjs +0 -2
  307. package/dist/state-CODDG9Nx.mjs +0 -2
  308. package/dist/tags-Dy2jG-Dt.mjs +0 -4
  309. package/dist/telemetry-Bdv5LZZs.mjs +0 -2
  310. package/dist/tunnels-DjbomhCa.mjs +0 -29
  311. package/dist/ui-BtIBQeaG.mjs +0 -2
  312. package/dist/update-check-Dld7rbLd.mjs +0 -2
  313. package/dist/url-scanner-D0egjBe5.mjs +0 -16
  314. package/dist/values-Bfr5-bL6.mjs +0 -4
  315. package/dist/version-CAuKDZAG.mjs +0 -2
  316. package/dist/workers-DfA9ugmb.mjs +0 -40
  317. package/dist/workers-builds-Cy6fdtm5.mjs +0 -14
  318. package/dist/wrangler-migration-R9TQ_4Qd.mjs +0 -946
  319. package/dist/zaraz-Dpr1pLDx.mjs +0 -22
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-MNz2D-PD.mjs";import{a as i,t as a}from"./context-q-6bMSL-.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-DaQ4MzBI.mjs";import{t as l}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-KWYZvJWM.mjs";import{n as y,t as b}from"./raw-fetch-Cy09TjHc.mjs";function ee(e){return e.usage(`$0 r2 buckets cors delete <bucket-name>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B4sZZTRA.mjs";import{i as n,n as r}from"./auth-BaUNb1Ed.mjs";import{a as i,t as a}from"./context-BQ6KeMgq.mjs";import{t as o}from"./output-O6b9MR9R.mjs";import{t as s}from"./dry-run-DQmFkNK_.mjs";import{t as c}from"./progress-CdlDthXA.mjs";import{t as l}from"./run-B_07PrkW.mjs";import"./telemetry-Dpm6GfZD.mjs";import{a as u,n as d,s as f,t as p}from"./body-parser-ChnyBsfm.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-1AC-qwxS.mjs";import{n as y,t as b}from"./raw-fetch-1VlXDwwX.mjs";function ee(e){return e.usage(`$0 r2 buckets cors delete <bucket-name>
3
3
 
4
4
  Delete the CORS policy for a bucket.`).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 te={command:`delete <bucket-name>`,describe:`Delete Bucket CORS Policy`,builder:ee,handler:async e=>l({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This removes the R2 bucket's CORS policy. Browser requests that depend on these cross-origin permissions may fail.`})){process.stderr.write(`Aborted.
5
5
  `);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function ne(e){return e.usage(`$0 r2 buckets cors get <bucket-name>
6
6
 
7
7
  Get the CORS policy for a bucket.`).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 re={command:`get <bucket-name>`,describe:`Get Bucket CORS Policy`,builder:ne,handler:async e=>l({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function ie(e){return e.usage(`$0 r2 buckets cors update <bucket-name>
8
8
 
9
- Replaces the Cross-Origin Resource Sharing (CORS) rules for an R2 bucket. Rules specify which origins, methods, and headers are allowed for browser requests to objects in the bucket.`).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(`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 ae={command:`update <bucket-name>`,describe:`Set Bucket CORS Policy`,builder:ie,handler:async e=>l({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:f(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's CORS policy. Browser requests that relied on the previous rules may fail.`})){process.stderr.write(`Aborted.
10
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&u(g,[`rules`],f(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},oe={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(te).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage("$0 r2 buckets create-by-name <bucket-name>\n\nCreates 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`.").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 S={command:`create-by-name <bucket-name>`,describe:`Create Bucket (by name)`,builder:x,handler:async e=>l({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Updated`})})};function C(e){return e.usage(`$0 r2 buckets create
9
+ Replaces the Cross-Origin Resource Sharing (CORS) rules for an R2 bucket. Rules specify which origins, methods, and headers are allowed for browser requests to objects in the bucket.`).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(`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 ae={command:`update <bucket-name>`,describe:`Set Bucket CORS Policy`,builder:ie,handler:async e=>l({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's CORS policy. Browser requests that relied on the previous rules may fail.`})){process.stderr.write(`Aborted.
10
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},oe={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(te).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage("$0 r2 buckets create-by-name <bucket-name>\n\nCreates 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`.").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 S={command:`create-by-name <bucket-name>`,describe:`Create Bucket (by name)`,builder:x,handler:async e=>l({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Updated`})})};function C(e){return e.usage(`$0 r2 buckets create
11
11
 
12
- Creates an R2 bucket in the account and selected jurisdiction, with an optional location hint and default storage class.`).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`]}).coerce(`location-hint`,e=>m(e,`location-hint`,`text`)).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`}).coerce(`storage-class`,e=>m(e,`storage-class`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create Bucket`,builder:C,handler:async e=>l({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({locationHint:e[`location-hint`],name:m(e.name,`name`,`text`),storageClass:e[`storage-class`]}):d(e.body)});return}let f=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`Name of the bucket.`));let _={};e[`location-hint`]!==void 0&&u(_,[`locationHint`],e[`location-hint`]),e.name!==void 0&&u(_,[`name`],m(e.name,`name`,`text`)),e[`storage-class`]!==void 0&&u(_,[`storageClass`],e[`storage-class`]);let v=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function T(e){return e.usage(`$0 r2 buckets delete <bucket-name>
12
+ Creates an R2 bucket in the account and selected jurisdiction, with an optional location hint and default storage class.`).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`]}).coerce(`location-hint`,e=>m(e,`location-hint`,`text`)).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`}).coerce(`storage-class`,e=>m(e,`storage-class`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create Bucket`,builder:C,handler:async e=>l({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({locationHint:e[`location-hint`],name:m(e.name,`name`,`text`),storageClass:e[`storage-class`]}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`Name of the bucket.`));let _={};e[`location-hint`]!==void 0&&f(_,[`locationHint`],e[`location-hint`]),e.name!==void 0&&f(_,[`name`],m(e.name,`name`,`text`)),e[`storage-class`]!==void 0&&f(_,[`storageClass`],e[`storage-class`]);let v=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function T(e){return e.usage(`$0 r2 buckets delete <bucket-name>
13
13
 
14
14
  Deletes an empty R2 bucket and its configuration. The bucket must have no objects, no in-progress multipart uploads, and no event notification rules; otherwise the request fails.`).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 E={command:`delete <bucket-name>`,describe:`Delete Bucket`,builder:T,handler:async e=>l({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This permanently deletes the empty R2 bucket and its configuration.`})){process.stderr.write(`Aborted.
15
15
  `);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function D(e){return e.usage(`$0 r2 buckets domains custom create <bucket-name>
16
16
 
17
- Register a new custom domain for an existing R2 bucket.`).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`]}).coerce(`min-tls`,e=>m(e,`min-tls`,`text`)).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 O={command:`create <bucket-name>`,describe:`Attach Custom Domain To Bucket`,builder:D,handler:async e=>l({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,domain:m(e.domain,`domain`,`text`),enabled:e.enabled,minTLS:e[`min-tls`],zoneId:m(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let f=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}if(e.domain===void 0&&(e.domain=await g(`domain`,`Name of the custom domain to be added.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`Zone ID of the custom domain.`));let _={};e.ciphers!==void 0&&u(_,[`ciphers`],e.ciphers),e.domain!==void 0&&u(_,[`domain`],m(e.domain,`domain`,`text`)),e.enabled!==void 0&&u(_,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&u(_,[`minTLS`],e[`min-tls`]),e[`zone-id`]!==void 0&&u(_,[`zoneId`],m(e[`zone-id`],`zone-id`,`text`));let v=await c(`Creating`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function k(e){return e.usage(`$0 r2 buckets domains custom delete <domain>
17
+ Register a new custom domain for an existing R2 bucket.`).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`]}).coerce(`min-tls`,e=>m(e,`min-tls`,`text`)).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 O={command:`create <bucket-name>`,describe:`Attach Custom Domain To Bucket`,builder:D,handler:async e=>l({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,domain:m(e.domain,`domain`,`text`),enabled:e.enabled,minTLS:e[`min-tls`],zoneId:m(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}if(e.domain===void 0&&(e.domain=await g(`domain`,`Name of the custom domain to be added.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`Zone ID of the custom domain.`));let _={};e.ciphers!==void 0&&f(_,[`ciphers`],e.ciphers),e.domain!==void 0&&f(_,[`domain`],m(e.domain,`domain`,`text`)),e.enabled!==void 0&&f(_,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&f(_,[`minTLS`],e[`min-tls`]),e[`zone-id`]!==void 0&&f(_,[`zoneId`],m(e[`zone-id`],`zone-id`,`text`));let v=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{successLabel:`Created`})})};function k(e){return e.usage(`$0 r2 buckets domains custom delete <domain>
18
18
 
19
19
  Disconnects a custom domain from an R2 bucket and removes its configuration. Access through other enabled custom domains or the bucket's r2.dev domain is unaffected.`).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 A={command:`delete <domain>`,describe:`Remove Custom Domain From Bucket`,builder:k,handler:async e=>l({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This disconnects the custom domain from the R2 bucket. Access through other enabled domains remains available.`})){process.stderr.write(`Aborted.
20
20
  `);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function j(e){return e.usage(`$0 r2 buckets domains custom get <domain>
@@ -23,35 +23,35 @@ Get the configuration for a custom domain on an existing R2 bucket.`).positional
23
23
 
24
24
  Gets a list of all custom domains registered with an existing R2 bucket.`).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 P={command:`list`,describe:`List Custom Domains of Bucket`,builder:N,handler:async e=>l({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 r2 buckets domains custom update <domain>
25
25
 
26
- Edit the configuration for a custom domain on an existing R2 bucket.`).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`]}).coerce(`min-tls`,e=>m(e,`min-tls`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <domain>`,describe:`Configure Custom Domain Settings`,builder:F,handler:async e=>l({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,enabled:e.enabled,minTLS:e[`min-tls`]}):d(e.body)});return}let f=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let h={};e.ciphers!==void 0&&u(h,[`ciphers`],e.ciphers),e.enabled!==void 0&&u(h,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&u(h,[`minTLS`],e[`min-tls`]);let g=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Updated`})})},L={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(O).command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.usage(`$0 r2 buckets domains managed list
26
+ Edit the configuration for a custom domain on an existing R2 bucket.`).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`]}).coerce(`min-tls`,e=>m(e,`min-tls`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <domain>`,describe:`Configure Custom Domain Settings`,builder:F,handler:async e=>l({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,enabled:e.enabled,minTLS:e[`min-tls`]}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let h={};e.ciphers!==void 0&&f(h,[`ciphers`],e.ciphers),e.enabled!==void 0&&f(h,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&f(h,[`minTLS`],e[`min-tls`]);let g=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Updated`})})},L={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(O).command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.usage(`$0 r2 buckets domains managed list
27
27
 
28
28
  Gets the R2 bucket's managed r2.dev domain and whether public access is enabled. The r2.dev domain is rate-limited and intended for development use.`).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 z={command:`list`,describe:`Get r2.dev Domain of Bucket`,builder:R,handler:async e=>l({command:`r2 buckets domains managed list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function B(e){return e.usage(`$0 r2 buckets domains managed update <bucket-name>
29
29
 
30
- Enables or disables public access to the R2 bucket through its managed r2.dev domain. Custom domain access is unaffected. The r2.dev domain is rate-limited and intended for development use.`).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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update <bucket-name>`,describe:`Update r2.dev Domain of Bucket`,builder:B,handler:async e=>l({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});return}let f=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.force,message:`This changes public access to the R2 bucket through its r2.dev domain.`})){process.stderr.write(`Aborted.
31
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};e.enabled!==void 0&&u(h,[`enabled`],e.enabled);let g=await c(`Deleting`,async()=>n(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Deleted`})})},H={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(L).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 r2 buckets edit <bucket-name>
30
+ Enables or disables public access to the R2 bucket through its managed r2.dev domain. Custom domain access is unaffected. The r2.dev domain is rate-limited and intended for development use.`).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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update <bucket-name>`,describe:`Update r2.dev Domain of Bucket`,builder:B,handler:async e=>l({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.force,message:`This changes public access to the R2 bucket through its r2.dev domain.`})){process.stderr.write(`Aborted.
31
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};e.enabled!==void 0&&f(h,[`enabled`],e.enabled);let g=await c(`Deleting`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Deleted`})})},H={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(L).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 r2 buckets edit <bucket-name>
32
32
 
33
33
  Changes the default storage class for newly uploaded objects in an existing R2 bucket. Existing objects retain their storage class, and individual uploads can override the bucket default.`).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 G={command:`edit <bucket-name>`,describe:`Patch Bucket`,builder:W,handler:async e=>l({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Updating`,async()=>n(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Updated`})})};function K(e){return e.usage(`$0 r2 buckets event-notifications delete <queue-id>
34
34
 
35
- Deletes the specified event notification rules for an R2 bucket and Cloudflare Queue. Provide ruleIds in the request body to select rules. If no body is provided, all rules for that bucket and queue are deleted.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,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 q={command:`delete <queue-id>`,describe:`Delete Event Notification Rules`,builder:K,handler:async e=>l({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({ruleIds:e[`rule-ids`]}):d(e.body)});return}let f=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.force,message:`This deletes event notification rules for the selected R2 bucket and queue. Without a request body, all rules for that bucket and queue are deleted.`})){process.stderr.write(`Aborted.
36
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(f,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let h={};e[`rule-ids`]!==void 0&&u(h,[`ruleIds`],e[`rule-ids`]);let g=await c(`Deleting`,async()=>n(f,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Deleted`})})};function se(e){return e.usage(`$0 r2 buckets event-notifications get <queue-id>
35
+ Deletes the specified event notification rules for an R2 bucket and Cloudflare Queue. Provide ruleIds in the request body to select rules. If no body is provided, all rules for that bucket and queue are deleted.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,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 q={command:`delete <queue-id>`,describe:`Delete Event Notification Rules`,builder:K,handler:async e=>l({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({ruleIds:e[`rule-ids`]}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.force,message:`This deletes event notification rules for the selected R2 bucket and queue. Without a request body, all rules for that bucket and queue are deleted.`})){process.stderr.write(`Aborted.
36
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let h={};e[`rule-ids`]!==void 0&&f(h,[`ruleIds`],e[`rule-ids`]);let g=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Deleted`})})};function se(e){return e.usage(`$0 r2 buckets event-notifications get <queue-id>
37
37
 
38
38
  Gets the event notification rules for the specified R2 bucket and Cloudflare Queue. The response includes the queue's configuration and its array of rules.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,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 ce={command:`get <queue-id>`,describe:`Get Event Notification Rules for a Queue`,builder:se,handler:async e=>l({command:`r2 buckets event-notifications get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function le(e){return e.usage(`$0 r2 buckets event-notifications list
39
39
 
40
40
  Lists event notification rules for an R2 bucket, grouped by the Cloudflare Queue that receives matching object events.`).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 ue={command:`list`,describe:`List Event Notification Rules`,builder:le,handler:async e=>l({command:`r2 buckets event-notifications list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function de(e){return e.usage(`$0 r2 buckets event-notifications update <queue-id>
41
41
 
42
- Creates rules that send notifications for matching R2 object events to the specified Cloudflare Queue. Rules can filter objects by key prefix and suffix. New rules are added to any existing rules for the queue; a rule that overlaps an existing rule is rejected.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,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 fe={command:`update <queue-id>`,describe:`Create Event Notification Rules`,builder:de,handler:async e=>l({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:f(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};e.rules!==void 0&&u(g,[`rules`],f(e.rules,`rules`));let _=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},pe={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(q).command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.usage(`$0 r2 buckets get <bucket-name>
42
+ Creates rules that send notifications for matching R2 object events to the specified Cloudflare Queue. Rules can filter objects by key prefix and suffix. New rules are added to any existing rules for the queue; a rule that overlaps an existing rule is rejected.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,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 fe={command:`update <queue-id>`,describe:`Create Event Notification Rules`,builder:de,handler:async e=>l({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},pe={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(q).command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.usage(`$0 r2 buckets get <bucket-name>
43
43
 
44
44
  Gets properties of an existing R2 bucket.`).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 he={command:`get <bucket-name>`,describe:`Get Bucket`,builder:me,handler:async e=>l({command:`r2 buckets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function ge(e){return e.usage('$0 r2 buckets jobs create <bucket-name>\n\nCreates a background job for an R2 bucket. The `jobType` field selects the job: - **`prefixDelete`**: deletes every object whose key begins with `prefix`. A non-empty prefix must end in `/`. An empty prefix (`""`) empties the entire bucket. - **`storageClassMigration`**: migrates every object in the bucket between storage classes. `sourceStorageClass` and `destinationStorageClass` must be provided together and must differ; omitting both migrates from `InfrequentAccess` to `Standard`. Poll the returned `id` with the Get Bucket Job endpoint. Small prefix-delete jobs can finish synchronously and return `COMPLETED`. Objects uploaded after a background job starts are not affected by that job. For prefix-delete jobs: abort active multipart uploads before submitting the request, since a synchronously completed job does not abort them, and avoid writing objects or starting multipart uploads while a bucket-emptying job is in progress. Each request creates a distinct job, and the number of active prefix-delete 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 (HTTP 409 / error code 10083). 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. Prefix-delete jobs require permission to delete objects; storage-class migration jobs require permission to write to the bucket.').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-data-catalog-check`,{type:`string`,description:`For prefix-delete jobs, set this header to reject the request when R2 Data Catalog is enabled for the bucket.`}).option(`job-type`,{type:`string`,description:`The jobType field`,choices:[`prefixDelete`,`storageClassMigration`]}).coerce(`job-type`,e=>m(e,`job-type`,`text`)).option(`prefix`,{type:`string`,description:`Prefix matched against object keys. A non-empty value must end in \`/\`.
45
45
  An empty string empties the entire bucket.
46
- `}).option(`destination-storage-class`,{type:`string`,description:`The destinationStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`destination-storage-class`,e=>m(e,`destination-storage-class`,`text`)).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`source-storage-class`,e=>m(e,`source-storage-class`,`text`)).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)`}).conflicts(`prefix`,[`destination-storage-class`,`source-storage-class`]).conflicts(`destination-storage-class`,[`prefix`]).conflicts(`source-storage-class`,[`prefix`])}const _e={command:`create <bucket-name>`,describe:`Create Bucket Job`,builder:ge,handler:async e=>l({command:`r2 buckets jobs create`,classification:{safeFlags:[`job-type`,`destination-storage-class`,`source-storage-class`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(l[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({jobType:e[`job-type`],prefix:m(e.prefix,`prefix`,`text`),destinationStorageClass:e[`destination-storage-class`],sourceStorageClass:e[`source-storage-class`]}):d(e.body)});return}let f=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This starts a background job that either permanently deletes every object under the given prefix (every object in the bucket for an empty prefix) or migrates every object in the bucket between storage classes.`})){process.stderr.write(`Aborted.
47
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}e[`job-type`]===void 0&&(e[`job-type`]=await _(`job-type`,`The jobType field`,[`prefixDelete`,`storageClassMigration`])),e[`job-type`]===`prefixDelete`&&e.prefix===void 0&&(e.prefix=await g(`prefix`,"Prefix matched against object keys. A non-empty value must end in `/`. An empty string empties the entire bucket. ",{question:`Enter value for --prefix`}));let y={};e[`job-type`]!==void 0&&u(y,[`jobType`],e[`job-type`]),e.prefix!==void 0&&u(y,[`prefix`],m(e.prefix,`prefix`,`text`)),e[`destination-storage-class`]!==void 0&&u(y,[`destinationStorageClass`],e[`destination-storage-class`]),e[`source-storage-class`]!==void 0&&u(y,[`sourceStorageClass`],e[`source-storage-class`]);let b=await c(`Deleting`,async()=>n(f,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:y,headers:Object.keys(l).length>0?l:void 0}));o(b,{successLabel:`Deleted`})})};function ve(e){return e.usage("$0 r2 buckets jobs get <job-id>\n\nGets the current status of a background job of any type for an R2 bucket. Poll this endpoint with the job identifier returned by Create Bucket Job until the status is `COMPLETED`, `FAILED`, or `CANCELLED`.").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 ye={command:`get <job-id>`,describe:`Get Bucket Job`,builder:ve,handler:async e=>l({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function be(e){return e.usage(`$0 r2 buckets jobs list
46
+ `}).option(`destination-storage-class`,{type:`string`,description:`The destinationStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`destination-storage-class`,e=>m(e,`destination-storage-class`,`text`)).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`source-storage-class`,e=>m(e,`source-storage-class`,`text`)).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)`}).conflicts(`prefix`,[`destination-storage-class`,`source-storage-class`]).conflicts(`destination-storage-class`,[`prefix`]).conflicts(`source-storage-class`,[`prefix`])}const _e={command:`create <bucket-name>`,describe:`Create Bucket Job`,builder:ge,handler:async e=>l({command:`r2 buckets jobs create`,classification:{safeFlags:[`job-type`,`destination-storage-class`,`source-storage-class`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(l[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({jobType:e[`job-type`],prefix:m(e.prefix,`prefix`,`text`),destinationStorageClass:e[`destination-storage-class`],sourceStorageClass:e[`source-storage-class`]}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This starts a background job that either permanently deletes every object under the given prefix (every object in the bucket for an empty prefix) or migrates every object in the bucket between storage classes.`})){process.stderr.write(`Aborted.
47
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}e[`job-type`]===void 0&&(e[`job-type`]=await _(`job-type`,`The jobType field`,[`prefixDelete`,`storageClassMigration`])),e[`job-type`]===`prefixDelete`&&e.prefix===void 0&&(e.prefix=await g(`prefix`,"Prefix matched against object keys. A non-empty value must end in `/`. An empty string empties the entire bucket. ",{question:`Enter value for --prefix`}));let y={};e[`job-type`]!==void 0&&f(y,[`jobType`],e[`job-type`]),e.prefix!==void 0&&f(y,[`prefix`],m(e.prefix,`prefix`,`text`)),e[`destination-storage-class`]!==void 0&&f(y,[`destinationStorageClass`],e[`destination-storage-class`]),e[`source-storage-class`]!==void 0&&f(y,[`sourceStorageClass`],e[`source-storage-class`]);let b=await c(`Deleting`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:y,headers:Object.keys(l).length>0?l:void 0}));o(b,{successLabel:`Deleted`})})};function ve(e){return e.usage("$0 r2 buckets jobs get <job-id>\n\nGets the current status of a background job of any type for an R2 bucket. Poll this endpoint with the job identifier returned by Create Bucket Job until the status is `COMPLETED`, `FAILED`, or `CANCELLED`.").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 ye={command:`get <job-id>`,describe:`Get Bucket Job`,builder:ve,handler:async e=>l({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function be(e){return e.usage(`$0 r2 buckets jobs list
48
48
 
49
49
  Lists background jobs for an R2 bucket, including prefix-delete (and bucket-emptying) jobs and storage-class migration jobs. Jobs of every type are returned unless \`jobType\` is provided.`).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`,`storageClassMigration`]}).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 xe={command:`list`,describe:`List Bucket Jobs`,builder:be,handler:async e=>l({command:`r2 buckets jobs list`,classification:{safeFlags:[`job-type`,`status`,`dry-run`]}},e,async()=>{let l={jobType:e[`job-type`],status:e.status,maxKeys:e[`max-keys`],continuationToken:e[`continuation-token`]},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(p,{successLabel:`Loaded`})})},Se={command:`jobs`,describe:`Create and inspect background jobs for an R2 bucket`,builder:e=>e.command(_e).command(ye).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.usage(`$0 r2 buckets lifecycle get <bucket-name>
50
50
 
51
51
  Get object lifecycle rules for a bucket.`).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 we={command:`get <bucket-name>`,describe:`Get Object Lifecycle Rules`,builder:Ce,handler:async e=>l({command:`r2 buckets lifecycle get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function Te(e){return e.usage(`$0 r2 buckets lifecycle update <bucket-name>
52
52
 
53
- Replaces the object lifecycle rules for an R2 bucket. Rules match object-key prefixes and can expire objects, abort incomplete multipart uploads, or transition objects to Infrequent Access storage.`).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(`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 Ee={command:`update <bucket-name>`,describe:`Set Object Lifecycle Rules`,builder:Te,handler:async e=>l({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:f(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's object lifecycle rules and can schedule object deletion or abort multipart uploads.`})){process.stderr.write(`Aborted.
54
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&u(g,[`rules`],f(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},De={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.usage(`$0 r2 buckets list
53
+ Replaces the object lifecycle rules for an R2 bucket. Rules match object-key prefixes and can expire objects, abort incomplete multipart uploads, or transition objects to Infrequent Access storage.`).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(`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 Ee={command:`update <bucket-name>`,describe:`Set Object Lifecycle Rules`,builder:Te,handler:async e=>l({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's object lifecycle rules and can schedule object deletion or abort multipart uploads.`})){process.stderr.write(`Aborted.
54
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},De={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(we).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Oe(e){return e.usage(`$0 r2 buckets list
55
55
 
56
56
  Lists a page of R2 buckets in the account and selected jurisdiction. Use the returned cursor to retrieve the next page.`).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 ke={command:`list`,describe:`List Buckets`,builder:Oe,handler:async e=>l({command:`r2 buckets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let l={name_contains:e[`name-contains`],start_after:e[`start-after`],per_page:e[`per-page`],order:e.order,direction:e.direction,cursor:e.cursor},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let e=await i();s({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets`,pathParams:{},query:l,bodyKind:`none`});return}let d=await r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(p,{successLabel:`Loaded`})})};var Ae={method:`GET`,path:t=>e`/accounts/${t.account_id}/r2/buckets/${t.bucket_name}/local-uploads`};function je(e){return e.usage(`$0 r2 buckets local-uploads get <bucket-name>
57
57
 
@@ -64,8 +64,8 @@ Delete all lock rules for a bucket.`).positional(`bucket-name`,{type:`string`,de
64
64
 
65
65
  Get lock rules for a bucket.`).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:`Get Bucket Lock Rules`,builder:Re,handler:async e=>l({command:`r2 buckets locks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Loaded`})})};function Be(e){return e.usage(`$0 r2 buckets locks update <bucket-name>
66
66
 
67
- Replaces the lock rules for an R2 bucket. Enabled rules prevent matching objects from being overwritten or deleted for a duration, until a date, or indefinitely. Rules apply to existing and newly uploaded objects.`).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(`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 Ve={command:`update <bucket-name>`,describe:`Set Bucket Lock Rules`,builder:Be,handler:async e=>l({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:f(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's lock rules. Removing or shortening retention can allow objects to be overwritten or deleted.`})){process.stderr.write(`Aborted.
68
- `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&u(g,[`rules`],f(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},He={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(Le).command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/r2/metrics`};function We(e){return e.usage(`$0 r2 buckets metrics list
67
+ Replaces the lock rules for an R2 bucket. Enabled rules prevent matching objects from being overwritten or deleted for a duration, until a date, or indefinitely. Rules apply to existing and newly uploaded objects.`).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(`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 Ve={command:`update <bucket-name>`,describe:`Set Bucket Lock Rules`,builder:Be,handler:async e=>l({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's lock rules. Removing or shortening retention can allow objects to be overwritten or deleted.`})){process.stderr.write(`Aborted.
68
+ `);return}if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},He={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(Le).command(ze).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ue={method:`GET`,path:t=>e`/accounts/${t.account_id}/r2/metrics`};function We(e){return e.usage(`$0 r2 buckets metrics list
69
69
 
70
70
  Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`list`,describe:`Get Account-Level Metrics`,builder:We,handler:async e=>l({command:`r2 buckets metrics list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ue,{account_id:l}));o(u,{successLabel:`Loaded`})})},Ke={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function qe(e){return e.usage(`$0 r2 buckets sippy delete <bucket-name>
71
71
 
@@ -86,17 +86,17 @@ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-t
86
86
 
87
87
  Sippy will use this token when writing objects to R2, so it is
88
88
  best to scope this token to the bucket you're enabling Sippy for.
89
- `}).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`]}).coerce(`source-provider`,e=>m(e,`source-provider`,`text`)).option(`source-region`,{type:`string`,description:`AWS region containing the source S3 bucket.`}).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 Qe={command:`update <bucket-name>`,describe:`Enable Sippy`,builder:Ze,handler:async e=>l({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({destination:{accessKeyId:m(e[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:e[`destination-provider`],secretAccessKey:m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:m(e[`source-access-key-id`],`source-access-key-id`,`text`),bucket:m(e[`source-bucket`],`source-bucket`,`text`),provider:e[`source-provider`],region:m(e[`source-region`],`source-region`,`text`),secretAccessKey:m(e[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:m(e[`source-client-email`],`source-client-email`,`text`),privateKey:m(e[`source-private-key`],`source-private-key`,`text`),bucketUrl:m(e[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:m(e[`source-account-key`],`source-account-key`,`text`),accountName:m(e[`source-account-name`],`source-account-name`,`text`),container:m(e[`source-container`],`source-container`,`text`),sasToken:m(e[`source-sas-token`],`source-sas-token`,`text`)}}):d(e.body),sensitiveBodyPaths:[[`destination`,`secretAccessKey`],[`source`,`secretAccessKey`],[`source`,`privateKey`],[`source`,`accountKey`],[`source`,`sasToken`]]});return}let f=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let g={};e[`destination-access-key-id`]!==void 0&&u(g,[`destination`,`accessKeyId`],m(e[`destination-access-key-id`],`destination-access-key-id`,`text`)),e[`destination-provider`]!==void 0&&u(g,[`destination`,`provider`],e[`destination-provider`]),e[`destination-secret-access-key`]!==void 0&&u(g,[`destination`,`secretAccessKey`],m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),e[`source-access-key-id`]!==void 0&&u(g,[`source`,`accessKeyId`],m(e[`source-access-key-id`],`source-access-key-id`,`text`)),e[`source-bucket`]!==void 0&&u(g,[`source`,`bucket`],m(e[`source-bucket`],`source-bucket`,`text`)),e[`source-provider`]!==void 0&&u(g,[`source`,`provider`],e[`source-provider`]),e[`source-region`]!==void 0&&u(g,[`source`,`region`],m(e[`source-region`],`source-region`,`text`)),e[`source-secret-access-key`]!==void 0&&u(g,[`source`,`secretAccessKey`],m(e[`source-secret-access-key`],`source-secret-access-key`,`text`)),e[`source-client-email`]!==void 0&&u(g,[`source`,`clientEmail`],m(e[`source-client-email`],`source-client-email`,`text`)),e[`source-private-key`]!==void 0&&u(g,[`source`,`privateKey`],m(e[`source-private-key`],`source-private-key`,`text`)),e[`source-bucket-url`]!==void 0&&u(g,[`source`,`bucketUrl`],m(e[`source-bucket-url`],`source-bucket-url`,`text`)),e[`source-account-key`]!==void 0&&u(g,[`source`,`accountKey`],m(e[`source-account-key`],`source-account-key`,`text`)),e[`source-account-name`]!==void 0&&u(g,[`source`,`accountName`],m(e[`source-account-name`],`source-account-name`,`text`)),e[`source-container`]!==void 0&&u(g,[`source`,`container`],m(e[`source-container`],`source-container`,`text`)),e[`source-sas-token`]!==void 0&&u(g,[`source`,`sasToken`],m(e[`source-sas-token`],`source-sas-token`,`text`));let _=await c(`Updating`,async()=>n(f,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},$e={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Je).command(Xe).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},et={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(w).command(S).command(E).command(G).command(he).command(ke).command(oe).command(U).command(pe).command(Se).command(De).command(Fe).command(He).command(Ke).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.usage("$0 r2 objects bulk-delete\n\nDeletes the listed objects from an R2 bucket. Provide a JSON array of 1 to 1000 object keys in the request body. If any key cannot be deleted (for example, because it does not exist or is locked), the remaining keys are still deleted, but the response is HTTP 200 with `success: false`, `result: null` and one entry in `errors` per failed key. The entries in `errors` do not identify which key failed. To delete every object under a prefix, or to empty a bucket, create a `prefixDelete` job with the Create Bucket Job endpoint instead. The `prefix` query parameter on this endpoint is deprecated; it creates the same job, but responses to it carry a `Deprecation` header and a message pointing to Create Bucket Job. 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.").option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`prefix`,{type:`string`,description:"Deprecated. Create a `prefixDelete` job with the Create Bucket Job endpoint instead.\nWhen present, the request body is ignored and a prefix-delete job is created for this\nprefix, exactly as Create Bucket Job does; an empty value empties the bucket. The\nresponse is the job descriptor, with a `Deprecation` header and a deprecation message\nin `messages`."}).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:"A JSON array of 1 to 1000 object keys to delete. Required unless the deprecated `prefix` parameter is present."})}const nt={command:`bulk-delete`,describe:`Delete Objects`,builder:tt,handler:async e=>l({command:`r2 objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={prefix:e.prefix},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(u[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let f=await r(e),p=e.local?t:await a();if(e.accountId=p,!await v({force:!!e.force,message:"This permanently deletes the listed R2 objects. With the deprecated `prefix` parameter it deletes every object under that prefix, and an empty prefix empties the bucket."})){process.stderr.write(`Aborted.
90
- `);return}if(e.body){let t=d(e.body),r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();if(Array.isArray(t)&&t.length>1e3){let i=Math.ceil(t.length/1e3),a=null;for(let o=0;o<t.length;o+=1e3){let s=t.slice(o,o+1e3),l=Math.floor(o/1e3)+1;a=await c(`Deleting: batch ${l}/${i}`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:s,headers:Object.keys(u).length>0?u:void 0}))}o(a,{successLabel:`Deleted`});return}let i=await c(`Deleting`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:t,headers:Object.keys(u).length>0?u:void 0}));o(i,{successLabel:`Deleted`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function rt(e){return e.usage(`$0 r2 objects delete <object-key>
89
+ `}).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`]}).coerce(`source-provider`,e=>m(e,`source-provider`,`text`)).option(`source-region`,{type:`string`,description:`AWS region containing the source S3 bucket.`}).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 Qe={command:`update <bucket-name>`,describe:`Enable Sippy`,builder:Ze,handler:async e=>l({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({destination:{accessKeyId:m(e[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:e[`destination-provider`],secretAccessKey:m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:m(e[`source-access-key-id`],`source-access-key-id`,`text`),bucket:m(e[`source-bucket`],`source-bucket`,`text`),provider:e[`source-provider`],region:m(e[`source-region`],`source-region`,`text`),secretAccessKey:m(e[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:m(e[`source-client-email`],`source-client-email`,`text`),privateKey:m(e[`source-private-key`],`source-private-key`,`text`),bucketUrl:m(e[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:m(e[`source-account-key`],`source-account-key`,`text`),accountName:m(e[`source-account-name`],`source-account-name`,`text`),container:m(e[`source-container`],`source-container`,`text`),sasToken:m(e[`source-sas-token`],`source-sas-token`,`text`)}}):d(e.body),sensitiveBodyPaths:[[`destination`,`secretAccessKey`],[`source`,`secretAccessKey`],[`source`,`privateKey`],[`source`,`accountKey`],[`source`,`sasToken`]]});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let g={};e[`destination-access-key-id`]!==void 0&&f(g,[`destination`,`accessKeyId`],m(e[`destination-access-key-id`],`destination-access-key-id`,`text`)),e[`destination-provider`]!==void 0&&f(g,[`destination`,`provider`],e[`destination-provider`]),e[`destination-secret-access-key`]!==void 0&&f(g,[`destination`,`secretAccessKey`],m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),e[`source-access-key-id`]!==void 0&&f(g,[`source`,`accessKeyId`],m(e[`source-access-key-id`],`source-access-key-id`,`text`)),e[`source-bucket`]!==void 0&&f(g,[`source`,`bucket`],m(e[`source-bucket`],`source-bucket`,`text`)),e[`source-provider`]!==void 0&&f(g,[`source`,`provider`],e[`source-provider`]),e[`source-region`]!==void 0&&f(g,[`source`,`region`],m(e[`source-region`],`source-region`,`text`)),e[`source-secret-access-key`]!==void 0&&f(g,[`source`,`secretAccessKey`],m(e[`source-secret-access-key`],`source-secret-access-key`,`text`)),e[`source-client-email`]!==void 0&&f(g,[`source`,`clientEmail`],m(e[`source-client-email`],`source-client-email`,`text`)),e[`source-private-key`]!==void 0&&f(g,[`source`,`privateKey`],m(e[`source-private-key`],`source-private-key`,`text`)),e[`source-bucket-url`]!==void 0&&f(g,[`source`,`bucketUrl`],m(e[`source-bucket-url`],`source-bucket-url`,`text`)),e[`source-account-key`]!==void 0&&f(g,[`source`,`accountKey`],m(e[`source-account-key`],`source-account-key`,`text`)),e[`source-account-name`]!==void 0&&f(g,[`source`,`accountName`],m(e[`source-account-name`],`source-account-name`,`text`)),e[`source-container`]!==void 0&&f(g,[`source`,`container`],m(e[`source-container`],`source-container`,`text`)),e[`source-sas-token`]!==void 0&&f(g,[`source`,`sasToken`],m(e[`source-sas-token`],`source-sas-token`,`text`));let _=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Updated`})})},$e={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Je).command(Xe).command(Qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},et={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(w).command(S).command(E).command(G).command(he).command(ke).command(oe).command(U).command(pe).command(Se).command(De).command(Fe).command(He).command(Ke).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.usage("$0 r2 objects bulk-delete\n\nDeletes the listed objects from an R2 bucket. Provide a JSON array of 1 to 1000 object keys in the request body. If any key cannot be deleted (for example, because it does not exist or is locked), the remaining keys are still deleted, but the response is HTTP 200 with `success: false`, `result: null` and one entry in `errors` per failed key. The entries in `errors` do not identify which key failed. To delete every object under a prefix, or to empty a bucket, create a `prefixDelete` job with the Create Bucket Job endpoint instead. The `prefix` query parameter on this endpoint is deprecated; it creates the same job, but responses to it carry a `Deprecation` header and a message pointing to Create Bucket Job. 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.").option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`prefix`,{type:`string`,description:"Deprecated. Create a `prefixDelete` job with the Create Bucket Job endpoint instead.\nWhen present, the request body is ignored and a prefix-delete job is created for this\nprefix, exactly as Create Bucket Job does; an empty value empties the bucket. The\nresponse is the job descriptor, with a `Deprecation` header and a deprecation message\nin `messages`."}).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:"A JSON array of 1 to 1000 object keys to delete. Required unless the deprecated `prefix` parameter is present."})}const nt={command:`bulk-delete`,describe:`Delete Objects`,builder:tt,handler:async e=>l({command:`r2 objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={prefix:e.prefix},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(u[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let f=await r(e),p=e.local?t:await a();if(e.accountId=p,!await v({force:!!e.force,message:"This permanently deletes the listed R2 objects. With the deprecated `prefix` parameter it deletes every object under that prefix, and an empty prefix empties the bucket."}))process.stderr.write(`Aborted.
90
+ `);else if(e.body){let t=d(e.body),r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();if(Array.isArray(t)&&t.length>1e3){let i=Math.ceil(t.length/1e3),a=null;for(let o=0;o<t.length;o+=1e3){let s=t.slice(o,o+1e3),l=Math.floor(o/1e3)+1;a=await c(`Deleting: batch ${l}/${i}`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:s,headers:Object.keys(u).length>0?u:void 0}))}o(a,{successLabel:`Deleted`});return}let i=await c(`Deleting`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:t,headers:Object.keys(u).length>0?u:void 0}));o(i,{successLabel:`Deleted`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function rt(e){return e.usage(`$0 r2 objects delete <object-key>
91
91
 
92
92
  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.`).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 it={command:`delete <object-key>`,describe:`Delete Object`,builder:rt,handler:async e=>l({command:`r2 objects delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This permanently deletes the specified object from the R2 bucket.`})){process.stderr.write(`Aborted.
93
93
  `);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function at(e){return e.usage(`$0 r2 objects get <object-key>
94
94
 
95
- 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.`).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 ot={command:`get <object-key>`,describe:`Get Object`,builder:at,handler:async e=>l({command:`r2 objects get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{if(e[`cf-r2-jurisdiction`]!==void 0&&String(e[`cf-r2-jurisdiction`]),e[`if-none-match`]!==void 0&&String(e[`if-none-match`]),e[`if-modified-since`]!==void 0&&String(e[`if-modified-since`]),e.dryRun){let t=await i();s({command:`cf r2 objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`none`});return}await r(e);let n=e.local?t:await a();e.accountId=n;let o=await c(`Loading`,async()=>b(`/accounts/${n}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo}));y(e.text===!0?o.toString(`utf-8`):o)})};function st(e){return e.usage(`$0 r2 objects list
95
+ 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.`).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 ot={command:`get <object-key>`,describe:`Get Object`,builder:at,handler:async e=>l({command:`r2 objects get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{let n={};if(e[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`if-none-match`]!==void 0&&(n[`If-None-Match`]=String(e[`if-none-match`])),e[`if-modified-since`]!==void 0&&(n[`If-Modified-Since`]=String(e[`if-modified-since`])),e.dryRun){let t=await i();s({command:`cf r2 objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`none`});return}await r(e);let o=e.local?t:await a();e.accountId=o;let l=await c(`Loading`,async()=>b(`/accounts/${o}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo,headers:Object.keys(n).length>0?n:void 0}));y(e.text===!0?l.toString(`utf-8`):l)})};function st(e){return e.usage(`$0 r2 objects list
96
96
 
97
97
  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.`).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 ct={command:`list`,describe:`List Objects`,builder:st,handler:async e=>l({command:`r2 objects list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={per_page:e[`per-page`],prefix:e.prefix,delimiter:e.delimiter,cursor:e.cursor,start_after:e[`start-after`]},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(p,{successLabel:`Loaded`})})};function lt(e){return e.usage(`$0 r2 objects put <object-key>
98
98
 
99
- 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.`).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 ut={command:`put <object-key>`,describe:`Upload Object`,builder:lt,handler:async e=>l({command:`r2 objects put`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`content-type`]!==void 0&&(l[`Content-Type`]=String(e[`content-type`])),e[`content-length`]!==void 0&&(l[`Content-Length`]=String(e[`content-length`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 objects put`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`octet-stream`,body:e.body});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.file){let t=h(e.file),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}}));o(r,{successLabel:`Updated`});return}if(e.body){let t=m(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...l}}));o(r,{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},dt={command:`objects`,describe:`Operations for objects`,builder:e=>e.command(nt).command(it).command(ot).command(ct).command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/source/connectivity-precheck`,body:`json`};function ft(e){return e.usage(`$0 r2 super-slurper connectivity-precheck source
99
+ 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.`).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 ut={command:`put <object-key>`,describe:`Upload Object`,builder:lt,handler:async e=>l({command:`r2 objects put`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`content-type`]!==void 0&&(l[`Content-Type`]=String(e[`content-type`])),e[`content-length`]!==void 0&&(l[`Content-Length`]=String(e[`content-length`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 objects put`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`octet-stream`,body:e.body});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.file){let t=h(e.file),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}}));o(r,{successLabel:`Updated`})}else if(e.body){let t=m(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...l}}));o(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},dt={command:`objects`,describe:`Operations for objects`,builder:e=>e.command(nt).command(it).command(ot).command(ct).command(ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/source/connectivity-precheck`,body:`json`};function ft(e){return e.usage(`$0 r2 super-slurper connectivity-precheck source
100
100
 
101
101
  Check whether tokens are valid against the source bucket`).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`]}).coerce(`vendor`,e=>m(e,`vendor`,`text`)).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>m(e,`jurisdiction`,`text`)).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 pt={command:`source`,describe:`Check source connectivity`,builder:ft,handler:async e=>l({command:`r2 super-slurper connectivity-precheck source`,classification:{safeFlags:[`vendor`,`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({bucket:m(e.bucket,`bucket`,`text`),endpoint:m(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:m(e[`path-prefix`],`path-prefix`,`text`),region:m(e.region,`region`,`text`),secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:m(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:m(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}):d(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`],[`secret`,`privateKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Y,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await g(`bucket`,`The bucket field`)),e.vendor===void 0&&(e.vendor=await _(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let u=p({bucket:m(e.bucket,`bucket`,`text`),endpoint:m(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:m(e[`path-prefix`],`path-prefix`,`text`),region:m(e.region,`region`,`text`),secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:m(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:m(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}),f=await c(`Updating`,async()=>n.send(Y,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})};var X={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/target/connectivity-precheck`,body:`json`,constants:{vendor:`r2`}};function mt(e){return e.usage(`$0 r2 super-slurper connectivity-precheck target
102
102
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-MNz2D-PD.mjs";import{t as n}from"./output-Co4xdFf6.mjs";import{t as r}from"./dry-run-C2KjGX10.mjs";import{t as i}from"./progress-DaQ4MzBI.mjs";import{t as a}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{n as o,t as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c,t as l}from"./raw-fetch-Cy09TjHc.mjs";var u={method:`GET`,path:t=>e`/radar/agent_readiness/summary/${t.dimension}`,query:[`date`,`domainCategory`,`name`,`format`],errors:{400:`BadRequestError`}};function ee(e){return e.usage(`$0 radar agent-readiness summary <dimension>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-BaUNb1Ed.mjs";import{t as n}from"./output-O6b9MR9R.mjs";import{t as r}from"./dry-run-DQmFkNK_.mjs";import{t as i}from"./progress-CdlDthXA.mjs";import{t as a}from"./run-B_07PrkW.mjs";import"./telemetry-Dpm6GfZD.mjs";import{n as o,t as s}from"./body-parser-ChnyBsfm.mjs";import{n as c,t as l}from"./raw-fetch-1VlXDwwX.mjs";var u={method:`GET`,path:t=>e`/radar/agent_readiness/summary/${t.dimension}`,query:[`date`,`domainCategory`,`name`,`format`],errors:{400:`BadRequestError`}};function ee(e){return e.usage(`$0 radar agent-readiness summary <dimension>
3
3
 
4
4
  Returns a summary of AI agent readiness scores across scanned domains, grouped by the specified dimension. Data is sourced from weekly bulk scans. All values are raw domain counts.`).positional(`dimension`,{type:`string`,description:`Specifies the agent readiness data dimension by which to group the results.`,demandOption:!0}).option(`date`,{type:`string`,description:`Filters results by the specified date.`}).option(`domain-category`,{type:`string`,description:`Filters results by domain category.`}).option(`name`,{type:`string`,description:`Array of names used to label the series in the response.`}).option(`format`,{type:`string`,description:`Format in which results will be returned.`,choices:[`JSON`,`CSV`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`summary <dimension>`,describe:`Get agent readiness summary`,builder:ee,handler:async e=>a({command:`radar agent-readiness summary`,classification:{safeFlags:[`format`,`dry-run`]}},e,async()=>{let a={date:e.date,domainCategory:e[`domain-category`],name:e.name,format:e.format};if(e.dryRun){r({command:`cf radar agent-readiness summary`,method:`GET`,url:`https://api.cloudflare.com/client/v4/radar/agent_readiness/summary/${e.dimension==null?`<dimension>`:encodeURIComponent(String(e.dimension))}`,pathParams:{dimension:String(e.dimension??``)},query:a,bodyKind:`none`});return}let o=await t(e),s=await i(`Loading`,async()=>o.send(u,{dimension:e.dimension,...a}));n(s,{successLabel:`Loaded`})})},ne={command:`agent-readiness`,describe:`Agent readiness summary statistics across the Cloudflare network`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var d={method:`GET`,path:t=>e`/radar/ai/bots/timeseries_groups/${t.dimension}`,query:[`aggInterval`,`name`,`dateRange`,`dateStart`,`dateEnd`,`asn`,`location`,`continent`,`crawlPurpose`,`userAgent`,`industry`,`vertical`,`contentType`,`responseStatus`,`responseStatusCategory`,`limitPerGroup`,`normalization`,`format`],errors:{400:`BadRequestError`}};function f(e){return e.usage(`$0 radar ai bots timeseries-groups <dimension>
5
5
 
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{K as e}from"./dist-DZRTPMMA.mjs";import{n as t}from"./api-eMuS5GI1.mjs";import{r as n}from"./local-Dil4fTWX.mjs";import{c as r,l as i}from"./auth-MNz2D-PD.mjs";import{n as a}from"./context-q-6bMSL-.mjs";import{t as o}from"./auth-token-Cw4c0y89.mjs";import{n as s}from"./request-headers-CqfJOkpO.mjs";async function c(c,l={}){let{method:u=`GET`,local:d=!1}=l,f=e({compliance_region:await a()}),p=`${f.replace(/\/+$/,``)}${c}`,m={...s()};l.headers&&Object.assign(m,l.headers);let h=globalThis.fetch;d?h=n({persistTo:l.persistTo,apiBaseUrl:f}):m.Authorization=`Bearer ${await o()}`;let g,_=l.body;_!=null&&(_ instanceof FormData?g=_:Buffer.isBuffer(_)||_ instanceof Uint8Array||_ instanceof ArrayBuffer?(g=_,m[`Content-Type`]??=l.contentType??`application/octet-stream`):typeof _==`string`?(g=_,l.contentType&&(m[`Content-Type`]??=l.contentType)):(g=JSON.stringify(_),m[`Content-Type`]??=l.contentType??`application/json`));let v=await h(p,{method:u,headers:m,...g===void 0?{}:{body:g},...r(g)?{}:{signal:AbortSignal.timeout(i)}});if(!v.ok){let e=v.headers.get(`content-type`)??``,n;try{n=e.includes(`application/json`)?await v.json():await v.text()}catch{n=null}throw new t({statusCode:v.status,body:n,rawResponse:{status:v.status,statusText:v.statusText,url:v.url||p,headers:v.headers,redirected:v.redirected,type:v.type}})}let y=await v.arrayBuffer();return Buffer.from(y)}function l(e){process.stdout.write(e)}export{l as n,c as t};
2
+ import{G as e}from"./dist-CnKd5XoR.mjs";import{n as t}from"./api-eMuS5GI1.mjs";import{r as n}from"./local-B4sZZTRA.mjs";import{c as r,l as i}from"./auth-BaUNb1Ed.mjs";import{n as a}from"./context-BQ6KeMgq.mjs";import{t as o}from"./auth-token-B1pP2jaK.mjs";import{n as s}from"./request-headers-ojAw3pQO.mjs";async function c(c,l={}){let{method:u=`GET`,local:d=!1}=l,f=e({compliance_region:await a()}),p=`${f.replace(/\/+$/,``)}${c}`,m={...s()};l.headers&&Object.assign(m,l.headers);let h=globalThis.fetch;d?h=n({persistTo:l.persistTo,apiBaseUrl:f}):m.Authorization=`Bearer ${await o()}`;let g,_=l.body;_!=null&&(_ instanceof FormData?g=_:Buffer.isBuffer(_)||_ instanceof Uint8Array||_ instanceof ArrayBuffer?(g=_,m[`Content-Type`]??=l.contentType??`application/octet-stream`):typeof _==`string`?(g=_,l.contentType&&(m[`Content-Type`]??=l.contentType)):(g=JSON.stringify(_),m[`Content-Type`]??=l.contentType??`application/json`));let v=await h(p,{method:u,headers:m,...g===void 0?{}:{body:g},...r(g)?{}:{signal:AbortSignal.timeout(i)}});if(!v.ok){let e=v.headers.get(`content-type`)??``,n;try{n=e.includes(`application/json`)?await v.json():await v.text()}catch{n=null}throw new t({statusCode:v.status,body:n,rawResponse:{status:v.status,statusText:v.statusText,url:v.url||p,headers:v.headers,redirected:v.redirected,type:v.type}})}let y=await v.arrayBuffer();return Buffer.from(y)}function l(e){process.stdout.write(e)}export{l as n,c as t};