cf 0.9.1 → 0.11.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 (363) hide show
  1. package/README.md +20 -5
  2. package/dist/_meta/agent-context.json +46 -39
  3. package/dist/_meta/commands.json +9358 -10581
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +14870 -14667
  6. package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
  7. package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/account-tags-Bz3JG5hI.mjs +9 -0
  10. package/dist/accounts-DCuW3xyZ.mjs +28 -0
  11. package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/args-DlUhyGU0.mjs +2 -0
  26. package/dist/artifacts-BBfXNfUg.mjs +4 -0
  27. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  28. package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
  29. package/dist/auth-DPhNN3Ly.mjs +5 -0
  30. package/dist/billing-B9e4PnvN.mjs +3 -0
  31. package/dist/body-parser-BshbixEq.mjs +2 -0
  32. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  33. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  34. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  35. package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  36. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  37. package/dist/build-D0FhOj40.mjs +8 -0
  38. package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
  39. package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
  40. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  41. package/dist/cf-Ds4JFovl.mjs +18 -0
  42. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  44. package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  45. package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  46. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  47. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  48. package/dist/command-C9VP3xaA.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  50. package/dist/config.d.mts +1460 -1348
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  53. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  54. package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
  55. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  56. package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
  57. package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  58. package/dist/containers-BrQtGiNp.mjs +58 -0
  59. package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  60. package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  61. package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  62. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  63. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  64. package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
  65. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  66. package/dist/custom-pages-DTINMR30.mjs +3 -0
  67. package/dist/d1-sKdExJYF.mjs +20 -0
  68. package/dist/data-security-mV3a6UfW.mjs +7 -0
  69. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  70. package/dist/delegate.mjs +1 -1
  71. package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
  72. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  73. package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
  74. package/dist/diagnostics-CJV6qWUA.mjs +3 -0
  75. package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
  76. package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  77. package/dist/dist-BHi7UhXO.mjs +72 -0
  78. package/dist/dist-BWpErtDM.mjs +384 -0
  79. package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
  80. package/dist/dns-C8FC2hbh.mjs +29 -0
  81. package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  84. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  85. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  86. package/dist/email-routing-CF3_Z957.mjs +6 -0
  87. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  88. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  89. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  90. package/dist/firewall-8YWWy4iB.mjs +11 -0
  91. package/dist/flagship-C4x0l-8J.mjs +4 -0
  92. package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
  93. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  94. package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
  95. package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
  96. package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  97. package/dist/iam-DR72hmii.mjs +6 -0
  98. package/dist/images-CeKc5JPh.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/intel-DtFix9WL.mjs +8 -0
  101. package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
  102. package/dist/ips-CtWCjXAN.mjs +2 -0
  103. package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  104. package/dist/keys-BmhG6Kn1.mjs +2 -0
  105. package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
  106. package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  107. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  108. package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
  109. package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  110. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  111. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  112. package/dist/logos-DRYjGBDq.mjs +3 -0
  113. package/dist/logpush-Dve9jOMp.mjs +4 -0
  114. package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
  115. package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  116. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  117. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  118. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  119. package/dist/matches-Iss9Fo4R.mjs +2 -0
  120. package/dist/mcp-8wxXT6JU.mjs +4 -0
  121. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  122. package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
  123. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  124. package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
  125. package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  126. package/dist/oauth-DuEONNgC.mjs +14 -0
  127. package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  128. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  129. package/dist/observability-Jya7-zkl.mjs +4 -0
  130. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  131. package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
  132. package/dist/organizations-SacGUW44.mjs +2 -0
  133. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  134. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  135. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  136. package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
  137. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  138. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  139. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  140. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  141. package/dist/precursor-iwK-1P_d.mjs +4 -0
  142. package/dist/progress-BqQcF5QH.mjs +2 -0
  143. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  144. package/dist/prompt-B0sWIs9c.mjs +3 -0
  145. package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  146. package/dist/queries-c7zvnfEQ.mjs +3 -0
  147. package/dist/queues-BU6y16qS.mjs +6 -0
  148. package/dist/r2-Jo3QMahK.mjs +24 -0
  149. package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  150. package/dist/radar-DIYAMEof.mjs +2 -0
  151. package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
  152. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  153. package/dist/realtimekit-cnZEVNDn.mjs +7 -0
  154. package/dist/registrar-BsWr_aPM.mjs +23 -0
  155. package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
  156. package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
  157. package/dist/reporting--1AyTV7k.mjs +2 -0
  158. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  159. package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  160. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  161. package/dist/rules-BfjzALMi.mjs +4 -0
  162. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  163. package/dist/rum-CjmIckiR.mjs +4 -0
  164. package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
  165. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  166. package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
  167. package/dist/sdk-ZctLa5jW.mjs +3 -0
  168. package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  169. package/dist/security-center-Djm06dq-.mjs +2 -0
  170. package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  171. package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
  172. package/dist/shared-BJvq4DkR.mjs +290 -0
  173. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  174. package/dist/snippets-Dyz0PH60.mjs +4 -0
  175. package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  176. package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  177. package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
  178. package/dist/src-gJma71Ec.mjs +108 -0
  179. package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
  180. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  181. package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
  182. package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  183. package/dist/submit-BxbKKhBn.mjs +2 -0
  184. package/dist/tags-DA8dq9fx.mjs +2 -0
  185. package/dist/tenant-DLXw48hS.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  187. package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
  188. package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  189. package/dist/tunnels-CC10EOsU.mjs +2 -0
  190. package/dist/turnstile-CH58hnf4.mjs +23 -0
  191. package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
  192. package/dist/url-info-BpCgdUtL.mjs +2 -0
  193. package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  194. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  195. package/dist/user-2-NGebfI.mjs +12 -0
  196. package/dist/values-S_bNv819.mjs +2 -0
  197. package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  198. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  199. package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  200. package/dist/web3-GnUocVYH.mjs +4 -0
  201. package/dist/workers-J1-PLwdl.mjs +28 -0
  202. package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
  203. package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
  204. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  205. package/dist/zero-trust-DVdUPtj1.mjs +93 -0
  206. package/dist/zone-DMAfrDJX.mjs +2 -0
  207. package/dist/zones-CNwxUi7I.mjs +21 -0
  208. package/package.json +10 -7
  209. package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
  210. package/dist/account-Dd4-tDYJ.mjs +0 -2
  211. package/dist/account-tags-65fAlHrf.mjs +0 -9
  212. package/dist/accounts-Bp5KGc6r.mjs +0 -28
  213. package/dist/agent-memory-D--BQS0W.mjs +0 -6
  214. package/dist/ai-BnVlQDiI.mjs +0 -5
  215. package/dist/ai-audit-CfpDKXkD.mjs +0 -2
  216. package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
  217. package/dist/ai-search-B2l3B_jn.mjs +0 -7
  218. package/dist/ai-security-byjIIrfl.mjs +0 -4
  219. package/dist/analytics-DeIKjC9n.mjs +0 -3
  220. package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
  221. package/dist/argo-DFerMyXF.mjs +0 -2
  222. package/dist/artifacts-CtyEYYDa.mjs +0 -4
  223. package/dist/audit-logs-retFtvow.mjs +0 -2
  224. package/dist/auth-aazs91XL.mjs +0 -5
  225. package/dist/billing-CxQVqpGZ.mjs +0 -3
  226. package/dist/body-parser-CYD7PKFC.mjs +0 -2
  227. package/dist/bot-management-Rli7v7tg.mjs +0 -5
  228. package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
  229. package/dist/brand-protection-CTvnHGfV.mjs +0 -3
  230. package/dist/browser-run-FwtwnBzA.mjs +0 -4
  231. package/dist/build-Dji9BYmV.mjs +0 -2
  232. package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
  233. package/dist/cf-oSz9pud_.mjs +0 -18
  234. package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
  235. package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
  236. package/dist/cloudforce-one-2PecncfX.mjs +0 -30
  237. package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
  238. package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
  239. package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
  240. package/dist/containers-Bog7j0Hw.mjs +0 -54
  241. package/dist/custom-certificates-4y35UC1X.mjs +0 -5
  242. package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
  243. package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
  244. package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
  245. package/dist/custom-pages-vfDxrXbt.mjs +0 -4
  246. package/dist/d1-Cllm-iTT.mjs +0 -20
  247. package/dist/data-security-rnoSCEdL.mjs +0 -7
  248. package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
  249. package/dist/deploy-input-DhCo1I0I.mjs +0 -242
  250. package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
  251. package/dist/dist-COfwjT96.mjs +0 -72
  252. package/dist/dns-DdQYtenF.mjs +0 -29
  253. package/dist/durable-objects-BvxXBht_.mjs +0 -2
  254. package/dist/email-CGOC_evd.mjs +0 -2
  255. package/dist/email-auth-DFvXKSkg.mjs +0 -2
  256. package/dist/email-routing-QBRPBlyl.mjs +0 -6
  257. package/dist/email-security-BFagcRPP.mjs +0 -18
  258. package/dist/email-sending-Ddhe7xjN.mjs +0 -7
  259. package/dist/filters-CGisPGD1.mjs +0 -4
  260. package/dist/firewall-DD8U-Brd.mjs +0 -11
  261. package/dist/flagship-FJHc4mFi.mjs +0 -4
  262. package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
  263. package/dist/iam-BhHYhMXO.mjs +0 -6
  264. package/dist/images-CDViyKtZ.mjs +0 -8
  265. package/dist/intel-YHZbPlS3.mjs +0 -8
  266. package/dist/ips-BpCdldFx.mjs +0 -2
  267. package/dist/keys-yYtv7Ztr.mjs +0 -2
  268. package/dist/load-balancers-jRCN75mX.mjs +0 -7
  269. package/dist/logexplorer-kO8CULiK.mjs +0 -24
  270. package/dist/logo-matches-LyDAYPbI.mjs +0 -2
  271. package/dist/logos-O9f5bGSB.mjs +0 -3
  272. package/dist/logpush-dtXLu3Ck.mjs +0 -5
  273. package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
  274. package/dist/magic-transit-DwgZeIj-.mjs +0 -111
  275. package/dist/managed-transforms-DCmogkxv.mjs +0 -3
  276. package/dist/matches-BAeN8VM1.mjs +0 -2
  277. package/dist/mcp-DKZ2D050.mjs +0 -4
  278. package/dist/media-CnxgOViL.mjs +0 -2
  279. package/dist/mesh-CzIPtuaM.mjs +0 -4
  280. package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
  281. package/dist/oauth-BPizUUqP.mjs +0 -15
  282. package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
  283. package/dist/observability-DXYgDdU5.mjs +0 -4
  284. package/dist/organizations-eNzfOwlP.mjs +0 -2
  285. package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
  286. package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
  287. package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
  288. package/dist/page-rules-B2Csdc4h.mjs +0 -18
  289. package/dist/pages-BAL6Q7OY.mjs +0 -14
  290. package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
  291. package/dist/pipelines-cyQOuFLb.mjs +0 -6
  292. package/dist/precursor-BrweY39h.mjs +0 -4
  293. package/dist/progress-B84wYh91.mjs +0 -2
  294. package/dist/prompt-CDtLWxNv.mjs +0 -3
  295. package/dist/queries-oM8uGZy5.mjs +0 -3
  296. package/dist/queues-CTx04ZNw.mjs +0 -6
  297. package/dist/r2-CnlIUn7R.mjs +0 -24
  298. package/dist/radar-CGNgGh8v.mjs +0 -2
  299. package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
  300. package/dist/realtimekit-BPwzhNS9.mjs +0 -7
  301. package/dist/registrar-BEcb90RX.mjs +0 -21
  302. package/dist/reporting-CLbjHlnw.mjs +0 -2
  303. package/dist/request-tracers-BcKpofP1.mjs +0 -2
  304. package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
  305. package/dist/rules-CmuB5rIN.mjs +0 -4
  306. package/dist/rulesets-CGaMq8vG.mjs +0 -8
  307. package/dist/rum-QT6EP4JK.mjs +0 -4
  308. package/dist/schema-flags-DHryz6SF.mjs +0 -5
  309. package/dist/sdk-m4xeaua4.mjs +0 -3
  310. package/dist/security-center-BNm4uPVB.mjs +0 -2
  311. package/dist/session-Ckt20hHa.mjs +0 -2
  312. package/dist/shared-BzPQog8H.mjs +0 -2
  313. package/dist/smart-shield-SODkOUyO.mjs +0 -4
  314. package/dist/snippets-B5jY8v_7.mjs +0 -4
  315. package/dist/src-CHW7s5IS.mjs +0 -108
  316. package/dist/submit-Dl_27e0n.mjs +0 -2
  317. package/dist/tags-Cdo_Pwtr.mjs +0 -2
  318. package/dist/tenant-EX-ANl6X.mjs +0 -2
  319. package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
  320. package/dist/triggers-Bf9hbP3h.mjs +0 -2
  321. package/dist/tunnels-CgyX8R2J.mjs +0 -2
  322. package/dist/turnstile-BUtzlW-0.mjs +0 -23
  323. package/dist/url-info-CJsa1Oc9.mjs +0 -2
  324. package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
  325. package/dist/user-BxHjEqpd.mjs +0 -12
  326. package/dist/values-C43NurfT.mjs +0 -2
  327. package/dist/versions-BFbc90Wu.mjs +0 -2
  328. package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
  329. package/dist/web3-Ctv9HGiR.mjs +0 -4
  330. package/dist/workers-D-YbIedB.mjs +0 -24
  331. package/dist/zaraz-BA6kY-b6.mjs +0 -2
  332. package/dist/zero-trust-DOFLlUz1.mjs +0 -102
  333. package/dist/zone-B_rgejLV.mjs +0 -2
  334. package/dist/zone-tags-BWdza4rH.mjs +0 -9
  335. package/dist/zones-DTWO7Vvn.mjs +0 -21
  336. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  337. /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
  338. /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
  339. /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
  340. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  341. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  342. /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
  343. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  344. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  345. /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
  346. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  347. /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
  348. /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
  349. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  350. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  351. /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
  352. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  353. /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
  354. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
  355. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  356. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
  357. /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
  358. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  359. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
  360. /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
  361. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  362. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  363. /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{a as d,i as f,n as p}from"./prompt-B0sWIs9c.mjs";function m(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a new Pipeline.`,builder:m,handler:async c=>{if(c.dryRun){a({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({name:u(c.name,`name`,`text`),sql:u(c.sql,`sql`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`Specifies the name of the Pipeline.`)),c.sql===void 0&&(c.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=l({name:u(c.name,`name`,`text`),sql:u(c.sql,`sql`,`text`)});i(await o(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>c.pipelines.delete({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.get({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`source`,{type:`string`,description:`The source field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:b,handler:async p=>{if(p.dryRun){a({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({destination:{batch:{max_bytes:p[`destination-batch-max-bytes`],max_duration_s:p[`destination-batch-max-duration-s`],max_rows:p[`destination-batch-max-rows`]},compression:{type:u(p[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:u(p[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:u(p[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:u(p[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:u(p[`destination-format`],`destination-format`,`text`),path:{bucket:u(p[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:u(p[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:u(p[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:u(p[`destination-type`],`destination-type`,`text`)},name:u(p.name,`name`,`text`),source:c(p.source,`source`)}):s(p.body)});return}let m=await r(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=s(p.body);i(await o(`Creating`,async()=>m.pipelines.legacyCreate({...e,account_id:h})),{successLabel:`Created`});return}if(p[`destination-credentials-access-key-id`]===void 0&&(p[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),p[`destination-credentials-endpoint`]===void 0&&(p[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),p[`destination-credentials-secret-access-key`]===void 0&&(p[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),p[`destination-format`]===void 0&&(p[`destination-format`]=await f(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),p[`destination-path-bucket`]===void 0&&(p[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),p[`destination-type`]===void 0&&(p[`destination-type`]=await f(`destination-type`,`Specifies the type of destination.`,[`r2`])),p.name===void 0&&(p.name=await d(`name`,`Defines the name of the pipeline.`)),p.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=l({destination:{batch:{max_bytes:p[`destination-batch-max-bytes`],max_duration_s:p[`destination-batch-max-duration-s`],max_rows:p[`destination-batch-max-rows`]},compression:{type:u(p[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:u(p[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:u(p[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:u(p[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:u(p[`destination-format`],`destination-format`,`text`),path:{bucket:u(p[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:u(p[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:u(p[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:u(p[`destination-type`],`destination-type`,`text`)},name:u(p.name,`name`,`text`),source:c(p.source,`source`)});i(await o(`Creating`,async()=>m.pipelines.legacyCreate({...g,account_id:h})),{successLabel:`Created`})}};function S(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
4
+ `);return}i(await o(`Deleting`,async()=>c.pipelines.legacyDelete({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.legacyGet({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:E,handler:async s=>{let c={search:s.search,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...c})),{successLabel:`Loaded`})}};function O(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`source`,{type:`string`,description:`The source field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:O,handler:async p=>{if(p.dryRun){a({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${p[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(p[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(p[`pipeline-name`]??``)},bodyKind:`json`,body:p.body===void 0?l({destination:{batch:{max_bytes:p[`destination-batch-max-bytes`],max_duration_s:p[`destination-batch-max-duration-s`],max_rows:p[`destination-batch-max-rows`]},compression:{type:u(p[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:u(p[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:u(p[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:u(p[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:u(p[`destination-format`],`destination-format`,`text`),path:{bucket:u(p[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:u(p[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:u(p[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:u(p[`destination-type`],`destination-type`,`text`)},name:u(p.name,`name`,`text`),source:c(p.source,`source`)}):s(p.body)});return}let m=await r(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=s(p.body);i(await o(`Updating`,async()=>m.pipelines.legacyUpdate({...e,account_id:h,pipeline_name:p[`pipeline-name`]})),{successLabel:`Updated`});return}if(p[`destination-credentials-access-key-id`]===void 0&&(p[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),p[`destination-credentials-endpoint`]===void 0&&(p[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),p[`destination-credentials-secret-access-key`]===void 0&&(p[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),p[`destination-format`]===void 0&&(p[`destination-format`]=await f(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),p[`destination-path-bucket`]===void 0&&(p[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),p[`destination-type`]===void 0&&(p[`destination-type`]=await f(`destination-type`,`Specifies the type of destination.`,[`r2`])),p.name===void 0&&(p.name=await d(`name`,`Defines the name of the pipeline.`)),p.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=l({destination:{batch:{max_bytes:p[`destination-batch-max-bytes`],max_duration_s:p[`destination-batch-max-duration-s`],max_rows:p[`destination-batch-max-rows`]},compression:{type:u(p[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:u(p[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:u(p[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:u(p[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:u(p[`destination-format`],`destination-format`,`text`),path:{bucket:u(p[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:u(p[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:u(p[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:u(p[`destination-type`],`destination-type`,`text`)},name:u(p.name,`name`,`text`),source:c(p.source,`source`)});i(await o(`Updating`,async()=>m.pipelines.legacyUpdate({...g,account_id:h,pipeline_name:p[`pipeline-name`]})),{successLabel:`Updated`})}};function A(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:A,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],name:s.name};if(s.dryRun){a({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.list({account_id:u,...c})),{successLabel:`Loaded`})}};function M(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-compression`,{type:`string`,description:`Specifies the compression applied to JSON sink output.`,choices:[`uncompressed`,`gzip`,`snappy`,`zstd`,`lz4`]}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-row-group-bytes`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-compression`,`format-type`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0})}const N={command:`create`,describe:`Create a new Sink.`,builder:M,handler:async c=>{if(c.dryRun){a({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({config:{account_id:u(c[`config-account-id`],`config-account-id`,`text`),bucket:u(c[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:u(c[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:u(c[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:u(c[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:u(c[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:u(c[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:u(c[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:u(c[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:u(c[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:c[`config-rolling-policy-file-size-bytes`],inactivity_seconds:c[`config-rolling-policy-inactivity-seconds`],interval_seconds:c[`config-rolling-policy-interval-seconds`]},namespace:u(c[`config-namespace`],`config-namespace`,`text`),table_name:u(c[`config-table-name`],`config-table-name`,`text`),token:u(c[`config-token`],`config-token`,`text`)},format:{decimal_encoding:u(c[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:u(c[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:c[`format-unstructured`],compression:u(c[`format-compression`],`format-compression`,`text`),type:u(c[`format-type`],`format-type`,`text`),row_group_bytes:c[`format-row-group-bytes`]},name:u(c.name,`name`,`text`),schema:{inferred:c[`schema-inferred`]},type:u(c.type,`type`,`text`)}):s(c.body)});return}let p=await r(c),m=c.local?e:await t();if(c.accountId=m,c.body){let e=s(c.body);i(await o(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`Defines the name of the Sink.`)),c.type===void 0&&(c.type=await f(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=l({config:{account_id:u(c[`config-account-id`],`config-account-id`,`text`),bucket:u(c[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:u(c[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:u(c[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:u(c[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:u(c[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:u(c[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:u(c[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:u(c[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:u(c[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:c[`config-rolling-policy-file-size-bytes`],inactivity_seconds:c[`config-rolling-policy-inactivity-seconds`],interval_seconds:c[`config-rolling-policy-interval-seconds`]},namespace:u(c[`config-namespace`],`config-namespace`,`text`),table_name:u(c[`config-table-name`],`config-table-name`,`text`),token:u(c[`config-token`],`config-token`,`text`)},format:{decimal_encoding:u(c[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:u(c[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:c[`format-unstructured`],compression:u(c[`format-compression`],`format-compression`,`text`),type:u(c[`format-type`],`format-type`,`text`),row_group_bytes:c[`format-row-group-bytes`]},name:u(c.name,`name`,`text`),schema:{inferred:c[`schema-inferred`]},type:u(c.type,`type`,`text`)});i(await o(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function ee(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:ee,handler:async s=>{if(s.dryRun){a({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
5
+ `);return}i(await o(`Deleting`,async()=>c.pipelines.sinks.delete({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.sinks.get({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List/Filter Sinks in Account.`,builder:L,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...c})),{successLabel:`Loaded`})}},z={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,builder:e=>e.command(N).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const V={command:`create`,describe:`Create a new Stream.`,builder:B,handler:async c=>{if(c.dryRun){a({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({format:{decimal_encoding:u(c[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:u(c[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:c[`format-unstructured`],type:u(c[`format-type`],`format-type`,`text`),compression:u(c[`format-compression`],`format-compression`,`text`),row_group_bytes:c[`format-row-group-bytes`]},http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},name:u(c.name,`name`,`text`),schema:{inferred:c[`schema-inferred`]},worker_binding:{enabled:c[`worker-binding-enabled`]}}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`Specifies the name of the Stream.`));let m=l({format:{decimal_encoding:u(c[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:u(c[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:c[`format-unstructured`],type:u(c[`format-type`],`format-type`,`text`),compression:u(c[`format-compression`],`format-compression`,`text`),row_group_bytes:c[`format-row-group-bytes`]},http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},name:u(c.name,`name`,`text`),schema:{inferred:c[`schema-inferred`]},worker_binding:{enabled:c[`worker-binding-enabled`]}});i(await o(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`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 U={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:H,handler:async s=>{if(s.dryRun){a({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
6
+ `);return}i(await o(`Deleting`,async()=>c.pipelines.streams.delete({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:W,handler:async s=>{if(s.dryRun){a({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.streams.get({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).option(`name`,{type:`string`,description:`Filters streams by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List/Filter Streams in Account.`,builder:K,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.streams.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const Y={command:`update <stream-id>`,describe:`Update a Stream.`,builder:J,handler:async c=>{if(c.dryRun){a({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${c[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(c[`stream-id`]))}`,pathParams:{"stream-id":String(c[`stream-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},worker_binding:{enabled:c[`worker-binding-enabled`]}}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Updating`,async()=>u.pipelines.streams.update({...e,account_id:d,stream_id:c[`stream-id`]})),{successLabel:`Updated`});return}let f=l({http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},worker_binding:{enabled:c[`worker-binding-enabled`]}});i(await o(`Updating`,async()=>u.pipelines.streams.update({...f,account_id:d,stream_id:c[`stream-id`]})),{successLabel:`Updated`})}},X={command:`streams`,describe:`Inbound data streams that feed events into a pipeline for processing`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`validate-sql`,describe:`Validates that the Pipelines SQL is correct.`,builder:Z,handler:async c=>{if(c.dryRun){a({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({sql:u(c.sql,`sql`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}c.sql===void 0&&(c.sql=await d(`sql`,`Specifies SQL to validate.`));let m=l({sql:u(c.sql,`sql`,`text`)});i(await o(`Creating`,async()=>f.pipelines.validateSql({...m,account_id:p})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).command(T).command(D).command(k).command(j).command(Q).command(z).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{h as e}from"./oauth-DuEONNgC.mjs";import{r as t}from"./auth-D3X9HYhD.mjs";import{t as n}from"./output-Ccqw2WOb.mjs";import{t as r}from"./dry-run-DL2V6yFm.mjs";import{t as i}from"./progress-BqQcF5QH.mjs";import{n as a,r as o,t as s}from"./body-parser-BshbixEq.mjs";import{n as c}from"./input-validation-QDIYu7Vb.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:"Retrieve a zone's Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.",builder:l,handler:async a=>{if(a.dryRun){r({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.precursor.get({zone_id:s})),{successLabel:`Loaded`})}};function d(e){return e.option(`default-mode`,{type:`string`,description:`The zone-level Precursor enforcement mode applied to requests that do
3
+ not match a more specific enforcement rule.
4
+ `,choices:[`off`,`min-friction`,`max-security`]}).option(`enforcement-rules`,{type:`string`,description:`The ordered list of enforcement rules for the zone. 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 f={command:`update`,describe:"Updates the Precursor configuration for a zone. `default_mode` sets the zone-level enforcement mode. `enforcement_rules` is the ordered list of rules that override enforcement for matching requests. This is a partial update: only the fields present in the request body are changed. - Sending an empty array (`[]`) clears all enforcement rules. - At least one of `default_mode` or `enforcement_rules` must be present; an empty body (`{}`) is rejected with `400`. - Rule `id` is read-only (assigned by Cloudflare) and ignored on input. - Rule `mode` must be `min-friction` or `max-security` (`off` is not a valid rule mode; use `default_mode` to disable enforcement). - Rule `expression` is limited to 4000 characters. The limit applies to each rule individually, not to the combined size of all rules.",builder:d,handler:async l=>{if(l.dryRun){r({command:`cf precursor update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({default_mode:c(l[`default-mode`],`default-mode`,`text`),enforcement_rules:o(l[`enforcement-rules`],`enforcement-rules`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.precursor.update({body:e,zone_id:d})),{successLabel:`Updated`});return}let f=s({default_mode:c(l[`default-mode`],`default-mode`,`text`),enforcement_rules:o(l[`enforcement-rules`],`enforcement-rules`)});n(await i(`Updating`,async()=>u.precursor.update({body:f,zone_id:d})),{successLabel:`Updated`})}},p={command:`precursor`,describe:`Precursor settings for a zone`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{c as e,i as t}from"./project-settings-C_1-JI6Y.mjs";import{t as n}from"./args-DlUhyGU0.mjs";import{r}from"./theme-CrIBazAF.mjs";import{d as i}from"./interactive-C7M55Wxx.mjs";const a={Hidden:0,Normal:1,Error:2,Indeterminate:3,Warning:4},o=new class{cleanupRegistered=!1;get isDisabled(){return process.env.CF_NO_OSC_PROGRESS===`1`||process.env.CF_QUIET===`1`||n()}get isSupported(){if(this.isDisabled||!process.stderr.isTTY)return!1;if(process.env.CF_FORCE_OSC_PROGRESS===`1`)return!0;let e=process.env.TERM_PROGRAM?.toLowerCase()??``;return!!(e.includes(`ghostty`)||e.includes(`iterm`)||e.includes(`wezterm`)||process.env.WT_SESSION||process.env.ConEmuANSI===`ON`)}setIndeterminate(){this.isSupported&&(this.ensureCleanup(),this.write(a.Indeterminate))}clear(){this.isSupported&&process.stderr.write(`\x1b]9;4;${a.Hidden};0\x07`)}ensureCleanup(){this.cleanupRegistered||(this.cleanupRegistered=!0,process.on(`exit`,()=>{this.clear()}))}write(e){this.isSupported&&process.stderr.write(`\x1b]9;4;${e};0\x07`)}},s=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function c(){return!(!r()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function l(n,r){if(!c())return r();t(e);let a=i({frames:[...s],indicator:`timer`,delay:80});o.setIndeterminate(),a.start(n);try{let e=await r();return o.clear(),a.stop(n),e}catch(e){throw o.clear(),a.error(n),e}}export{l as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{o as e}from"./chunk-LQW53VED-22IYZovK.mjs";import"./delegate.mjs";import{a as t,n,t as r}from"./theme-CrIBazAF.mjs";import{statSync as i}from"node:fs";import{stripVTControlCharacters as a}from"node:util";import{dirname as o,join as s,resolve as c}from"node:path";function l({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const u=l();function d(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(u,``)}const f=(e=0)=>t=>`\u001B[${t+e}m`,p=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,m=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,h={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(h.modifier);const g=Object.keys(h.color),_=Object.keys(h.bgColor);[...g,..._];function v(){let e=new Map;for(let[t,n]of Object.entries(h)){for(let[t,r]of Object.entries(n))h[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=h[t],e.set(r[0],r[1]);Object.defineProperty(h,t,{value:n,enumerable:!1})}return Object.defineProperty(h,`codes`,{value:e,enumerable:!1}),h.color.close=`\x1B[39m`,h.bgColor.close=`\x1B[49m`,h.color.ansi=f(),h.color.ansi256=p(),h.color.ansi16m=m(),h.bgColor.ansi=f(10),h.bgColor.ansi256=p(10),h.bgColor.ansi16m=m(10),Object.defineProperties(h,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>h.rgbToAnsi256(...h.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>h.ansi256ToAnsi(h.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>h.ansi256ToAnsi(h.hexToAnsi256(e)),enumerable:!1}}),h}const y=v(),b=process.env.CLI_VERSION??`0.11.0`,x=`cf-cli/${b}`;function S(e){let t=n(),i=process.env.CF_DELEGATION?` ${t.dim(`·`)} ${t.dim(`delegated`)}`:``,o=`🍊☁️ ${t.bold.hex(r.orange)(`cf`)} ${t.dim(`·`)} ${t.dim(`v${e}`)}${i}`,s=a(o).length,c=`─`.repeat(s);return`${o}\n${t.hex(r.orange)(c)}`}let C=!1,w=!1,T=!1;function E(e,t={}){if(!(C||w)){if(t.quiet||!process.stderr.isTTY){w=!0;return}process.stderr.write(`${S(e)}\n`),C=!0}}function D(n){!C||w||T||n===`default`||e({allowGlobalAuthKey:!1})!==void 0||(process.stderr.write(`${t.muted(`Active profile:`)} ${t.info(n)}\n`),T=!0)}const O=`cloudflare.config.ts`;let k,A;function j(e){A=e,k=void 0}function M(e=process.cwd()){let t=c(e);for(;;){let e=s(t,O);try{if(i(e).isFile())return e}catch{}let n=o(t);if(n===t)return null;t=n}}async function N(e=process.cwd()){let t=c(e);k=void 0;let n=M(t);if(!n)return k={startDir:t,result:null},null;let{loadAndValidateConfig:r}=await import(`./dist-BHi7UhXO.mjs`).then(e=>e.r),i=await r(n,{mode:A},{include:[`settings`]});if(!i.result.success){let e=i.result.error.issues.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
3
+ `);throw Error(`Invalid ${O}:\n${e}`)}let a=i.result.data.settings,o={path:n,settings:a?.type===`settings`?a:void 0};return k={startDir:t,result:o},o}function P(e=process.cwd()){let t=c(e);return k?.startDir===t?k.result:void 0}export{D as a,b as c,E as i,y as l,N as n,S as o,j as r,x as s,P as t,d as u};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{c as e,i as t}from"./project-settings-C_1-JI6Y.mjs";import{n,t as r}from"./theme-CrIBazAF.mjs";import{f as i,l as a,n as o,s,u as c,v as l}from"./interactive-C7M55Wxx.mjs";function u(e){return e.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,` `)}function d(){t(e)}async function f(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
3
+ `)?t.slice(0,-1):t}async function p(e,t,n){let r=n?.kind??`text`;if(o()){if(r===`secret`){let t=await f();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let s=`Enter value for --${e}`,c=t||n?.question||s,u=e=>e&&e.length>0?n?.validate?.(e):`Value cannot be empty`;d();let p=r===`secret`?await a({message:c,mask:`•`,validate:u}):await i({message:c,validate:u});return(l(p)||typeof p!=`string`)&&process.exit(130),p}async function m(e,t,n,r={}){let i=u(e),a=n.map(u);if(o())throw Error(`--${i} is required (one of: ${a.join(`, `)}). Pass --${i} <value> or run interactively.`);let s=`Select value for --${i}`,f=u(t||s);d();let p=await c({message:f,options:n.map(e=>({value:e,label:u((Object.hasOwn(r,e)?r[e]:void 0)??e)}))});return(l(p)||typeof p!=`string`)&&process.exit(130),p}async function h(e,t){if(o())throw Error(`--${e} is required and must be true. Pass --${e} or run interactively.`);d();let n=await s({message:t||`Confirm --${e}`,initialValue:!1});return l(n)&&process.exit(130),n===!0}async function g(e,{defaultValue:t=!0,fallbackValue:n=!0}={}){if(o())return process.stderr.write(`? ${e}\n Using fallback value in non-interactive context: ${n?`yes`:`no`}\n`),n;d();let r=await s({message:e,initialValue:t});return l(r)&&process.exit(130),r===!0}async function _(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(o()){let e=n();return process.stderr.write(`${e.hex(r.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}d();let i=await s({message:t,initialValue:!1});return l(i)&&process.exit(130),i===!0}export{p as a,m as i,_ as n,u as o,h as r,g as t};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const e={agentMemory:e=>({type:`agent-memory`,...e}),ai:e=>({type:`ai`,...e}),aiSearch:e=>({type:`ai-search`,...e}),aiSearchNamespace:e=>({type:`ai-search-namespace`,...e}),analyticsEngineDataset:e=>({type:`analytics-engine-dataset`,...e}),artifacts:e=>({type:`artifacts`,...e}),assets:()=>({type:`assets`}),browser:e=>({type:`browser`,...e}),d1:e=>({type:`d1`,...e}),dispatchNamespace:e=>({type:`dispatch-namespace`,...e}),durableObject:e=>({type:`durable-object`,...e}),flagship:e=>({type:`flagship`,...e}),hyperdrive:e=>({type:`hyperdrive`,...e}),images:e=>({type:`images`,...e}),json:e=>({type:`json`,value:e}),kv:e=>({type:`kv`,...e}),logfwdr:e=>({type:`logfwdr`,...e}),media:e=>({type:`media`,...e}),mtlsCertificate:e=>({type:`mtls-certificate`,...e}),pipeline:e=>({type:`pipeline`,...e}),queue:e=>({type:`queue`,...e}),rateLimit:e=>({type:`rate-limit`,...e}),r2:e=>({type:`r2`,...e}),secret:()=>({type:`secret`}),secretsStoreSecret:e=>({type:`secrets-store-secret`,...e}),sendEmail:e=>({type:`send-email`,...e}),stream:e=>({type:`stream`,...e}),text:e=>({type:`text`,value:e}),vectorize:e=>({type:`vectorize`,...e}),versionMetadata:()=>({type:`version-metadata`}),vpcService:e=>({type:`vpc-service`,...e}),vpcNetwork:e=>({type:`vpc-network`,...e}),webSearch:e=>({type:`web-search`,...e}),worker:e=>({type:`worker`,...e}),workerLoader:()=>({type:`worker-loader`})},t={fetch:e=>({type:`fetch`,...e}),queue:e=>({type:`queue`,...e}),scheduled:e=>({type:`scheduled`,...e}),email:e=>({type:`email`,...e}),connect:e=>({type:`connect`,...e})};function n(e){return{type:`durable-object`,...e}}function r(e={}){return{type:`worker`,...e}}const i={durableObject:n,worker:r},a=Symbol.for(`@cloudflare/config:definition`);async function o(e,t){return typeof e==`function`?await e(t):await e}async function s(e,t){if(typeof e==`object`&&e&&a in e){let{config:n,type:r}=e[a];return{...await o(n,t),type:r}}return await o(e,t)}function c(e){return{[a]:{config:e,type:`worker`},durableObject(e){return{type:`durable-object`,...e}},worker(e){return{type:`worker`,...e}}}}function l(e){return{[a]:{config:e,type:`settings`}}}export{s as a,i,l as n,t as o,c as r,e as t};
2
+ const e={agentMemory:e=>({type:`agent-memory`,...e}),ai:e=>({type:`ai`,...e}),aiSearch:e=>({type:`ai-search`,...e}),aiSearchNamespace:e=>({type:`ai-search-namespace`,...e}),analyticsEngineDataset:e=>({type:`analytics-engine-dataset`,...e}),artifacts:e=>({type:`artifacts`,...e}),assets:()=>({type:`assets`}),browser:e=>({type:`browser`,...e}),d1:e=>({type:`d1`,...e}),dispatchNamespace:e=>({type:`dispatch-namespace`,...e}),durableObject:e=>({type:`durable-object`,...e}),flagship:e=>({type:`flagship`,...e}),hyperdrive:e=>({type:`hyperdrive`,...e}),images:e=>({type:`images`,...e}),json:e=>({type:`json`,value:e}),kv:e=>({type:`kv`,...e}),logfwdr:e=>({type:`logfwdr`,...e}),media:e=>({type:`media`,...e}),mtlsCertificate:e=>({type:`mtls-certificate`,...e}),pipeline:e=>({type:`pipeline`,...e}),queue:e=>({type:`queue`,...e}),rateLimit:e=>({type:`rate-limit`,...e}),r2:e=>({type:`r2`,...e}),secret:()=>({type:`secret`}),secretsStoreSecret:e=>({type:`secrets-store-secret`,...e}),sendEmail:e=>({type:`send-email`,...e}),stream:e=>({type:`stream`,...e}),text:e=>({type:`text`,value:e}),vectorize:e=>({type:`vectorize`,...e}),versionMetadata:()=>({type:`version-metadata`}),vpcService:e=>({type:`vpc-service`,...e}),vpcNetwork:e=>({type:`vpc-network`,...e}),webSearch:e=>({type:`web-search`,...e}),worker:e=>({type:`worker`,...e}),workerLoader:()=>({type:`worker-loader`})},t={fetch:e=>({type:`fetch`,...e}),queue:e=>({type:`queue`,...e}),scheduled:e=>({type:`scheduled`,...e}),email:e=>({type:`email`,...e}),connect:e=>({type:`connect`,...e})};function n(e){return{type:`durable-object`,...e}}function r(e={}){return{type:`worker`,...e}}const i={durableObject:n,worker:r};function a(e,t){function n(e){return{...e,type:t}}return typeof e==`function`?t=>{let r=e(t);return r instanceof Promise?r.then(n):n(r)}:e instanceof Promise?e.then(n):n(e)}function o(e){function t(t){return a(t,e)}return t}const s=o(`container`),c=o(`worker`),l=o(`settings`);export{i as a,c as i,s as n,t as o,l as r,e as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{n as d}from"./prompt-B0sWIs9c.mjs";function f(e){return e.option(`queries`,{type:`string`,description:`The queries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:f,handler:async u=>{if(u.dryRun){a({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:u.body===void 0?l({queries:c(u.queries,`queries`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queries.bulk.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({queries:c(u.queries,`queries`)});i(await o(`Creating`,async()=>d.queries.bulk.create({...p,account_id:f})),{successLabel:`Created`})}},m={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`max-time`,{type:`string`,description:`The max_time field`}).option(`min-time`,{type:`string`,description:`The min_time field`}).option(`scan`,{type:`boolean`,description:`The scan field`}).option(`tag`,{type:`string`,description:`The tag field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Return a success message after creating new saved string queries`,builder:h,handler:async c=>{let d={id:c.id};if(c.dryRun){a({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:d,bodyKind:`json`,body:c.body===void 0?l({max_time:u(c[`max-time`],`max-time`,`text`),min_time:u(c[`min-time`],`min-time`,`text`),scan:c.scan,tag:u(c.tag,`tag`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...e,account_id:p,...d})),{successLabel:`Created`});return}let m=l({max_time:u(c[`max-time`],`max-time`,`text`),min_time:u(c[`min-time`],`min-time`,`text`),scan:c.scan,tag:u(c.tag,`tag`,`text`)});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...m,account_id:p,...d})),{successLabel:`Created`})}};function _(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Return a success message after deleting saved string queries by ID`,builder:_,handler:async s=>{let c={id:s.id,tag:s.tag,scan:s.scan};if(s.dryRun){a({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>l.queries.delete({account_id:u,...c})),{successLabel:`Deleted`})}},y={command:`queries`,describe:`queries`,builder:e=>e.command(g).command(v).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{r}from"./auth-D3X9HYhD.mjs";import{t as i}from"./output-Ccqw2WOb.mjs";import{t as a}from"./dry-run-DL2V6yFm.mjs";import{t as o}from"./progress-BqQcF5QH.mjs";import{n as s,r as c,t as l}from"./body-parser-BshbixEq.mjs";import{n as u}from"./input-validation-QDIYu7Vb.mjs";import{a as d,i as f,n as p}from"./prompt-B0sWIs9c.mjs";import{t as m}from"./cli-types-DAYeL_Mj.mjs";function h(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const ee={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:h,handler:async c=>{if(c.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({dead_letter_queue:u(c[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(c[`script-name`],`script-name`,`text`),settings:{batch_size:c[`settings-batch-size`],max_concurrency:c[`settings-max-concurrency`],max_retries:c[`settings-max-retries`],max_wait_time_ms:c[`settings-max-wait-time-ms`],retry_delay:c[`settings-retry-delay`],visibility_timeout_ms:c[`settings-visibility-timeout-ms`]},type:u(c.type,`type`,`text`)}):s(c.body)});return}let p=await r(c),m=c.local?e:await t();if(c.accountId=m,c.body){let e=s(c.body);i(await o(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}c.type===void 0&&(c.type=await f(`type`,`The type field`,[`worker`,`http_pull`])),c.type===`worker`&&c[`script-name`]===void 0&&(c[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(c[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(c[`script-name`],`script-name`,`text`),settings:{batch_size:c[`settings-batch-size`],max_concurrency:c[`settings-max-concurrency`],max_retries:c[`settings-max-retries`],max_wait_time_ms:c[`settings-max-wait-time-ms`],retry_delay:c[`settings-retry-delay`],visibility_timeout_ms:c[`settings-visibility-timeout-ms`]},type:u(c.type,`type`,`text`)});i(await o(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:c[`queue-id`]})),{successLabel:`Created`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}/consumers/${s[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(s[`consumer-id`]))}`,pathParams:{"consumer-id":String(s[`consumer-id`]??``),"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
3
+ `);return}i(await o(`Deleting`,async()=>c.queues.consumers.delete({account_id:l,queue_id:s[`queue-id`],consumer_id:s[`consumer-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}/consumers/${s[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(s[`consumer-id`]))}`,pathParams:{"consumer-id":String(s[`consumer-id`]??``),"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.get({account_id:l,queue_id:s[`queue-id`],consumer_id:s[`consumer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Returns the consumers for a Queue`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.consumers.list({account_id:l,queue_id:s[`queue-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const C={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:S,handler:async c=>{if(c.dryRun){a({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/consumers/${c[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(c[`consumer-id`]))}`,pathParams:{"consumer-id":String(c[`consumer-id`]??``),"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({dead_letter_queue:u(c[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(c[`script-name`],`script-name`,`text`),settings:{batch_size:c[`settings-batch-size`],max_concurrency:c[`settings-max-concurrency`],max_retries:c[`settings-max-retries`],max_wait_time_ms:c[`settings-max-wait-time-ms`],retry_delay:c[`settings-retry-delay`],visibility_timeout_ms:c[`settings-visibility-timeout-ms`]},type:u(c.type,`type`,`text`)}):s(c.body)});return}let p=await r(c),m=c.local?e:await t();if(c.accountId=m,c.body){let e=s(c.body);i(await o(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:c[`queue-id`],consumer_id:c[`consumer-id`]})),{successLabel:`Updated`});return}c.type===void 0&&(c.type=await f(`type`,`The type field`,[`worker`,`http_pull`])),c.type===`worker`&&c[`script-name`]===void 0&&(c[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(c[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(c[`script-name`],`script-name`,`text`),settings:{batch_size:c[`settings-batch-size`],max_concurrency:c[`settings-max-concurrency`],max_retries:c[`settings-max-retries`],max_wait_time_ms:c[`settings-max-wait-time-ms`],retry_delay:c[`settings-retry-delay`],visibility_timeout_ms:c[`settings-visibility-timeout-ms`]},type:u(c.type,`type`,`text`)});i(await o(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:c[`queue-id`],consumer_id:c[`consumer-id`]})),{successLabel:`Updated`})}},w={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a new queue`,builder:T,handler:async c=>{if(c.dryRun){a({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({queue_name:u(c[`queue-name`],`queue-name`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.queues.create({...e,account_id:p})),{successLabel:`Created`});return}c[`queue-name`]===void 0&&(c[`queue-name`]=await d(`queue-name`,`The queue_name field`));let m=l({queue_name:u(c[`queue-name`],`queue-name`,`text`)});i(await o(`Creating`,async()=>f.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}`,pathParams:{"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
4
+ `);return}i(await o(`Deleting`,async()=>c.queues.delete({account_id:l,queue_id:s[`queue-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:k,handler:async c=>{if(c.dryRun){a({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({queue_name:u(c[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:c[`settings-delivery-delay`],delivery_paused:c[`settings-delivery-paused`],message_retention_period:c[`settings-message-retention-period`]}}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.queues.edit({body:e,account_id:f,queue_id:c[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(c[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:c[`settings-delivery-delay`],delivery_paused:c[`settings-delivery-paused`],message_retention_period:c[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>d.queues.edit({body:p,account_id:f,queue_id:c[`queue-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:j,handler:async s=>{if(s.dryRun){a({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}`,pathParams:{"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.get({account_id:l,queue_id:s[`queue-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the queues owned by an account.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`acks`,{type:`string`,description:`The acks field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`retries`,{type:`string`,description:`The retries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:F,handler:async u=>{if(u.dryRun){a({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({acks:c(u.acks,`acks`),retries:c(u.retries,`retries`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queues.messages.ackPreview({...e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`});return}let p=l({acks:c(u.acks,`acks`),retries:c(u.retries,`retries`)});i(await o(`Creating`,async()=>d.queues.messages.ackPreview({...p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`})}};function L(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`acks`,{type:`string`,description:`The acks field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`retries`,{type:`string`,description:`The retries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:L,handler:async u=>{if(u.dryRun){a({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({acks:c(u.acks,`acks`),retries:c(u.retries,`retries`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queues.messages.ack({...e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`});return}let p=l({acks:c(u.acks,`acks`),retries:c(u.retries,`retries`)});i(await o(`Creating`,async()=>d.queues.messages.ack({...p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:z,handler:async u=>{if(u.dryRun){a({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({delay_seconds:u[`delay-seconds`],messages:c(u.messages,`messages`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queues.messages.bulkPush({...e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`});return}let p=l({delay_seconds:u[`delay-seconds`],messages:c(u.messages,`messages`)});i(await o(`Creating`,async()=>d.queues.messages.bulkPush({...p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`extend`,{type:`string`,description:`The extend field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`extendLeases <queue-id>`,describe:"Extend the lease on a message. This creates a new lease ID on your message without incrementing the message's `attempts` counter.",builder:V,handler:async u=>{if(u.dryRun){a({command:`cf queues messages extendLeases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({extend:c(u.extend,`extend`),visibility_timeout_ms:u[`visibility-timeout-ms`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queues.messages.extendLeases({...e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`});return}let p=l({extend:c(u.extend,`extend`),visibility_timeout_ms:u[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>d.queues.messages.extendLeases({...p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`peek <queue-id>`,describe:`Peek messages from a Queue without leasing them. Messages remain available for subsequent peek or pull operations.`,builder:U,handler:async c=>{if(c.dryRun){a({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({batch_size:c[`batch-size`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Creating`,async()=>u.queues.messages.peek({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:c[`batch-size`]});i(await o(`Creating`,async()=>u.queues.messages.peek({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}};function W(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:W,handler:async c=>{if(c.dryRun){a({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({batch_size:c[`batch-size`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Loading`,async()=>u.queues.messages.preview({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Loaded`});return}let f=l({batch_size:c[`batch-size`]});i(await o(`Loading`,async()=>u.queues.messages.preview({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Loaded`})}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:K,handler:async c=>{if(c.dryRun){a({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({batch_size:c[`batch-size`],visibility_timeout_ms:c[`visibility-timeout-ms`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Creating`,async()=>u.queues.messages.pull({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:c[`batch-size`],visibility_timeout_ms:c[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>u.queues.messages.pull({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`refs`,{type:`string`,description:`The refs field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`purge <queue-id>`,describe:`Delete peeked messages from a Queue by their ref. Purged messages aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:J,handler:async u=>{if(u.dryRun){a({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?l({refs:c(u.refs,`refs`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.queues.messages.purge({...e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`});return}if(u.refs===void 0)throw Error(`--refs is required (or pass --body with this field set).`);let p=l({refs:c(u.refs,`refs`)});i(await o(`Creating`,async()=>d.queues.messages.purge({...p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Created`})}};function X(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:X,handler:async c=>{if(c.dryRun){a({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({delay_seconds:c[`delay-seconds`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Creating`,async()=>u.queues.messages.push({body:e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:c[`delay-seconds`]});i(await o(`Creating`,async()=>u.queues.messages.push({body:f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}},Q={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(R).command(I).command(B).command(H).command(te).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <queue-id>`,describe:`Return best-effort metrics for a queue. Values may be approximate due to the distributed nature of queues.`,builder:ne,handler:async s=>{if(s.dryRun){a({command:`cf queues metrics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}/metrics`,pathParams:{"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.metrics.get({account_id:l,queue_id:s[`queue-id`]})),{successLabel:`Loaded`})}},ie={command:`metrics`,describe:`Operations for metrics`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:ae,handler:async c=>{if(c.dryRun){a({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/purge`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({delete_messages_permanently:c[`delete-messages-permanently`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,!await p({force:!!c.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
5
+ `);return}if(c.body){let e=s(c.body);i(await o(`Deleting`,async()=>u.queues.purge.start({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Deleted`});return}let f=l({delete_messages_permanently:c[`delete-messages-permanently`]});i(await o(`Deleting`,async()=>u.queues.purge.start({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Deleted`})}};function se(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:se,handler:async s=>{if(s.dryRun){a({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${s[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(s[`queue-id`]))}/purge`,pathParams:{"queue-id":String(s[`queue-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.purge.status({account_id:l,queue_id:s[`queue-id`]})),{successLabel:`Loaded`})}},le={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workers.script`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-script-tag`,{type:`string`,description:`Tag of the Worker script`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-model-name`,[`source-worker-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-script-tag`,[`source-model-name`,`source-worker-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`,`source-script-tag`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const de={command:`create`,describe:`Create a new event subscription for a queue`,builder:ue,handler:async c=>{if(c.dryRun){a({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({destination:{queue_id:u(c[`destination-queue-id`],`destination-queue-id`,`text`),type:u(c[`destination-type`],`destination-type`,`text`)},enabled:c.enabled,events:c.events,name:u(c.name,`name`,`text`),source:{type:u(c[`source-type`],`source-type`,`text`),model_name:u(c[`source-model-name`],`source-model-name`,`text`),worker_name:u(c[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(c[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(c[`source-workflow-name`],`source-workflow-name`,`text`)}}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Creating`,async()=>d.queues.subscriptions.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({destination:{queue_id:u(c[`destination-queue-id`],`destination-queue-id`,`text`),type:u(c[`destination-type`],`destination-type`,`text`)},enabled:c.enabled,events:c.events,name:u(c.name,`name`,`text`),source:{type:u(c[`source-type`],`source-type`,`text`),model_name:u(c[`source-model-name`],`source-model-name`,`text`),worker_name:u(c[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(c[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(c[`source-workflow-name`],`source-workflow-name`,`text`)}});i(await o(`Creating`,async()=>d.queues.subscriptions.create({...p,account_id:f})),{successLabel:`Created`})}};function fe(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const pe={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:fe,handler:async s=>{if(s.dryRun){a({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions/${s[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(s[`subscription-id`]))}`,pathParams:{"subscription-id":String(s[`subscription-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await p({force:!!s.force})){process.stderr.write(`Aborted.
6
+ `);return}i(await o(`Deleting`,async()=>c.queues.subscriptions.delete({account_id:l,subscription_id:s[`subscription-id`]})),{successLabel:`Deleted`})}};function $(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:$,handler:async s=>{if(s.dryRun){a({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions/${s[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(s[`subscription-id`]))}`,pathParams:{"subscription-id":String(s[`subscription-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.queues.subscriptions.get({account_id:l,subscription_id:s[`subscription-id`]})),{successLabel:`Loaded`})}};function he(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:m(he),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],order:s.order,direction:s.direction};if(s.dryRun){a({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.queues.subscriptions.list({account_id:u,...c})),{successLabel:`Loaded`})}};function _e(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const ve={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:_e,handler:async c=>{if(c.dryRun){a({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions/${c[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(c[`subscription-id`]))}`,pathParams:{"subscription-id":String(c[`subscription-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({destination:{queue_id:u(c[`destination-queue-id`],`destination-queue-id`,`text`),type:u(c[`destination-type`],`destination-type`,`text`)},enabled:c.enabled,events:c.events,name:u(c.name,`name`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.queues.subscriptions.update({...e,account_id:f,subscription_id:c[`subscription-id`]})),{successLabel:`Updated`});return}let p=l({destination:{queue_id:u(c[`destination-queue-id`],`destination-queue-id`,`text`),type:u(c[`destination-type`],`destination-type`,`text`)},enabled:c.enabled,events:c.events,name:u(c.name,`name`,`text`)});i(await o(`Updating`,async()=>d.queues.subscriptions.update({...p,account_id:f,subscription_id:c[`subscription-id`]})),{successLabel:`Updated`})}},ye={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(de).command(pe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:be,handler:async c=>{if(c.dryRun){a({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({queue_name:u(c[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:c[`settings-delivery-delay`],delivery_paused:c[`settings-delivery-paused`],message_retention_period:c[`settings-message-retention-period`]}}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.queues.update({body:e,account_id:f,queue_id:c[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(c[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:c[`settings-delivery-delay`],delivery_paused:c[`settings-delivery-paused`],message_retention_period:c[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>d.queues.update({body:p,account_id:f,queue_id:c[`queue-id`]})),{successLabel:`Updated`})}},Se={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(xe).command(w).command(Q).command(ie).command(le).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Se as default};
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import{t as e}from"./local-Be3lg_9E.mjs";import{f as t,g as n}from"./oauth-DuEONNgC.mjs";import{a as r,r as i}from"./auth-D3X9HYhD.mjs";import{t as a}from"./output-Ccqw2WOb.mjs";import{t as o}from"./dry-run-DL2V6yFm.mjs";import{t as s}from"./progress-BqQcF5QH.mjs";import{i as c,n as l,r as u,t as d}from"./body-parser-BshbixEq.mjs";import{n as f,t as p}from"./input-validation-QDIYu7Vb.mjs";import{a as m,i as h,n as g}from"./prompt-B0sWIs9c.mjs";import{n as _,t as ee}from"./raw-fetch-Cc-MjHeL.mjs";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(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:te,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
3
+ `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function y(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 b={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:y,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function x(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:x,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/cors`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},C={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(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 T={command:`create`,describe:`Creates a new R2 bucket.`,builder:w,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:u.body===void 0?d({locationHint:f(u[`location-hint`],`location-hint`,`text`),name:f(u.name,`name`,`text`),storageClass:f(u[`storage-class`],`storage-class`,`text`)}):l(u.body)});return}let h=await i(u),g=u.local?e:await t();if(u.accountId=g,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await m(`name`,`Name of the bucket.`));let _={};u[`location-hint`]!==void 0&&c(_,[`locationHint`],f(u[`location-hint`],`location-hint`,`text`)),u.name!==void 0&&c(_,[`name`],f(u.name,`name`,`text`)),u[`storage-class`]!==void 0&&c(_,[`storageClass`],f(u[`storage-class`],`storage-class`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function E(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`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 D={command:`createByName <bucket-name>`,describe:"Creates a new R2 bucket using the name from the URL path. Similar to `r2-create-bucket` (POST), but the bucket name comes from the path and the optional storage class is supplied via the `cf-r2-storage-class` header. There is no request body. Unlike the POST variant, this endpoint does not accept a location hint — the bucket is placed in the R2 region for the caller's edge colo. Use the POST variant if you need to set a `locationHint`.",builder:E,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){o({command:`cf r2 buckets createByName`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function O(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 k={command:`delete <bucket-name>`,describe:`Deletes 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){o({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
4
+ `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function A(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 j={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:A,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({ciphers:u.ciphers,domain:f(u.domain,`domain`,`text`),enabled:u.enabled,minTLS:f(u[`min-tls`],`min-tls`,`text`),zoneId:f(u[`zone-id`],`zone-id`,`text`)}):l(u.body)});return}let h=await i(u),g=u.local?e:await t();if(u.accountId=g,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}if(u.domain===void 0&&(u.domain=await m(`domain`,`Name of the custom domain to be added.`)),u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);u[`zone-id`]===void 0&&(u[`zone-id`]=await m(`zone-id`,`Zone ID of the custom domain.`));let _={};u.ciphers!==void 0&&c(_,[`ciphers`],u.ciphers),u.domain!==void 0&&c(_,[`domain`],f(u.domain,`domain`,`text`)),u.enabled!==void 0&&c(_,[`enabled`],u.enabled),u[`min-tls`]!==void 0&&c(_,[`minTLS`],f(u[`min-tls`],`min-tls`,`text`)),u[`zone-id`]!==void 0&&c(_,[`zoneId`],f(u[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};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(`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 N={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:M,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${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 i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
5
+ `);return}a(await s(`Deleting`,async()=>r(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 P(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 F={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:P,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(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 I(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 L={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:I,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(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 R(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 z={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:R,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${u.domain==null?`<domain>`:encodeURIComponent(String(u.domain))}`,pathParams:{"bucket-name":String(u[`bucket-name`]??``),domain:String(u.domain??``)},bodyKind:`json`,body:u.body===void 0?d({ciphers:u.ciphers,enabled:u.enabled,minTLS:f(u[`min-tls`],`min-tls`,`text`)}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(u.domain))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};u.ciphers!==void 0&&c(g,[`ciphers`],u.ciphers),u.enabled!==void 0&&c(g,[`enabled`],u.enabled),u[`min-tls`]!==void 0&&c(g,[`minTLS`],f(u[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(u.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},B={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(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 H={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:V,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(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 U(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 W={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:U,handler:async u=>{let f={};if(u[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({enabled:u.enabled}):l(u.body)});return}let p=await i(u),m=u.local?e:await t();if(u.accountId=m,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}if(u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};u.enabled!==void 0&&c(h,[`enabled`],u.enabled),a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},G={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(B).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`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 J={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:q,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){o({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function Y(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`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 X={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:Y,handler:async u=>{let f={};if(u[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}`,pathParams:{"queue-id":String(u[`queue-id`]??``),"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({ruleIds:u[`rule-ids`]}):l(u.body)});return}let p=await i(u),m=u.local?e:await t();if(u.accountId=m,!await g({force:!!u.force})){process.stderr.write(`Aborted.
6
+ `);return}if(u.body){let e=l(u.body);a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(u[`queue-id`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`});return}let h={};u[`rule-ids`]!==void 0&&c(h,[`ruleIds`],u[`rule-ids`]),a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(u[`queue-id`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`})}};function Z(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`The bucket jurisdiction.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <queue-id>`,describe:`Get a single event notification rule.`,builder:Z,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}`,pathParams:{"queue-id":String(c[`queue-id`]??``),"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(c[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ne(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 re={command:`list`,describe:`List all event notification rules for a bucket.`,builder:ne,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ie(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`Array of rules to drive notifications. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`update <queue-id>`,describe:`Create event notification rule.`,builder:ie,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${f[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(f[`queue-id`]))}`,pathParams:{"queue-id":String(f[`queue-id`]??``),"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(f[`queue-id`]))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}if(f.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(f[`queue-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},oe={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <bucket-name>`,describe:`Gets properties of an existing R2 bucket.`,builder:se,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<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 i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function le(e){return e.positional(`job-id`,{type:`string`,description:`Identifier returned when the background job was submitted.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <job-id>`,describe:"Gets the current status of a background job for an R2 bucket. Poll this endpoint with the job identifier returned when the operation was submitted until the status is `COMPLETED`, `FAILED`, or `CANCELLED`.",builder:le,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"job-id":String(c[`job-id`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs/${encodeURIComponent(String(c[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function de(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`job-type`,{type:`string`,description:`Restricts results to jobs of the specified type.`,choices:[`prefixDelete`]}).option(`status`,{type:`string`,description:"Restricts results to jobs with the specified status. `jobType` is required when this parameter is provided.",choices:[`ENQUEUED`,`RUNNING`,`COMPLETED`,`FAILED`,`CANCELLED`]}).option(`max-keys`,{type:`number`,description:`Maximum number of jobs to return.`}).option(`continuation-token`,{type:`string`,description:"Pagination token received as `nextContinuationToken` in the previous response."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Lists background jobs for an R2 bucket. Use this endpoint to poll jobs returned by asynchronous operations such as deleting objects by prefix or emptying a bucket.`,builder:de,handler:async c=>{let l={jobType:c[`job-type`],status:c.status,maxKeys:c[`max-keys`],continuationToken:c[`continuation-token`]},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}},pe={command:`jobs`,describe:`Inspect background jobs for an R2 bucket`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <bucket-name>`,describe:`Get object lifecycle rules for a bucket.`,builder:me,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ge(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`update <bucket-name>`,describe:`Set the object lifecycle rules for a bucket.`,builder:ge,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ve={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.option(`name-contains`,{type:`string`,description:`Bucket names to filter by. Only buckets with this phrase in their name will be returned.`}).option(`start-after`,{type:`string`,description:`Bucket name to start searching after. Buckets are ordered lexicographically.`}).option(`per-page`,{type:`number`,description:`Maximum number of buckets to return in a single call.`}).option(`order`,{type:`string`,description:`Field to order buckets by.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`Direction to order buckets.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor received during the last List Buckets call. R2 buckets are paginated using cursors instead of page numbers.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`list`,describe:`Lists all R2 buckets on your account.`,builder:ye,handler:async c=>{let l={name_contains:c[`name-contains`],start_after:c[`start-after`],per_page:c[`per-page`],order:c.order,direction:c.direction,cursor:c.cursor},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}};function xe(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get <bucket-name>`,describe:`Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:xe,handler:async r=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.localUploads.get({account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const we={command:`update <bucket-name>`,describe:`Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`,builder:Ce,handler:async r=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`json`,body:r.body===void 0?d({enabled:r.enabled}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...e,account_id:u,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let f=d({enabled:r.enabled});a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...f,account_id:u,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`})}},Te={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(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 De={command:`get <bucket-name>`,describe:`Get lock rules for a bucket.`,builder:Ee,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Oe(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ke={command:`update <bucket-name>`,describe:`Set lock rules for a bucket.`,builder:Oe,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lock`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lock`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Ae={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`,builder:je,handler:async r=>{if(r.dryRun){o({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.metrics.list({account_id:l})),{successLabel:`Loaded`})}},Ne={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`prefix`,{type:`string`,description:"When present, switches the operation to prefix-delete mode. A non-empty value must\nend in `/` and deletes keys beginning with that prefix. Preserve an empty value\n(`?prefix=`) to empty the entire bucket. Omitting this parameter instead selects\ndelete-by-list mode and requires a JSON request body."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-data-catalog-check`,{type:`string`,description:`Set this header to reject the operation when R2 Data Catalog is enabled for the bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:'Required for "delete by list" mode (when `prefix` query parameter is omitted). A JSON array of object keys to delete. Ignored when `prefix` is provided. '})}const Fe={command:`bulk-delete`,describe:"Deletes objects from an R2 bucket. Three modes are supported: 1. **Delete by list** (default): Provide a JSON array of object keys in the request body. All listed objects are deleted; per-key errors are reported in the response. 2. **Delete by prefix**: Provide a non-empty `prefix` query parameter and no request body to delete every object whose key begins with that prefix. 3. **Empty bucket**: Provide the `prefix` query parameter with an empty value (`?prefix=`) and no request body to delete all objects in the bucket. Prefix and empty-bucket requests return a job descriptor. Small jobs can finish synchronously and return `COMPLETED`; larger jobs continue in the background. Poll the returned `id` with the Get Bucket Job endpoint. Objects uploaded after a background job starts are not deleted by that job. Abort active multipart uploads before submitting the request; a synchronously completed job does not abort them. Avoid writing objects or starting multipart uploads while a bucket-emptying job is in progress. Each repeated or concurrent request creates a distinct job. The number of active jobs is limited per bucket; wait for an existing job to finish before retrying a request rejected with HTTP 429. A bucket cannot be emptied while event notifications are configured. Remove the event notification rules and retry requests rejected with HTTP 409 / error code 10034. To protect a bucket with R2 Data Catalog enabled, send the `cf-r2-data-catalog-check` header; a conflict is returned with HTTP 409 / error code 10081. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.",builder:Pe,handler:async c=>{let u={prefix:c.prefix},d={};if(c[`cf-r2-jurisdiction`]!==void 0&&(d[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-data-catalog-check`]!==void 0&&(d[`cf-r2-data-catalog-check`]=String(c[`cf-r2-data-catalog-check`])),c.dryRun){o({command:`cf r2 buckets objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:u,bodyKind:`json`,body:c.body===void 0?void 0:l(c.body)});return}let f=await i(c),p=c.local?e:await t();if(c.accountId=p,!await g({force:!!c.force})){process.stderr.write(`Aborted.
7
+ `);return}if(c.body){let e=l(c.body),t=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Deleting`,async()=>r(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects${t?`?`+t:``}`,{body:e,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Deleted`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Ie(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) of the object to delete. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Le={command:`delete <object-key>`,describe:`Deletes an object from an R2 bucket. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Ie,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects/${c[`object-key`]==null?`<object-key>`:encodeURIComponent(String(c[`object-key`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"object-key":String(c[`object-key`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
8
+ `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function Re(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) of the object to retrieve. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`if-none-match`,{type:`string`,description:`Returns the object only if its ETag does not match the given value.`}).option(`if-modified-since`,{type:`string`,description:"Returns the object only if it has been modified since the specified time.\nMust be formatted as an HTTP-date (RFC 7231), e.g. `Tue, 15 Jan 2024 10:30:00 GMT`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ze={command:`get <object-key>`,describe:`Retrieves an object from an R2 bucket. Returns the object body along with metadata headers. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Re,handler:async r=>{let a={};if(r[`cf-r2-jurisdiction`]!==void 0&&(a[`cf-r2-jurisdiction`]=String(r[`cf-r2-jurisdiction`])),r[`if-none-match`]!==void 0&&(a[`If-None-Match`]=String(r[`if-none-match`])),r[`if-modified-since`]!==void 0&&(a[`If-Modified-Since`]=String(r[`if-modified-since`])),r.dryRun){o({command:`cf r2 buckets objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/objects/${r[`object-key`]==null?`<object-key>`:encodeURIComponent(String(r[`object-key`]))}`,pathParams:{"bucket-name":String(r[`bucket-name`]??``),"object-key":String(r[`object-key`]??``)},bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=await s(`Loading`,async()=>ee(`/accounts/${c}/r2/buckets/${encodeURIComponent(String(r[`bucket-name`]))}/objects/${encodeURIComponent(String(r[`object-key`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?l.toString(`utf-8`):l)}};function Be(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Maximum number of objects to return per page.`}).option(`prefix`,{type:`string`,description:`Restricts results to only those objects whose keys begin with the specified prefix.`}).option(`delimiter`,{type:`string`,description:`A single character used to group keys. All keys that contain the delimiter between the prefix and the first occurrence of the delimiter after the prefix are grouped under a single result element.`}).option(`cursor`,{type:`string`,description:`Pagination cursor received from a previous List Objects call. Used to retrieve the next page of results.`}).option(`start-after`,{type:`string`,description:`Returns objects with keys that come after the specified key in lexicographic order.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`list`,describe:`Lists objects in an R2 bucket. Returns object metadata including key, size, etag, last modified date, HTTP metadata, and custom metadata. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:Be,handler:async c=>{let l={per_page:c[`per-page`],prefix:c.prefix,delimiter:c.delimiter,cursor:c.cursor,start_after:c[`start-after`]},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}};function He(e){return e.positional(`object-key`,{type:`string`,description:"The key (name) to assign to the object. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`content-type`,{type:`string`,description:`The MIME type of the object being uploaded.`}).option(`content-length`,{type:`string`,description:`The size of the object body in bytes.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for this object. Overrides the bucket default.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The object body to upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Ue={command:`upload <object-key>`,describe:`Uploads an object to an R2 bucket. The object body is provided as the request body. Returns metadata about the uploaded object. The maximum upload size for this endpoint is 300 MB. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`,builder:He,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`content-type`]!==void 0&&(l[`Content-Type`]=String(c[`content-type`])),c[`content-length`]!==void 0&&(l[`Content-Length`]=String(c[`content-length`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){o({command:`cf r2 buckets objects upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects/${c[`object-key`]==null?`<object-key>`:encodeURIComponent(String(c[`object-key`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"object-key":String(c[`object-key`]??``)},bodyKind:`octet-stream`,body:c.body});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,c.file){let e=p(c.file);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}})),{successLabel:`Updated`});return}if(c.body){let e=f(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...l}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},We={command:`objects`,describe:`Operations for buckets.objects`,builder:e=>e.command(Fe).command(Le).command(ze).command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ke={command:`delete <bucket-name>`,describe:`Disables Sippy on this bucket.`,builder:Ge,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
9
+ `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function qe(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <bucket-name>`,describe:`Gets configuration for Sippy for an existing R2 bucket.`,builder:qe,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Ye(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`destination-access-key-id`,{type:`string`,description:`ID of a Cloudflare API token.
10
+ This is the value labelled "Access Key ID" when creating an API.
11
+ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
12
+
13
+ Sippy will use this token when writing objects to R2, so it is
14
+ best to scope this token to the bucket you're enabling Sippy for.
15
+ `}).option(`destination-provider`,{type:`string`,description:`The destination.provider field`,choices:[`r2`]}).option(`destination-secret-access-key`,{type:`string`,description:`Value of a Cloudflare API token.
16
+ This is the value labelled "Secret Access Key" when creating an API.
17
+ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
18
+
19
+ Sippy will use this token when writing objects to R2, so it is
20
+ best to scope this token to the bucket you're enabling Sippy for.
21
+ `}).option(`source-access-key-id`,{type:`string`,description:`Access Key ID of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-bucket`,{type:`string`,description:`Name of the AWS S3 bucket.`}).option(`source-provider`,{type:`string`,description:`The source.provider field`,choices:[`aws`,`gcs`,`s3`,`azure`]}).option(`source-region`,{type:`string`,description:`Name of the AWS availability zone.`}).option(`source-secret-access-key`,{type:`string`,description:`Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-client-email`,{type:`string`,description:`Client email of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-private-key`,{type:`string`,description:`Private Key of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-bucket-url`,{type:`string`,description:`URL to the S3-compatible API of the bucket.`}).option(`source-account-key`,{type:`string`,description:`Access key for the Azure Storage account. Mutually exclusive with sasToken.`}).option(`source-account-name`,{type:`string`,description:`Name of the Azure Storage account.`}).option(`source-container`,{type:`string`,description:`Name of the Azure Blob Storage container.`}).option(`source-sas-token`,{type:`string`,description:`Shared Access Signature token for the Azure Storage account. Mutually exclusive with accountKey.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-bucket`,[`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-region`,[`source-client-email`,`source-private-key`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-client-email`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-private-key`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-bucket-url`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-account-key`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-account-name`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-container`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-sas-token`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`])}const Xe={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Ye,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({destination:{accessKeyId:f(u[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:f(u[`destination-provider`],`destination-provider`,`text`),secretAccessKey:f(u[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:f(u[`source-access-key-id`],`source-access-key-id`,`text`),bucket:f(u[`source-bucket`],`source-bucket`,`text`),provider:f(u[`source-provider`],`source-provider`,`text`),region:f(u[`source-region`],`source-region`,`text`),secretAccessKey:f(u[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:f(u[`source-client-email`],`source-client-email`,`text`),privateKey:f(u[`source-private-key`],`source-private-key`,`text`),bucketUrl:f(u[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:f(u[`source-account-key`],`source-account-key`,`text`),accountName:f(u[`source-account-name`],`source-account-name`,`text`),container:f(u[`source-container`],`source-container`,`text`),sasToken:f(u[`source-sas-token`],`source-sas-token`,`text`)}}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};u[`destination-access-key-id`]!==void 0&&c(g,[`destination`,`accessKeyId`],f(u[`destination-access-key-id`],`destination-access-key-id`,`text`)),u[`destination-provider`]!==void 0&&c(g,[`destination`,`provider`],f(u[`destination-provider`],`destination-provider`,`text`)),u[`destination-secret-access-key`]!==void 0&&c(g,[`destination`,`secretAccessKey`],f(u[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),u[`source-access-key-id`]!==void 0&&c(g,[`source`,`accessKeyId`],f(u[`source-access-key-id`],`source-access-key-id`,`text`)),u[`source-bucket`]!==void 0&&c(g,[`source`,`bucket`],f(u[`source-bucket`],`source-bucket`,`text`)),u[`source-provider`]!==void 0&&c(g,[`source`,`provider`],f(u[`source-provider`],`source-provider`,`text`)),u[`source-region`]!==void 0&&c(g,[`source`,`region`],f(u[`source-region`],`source-region`,`text`)),u[`source-secret-access-key`]!==void 0&&c(g,[`source`,`secretAccessKey`],f(u[`source-secret-access-key`],`source-secret-access-key`,`text`)),u[`source-client-email`]!==void 0&&c(g,[`source`,`clientEmail`],f(u[`source-client-email`],`source-client-email`,`text`)),u[`source-private-key`]!==void 0&&c(g,[`source`,`privateKey`],f(u[`source-private-key`],`source-private-key`,`text`)),u[`source-bucket-url`]!==void 0&&c(g,[`source`,`bucketUrl`],f(u[`source-bucket-url`],`source-bucket-url`,`text`)),u[`source-account-key`]!==void 0&&c(g,[`source`,`accountKey`],f(u[`source-account-key`],`source-account-key`,`text`)),u[`source-account-name`]!==void 0&&c(g,[`source`,`accountName`],f(u[`source-account-name`],`source-account-name`,`text`)),u[`source-container`]!==void 0&&c(g,[`source`,`container`],f(u[`source-container`],`source-container`,`text`)),u[`source-sas-token`]!==void 0&&c(g,[`source`,`sasToken`],f(u[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Ze={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ke).command(Je).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qe={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(T).command(D).command(k).command(J).command(ce).command(be).command(C).command(K).command(oe).command(pe).command(ve).command(Te).command(Ae).command(Ne).command(We).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $e(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`keys`,{type:`string`,array:!0,description:`The keys field`}).option(`path-prefix`,{type:`string`,description:`The pathPrefix field`}).option(`region`,{type:`string`,description:`The region field`}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`secret-client-email`,{type:`string`,description:`The secret.clientEmail field`}).option(`secret-private-key`,{type:`string`,description:`The secret.privateKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`endpoint`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`region`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`secret-access-key-id`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-secret-access-key`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-client-email`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`secret-private-key`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`jurisdiction`,[`endpoint`,`region`,`secret-client-email`,`secret-private-key`])}const et={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:$e,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({bucket:f(r.bucket,`bucket`,`text`),endpoint:f(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),region:f(r.region,`region`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:f(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:f(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:u})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let p=d({bucket:f(r.bucket,`bucket`,`text`),endpoint:f(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),region:f(r.region,`region`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:f(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:f(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:p,account_id:u})),{successLabel:`Updated`})}};function tt(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const nt={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:tt,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({bucket:f(r.bucket,`bucket`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:u})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await m(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await m(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The vendor field`,[`r2`]));let p=d({bucket:f(r.bucket,`bucket`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:p,account_id:u})),{successLabel:`Updated`})}},rt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(et).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function it(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const at={command:`abort-all`,describe:`Cancels all running R2 Super Slurper migration jobs for the account. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:it,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
22
+ `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})}};function ot(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const st={command:`abort <job-id>`,describe:`Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`,builder:ot,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/abort`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
23
+ `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function ct(e){return e.option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0)){let t=[`source-bucket`,`source-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0}).check(e=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --target-* flag is set`)}return!0})}const lt={command:`create`,describe:`Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`,builder:ct,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({overwrite:r.overwrite,source:{bucket:f(r[`source-bucket`],`source-bucket`,`text`),endpoint:f(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:f(r[`source-path-prefix`],`source-path-prefix`,`text`),region:f(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:f(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:f(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:f(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:f(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:f(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:f(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:f(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:f(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:f(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:f(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:f(r[`target-vendor`],`target-vendor`,`text`)}}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...e,account_id:u})),{successLabel:`Created`});return}let p=d({overwrite:r.overwrite,source:{bucket:f(r[`source-bucket`],`source-bucket`,`text`),endpoint:f(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:f(r[`source-path-prefix`],`source-path-prefix`,`text`),region:f(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:f(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:f(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:f(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:f(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:f(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:f(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:f(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:f(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:f(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:f(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:f(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...p,account_id:u})),{successLabel:`Created`})}};function ut(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const dt={command:`delete <job-id>`,describe:`Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`,builder:ut,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
24
+ `);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.delete({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function ft(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:ft,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.get({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})}};function mt(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:mt,handler:async r=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.list({account_id:u,...c})),{successLabel:`Loaded`})}};function gt(e){return e.option(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _t={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:gt,handler:async r=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/logs`,pathParams:{"job-id":String(r[`job-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.logs.list({account_id:u,job_id:r[`job-id`],...c})),{successLabel:`Loaded`})}},vt={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yt(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:yt,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/pause`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.pause({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})}};function bt(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:bt,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/progress`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.progress({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})}};function St(e){return e.positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ct={command:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:St,handler:async r=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/resume`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.resume({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})}},wt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(st).command(at).command(lt).command(dt).command(pt).command(ht).command($).command(xt).command(Ct).command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tt={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(rt).command(wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Et(e){return e.option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`The parent access key id to use for signing.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`How long the credentials will live for in seconds.`,default:900}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Dt={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:Et,handler:async r=>{if(r.dryRun){o({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({bucket:f(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:f(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:f(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...e,account_id:u})),{successLabel:`Created`});return}if(r.bucket===void 0&&(r.bucket=await m(`bucket`,`Name of the R2 bucket.`)),r[`parent-access-key-id`]===void 0&&(r[`parent-access-key-id`]=await m(`parent-access-key-id`,`The parent access key id to use for signing.`)),r.permission===void 0&&(r.permission=await h(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),r[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let p=d({bucket:f(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:f(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:f(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]});a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...p,account_id:u})),{successLabel:`Created`})}},Ot={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(Qe).command(Tt).command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{kt as default};