cf 1.0.0-beta.17 → 1.0.0-beta.18

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 (226) hide show
  1. package/dist/_meta/commands.json +6117 -4540
  2. package/dist/_meta/schemas.json +5016 -3257
  3. package/dist/{abuse-reports-C4LxDvUM.mjs → abuse-reports-Ce-g5uZP.mjs} +6 -6
  4. package/dist/{access-DnWW2AAT.mjs → access-BtsMwesh.mjs} +1 -1
  5. package/dist/{accounts-8UcHNm3S.mjs → accounts-X5QVzEUW.mjs} +27 -21
  6. package/dist/{acm-qRM3iy4Z.mjs → acm-C_NepMi6.mjs} +1 -1
  7. package/dist/{addressing-CAb8z2Dq.mjs → addressing-BkQY1hoA.mjs} +18 -18
  8. package/dist/{agent-memory-oIUP4ZV5.mjs → agent-memory-1OPgC3lK.mjs} +6 -6
  9. package/dist/{ai-DnhytGdc.mjs → ai-Bb0_Zknm.mjs} +1 -1
  10. package/dist/{ai-audit-B7_5EOcN.mjs → ai-audit-DuEjVdML.mjs} +1 -1
  11. package/dist/{ai-gateway-b3FFu6UV.mjs → ai-gateway-Cm2vWMSI.mjs} +42 -42
  12. package/dist/ai-search-DDRpxyOM.mjs +79 -0
  13. package/dist/{ai-security-KUs94UW-.mjs → ai-security-A2STvE1b.mjs} +5 -5
  14. package/dist/{alerting-CCmyEPzN.mjs → alerting-CIwSk-Ks.mjs} +1 -1
  15. package/dist/{analytics-BAvBj6qx.mjs → analytics-H--uM3DA.mjs} +7 -7
  16. package/dist/{analytics-engine-DAJp89gM.mjs → analytics-engine-Alu7cllT.mjs} +1 -1
  17. package/dist/{api-security-BItVQymb.mjs → api-security-D-pcnhUL.mjs} +26 -26
  18. package/dist/{argo-DsJCvfml.mjs → argo-Lvmcx3am.mjs} +1 -1
  19. package/dist/{artifacts-DzHXeah6.mjs → artifacts-xT5S-mVa.mjs} +1 -1
  20. package/dist/{audit-logs-D9XxsVZm.mjs → audit-logs-DEoRBLkU.mjs} +1 -1
  21. package/dist/{auth-C530fHKQ.mjs → auth-B73lQS2h.mjs} +1 -1
  22. package/dist/auth-DMzEmOhG.mjs +2 -0
  23. package/dist/{auth-MNz2D-PD.mjs → auth-Db1KT0vm.mjs} +1 -1
  24. package/dist/{auth-token-Cw4c0y89.mjs → auth-token-D9XIPlwf.mjs} +1 -1
  25. package/dist/{basin-catalog-DcMiZV9J.mjs → basin-catalog-DFHt3cWi.mjs} +1 -1
  26. package/dist/{billing-COgAWTYh.mjs → billing-Bm2JNSGa.mjs} +6 -6
  27. package/dist/body-parser-DnBfDdx3.mjs +2 -0
  28. package/dist/{bot-management-Dx3lh9Fi.mjs → bot-management-CSr38g-O.mjs} +4 -4
  29. package/dist/{botnet-feed-C8496Nhl.mjs → botnet-feed-ebeWWSJj.mjs} +1 -1
  30. package/dist/{brand-protection-B0p8Sv6s.mjs → brand-protection-BCn9Mv-d.mjs} +5 -5
  31. package/dist/browser-run-BcWxzhAn.mjs +42 -0
  32. package/dist/{builds-DmEFTQTa.mjs → builds-BMwDzi7G.mjs} +39 -39
  33. package/dist/{cache-BUh85NRr.mjs → cache-_VaTLC5T.mjs} +1 -1
  34. package/dist/{cli-DJhpXf38.mjs → cli-P3q5DG3W.mjs} +1 -1
  35. package/dist/{client-side-security-km3-4L_4.mjs → client-side-security-CjSXrpa9.mjs} +1 -1
  36. package/dist/{cloud-connector-BoKFprDD.mjs → cloud-connector-BPJBeP06.mjs} +1 -1
  37. package/dist/{cloudforce-one-DN5N3C3w.mjs → cloudforce-one-DXX31GMi.mjs} +189 -189
  38. package/dist/{command-B694oLDo.mjs → command-BXiA79DP.mjs} +1 -1
  39. package/dist/{command-rx0Kb5pn.mjs → command-BbsPxJBT.mjs} +1 -1
  40. package/dist/{command-RC9WM5jq.mjs → command-Bkc04OyY.mjs} +1 -1
  41. package/dist/{command-Bmee6uwe.mjs → command-BtTc28ql.mjs} +1 -1
  42. package/dist/{command-CAs3SxlI.mjs → command-CBZhxmKD.mjs} +1 -1
  43. package/dist/{command-CCq-Z2Ua.mjs → command-CL7LLXM7.mjs} +1 -1
  44. package/dist/{command-DerHAjQL.mjs → command-CYyfigfC.mjs} +1 -1
  45. package/dist/{command-D1JR8Fb7.mjs → command-CxWLFv5Y.mjs} +1 -1
  46. package/dist/{command-CiApsRql.mjs → command-DDcBC4px.mjs} +1 -1
  47. package/dist/{command-CbQFbfps.mjs → command-NoxvOARP.mjs} +1 -1
  48. package/dist/{completions-11latun5.mjs → completions-CrDmwKnK.mjs} +1 -1
  49. package/dist/{connector-interrupts-wvQcZsO1.mjs → connector-interrupts-V4HGULCM.mjs} +1 -1
  50. package/dist/{connector-telemetry-events-C0GGCIQk.mjs → connector-telemetry-events-D9mTcfbJ.mjs} +1 -1
  51. package/dist/{connector-telemetry-snapshots-ZXzsFgea.mjs → connector-telemetry-snapshots-COrPVKol.mjs} +1 -1
  52. package/dist/{connectors-DXIUG4Zi.mjs → connectors-DvVlxGDx.mjs} +1 -1
  53. package/dist/{containers-DCH6MFjY.mjs → containers-Bt2zFsFd.mjs} +8 -8
  54. package/dist/{containers-WMWKhLkp.mjs → containers-BtcOgwm5.mjs} +2 -2
  55. package/dist/{content-scan-CRDmR7rD.mjs → content-scan-DldLmTjy.mjs} +1 -1
  56. package/dist/{context-q-6bMSL-.mjs → context-C_a8oSY9.mjs} +1 -1
  57. package/dist/cps-REo1OWP1.mjs +6 -0
  58. package/dist/csam-scanner-CIbbdoJK.mjs +10 -0
  59. package/dist/{custom-csrs-BV017SqE.mjs → custom-csrs-iGNc3rSZ.mjs} +1 -1
  60. package/dist/{custom-hostnames-DI_dFaof.mjs → custom-hostnames-BNxYbTyu.mjs} +15 -15
  61. package/dist/{custom-nameservers-BLoE8VGG.mjs → custom-nameservers-BMJoTSlQ.mjs} +1 -1
  62. package/dist/custom-pages-Qdemt1Fm.mjs +21 -0
  63. package/dist/{d1-Dbs8HItA.mjs → d1-DvCiQibO.mjs} +8 -8
  64. package/dist/{deploy-5utIiOMN.mjs → deploy-K664XPOb.mjs} +1 -1
  65. package/dist/{deploy-context-C0iVbWRG.mjs → deploy-context-ClNVJYlR.mjs} +13 -13
  66. package/dist/{diagnostics-C9B07eJY.mjs → diagnostics-Cw0mtcep.mjs} +2 -2
  67. package/dist/{dls-lbM3i4x-.mjs → dls-DoqfqutH.mjs} +1 -1
  68. package/dist/{dns-QTMPGYMa.mjs → dns-DC6WcO3m.mjs} +21 -21
  69. package/dist/{dns-firewall-Bfv0S44I.mjs → dns-firewall-DpQH9BCE.mjs} +9 -9
  70. package/dist/{docs-bV3hPwQL.mjs → docs-CqNRBHab.mjs} +1 -1
  71. package/dist/{durable-objects-0JvGTV27.mjs → durable-objects-CJDDy3CC.mjs} +1 -1
  72. package/dist/{email-auth-PzRqG0ex.mjs → email-auth--NHg1TjG.mjs} +1 -1
  73. package/dist/{email-routing-BgHL0Rbz.mjs → email-routing-COjENK55.mjs} +13 -13
  74. package/dist/{email-security-CSTKIecn.mjs → email-security-rdjH95T2.mjs} +38 -38
  75. package/dist/{email-sending-BSwuAir8.mjs → email-sending-26VJhR6Q.mjs} +18 -18
  76. package/dist/{field-extractors-B_lFnwaL.mjs → field-extractors-DBOvGOwz.mjs} +2 -2
  77. package/dist/{firewall-BsZxVitA.mjs → firewall-D8K93ffF.mjs} +20 -20
  78. package/dist/{flagship-qBohOZaM.mjs → flagship-CHdmCmvQ.mjs} +11 -11
  79. package/dist/{fraud-vGNdrSm-.mjs → fraud-CY4TV5Vc.mjs} +1 -1
  80. package/dist/{google-tag-gateway-BHdOg4VW.mjs → google-tag-gateway-DzSt4wlz.mjs} +1 -1
  81. package/dist/healthchecks-B52Mf3uL.mjs +22 -0
  82. package/dist/{hostnames-CLlaMqHu.mjs → hostnames-BMITIM8P.mjs} +1 -1
  83. package/dist/{hyperdrive-CXTqaIqk.mjs → hyperdrive-CHsW0r6Z.mjs} +1 -1
  84. package/dist/{iam-Dl_n_Lqq.mjs → iam-o1n9eUXf.mjs} +9 -9
  85. package/dist/{images-vMtXk2Rf.mjs → images-CJHAGxX6.mjs} +37 -37
  86. package/dist/index.mjs +1 -1
  87. package/dist/{init-_7djeBVw.mjs → init-CqQDL6i3.mjs} +1 -1
  88. package/dist/{intel-Bq4GGXv-.mjs → intel-B3S1gxUg.mjs} +1 -1
  89. package/dist/{ips-BcvZS46g.mjs → ips-q_UJMiy8.mjs} +1 -1
  90. package/dist/{k2-DL4hrVTj.mjs → k2-BNqVZnDN.mjs} +2 -2
  91. package/dist/{kv-BLo9wMgb.mjs → kv-B0nXSOcW.mjs} +1 -1
  92. package/dist/{lazy-command-CRcT6Dx-.mjs → lazy-command-4ccdBqrc.mjs} +1 -1
  93. package/dist/{leaked-credential-checks-Dx4RXMyN.mjs → leaked-credential-checks-BXwIjlTs.mjs} +1 -1
  94. package/dist/load-balancers-DJtMztJ0.mjs +76 -0
  95. package/dist/{login-Du_W6b9o.mjs → login-D-1FiBNv.mjs} +1 -1
  96. package/dist/{login-DT6Q1UJw.mjs → login-chQP8825.mjs} +1 -1
  97. package/dist/{logo-matches-C-1J0Oc3.mjs → logo-matches-qVYq8tWL.mjs} +1 -1
  98. package/dist/{logos-BuhvSu_H.mjs → logos-tnIahhcu.mjs} +1 -1
  99. package/dist/{logpush-DgZtF9vG.mjs → logpush-D4s3pJRw.mjs} +24 -24
  100. package/dist/{logs-CaKOk-1v.mjs → logs-cw7UL5V2.mjs} +3 -3
  101. package/dist/{magic-cloud-networking-CKxXYT8r.mjs → magic-cloud-networking-CLEHztNY.mjs} +1 -1
  102. package/dist/{magic-network-monitoring-BykFGQCz.mjs → magic-network-monitoring-DRwygeVq.mjs} +9 -9
  103. package/dist/{magic-transit-DYULsrUP.mjs → magic-transit-BFopRdPs.mjs} +170 -170
  104. package/dist/{managed-defense-DIb_uN25.mjs → managed-defense-D5kpmq0T.mjs} +9 -9
  105. package/dist/{managed-transforms-an3wQ0DW.mjs → managed-transforms-CT4jjnzJ.mjs} +2 -2
  106. package/dist/{matches-DkLSWb5X.mjs → matches-ClJ_24EY.mjs} +1 -1
  107. package/dist/{mcp-BcV1XqE8.mjs → mcp-50os3IRG.mjs} +10 -10
  108. package/dist/{mesh-CSSlZ-0F.mjs → mesh-jxtQP8sS.mjs} +2 -2
  109. package/dist/{monetization-B-nJ0SyI.mjs → monetization-D6cCDi-h.mjs} +4 -4
  110. package/dist/{network-ZzxQ_Dcz.mjs → network-dnWHB2uY.mjs} +27 -25
  111. package/dist/{network-interconnects-CI9NXQpe.mjs → network-interconnects-Cf8qSVdt.mjs} +1 -1
  112. package/dist/{o11y-LG6Y9LUZ.mjs → o11y-oMSg1pG4.mjs} +49 -49
  113. package/dist/{oauth-CP82E1_0.mjs → oauth-BfBdHhPS.mjs} +1 -1
  114. package/dist/{oauth-Bx693Af5.mjs → oauth-DDOiiH7h.mjs} +1 -1
  115. package/dist/{oauth-clients-BA30rTEl.mjs → oauth-clients-XDmoe-b4.mjs} +1 -1
  116. package/dist/{oauth-scopes-hseWES1v.mjs → oauth-scopes-D9VYGuTs.mjs} +1 -1
  117. package/dist/organization-94lHeeOs.mjs +75 -0
  118. package/dist/{organizations-CcgZPmFl.mjs → organizations-BJf3UTFi.mjs} +1 -1
  119. package/dist/{origin-post-quantum-encryption-BhdlaolV.mjs → origin-post-quantum-encryption-DMytVSUZ.mjs} +1 -1
  120. package/dist/{page-rules-DFfqfllI.mjs → page-rules-BUI-50oz.mjs} +4 -4
  121. package/dist/pages-CcdpCzHs.mjs +54 -0
  122. package/dist/pay-per-crawl-B1uHZn9j.mjs +38 -0
  123. package/dist/{pay-per-use-C_HxhpM4.mjs → pay-per-use-t066I5wm.mjs} +7 -7
  124. package/dist/{pipelines-DUMIVwof.mjs → pipelines-Co6S044l.mjs} +8 -8
  125. package/dist/precursor-BftyvS86.mjs +4 -0
  126. package/dist/previews-BLhnhElx.mjs +7 -0
  127. package/dist/{progress-DaQ4MzBI.mjs → progress-Q5w9PNTT.mjs} +1 -1
  128. package/dist/{prompt-KWYZvJWM.mjs → prompt-C0hKSr-R.mjs} +1 -1
  129. package/dist/{queries-DoyhspQf.mjs → queries-4MubO6Sz.mjs} +3 -3
  130. package/dist/{queues-BPxTU2rU.mjs → queues-CteS5M92.mjs} +17 -17
  131. package/dist/{r2-CQt4S7o7.mjs → r2-2QpT_Gso.mjs} +24 -24
  132. package/dist/{radar-CALpR1vq.mjs → radar-ODKaK4FJ.mjs} +1 -1
  133. package/dist/{raw-fetch-Cy09TjHc.mjs → raw-fetch-CEOuoKl9.mjs} +1 -1
  134. package/dist/{realtime-BiHKBoI4.mjs → realtime-DkfU8uEX.mjs} +84 -84
  135. package/dist/registrar-DM6JTVPS.mjs +43 -0
  136. package/dist/{registrar-sandbox-BttFwYqE.mjs → registrar-sandbox-BPNGf65G.mjs} +11 -9
  137. package/dist/{reporting-8aRJD5HX.mjs → reporting-5yFNXbJg.mjs} +1 -1
  138. package/dist/{request-headers-CqfJOkpO.mjs → request-headers-DXvswze2.mjs} +1 -1
  139. package/dist/request-tracers-BarLZY95.mjs +4 -0
  140. package/dist/{resource-sharing-uVVpMW0w.mjs → resource-sharing-BVEwBPs8.mjs} +19 -19
  141. package/dist/{rules-CFOuN3t2.mjs → rules-_C31X4Jz.mjs} +6 -6
  142. package/dist/{rulesets-DkhV2Hny.mjs → rulesets-8RwxoFhG.mjs} +6 -6
  143. package/dist/{rum-BnMW0Tlb.mjs → rum-CAUcpXpM.mjs} +6 -6
  144. package/dist/{run-Clc3P2u7.mjs → run-DtFLvOHB.mjs} +1 -1
  145. package/dist/run-LcOb9rhI.mjs +2 -0
  146. package/dist/{schema-flags-b096XMpt.mjs → schema-flags-DibfxEF6.mjs} +1 -1
  147. package/dist/{scim-tvZm6A-r.mjs → scim-DX5XrQ4w.mjs} +1 -1
  148. package/dist/{secrets-store-DuNxSh1_.mjs → secrets-store-DSqqrr25.mjs} +1 -1
  149. package/dist/{security-insights-C17c9ZYZ.mjs → security-insights-FSktO04S.mjs} +1 -1
  150. package/dist/{security-txt-D4pRk7-w.mjs → security-txt-D2g3lQdg.mjs} +1 -1
  151. package/dist/{shared-zePemxHi.mjs → shared-eefMO8R4.mjs} +1 -1
  152. package/dist/smart-shield-IVb2sR0C.mjs +24 -0
  153. package/dist/{snippets-BIcZ6vSW.mjs → snippets-cWwWficN.mjs} +2 -2
  154. package/dist/{spectrum-DjDX0geK.mjs → spectrum-DYiIBYRB.mjs} +1 -1
  155. package/dist/{speed-DiPoFJMm.mjs → speed-C7uiW2Wf.mjs} +1 -1
  156. package/dist/{sql-DLjCt_R3.mjs → sql-TGV8qQMj.mjs} +1 -1
  157. package/dist/{src-CutrsNl4.mjs → src-BUH-P_zd.mjs} +5 -5
  158. package/dist/ssl-xQP_HbWN.mjs +139 -0
  159. package/dist/{stream-uhn_Zsni.mjs → stream-CfWgj8Cr.mjs} +55 -55
  160. package/dist/{submit-C3suIDBX.mjs → submit-DxGr1T40.mjs} +1 -1
  161. package/dist/tags-LEJ2VYhQ.mjs +23 -0
  162. package/dist/{telemetry-DYjsavEr.mjs → telemetry-BHne10Yy.mjs} +1 -1
  163. package/dist/telemetry-BavSU4ku.mjs +2 -0
  164. package/dist/{tenant-DK88yQM4.mjs → tenant-7d5vwc6K.mjs} +1 -1
  165. package/dist/{tenant-custom-nameservers-BZ1JD1Yf.mjs → tenant-custom-nameservers-BkxlPr5O.mjs} +1 -1
  166. package/dist/{tunnels-DjbomhCa.mjs → tunnels-DlGODvwT.mjs} +4 -4
  167. package/dist/{turnstile-DXrbEy2A.mjs → turnstile-DhLkdhij.mjs} +5 -5
  168. package/dist/update-check-nLfkSfdz.mjs +2 -0
  169. package/dist/update-check-worker.mjs +1 -1
  170. package/dist/{update-check-BhhtSXVZ.mjs → update-check-wvjOsnGK.mjs} +1 -1
  171. package/dist/{url-info-a0mY4UsC.mjs → url-info-CeoV5dBc.mjs} +1 -1
  172. package/dist/{url-normalization-DiwpDIhc.mjs → url-normalization-9NoaoRNh.mjs} +1 -1
  173. package/dist/{url-scanner-D0egjBe5.mjs → url-scanner-w_-Sumz-.mjs} +8 -8
  174. package/dist/{user-DDH9lxf5.mjs → user-D33B3alX.mjs} +59 -59
  175. package/dist/{vectorize-DaT3amFV.mjs → vectorize-Wp9De13y.mjs} +17 -17
  176. package/dist/version-B2RUUqGT.mjs +2 -0
  177. package/dist/{waiting-rooms-BGMpu9gS.mjs → waiting-rooms-BE8FloRd.mjs} +13 -13
  178. package/dist/{web-assets-NqNglLSI.mjs → web-assets-ew0iaP7c.mjs} +35 -35
  179. package/dist/{web3-UnCUuIfB.mjs → web3-BUyXBaqq.mjs} +6 -6
  180. package/dist/{workers-builds-Cy6fdtm5.mjs → workers-builds-DzU9NGno.mjs} +7 -7
  181. package/dist/{workers-for-platforms-JscCHivQ.mjs → workers-for-platforms-B4xzFNxJ.mjs} +25 -22
  182. package/dist/{workers-DfA9ugmb.mjs → workers-pP5tsDbD.mjs} +25 -22
  183. package/dist/{workers-vpc-FDZQBqOu.mjs → workers-vpc-Bre_t9Al.mjs} +1 -1
  184. package/dist/{workflows-Dq-k81hU.mjs → workflows-DXYGKtqq.mjs} +1 -1
  185. package/dist/zaraz-DoH4QD0u.mjs +22 -0
  186. package/dist/{zero-trust-CZ685QhO.mjs → zero-trust-DKt20rzE.mjs} +461 -458
  187. package/dist/{zone-DcZIUTWt.mjs → zone-BXM3p0JR.mjs} +1 -1
  188. package/dist/{zones-BVdvYUCv.mjs → zones-CJdtqEBx.mjs} +21 -21
  189. package/package.json +9 -9
  190. package/dist/account-tags-zvHRQZxb.mjs +0 -15
  191. package/dist/ai-search-CtfW5fzl.mjs +0 -79
  192. package/dist/auth-Ccm5viK_.mjs +0 -2
  193. package/dist/body-parser-DkHKPkJ7.mjs +0 -2
  194. package/dist/browser-run-ChXohmNG.mjs +0 -42
  195. package/dist/certificate-authorities-BTLdA7EQ.mjs +0 -6
  196. package/dist/client-certificates-B3UxH_Au.mjs +0 -13
  197. package/dist/cps-Due0P5IW.mjs +0 -6
  198. package/dist/csam-scanner-DvLrPw45.mjs +0 -10
  199. package/dist/ct-alerting-BtEGkRJi.mjs +0 -5
  200. package/dist/custom-certificates-CMLXTTEc.mjs +0 -17
  201. package/dist/custom-pages-ubava9Qm.mjs +0 -21
  202. package/dist/dcv-delegation-sGGt6UU_.mjs +0 -4
  203. package/dist/healthchecks-DAYYLZ6u.mjs +0 -22
  204. package/dist/keyless-certificates-0pzjkZb6.mjs +0 -13
  205. package/dist/keys-BSV5IXdU.mjs +0 -4
  206. package/dist/load-balancers-CCCWoQXv.mjs +0 -76
  207. package/dist/mtls-certificates-ukwDz6Lc.mjs +0 -13
  208. package/dist/organization-DMr_z6n4.mjs +0 -71
  209. package/dist/origin-ca-certificates-BZxUbB5N.mjs +0 -11
  210. package/dist/origin-tls-client-auth-DzbZvtmi.mjs +0 -30
  211. package/dist/pages-BkcL5rC4.mjs +0 -54
  212. package/dist/pay-per-crawl-Dulm7Xy5.mjs +0 -38
  213. package/dist/precursor-DsGbA_YJ.mjs +0 -4
  214. package/dist/previews-Cma3-M7K.mjs +0 -7
  215. package/dist/registrar-gERQ3b85.mjs +0 -43
  216. package/dist/request-tracers-DcnwQg3K.mjs +0 -4
  217. package/dist/resource-tagging-SlsUtLsq.mjs +0 -4
  218. package/dist/run-CHNyLZLG.mjs +0 -2
  219. package/dist/smart-shield-2egm1Vaw.mjs +0 -24
  220. package/dist/ssl-vNzK0c9S.mjs +0 -45
  221. package/dist/tags-Dy2jG-Dt.mjs +0 -4
  222. package/dist/telemetry-Bdv5LZZs.mjs +0 -2
  223. package/dist/update-check-Dld7rbLd.mjs +0 -2
  224. package/dist/values-Bfr5-bL6.mjs +0 -4
  225. package/dist/version-CAuKDZAG.mjs +0 -2
  226. 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-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-Db1KT0vm.mjs";import{a as i,t as a}from"./context-C_a8oSY9.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-Q5w9PNTT.mjs";import{t as l}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{a as u,i as d,n as f,t as p}from"./body-parser-DnBfDdx3.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-C0hKSr-R.mjs";import{n as y,t as b}from"./raw-fetch-CEOuoKl9.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:d(e.rules,`rules`)}):f(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=f(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`],d(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`]}):f(e.body)});return}let d=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n(d,`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(d,`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`)}):f(e.body)});return}let d=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n(d,`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(d,`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,49 +23,49 @@ 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`]}):f(e.body)});return}let d=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(d,`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(d,`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}):f(e.body)});return}let d=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=f(e.body),r=await c(`Deleting`,async()=>n(d,`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(d,`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`]}):f(e.body)});return}let d=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=f(e.body),r=await c(`Deleting`,async()=>n(d,`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(d,`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:d(e.rules,`rules`)}):f(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=f(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`],d(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`]}):f(e.body)});return}let d=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=f(e.body),r=await c(`Deleting`,async()=>n(d,`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(d,`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:d(e.rules,`rules`)}):f(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=f(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`],d(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
 
58
58
  Gets the Local Uploads configuration for an R2 bucket. When enabled, object data is written near the client before being asynchronously copied to the bucket's primary region. Local Uploads is only supported in the default jurisdiction.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`get <bucket-name>`,describe:`Get Local Uploads Configuration`,builder:je,handler:async e=>l({command:`r2 buckets local-uploads get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 buckets local-uploads 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`]))}/local-uploads`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},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(Ae,{account_id:l,bucket_name:e[`bucket-name`]}));o(u,{successLabel:`Loaded`})})};var J={method:`PUT`,path:t=>e`/accounts/${t.account_id}/r2/buckets/${t.bucket_name}/local-uploads`,body:`json`};function Ne(e){return e.usage(`$0 r2 buckets local-uploads update <bucket-name>
59
59
 
60
- Enables or disables Local Uploads for an R2 bucket in the default jurisdiction. When enabled, object data is written near the client before being asynchronously copied to the bucket's primary region. Disabling Local Uploads allows existing replication to finish.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`update <bucket-name>`,describe:`Set Local Uploads Configuration`,builder:Ne,handler:async e=>l({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 buckets local-uploads 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`]))}/local-uploads`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});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(J,{body:t,account_id:l,bucket_name:e[`bucket-name`]}));o(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:e.enabled}),f=await c(`Updating`,async()=>n.send(J,{body:u,account_id:l,bucket_name:e[`bucket-name`]}));o(f,{successLabel:`Updated`})})},Fe={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.usage(`$0 r2 buckets locks delete <bucket-name>
60
+ Enables or disables Local Uploads for an R2 bucket in the default jurisdiction. When enabled, object data is written near the client before being asynchronously copied to the bucket's primary region. Disabling Local Uploads allows existing replication to finish.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`update <bucket-name>`,describe:`Set Local Uploads Configuration`,builder:Ne,handler:async e=>l({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 buckets local-uploads 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`]))}/local-uploads`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(J,{body:t,account_id:l,bucket_name:e[`bucket-name`]}));o(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:e.enabled}),d=await c(`Updating`,async()=>n.send(J,{body:u,account_id:l,bucket_name:e[`bucket-name`]}));o(d,{successLabel:`Updated`})})},Fe={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ie(e){return e.usage(`$0 r2 buckets locks delete <bucket-name>
61
61
 
62
62
  Delete all 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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Le={command:`delete <bucket-name>`,describe:`Delete Bucket Lock Rules`,builder:Ie,handler:async e=>l({command:`r2 buckets locks 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 locks 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`]))}/lock`,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 all lock rules from the R2 bucket, removing their protection against object deletion and overwriting.`})){process.stderr.write(`Aborted.
63
63
  `);return}let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{successLabel:`Deleted`})})};function Re(e){return e.usage(`$0 r2 buckets locks get <bucket-name>
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:d(e.rules,`rules`)}):f(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=f(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`],d(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,8 +86,8 @@ 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`)}}):f(e.body),sensitiveBodyPaths:[[`destination`,`secretAccessKey`],[`source`,`secretAccessKey`],[`source`,`privateKey`],[`source`,`accountKey`],[`source`,`sasToken`]]});return}let d=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n(d,`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(d,`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:f(e.body)});return}let d=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=f(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(d,`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(d,`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>
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>
@@ -98,9 +98,9 @@ Lists objects in an R2 bucket. Returns object metadata including key, size, etag
98
98
 
99
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
100
100
 
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
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}):f(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=f(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}),d=await c(`Updating`,async()=>n.send(Y,{body:u,account_id:l}));o(d,{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
 
103
- Check whether tokens are valid against the target bucket`).option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>m(e,`jurisdiction`,`text`)).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).coerce(`vendor`,e=>m(e,`vendor`,`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 ht={command:`target`,describe:`Check target connectivity`,builder:mt,handler:async e=>l({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,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`)},vendor:e.vendor}):d(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`]]});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(X,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await g(`bucket`,`The bucket field`)),e[`secret-access-key-id`]===void 0&&(e[`secret-access-key-id`]=await g(`secret-access-key-id`,`The secret.accessKeyId field`)),e[`secret-secret-access-key`]===void 0&&(e[`secret-secret-access-key`]=await g(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),e.vendor===void 0&&(e.vendor=await _(`vendor`,`The vendor field`,[`r2`]));let u=p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,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`)},vendor:e.vendor}),f=await c(`Updating`,async()=>n.send(X,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})},gt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(pt).command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _t={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/abortAll`};function vt(e){return e.usage(`$0 r2 super-slurper jobs abort-all
103
+ Check whether tokens are valid against the target bucket`).option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>m(e,`jurisdiction`,`text`)).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).coerce(`vendor`,e=>m(e,`vendor`,`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 ht={command:`target`,describe:`Check target connectivity`,builder:mt,handler:async e=>l({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,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`)},vendor:e.vendor}):f(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Updating`,async()=>n.send(X,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await g(`bucket`,`The bucket field`)),e[`secret-access-key-id`]===void 0&&(e[`secret-access-key-id`]=await g(`secret-access-key-id`,`The secret.accessKeyId field`)),e[`secret-secret-access-key`]===void 0&&(e[`secret-secret-access-key`]=await g(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),e.vendor===void 0&&(e.vendor=await _(`vendor`,`The vendor field`,[`r2`]));let u=p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,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`)},vendor:e.vendor}),d=await c(`Updating`,async()=>n.send(X,{body:u,account_id:l}));o(d,{successLabel:`Updated`})})},gt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(pt).command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _t={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/abortAll`};function vt(e){return e.usage(`$0 r2 super-slurper jobs abort-all
104
104
 
105
105
  Cancels all running R2 Super Slurper migration jobs for the account. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`).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 yt={command:`abort-all`,describe:`Abort all jobs`,builder:vt,handler:async e=>l({command:`r2 super-slurper jobs abort-all`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await i();s({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
106
106
  `);return}let u=await c(`Deleting`,async()=>n.send(_t,{account_id:l}));o(u,{successLabel:`Deleted`})})};var bt={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.job_id}/abort`};function xt(e){return e.usage(`$0 r2 super-slurper jobs abort <job-id>
@@ -108,7 +108,7 @@ Cancels all running R2 Super Slurper migration jobs for the account. Any objects
108
108
  Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const St={command:`abort <job-id>`,describe:`Abort a job`,builder:xt,handler:async e=>l({command:`r2 super-slurper jobs abort`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/abort`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
109
109
  `);return}let u=await c(`Deleting`,async()=>n.send(bt,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Deleted`})})};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/slurper/jobs`,body:`json`,errors:{409:`ConflictError`}};function Ct(e){return e.usage(`$0 r2 super-slurper jobs create
110
110
 
111
- Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`).option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).coerce(`source-vendor`,e=>m(e,`source-vendor`,`text`)).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`source-jurisdiction`,e=>m(e,`source-jurisdiction`,`text`)).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`target-jurisdiction`,e=>m(e,`target-jurisdiction`,`text`)).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).coerce(`target-vendor`,e=>m(e,`target-vendor`,`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(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0)){let t=[`source-bucket`,`source-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0}).check(e=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --target-* flag is set`)}return!0})}const wt={command:`create`,describe:`Create a job`,builder:Ct,handler:async e=>l({command:`r2 super-slurper jobs create`,classification:{safeFlags:[`overwrite`,`source-vendor`,`source-jurisdiction`,`target-jurisdiction`,`target-vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}):d(e.body),sensitiveBodyPaths:[[`source`,`secret`,`secretAccessKey`],[`source`,`secret`,`privateKey`],[`target`,`secret`,`secretAccessKey`]]});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(`Creating`,async()=>n.send(Z,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let u=p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}),f=await c(`Creating`,async()=>n.send(Z,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Tt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.job_id}`,errors:{409:`ConflictError`}};function Et(e){return e.usage(`$0 r2 super-slurper jobs delete <job-id>
111
+ Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`).option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).coerce(`source-vendor`,e=>m(e,`source-vendor`,`text`)).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`source-jurisdiction`,e=>m(e,`source-jurisdiction`,`text`)).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`target-jurisdiction`,e=>m(e,`target-jurisdiction`,`text`)).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).coerce(`target-vendor`,e=>m(e,`target-vendor`,`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(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0)){let t=[`source-bucket`,`source-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0}).check(e=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --target-* flag is set`)}return!0})}const wt={command:`create`,describe:`Create a job`,builder:Ct,handler:async e=>l({command:`r2 super-slurper jobs create`,classification:{safeFlags:[`overwrite`,`source-vendor`,`source-jurisdiction`,`target-jurisdiction`,`target-vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}):f(e.body),sensitiveBodyPaths:[[`source`,`secret`,`secretAccessKey`],[`source`,`secret`,`privateKey`],[`target`,`secret`,`secretAccessKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send(Z,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let u=p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}),d=await c(`Creating`,async()=>n.send(Z,{body:u,account_id:l}));o(d,{successLabel:`Created`})})};var Tt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.job_id}`,errors:{409:`ConflictError`}};function Et(e){return e.usage(`$0 r2 super-slurper jobs delete <job-id>
112
112
 
113
113
  Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Dt={command:`delete <job-id>`,describe:`Delete a job`,builder:Et,handler:async e=>l({command:`r2 super-slurper jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force})){process.stderr.write(`Aborted.
114
114
  `);return}let u=await c(`Deleting`,async()=>n.send(Tt,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Deleted`})})};var Ot={method:`GET`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.job_id}`};function kt(e){return e.usage(`$0 r2 super-slurper jobs get <job-id>
@@ -125,4 +125,4 @@ Retrieves current progress metrics for an R2 Super Slurper migration job`).posit
125
125
 
126
126
  Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Gt={command:`resume <job-id>`,describe:`Resume a job`,builder:Wt,handler:async e=>l({command:`r2 super-slurper jobs resume`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/resume`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Updating`,async()=>n.send(Ut,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Updated`})})},Kt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(St).command(yt).command(wt).command(Dt).command(At).command(Nt).command(Bt).command(Ht).command(Gt).command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qt={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(gt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`POST`,path:t=>e`/accounts/${t.account_id}/r2/temp-access-credentials`,body:`json`};function Jt(e){return e.usage(`$0 r2 temporary-credentials create
127
127
 
128
- Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`).option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).coerce(`permission`,e=>m(e,`permission`,`text`)).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`Lifetime of the temporary credentials in seconds, up to 604800 seconds (7 days).`,default:900}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yt={command:`create`,describe:`Create Temporary Access Credentials`,builder:Jt,handler:async e=>l({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}):d(e.body)});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(`Creating`,async()=>n.send($,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await g(`bucket`,`Name of the R2 bucket.`)),e[`parent-access-key-id`]===void 0&&(e[`parent-access-key-id`]=await g(`parent-access-key-id`,`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`)),e.permission===void 0&&(e.permission=await _(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),e[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let u=p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}),f=await c(`Creating`,async()=>n.send($,{body:u,account_id:l}));o(f,{successLabel:`Created`})})},Xt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Zt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(et).command(dt).command(qt).command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Zt as default};
128
+ Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`).option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).coerce(`permission`,e=>m(e,`permission`,`text`)).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`Lifetime of the temporary credentials in seconds, up to 604800 seconds (7 days).`,default:900}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Yt={command:`create`,describe:`Create Temporary Access Credentials`,builder:Jt,handler:async e=>l({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}):f(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=f(e.body),r=await c(`Creating`,async()=>n.send($,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await g(`bucket`,`Name of the R2 bucket.`)),e[`parent-access-key-id`]===void 0&&(e[`parent-access-key-id`]=await g(`parent-access-key-id`,`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`)),e.permission===void 0&&(e.permission=await _(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),e[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let u=p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}),d=await c(`Creating`,async()=>n.send($,{body:u,account_id:l}));o(d,{successLabel:`Created`})})},Xt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Zt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(et).command(dt).command(qt).command(Xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Zt as default};
@@ -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-Db1KT0vm.mjs";import{t as n}from"./output-Co4xdFf6.mjs";import{t as r}from"./dry-run-C2KjGX10.mjs";import{t as i}from"./progress-Q5w9PNTT.mjs";import{t as a}from"./run-DtFLvOHB.mjs";import"./telemetry-BavSU4ku.mjs";import{n as o,t as s}from"./body-parser-DnBfDdx3.mjs";import{n as c,t as l}from"./raw-fetch-CEOuoKl9.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{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-Db1KT0vm.mjs";import{n as a}from"./context-C_a8oSY9.mjs";import{t as o}from"./auth-token-D9XIPlwf.mjs";import{n as s}from"./request-headers-DXvswze2.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};