cf 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/_meta/agent-context.json +1 -1
  2. package/dist/_meta/commands.json +9 -112
  3. package/dist/{abuse-reports-BsF9JZPW.mjs → abuse-reports-C6GFnuYE.mjs} +1 -1
  4. package/dist/{account-D8mYiWxQ.mjs → account-DxzpnGA8.mjs} +1 -1
  5. package/dist/{accounts-CJci1Oez.mjs → accounts-6RFDuFLF.mjs} +1 -1
  6. package/dist/{acm-CmCd985Q.mjs → acm-Bndi5Jqo.mjs} +1 -1
  7. package/dist/{addressing-R7p6TRBe.mjs → addressing-C8HB4n_n.mjs} +1 -1
  8. package/dist/ai-B4La9Oqk.mjs +8 -0
  9. package/dist/{ai-audit-B0vJNOZG.mjs → ai-audit-B9kKFhoY.mjs} +1 -1
  10. package/dist/{ai-gateway-D3vJR3My.mjs → ai-gateway-Bx9MzNxL.mjs} +1 -1
  11. package/dist/{ai-search-CNg7W7U4.mjs → ai-search-BgIOIgXd.mjs} +1 -1
  12. package/dist/{alerting-_sdM0B0S.mjs → alerting-DVI-v6mE.mjs} +1 -1
  13. package/dist/{analytics-BFBJhDrP.mjs → analytics-B98epmDb.mjs} +1 -1
  14. package/dist/{analytics_engine-CWhFvyeK.mjs → analytics_engine-DwDePA2c.mjs} +1 -1
  15. package/dist/{api-gateway-D4AIEtUq.mjs → api-gateway-DW2GX64w.mjs} +1 -1
  16. package/dist/{argo-Bjk6nFfs.mjs → argo-DKEx-B66.mjs} +1 -1
  17. package/dist/{artifacts-Ba4b3iOa.mjs → artifacts-BEU8fBqt.mjs} +1 -1
  18. package/dist/{audit-logs-BE0T5All.mjs → audit-logs-DZiEPYL0.mjs} +1 -1
  19. package/dist/{auth-D_zyQbDR.mjs → auth-009DISzb.mjs} +1 -1
  20. package/dist/{auth-CZ0E51rF.mjs → auth-B1CY5zpC.mjs} +2 -2
  21. package/dist/{billing-Dz6Zj8Eq.mjs → billing-10B4_1qb.mjs} +1 -1
  22. package/dist/{bot-management-pFwIbFi-.mjs → bot-management-D51WzJBO.mjs} +1 -1
  23. package/dist/{botnet-feed-BY9uGChY.mjs → botnet-feed-Dw-leAwX.mjs} +1 -1
  24. package/dist/{brand-protection-DkPAk2Cz.mjs → brand-protection-BTYkTsER.mjs} +1 -1
  25. package/dist/{browser-extension-D9P6Yv8i.mjs → browser-extension-BFa5Ky8u.mjs} +1 -1
  26. package/dist/{browser-run-DhHtz4y3.mjs → browser-run-BMA8Z_hI.mjs} +1 -1
  27. package/dist/build-C1FOoThn.mjs +70 -0
  28. package/dist/{cache-DVhkiIGK.mjs → cache-DrX4gWvg.mjs} +1 -1
  29. package/dist/{calls-95zjvIcO.mjs → calls-m4WyL1Rb.mjs} +1 -1
  30. package/dist/{certificate-authorities-BowBqbVq.mjs → certificate-authorities-BA-S8NE-.mjs} +1 -1
  31. package/dist/{cf-BLT7uKJF.mjs → cf-BhDnTcDR.mjs} +7 -7
  32. package/dist/chunk-2SIGYDH3-_JSHaszR.mjs +473 -0
  33. package/dist/{chunk-6IEM75FG-BEjRFMGh.mjs → chunk-Q72B4Q5Z-B-N_eqrM.mjs} +1 -1
  34. package/dist/{client-certificates-D6mE4vJu.mjs → client-certificates-5h-fXoNq.mjs} +1 -1
  35. package/dist/{cloud-connector-DmwsjeFN.mjs → cloud-connector-ywFQuqtV.mjs} +1 -1
  36. package/dist/{cloudforce-one-CG3TT7IN.mjs → cloudforce-one-CPx4C-r3.mjs} +1 -1
  37. package/dist/{completions-DMc_PlIw.mjs → completions-CCRu-jvY.mjs} +1 -1
  38. package/dist/{connectivity-DJkE3crz.mjs → connectivity-y-Gav-Ge.mjs} +1 -1
  39. package/dist/{connector-interrupts-DTgQ7onV.mjs → connector-interrupts-Bs-jfuh8.mjs} +1 -1
  40. package/dist/{connector-telemetry-events-D0rTHDou.mjs → connector-telemetry-events-Bc6f3xpx.mjs} +1 -1
  41. package/dist/{connector-telemetry-snapshots--0QmD3z6.mjs → connector-telemetry-snapshots-Bl54XZ3h.mjs} +1 -1
  42. package/dist/{connectors-zWaZTi2A.mjs → connectors-BnQq_R19.mjs} +1 -1
  43. package/dist/{content-scanning-CGvGf04y.mjs → content-scanning-Bxk-WkSL.mjs} +1 -1
  44. package/dist/{ct-alerting-ebSPSWNC.mjs → ct-alerting-BSn2Jqou.mjs} +1 -1
  45. package/dist/{custom-certificates-CWUrPYLP.mjs → custom-certificates-BBqr4S9W.mjs} +1 -1
  46. package/dist/{custom-csrs-CRtdrF9R.mjs → custom-csrs-CXeBzLUy.mjs} +1 -1
  47. package/dist/{custom-hostnames-CVQSksqq.mjs → custom-hostnames-CfCOedoN.mjs} +1 -1
  48. package/dist/{custom-nameservers-BRwbIdsX.mjs → custom-nameservers-RPXeu7f_.mjs} +1 -1
  49. package/dist/{custom-pages-Ci8sTQX7.mjs → custom-pages-xGG1xo88.mjs} +1 -1
  50. package/dist/{d1-78Ym1P6D.mjs → d1-CRIOfBsJ.mjs} +1 -1
  51. package/dist/{data-security-zmFoMwRU.mjs → data-security-D5Sw5rwj.mjs} +1 -1
  52. package/dist/{dcv-delegation-Dd4FZ2IG.mjs → dcv-delegation-BBnlgr6F.mjs} +1 -1
  53. package/dist/deploy-D0_KIUpW.mjs +2 -0
  54. package/dist/deploy-input-CdWrpzPA.mjs +1178 -0
  55. package/dist/{dev-DSslyDXx.mjs → dev-Bz87BeKt.mjs} +1 -1
  56. package/dist/{diagnostics-B8Ev5m_o.mjs → diagnostics-C1qryRf4.mjs} +1 -1
  57. package/dist/{dispatch-namespaces-Dm5vGeEP.mjs → dispatch-namespaces-DbosPgPV.mjs} +1 -1
  58. package/dist/{dist-BH-4NQOV.mjs → dist-C-6VkMPZ.mjs} +35 -35
  59. package/dist/dist-CnaLMpVH.mjs +18 -0
  60. package/dist/{dns-D7VAaCyO.mjs → dns-ByufYrJH.mjs} +1 -1
  61. package/dist/{dns-firewall-ByLCsf0q.mjs → dns-firewall-CiokCKRr.mjs} +1 -1
  62. package/dist/{durable-objects-BIpvyu9m.mjs → durable-objects-DjF-WAD3.mjs} +1 -1
  63. package/dist/{email-auth-Cx--s8W4.mjs → email-auth-B4BIYMb-.mjs} +1 -1
  64. package/dist/{email-routing-CiDbivcN.mjs → email-routing-BbbtpVyS.mjs} +1 -1
  65. package/dist/{email-security-BYeAuSc6.mjs → email-security-DuBVypAO.mjs} +1 -1
  66. package/dist/{email-sending-Dg2rSmHH.mjs → email-sending-5g-k05Lv.mjs} +1 -1
  67. package/dist/{filters-DZ8YnQ90.mjs → filters-CzJmLFcS.mjs} +1 -1
  68. package/dist/{firewall-DEd1hs_I.mjs → firewall-CjmeWA2M.mjs} +1 -1
  69. package/dist/{flagship-DVw7xGoP.mjs → flagship-BfyVrWP-.mjs} +1 -1
  70. package/dist/{fraud-BbGS3FZs.mjs → fraud-reRvxNg-.mjs} +1 -1
  71. package/dist/{google-tag-gateway-CBnRGYQR.mjs → google-tag-gateway-CGwzMZU1.mjs} +1 -1
  72. package/dist/{healthchecks-Da9N3ix4.mjs → healthchecks-BhCsPWcG.mjs} +1 -1
  73. package/dist/{hostnames-mimZu2tB.mjs → hostnames-JpgQW4kn.mjs} +1 -1
  74. package/dist/{hyperdrive-BNdvxOos.mjs → hyperdrive-iwYttuwV.mjs} +1 -1
  75. package/dist/{iam-DGQ-OgRl.mjs → iam-ffI98_4v.mjs} +1 -1
  76. package/dist/{images-CI6Iy9ho.mjs → images-Bgb9DGlr.mjs} +1 -1
  77. package/dist/index.mjs +1 -1
  78. package/dist/{intel-BDB-aRtU.mjs → intel-DVRjKpyU.mjs} +1 -1
  79. package/dist/{ips-B9UuPvsY.mjs → ips-BtLRO19r.mjs} +1 -1
  80. package/dist/{keyless-certificates-Ua9uJgPt.mjs → keyless-certificates-13w8KOcC.mjs} +1 -1
  81. package/dist/{kv-BHerx4dZ.mjs → kv-CvQyF_NB.mjs} +1 -1
  82. package/dist/{leaked-credential-checks-B8Vunj9h.mjs → leaked-credential-checks-DvY8VReW.mjs} +1 -1
  83. package/dist/{load-balancers-DSjS5WKw.mjs → load-balancers-6lgExyS7.mjs} +1 -1
  84. package/dist/{logexplorer-DBIfTlRP.mjs → logexplorer-DBfrK1hn.mjs} +1 -1
  85. package/dist/{logo-matches-C00iGpzW.mjs → logo-matches-XS2RaxQu.mjs} +1 -1
  86. package/dist/{logos-CJLhx1go.mjs → logos-COtlpbRq.mjs} +1 -1
  87. package/dist/{logpush-Cr1U-eK-.mjs → logpush-CIpiK3Xl.mjs} +1 -1
  88. package/dist/{logs-DMvtchc6.mjs → logs-0KjIf_3g.mjs} +1 -1
  89. package/dist/{magic-cloud-networking-FQfO8QWH.mjs → magic-cloud-networking-q_d9-he-.mjs} +1 -1
  90. package/dist/{magic-network-monitoring-CDd70fJQ.mjs → magic-network-monitoring-DLNCrUsn.mjs} +1 -1
  91. package/dist/{magic-transit-DiKiPUax.mjs → magic-transit-sIwSlzoK.mjs} +1 -1
  92. package/dist/{managed-transforms-fPVUTrAv.mjs → managed-transforms-BKRjmzJS.mjs} +1 -1
  93. package/dist/{matches-B0yHbQ2I.mjs → matches-DZLS60M2.mjs} +1 -1
  94. package/dist/{moq-UgBawOXe.mjs → moq-Dbb9QhC1.mjs} +1 -1
  95. package/dist/{mtls-certificates-xKUbC5EL.mjs → mtls-certificates-BpIqoWpc.mjs} +1 -1
  96. package/dist/{network-interconnects-BJzOE2ny.mjs → network-interconnects-DZwGJFYT.mjs} +1 -1
  97. package/dist/{oauth-DBJ5GSFk.mjs → oauth-DC9g9uK_.mjs} +1 -1
  98. package/dist/{observability-B-1y36QS.mjs → observability-CVLjPAir.mjs} +1 -1
  99. package/dist/{open-YWOUIZ5Y-CFRcYALi.mjs → open-PBXRGS4R-D5C2-7de.mjs} +1 -1
  100. package/dist/{organization-Dq3PClZ7.mjs → organization-BGF8N1QQ.mjs} +1 -1
  101. package/dist/{organizations-AhsQkHyX.mjs → organizations-BInE8nlx.mjs} +1 -1
  102. package/dist/{origin-ca-certificates-CRgF0UyU.mjs → origin-ca-certificates-wPzWcEa0.mjs} +1 -1
  103. package/dist/{origin-post-quantum-encryption-BXTx7DPa.mjs → origin-post-quantum-encryption-t1Cl9hiy.mjs} +1 -1
  104. package/dist/{origin-tls-client-auth-BDw5q-6G.mjs → origin-tls-client-auth-Cvr9D8eq.mjs} +1 -1
  105. package/dist/{page-rules-DqYQ23eg.mjs → page-rules-CMo73oVb.mjs} +1 -1
  106. package/dist/{page-shield-DKdlZOLO.mjs → page-shield-Z23iqabu.mjs} +1 -1
  107. package/dist/{pages-BsXF11Kv.mjs → pages-ByaZvYjA.mjs} +1 -1
  108. package/dist/{pay-per-crawl-BGAwuAP3.mjs → pay-per-crawl-BXTenh_d.mjs} +1 -1
  109. package/dist/{pipelines-D_QhSnGW.mjs → pipelines-7KWm5BYN.mjs} +1 -1
  110. package/dist/{progress-O88q63Bk.mjs → progress-BLQ2xXwD.mjs} +1 -1
  111. package/dist/{prompt-DTAWiEm2.mjs → prompt-DcfYBioA.mjs} +1 -1
  112. package/dist/{queries-CAE95-OH.mjs → queries-Cgx1lQbn.mjs} +1 -1
  113. package/dist/{queues-BBz35Mqd.mjs → queues-jnugmCYI.mjs} +1 -1
  114. package/dist/{r2-Zp99S5xF.mjs → r2-Dllx7F7a.mjs} +1 -1
  115. package/dist/{r2-data-catalog-BeVLZwrE.mjs → r2-data-catalog-CaAAPwKp.mjs} +1 -1
  116. package/dist/{radar-Cij-XVQJ.mjs → radar-DLSHX2_1.mjs} +1 -1
  117. package/dist/{rate-limits-DSdToIWv.mjs → rate-limits-DlVTd6QY.mjs} +1 -1
  118. package/dist/{raw-fetch-DgezeshQ.mjs → raw-fetch-CeW1mW_u.mjs} +1 -1
  119. package/dist/{realtime-kit-9rJcapfM.mjs → realtime-kit-ct8Fu2kO.mjs} +1 -1
  120. package/dist/{registrar-CXViZlah.mjs → registrar-CKTB7QTM.mjs} +1 -1
  121. package/dist/{registrar-sandbox-CvQyjXLJ.mjs → registrar-sandbox-1-nNk6Uy.mjs} +1 -1
  122. package/dist/{request-tracers-DATfBnE9.mjs → request-tracers-DO6lno0x.mjs} +1 -1
  123. package/dist/{resource-sharing-Cmhn6ghR.mjs → resource-sharing-DYhXJw44.mjs} +1 -1
  124. package/dist/{resource-tagging-BTn05AOj.mjs → resource-tagging-CcKWMF9l.mjs} +1 -1
  125. package/dist/{rules-ens3OHme.mjs → rules-DQKR3qb7.mjs} +1 -1
  126. package/dist/{rulesets-bkreZRao.mjs → rulesets-B9fZb_JY.mjs} +1 -1
  127. package/dist/{rum-CpgXFcwl.mjs → rum-BaJio_GD.mjs} +1 -1
  128. package/dist/{schema-validation-Ca6o94ts.mjs → schema-validation-Cqv8KT1B.mjs} +1 -1
  129. package/dist/{scim-C4oT8TMc.mjs → scim-DkYH1dep.mjs} +1 -1
  130. package/dist/{secrets-store-CWEuiDNo.mjs → secrets-store-CMR_pA1t.mjs} +1 -1
  131. package/dist/{security-center-BOvm7xy6.mjs → security-center-DCHfgCq6.mjs} +1 -1
  132. package/dist/{security-txt-BCAUBctN.mjs → security-txt-D19uTyaf.mjs} +1 -1
  133. package/dist/{session-B1ARgLG7.mjs → session-CQpgz61H.mjs} +1 -1
  134. package/dist/{share-DhmVspmL.mjs → share-CfJbt0WU.mjs} +1 -1
  135. package/dist/shared-D0xvDsDl.mjs +2 -0
  136. package/dist/{smart-shield-DZm4fn6z.mjs → smart-shield-BG5WOmi1.mjs} +1 -1
  137. package/dist/{snippets-oQ0u26-z.mjs → snippets-CYiSdx7R.mjs} +1 -1
  138. package/dist/{spawn-ChG5Xi9Z.mjs → spawn-j3dn7A69.mjs} +1 -1
  139. package/dist/{spectrum-Cnkee5Ww.mjs → spectrum-Qvq3yJax.mjs} +1 -1
  140. package/dist/{speed-DqNnvLBD.mjs → speed-vpoB9msm.mjs} +1 -1
  141. package/dist/{src-By-zTCHz.mjs → src-Bn0FyQIp.mjs} +5 -5
  142. package/dist/{ssl-tS3CYZsZ.mjs → ssl-Qw8eVAiS.mjs} +1 -1
  143. package/dist/{state-OsdDJvdj.mjs → state-C2cBU9iK.mjs} +1 -1
  144. package/dist/{stream-Bud9Os5V.mjs → stream-BNbkY3zI.mjs} +1 -1
  145. package/dist/{submit-BtP8she2.mjs → submit-pQNW7uWj.mjs} +1 -1
  146. package/dist/{tenant-CMwHa-tU.mjs → tenant-xkvdAutS.mjs} +1 -1
  147. package/dist/{token-validation-BYC7HTok.mjs → token-validation-5F2AbQCz.mjs} +1 -1
  148. package/dist/triggers-CYdZhJYr.mjs +2 -0
  149. package/dist/{turnstile-CP4nScaL.mjs → turnstile-BSIaunXn.mjs} +1 -1
  150. package/dist/{ui-BNoF0KpD.mjs → ui-CTo5OG9r.mjs} +1 -1
  151. package/dist/{url-info-Chs9h7Y-.mjs → url-info-Q7m7AVih.mjs} +1 -1
  152. package/dist/{url-normalization-XYxW5Gj0.mjs → url-normalization-Bs2m5jlD.mjs} +1 -1
  153. package/dist/{url-scanner-D4pYNlO-.mjs → url-scanner-CYmT3C99.mjs} +1 -1
  154. package/dist/{user-DtefniLc.mjs → user-Bay_0p3C.mjs} +1 -1
  155. package/dist/{vectorize-BeAY2g-7.mjs → vectorize-cP2OuB5N.mjs} +1 -1
  156. package/dist/{versions-dMW3bLVv.mjs → versions-D7F26fhH.mjs} +1 -1
  157. package/dist/{waiting-rooms-K78HeeTg.mjs → waiting-rooms-B5HR1-37.mjs} +1 -1
  158. package/dist/{web3-Dhw79l4S.mjs → web3-DqCXM4sx.mjs} +1 -1
  159. package/dist/{workers-l3zMNOU6.mjs → workers-Cu-A8AZc.mjs} +1 -1
  160. package/dist/{workers-builds-CuOAB3u4.mjs → workers-builds-CmCg27M-.mjs} +1 -1
  161. package/dist/{workflows-rb7RYBKP.mjs → workflows-DavS4SEh.mjs} +1 -1
  162. package/dist/{zaraz-CHecMYuo.mjs → zaraz-CKcVy5Xa.mjs} +1 -1
  163. package/dist/{zero-trust-DAZoa-Aj.mjs → zero-trust-BKVqb2yq.mjs} +1 -1
  164. package/dist/{zone-BnnqJwW-.mjs → zone-BOcuY4sU.mjs} +1 -1
  165. package/dist/{zones-DpI2YikF.mjs → zones-BR-9WaY7.mjs} +1 -1
  166. package/package.json +5 -4
  167. package/dist/ai-BzJg0RIX.mjs +0 -3
  168. package/dist/build-CWuStmDi.mjs +0 -2
  169. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +0 -397
  170. package/dist/deploy-CVvkZFjR.mjs +0 -2
  171. package/dist/lib-Og5sB51C.mjs +0 -68
  172. package/dist/shared-Bod3-Exx.mjs +0 -990
  173. /package/dist/{schema-DCF4yEp_.mjs → schema-DAW-B7wT.mjs} +0 -0
  174. /package/dist/{tools-Dru4l8yh.mjs → tools-BpNGzfj2.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{i as n,n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DTAWiEm2.mjs";function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:h,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{i as n,n as r}from"./auth-B1CY5zpC.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-BLQ2xXwD.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,r as l,t as u}from"./body-parser-BO6mfo_W.mjs";import{n as d}from"./input-validation-BwUR9z8e.mjs";import{n as f,r as p,t as m}from"./prompt-DcfYBioA.mjs";function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:h,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:_,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function te(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:te,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){a({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await r(l),f=l.local?s:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>n(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},y={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(g).command(ee).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`location-hint`,{type:`string`,description:`Location of the bucket.`,choices:[`apac`,`eeur`,`enam`,`weur`,`wnam`,`oc`]}).option(`name`,{type:`string`,description:`Name of the bucket.`}).option(`storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,choices:[`Standard`,`InfrequentAccess`],default:`Standard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new R2 bucket.`,builder:b,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({locationHint:d(f[`location-hint`],`location-hint`,`text`),name:d(f.name,`name`,`text`),storageClass:d(f[`storage-class`],`storage-class`,`text`)}):c(f.body)});return}let h=await r(f),g=f.local?s:await t();if(f.accountId=g,f.body){let e=c(f.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await p(`name`,`Name of the bucket.`));let _={};f[`location-hint`]!==void 0&&l(_,[`locationHint`],d(f[`location-hint`],`location-hint`,`text`)),f.name!==void 0&&l(_,[`name`],d(f.name,`name`,`text`)),f[`storage-class`]!==void 0&&l(_,[`storageClass`],d(f[`storage-class`],`storage-class`,`text`)),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function S(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:S,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function w(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`domain`,{type:`string`,description:`Name of the custom domain to be added.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`zone-id`,{type:`string`,description:`Zone ID of the custom domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:w,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,domain:d(f.domain,`domain`,`text`),enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`),zoneId:d(f[`zone-id`],`zone-id`,`text`)}):c(f.body)});return}let h=await r(f),g=f.local?s:await t();if(f.accountId=g,f.body){let e=c(f.body);i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}if(f.domain===void 0&&(f.domain=await p(`domain`,`Name of the custom domain to be added.`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f[`zone-id`]===void 0&&(f[`zone-id`]=await p(`zone-id`,`Zone ID of the custom domain.`));let _={};f.ciphers!==void 0&&l(_,[`ciphers`],f.ciphers),f.domain!==void 0&&l(_,[`domain`],d(f.domain,`domain`,`text`)),f.enabled!==void 0&&l(_,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(_,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),f[`zone-id`]!==void 0&&l(_,[`zoneId`],d(f[`zone-id`],`zone-id`,`text`)),i(await o(`Creating`,async()=>n(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function E(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:E,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();if(c.accountId=d,!await m({force:!!c.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function O(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:O,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:A,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function M(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the specified custom domain.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:M,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){a({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${f.domain==null?`<domain>`:encodeURIComponent(String(f.domain))}`,pathParams:{"bucket-name":String(f[`bucket-name`]??``),domain:String(f.domain??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`)}):c(f.body)});return}let m=await r(f),h=f.local?s:await t();if(f.accountId=h,f.body){let e=c(f.body);i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.ciphers!==void 0&&l(g,[`ciphers`],f.ciphers),f.enabled!==void 0&&l(g,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(g,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),i(await o(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},P={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:F,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){a({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function L(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the r2.dev domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:L,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){a({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({enabled:d.enabled}):c(d.body)});return}let p=await r(d),m=d.local?s:await t();if(d.accountId=m,d.body){let e=c(d.body);i(await o(`Updating`,async()=>n(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}if(d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};d.enabled!==void 0&&l(h,[`enabled`],d.enabled),i(await o(`Updating`,async()=>n(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},z={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(P).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:V,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){a({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(c),d=c.local?s:await t();c.accountId=d,i(await o(`Updating`,async()=>n(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rule-ids`,{type:`string`,array:!0,description:`Array of rule ids to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:U,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){a({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/event_notifications/r2/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}`,pathParams:{"queue-id":String(d[`queue-id`]??``),"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({ruleIds:d[`rule-ids`]}):c(d.body)});return}let p=await r(d),h=d.local?s:await t();if(d.accountId=h,!await m({force:!!d.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async d=>{if(d.dryRun){i({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({token:l(d.token,`token`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}d.token===void 0&&(d.token=await u(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=c({token:l(d.token,`token`,`text`)});r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Operations for credentials`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:h,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
2
+ import{O as e,w as t}from"./oauth-DC9g9uK_.mjs";import{n}from"./auth-B1CY5zpC.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-BLQ2xXwD.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DcfYBioA.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async d=>{if(d.dryRun){i({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({token:l(d.token,`token`,`text`)}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}d.token===void 0&&(d.token=await u(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=c({token:l(d.token,`token`,`text`)});r(await a(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Operations for credentials`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:h,handler:async s=>{let c={force:s.force};if(s.dryRun){i({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
3
3
  `);return}r(await a(`Deleting`,async()=>l.r2DataCatalog.delete({account_id:u,bucket_name:s[`bucket-name`],...c})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
4
4
  `);return}r(await a(`Deleting`,async()=>c.r2DataCatalog.disable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Creating`,async()=>c.r2DataCatalog.enable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Created`})}};function x(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:x,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:C,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.list({account_id:l})),{successLabel:`Loaded`})}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.r2DataCatalog.maintenanceConfigs.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const O={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:D,handler:async u=>{if(u.dryRun){i({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/r2-catalog/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`});return}let p=c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}});r(await a(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`})}},k={command:`maintenance-configs`,describe:`Operations for maintenance-configs`,builder:e=>e.command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
5
5
  Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.