cf 0.13.0 → 0.14.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 (266) hide show
  1. package/dist/_meta/agent-context.json +189 -187
  2. package/dist/_meta/commands.json +2591 -2248
  3. package/dist/_meta/hand-written-commands.json +146 -1
  4. package/dist/_meta/schemas.json +1548 -1313
  5. package/dist/{abuse-reports-BbaHw4ST.mjs → abuse-reports-CDFjJ2e8.mjs} +1 -1
  6. package/dist/{access-D6Xz892p.mjs → access-BoT1waG4.mjs} +1 -1
  7. package/dist/{account-DvxcqeaK.mjs → account-agnMUKWj.mjs} +1 -1
  8. package/dist/{account-tags-CeqfEWpz.mjs → account-tags-BRMMHCee.mjs} +1 -1
  9. package/dist/{accounts-Bx-8BMH9.mjs → accounts-Cut77dAt.mjs} +2 -2
  10. package/dist/{acm--0opdSGE.mjs → acm-C8WgXNCl.mjs} +1 -1
  11. package/dist/{addressing-BS1ynzLA.mjs → addressing-CR8EV42x.mjs} +1 -1
  12. package/dist/{agent-context-BPhyrSns.mjs → agent-context-Wj5TRRbW.mjs} +1 -1
  13. package/dist/{agent-memory-DczzpEw5.mjs → agent-memory-CVJpKKZy.mjs} +1 -1
  14. package/dist/{ai-CDdCTcQl.mjs → ai-BbNYt-yI.mjs} +1 -1
  15. package/dist/{ai-audit-Bx9KMQYh.mjs → ai-audit-mVajM-2i.mjs} +1 -1
  16. package/dist/{ai-gateway-BSXJEaYS.mjs → ai-gateway-BsepSA_v.mjs} +2 -2
  17. package/dist/{ai-search-DRQj1aMu.mjs → ai-search-DbEJqm5-.mjs} +1 -1
  18. package/dist/{ai-security-C_Rb0lGT.mjs → ai-security-DmyB5EYk.mjs} +1 -1
  19. package/dist/{alerting-BAR9eFs2.mjs → alerting-dmy3hd8O.mjs} +3 -3
  20. package/dist/analytics-B1xBMla0.mjs +5 -0
  21. package/dist/{analytics_engine-DkEzlhfT.mjs → analytics_engine-DazCn3iC.mjs} +1 -1
  22. package/dist/{api-security-jA0lOk6a.mjs → api-security-0HXCzfHk.mjs} +1 -1
  23. package/dist/{argo-Cz4pDagx.mjs → argo-DSHsE8zv.mjs} +1 -1
  24. package/dist/{artifacts-BcLTGfAv.mjs → artifacts-CwiU9Mxu.mjs} +1 -1
  25. package/dist/{audit-logs-DbIv4n6u.mjs → audit-logs-DwFtMDwH.mjs} +1 -1
  26. package/dist/{auth-rW5d3jtr.mjs → auth-B0ZyXc3y.mjs} +1 -1
  27. package/dist/{auth-tvDdC1J-.mjs → auth-DWxtJ918.mjs} +2 -2
  28. package/dist/{billing-Md87QjqW.mjs → billing-Cbpadkgu.mjs} +1 -1
  29. package/dist/{bot-management-VHMo4hpU.mjs → bot-management-B6M2Vyyn.mjs} +1 -1
  30. package/dist/{botnet-feed-BHqfo3sa.mjs → botnet-feed-Dn8UuE4h.mjs} +1 -1
  31. package/dist/{brand-protection-HUeR6Pof.mjs → brand-protection-B5R0b3pu.mjs} +1 -1
  32. package/dist/{browser-extension-199oZg3X.mjs → browser-extension-D55pYZf_.mjs} +1 -1
  33. package/dist/{browser-run-DDasyux-.mjs → browser-run-C1b2VkGB.mjs} +1 -1
  34. package/dist/build-CP2JUfV1.mjs +2 -0
  35. package/dist/{builds-B-lXn6JR.mjs → builds-CVEXO_4a.mjs} +8 -8
  36. package/dist/{cache-CevKpiTM.mjs → cache-BU5xX82E.mjs} +1 -1
  37. package/dist/{certificate-authorities-DAg-aO1B.mjs → certificate-authorities--tZTWJWD.mjs} +1 -1
  38. package/dist/cf-BV2HLCQm.mjs +18 -0
  39. package/dist/{chunk-QBZBEHZB-BuiXJn8j.mjs → chunk-QBZBEHZB-BcCMlc8C.mjs} +1 -1
  40. package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +103 -0
  41. package/dist/{client-certificates-Bay7oPLE.mjs → client-certificates-DX84qeYG.mjs} +1 -1
  42. package/dist/{client-side-security-CbU9xn0k.mjs → client-side-security-DsSO2rZQ.mjs} +1 -1
  43. package/dist/{cloud-connector-AH2ClcSL.mjs → cloud-connector-cf8qlxap.mjs} +1 -1
  44. package/dist/{cloudforce-one-DwOfS75V.mjs → cloudforce-one-DzVXorbu.mjs} +2 -2
  45. package/dist/command-BL6weJf3.mjs +3 -0
  46. package/dist/command-DYrspBc0.mjs +2 -0
  47. package/dist/{completions-nPO9PdSu.mjs → completions-Dn621okY.mjs} +1 -1
  48. package/dist/{config-B8lwPpVl.mjs → config-BY6KpMZs.mjs} +1 -1
  49. package/dist/config.d.mts +1 -1729
  50. package/dist/config.mjs +1 -1
  51. package/dist/{connector-interrupts-DcLrqM2V.mjs → connector-interrupts-DqpqPPkp.mjs} +1 -1
  52. package/dist/{connector-telemetry-events-PrJWgNs9.mjs → connector-telemetry-events-CCD-_B-8.mjs} +1 -1
  53. package/dist/{connector-telemetry-snapshots-CIjJm5yu.mjs → connector-telemetry-snapshots-D3CeGGhk.mjs} +1 -1
  54. package/dist/{connectors-CEAy30E-.mjs → connectors-aPQspZdg.mjs} +1 -1
  55. package/dist/{containers-BsbDqbSn.mjs → containers-D0Kjl8h-.mjs} +1 -1
  56. package/dist/{content-scan-BdK936iO.mjs → content-scan-BVx18XmS.mjs} +1 -1
  57. package/dist/{cps-oP97-qkm.mjs → cps-ByazyM0x.mjs} +1 -1
  58. package/dist/{csamScanner-DUNN4INg.mjs → csamScanner-OG5lQxBC.mjs} +1 -1
  59. package/dist/{ct-alerting-dV_gsV2w.mjs → ct-alerting-BJx5n8Zf.mjs} +1 -1
  60. package/dist/{custom-certificates-DYspvjo4.mjs → custom-certificates-BuJ2e9TA.mjs} +1 -1
  61. package/dist/{custom-csrs-DjSWLQRu.mjs → custom-csrs-CR_5qbST.mjs} +1 -1
  62. package/dist/{custom-hostnames-df1lH6IY.mjs → custom-hostnames-BzDTsQXb.mjs} +1 -1
  63. package/dist/{custom-nameservers-CLTbN-9R.mjs → custom-nameservers-OfMPRGkD.mjs} +1 -1
  64. package/dist/custom-pages-BmGXoTIo.mjs +3 -0
  65. package/dist/d1-DedC8N0N.mjs +21 -0
  66. package/dist/data-security-B2UB26ry.mjs +7 -0
  67. package/dist/{dcv-delegation-_r6Vc6VL.mjs → dcv-delegation-C11vmzbG.mjs} +1 -1
  68. package/dist/{deploy-QTGENpOM.mjs → deploy-BtETDvDA.mjs} +1 -1
  69. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-BoLTdQzS.mjs} +1 -1
  70. package/dist/{dev-CAubuxCc.mjs → dev-B5WcIpEr.mjs} +2 -2
  71. package/dist/{diagnostics-B0DRh714.mjs → diagnostics-Cf6BLpAo.mjs} +1 -1
  72. package/dist/dialog-Bud0hiYv.mjs +2 -0
  73. package/dist/{dist-DW5BPGFs.mjs → dist-BRg_z9Ut.mjs} +1 -1
  74. package/dist/{shared-YJtB5KZB.mjs → dist-CFQREIRi.mjs} +86 -86
  75. package/dist/dist-CyisSore.mjs +371 -0
  76. package/dist/dist-Dr4Hg_Up.mjs +48 -0
  77. package/dist/{dls-CFzTHcZM.mjs → dls-R6PvHbhj.mjs} +1 -1
  78. package/dist/{dns-Dw6u-NV1.mjs → dns-Cl8se64c.mjs} +1 -1
  79. package/dist/{dns-firewall-CIPptslp.mjs → dns-firewall-WtmKilDT.mjs} +1 -1
  80. package/dist/dry-run-YSQndLvt.mjs +2 -0
  81. package/dist/{durable-objects-CCkeqqBq.mjs → durable-objects-jfVU6yp_.mjs} +1 -1
  82. package/dist/{email-auth-kdxO51Oz.mjs → email-auth-DPmZ85eW.mjs} +1 -1
  83. package/dist/{email-routing-BLggZdQq.mjs → email-routing-Bf6DbNTr.mjs} +1 -1
  84. package/dist/{email-security-DjADlgdM.mjs → email-security-DTifjSxM.mjs} +1 -1
  85. package/dist/{email-sending-Cz7E7GoP.mjs → email-sending-Dm3WkFHV.mjs} +1 -1
  86. package/dist/{error-sanitization-DfLijlBJ.mjs → error-sanitization-D8zuyPj_.mjs} +1 -1
  87. package/dist/{fieldExtractors-BWaMi6lD.mjs → fieldExtractors-CeXZL0-I.mjs} +1 -1
  88. package/dist/{firewall-5t6OBIOl.mjs → firewall-D5N2APXO.mjs} +1 -1
  89. package/dist/{flagship-CzG_VoNR.mjs → flagship-sUOy9jei.mjs} +1 -1
  90. package/dist/{fraud-UOg_69Ob.mjs → fraud-WLW2Ep1Z.mjs} +1 -1
  91. package/dist/{google-tag-gateway-DirkD-Q2.mjs → google-tag-gateway-lbww1FaJ.mjs} +1 -1
  92. package/dist/{healthchecks-BkHZGTp1.mjs → healthchecks-0ih8Qjiw.mjs} +1 -1
  93. package/dist/{hostnames-EUYOZm21.mjs → hostnames-Ba6FuL8K.mjs} +1 -1
  94. package/dist/{hyperdrive-ZoLJlJCL.mjs → hyperdrive-DMqcU639.mjs} +1 -1
  95. package/dist/{iam-BQ2xSgYN.mjs → iam-CXlYm0uC.mjs} +1 -1
  96. package/dist/{images-CkEq6ScP.mjs → images-D_g1oli6.mjs} +1 -1
  97. package/dist/index.mjs +1 -1
  98. package/dist/{intel-DDWEdGyl.mjs → intel-B8bS0ARd.mjs} +1 -1
  99. package/dist/interactive-CGOh-aYq.mjs +32 -0
  100. package/dist/{ips-54Qmy-Uw.mjs → ips-68fzniN4.mjs} +1 -1
  101. package/dist/{keyless-certificates-CXHLc3Qz.mjs → keyless-certificates-CeLnqBvX.mjs} +1 -1
  102. package/dist/{keys-rvI4TC3Z.mjs → keys-DkVdS2lF.mjs} +1 -1
  103. package/dist/{kv-CAeN1zBy.mjs → kv-gDAN50BQ.mjs} +1 -1
  104. package/dist/{leaked-credential-checks-CbbwtG-p.mjs → leaked-credential-checks-DfnvHpvg.mjs} +1 -1
  105. package/dist/{lifecycle-XswDq0ZB.mjs → lifecycle-CadF_i2n.mjs} +1 -1
  106. package/dist/{load-balancers-BFwdwAIU.mjs → load-balancers-m0HqyXPZ.mjs} +1 -1
  107. package/dist/{local-C6XsFD_W.mjs → local-BwL_gesw.mjs} +1 -1
  108. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-Dj8k-p62.mjs} +1 -1
  109. package/dist/{logo-matches-Y3PxVn7t.mjs → logo-matches-DPbHlsKQ.mjs} +1 -1
  110. package/dist/{logos-BN8SvJhS.mjs → logos-DFBJFAYJ.mjs} +1 -1
  111. package/dist/{logpush-BnLA4WVm.mjs → logpush-gzmlZayc.mjs} +1 -1
  112. package/dist/logs-BuzwQgt5.mjs +18 -0
  113. package/dist/{magic-cloud-networking-wPuLwu-F.mjs → magic-cloud-networking-BbHCi1Vp.mjs} +1 -1
  114. package/dist/{magic-network-monitoring-BNERUpxS.mjs → magic-network-monitoring-kWMmnPTG.mjs} +1 -1
  115. package/dist/{magic-transit-6tvVOECW.mjs → magic-transit-ClSmJDKw.mjs} +1 -1
  116. package/dist/{managed-defense-AYwBOYIH.mjs → managed-defense-EOihg1UR.mjs} +1 -1
  117. package/dist/{managed-transforms-HZZNrkC7.mjs → managed-transforms-BZ_XdGE2.mjs} +1 -1
  118. package/dist/{matches-Dp91L3dL.mjs → matches-B6sG0_fr.mjs} +1 -1
  119. package/dist/{mcp-P7pcieiT.mjs → mcp--kK0vS5i.mjs} +1 -1
  120. package/dist/{mesh-DjFrk6PL.mjs → mesh-DfXYUHOO.mjs} +1 -1
  121. package/dist/{mtls-certificates-DZMoef2H.mjs → mtls-certificates-DZd-0X7l.mjs} +1 -1
  122. package/dist/{network-7cd1U6-I.mjs → network-U6f_5ihp.mjs} +1 -1
  123. package/dist/{network-interconnects-CQ7cPZjK.mjs → network-interconnects-DKZGTiYM.mjs} +1 -1
  124. package/dist/oauth-BdVr2hJp.mjs +14 -0
  125. package/dist/{oauth-clients-P9t-eMnx.mjs → oauth-clients-CY3OkPhC.mjs} +1 -1
  126. package/dist/{oauth-scopes-C3r9Qh_y.mjs → oauth-scopes-BTY7_5L-.mjs} +1 -1
  127. package/dist/{observability-M1DnLhMR.mjs → observability-Bsp-LdmJ.mjs} +1 -1
  128. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-ClEt4E8F.mjs} +3 -3
  129. package/dist/{organization-cUE7GDCt.mjs → organization-BSeMdj-7.mjs} +1 -1
  130. package/dist/{organizations-C-Hcpd0w.mjs → organizations-BroR48Nv.mjs} +1 -1
  131. package/dist/{origin-ca-certificates-C8cJMyQH.mjs → origin-ca-certificates-jC-EMn6W.mjs} +1 -1
  132. package/dist/{origin-post-quantum-encryption-DjZJCk8M.mjs → origin-post-quantum-encryption-DIspLvA0.mjs} +1 -1
  133. package/dist/{origin-tls-client-auth-BsjR5EAV.mjs → origin-tls-client-auth-CZ_nUEcM.mjs} +1 -1
  134. package/dist/{page-rules-B-zq1EUb.mjs → page-rules-ZcdjPohY.mjs} +1 -1
  135. package/dist/{pages-B6YpkPos.mjs → pages-W4tKa7xk.mjs} +1 -1
  136. package/dist/pay-per-crawl-BNM1mJmP.mjs +5 -0
  137. package/dist/pay-per-use-DKxlnkH3.mjs +2 -0
  138. package/dist/{pipelines-BJc_RylD.mjs → pipelines-Dug0BR-c.mjs} +1 -1
  139. package/dist/{precursor-CLQu7suY.mjs → precursor-D-11DkRU.mjs} +1 -1
  140. package/dist/previews-D_Nv4dR6.mjs +4 -0
  141. package/dist/{progress-V6SZV3Ux.mjs → progress-a5IKeKni.mjs} +1 -1
  142. package/dist/project-settings-Bc3wYHo8.mjs +3 -0
  143. package/dist/prompt-BP8XrQSj.mjs +3 -0
  144. package/dist/{queries-DSrrket-.mjs → queries-BdA2vJoe.mjs} +1 -1
  145. package/dist/{queues-Tf7kPBpn.mjs → queues-Bu06ZqUE.mjs} +1 -1
  146. package/dist/{r2-DmKNnxtC.mjs → r2-COC9wMKb.mjs} +1 -1
  147. package/dist/{r2-data-catalog-DBxoifOq.mjs → r2-data-catalog-CX5Rl5Qx.mjs} +1 -1
  148. package/dist/{radar-Csk7Ab-b.mjs → radar-L-yoLIHF.mjs} +1 -1
  149. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNH2V8qH.mjs} +1 -1
  150. package/dist/{realtime-CDehZVhV.mjs → realtime-JKIiXfzi.mjs} +1 -1
  151. package/dist/{registrar-vflzeNQ9.mjs → registrar-_dYUZrK0.mjs} +2 -2
  152. package/dist/{registrar-sandbox-BxVdfnam.mjs → registrar-sandbox-D1yfW_Q_.mjs} +2 -2
  153. package/dist/{registry-CWUfXloz.mjs → registry-BrtVdMrC.mjs} +1 -1
  154. package/dist/{reporting-BaPZ1PHN.mjs → reporting-3fyoMcmb.mjs} +1 -1
  155. package/dist/request-headers-BhQQAfJt.mjs +2 -0
  156. package/dist/{request-tracers-C_UVBexV.mjs → request-tracers-TisEth2p.mjs} +1 -1
  157. package/dist/{resolve-B8CyM1mi.mjs → resolve-CYUp6YgC.mjs} +1 -1
  158. package/dist/{resource-sharing-CoB4S9j1.mjs → resource-sharing-C4-dnohU.mjs} +1 -1
  159. package/dist/{resource-tagging-CUiUC5g4.mjs → resource-tagging-BRDifKqM.mjs} +1 -1
  160. package/dist/{rules-4O8076_s.mjs → rules-BCF3gIkw.mjs} +2 -2
  161. package/dist/{rulesets-C84MxTYo.mjs → rulesets-wp6rllt3.mjs} +1 -1
  162. package/dist/{rum-Bvwkrntx.mjs → rum-B77awgoB.mjs} +1 -1
  163. package/dist/run-BS8otL3u.mjs +2 -0
  164. package/dist/{schema-C8hU6G9R.mjs → schema-DmuJtMN5.mjs} +1 -1
  165. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CUGxFeZe.mjs} +4 -4
  166. package/dist/{scim-BvxQmde6.mjs → scim-C9BmUYil.mjs} +1 -1
  167. package/dist/{sdk-C12y5qCN.mjs → sdk-Bvqx-_3z.mjs} +1 -1
  168. package/dist/{secrets-store-DOKWiC-j.mjs → secrets-store-ckkZR2dM.mjs} +1 -1
  169. package/dist/{security-center-Bhy_aC-w.mjs → security-center-BCahKT57.mjs} +1 -1
  170. package/dist/{security-txt-L7HJ9tq5.mjs → security-txt-0SI5du7I.mjs} +1 -1
  171. package/dist/shared-D0B-7q-D.mjs +2 -0
  172. package/dist/{smart-shield-COMXuQ1S.mjs → smart-shield-BDPbrZa4.mjs} +1 -1
  173. package/dist/{snippets-DffQhlKt.mjs → snippets-CVRR_h0i.mjs} +1 -1
  174. package/dist/spawn-DP4T92ss.mjs +519 -0
  175. package/dist/{spectrum-Cmf7SqQE.mjs → spectrum-CjNXQIQE.mjs} +3 -3
  176. package/dist/{speed-m8cdhLFS.mjs → speed-CrXCHk3h.mjs} +1 -1
  177. package/dist/src-BbnV77C4.mjs +108 -0
  178. package/dist/{ssl-D4ffsdSw.mjs → ssl-DKORhHkh.mjs} +1 -1
  179. package/dist/{startup-profile-Dx95Y5cl.mjs → startup-profile-CBIH6yZy.mjs} +3 -3
  180. package/dist/{state-CHif8Y5I.mjs → state-QUu6HfxC.mjs} +1 -1
  181. package/dist/{stream-DPF5fojV.mjs → stream-wY3zi3FK.mjs} +1 -1
  182. package/dist/{submit-Br8hfP0_.mjs → submit-B-4oCBSk.mjs} +1 -1
  183. package/dist/{tags-Bnt4JuxQ.mjs → tags-5uJEkYJZ.mjs} +1 -1
  184. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-2s9Y3FaN.mjs} +1 -1
  185. package/dist/{telemetry-Ch1vCICm.mjs → telemetry-n3NJourL.mjs} +1 -1
  186. package/dist/{tenant-D8u0CxoC.mjs → tenant-BkFvv2o3.mjs} +1 -1
  187. package/dist/{tenant-custom-nameservers-BrWMyslZ.mjs → tenant-custom-nameservers-DcjC1q0r.mjs} +1 -1
  188. package/dist/{tools-D9RZkZRc.mjs → tools-Dz1JCrHd.mjs} +1 -1
  189. package/dist/tunnel-Cd4ipbvJ.mjs +2 -0
  190. package/dist/{tunnels-BkNPpTHa.mjs → tunnels-9Zg3ePwD.mjs} +1 -1
  191. package/dist/{turnstile-MgwRECJv.mjs → turnstile-BTwKYpzD.mjs} +1 -1
  192. package/dist/{url-info-Ddp7MgcI.mjs → url-info-D7Y61BFd.mjs} +1 -1
  193. package/dist/{url-normalization-3ptK9ntV.mjs → url-normalization-B4n8HiNQ.mjs} +1 -1
  194. package/dist/{url-scanner-Psb9ollR.mjs → url-scanner-CiCIltSQ.mjs} +1 -1
  195. package/dist/{user-DWdshcIu.mjs → user-DDFDGJ0Y.mjs} +1 -1
  196. package/dist/{values-CDKQL1z2.mjs → values-DRznB_Cl.mjs} +1 -1
  197. package/dist/{vectorize-CTYYUyQj.mjs → vectorize-CbznPhzq.mjs} +1 -1
  198. package/dist/waiting-rooms-CKP5hYBK.mjs +11 -0
  199. package/dist/{web-assets-CpDwDEx8.mjs → web-assets-C-ZoSkkh.mjs} +1 -1
  200. package/dist/{web3-YsjDyAzH.mjs → web3-DwlN4dOw.mjs} +1 -1
  201. package/dist/{workers-builds-BWo5vUA9.mjs → workers-builds-ECw_x_kp.mjs} +1 -1
  202. package/dist/{workers-for-platforms-ASJsxYdM.mjs → workers-for-platforms-BYGy46R6.mjs} +2 -2
  203. package/dist/{workers-vpc-RkTnRvA2.mjs → workers-vpc-CCosFcxz.mjs} +1 -1
  204. package/dist/workers-zFMrbUkg.mjs +6 -0
  205. package/dist/{workflows-KrIFI9ns.mjs → workflows-C8GXGDRW.mjs} +1 -1
  206. package/dist/{zaraz-DglXbVzZ.mjs → zaraz-B5UIREaz.mjs} +1 -1
  207. package/dist/{zero-trust-RilTdSjX.mjs → zero-trust-DUp0XoIo.mjs} +50 -50
  208. package/dist/{zone-DsBtVkvT.mjs → zone-BGLkk-mL.mjs} +1 -1
  209. package/dist/{zones-BFxvWFQW.mjs → zones-CwYjNXMH.mjs} +1 -1
  210. package/package.json +11 -11
  211. package/dist/analytics-BaUZwNc5.mjs +0 -4
  212. package/dist/build-0QlYUfFS.mjs +0 -2
  213. package/dist/cf-C11NGkjx.mjs +0 -18
  214. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  215. package/dist/command-CMzMsll4.mjs +0 -2
  216. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  217. package/dist/d1-JBEqjJoj.mjs +0 -20
  218. package/dist/data-security-CIktWnXt.mjs +0 -7
  219. package/dist/dist-12KzRsBM.mjs +0 -387
  220. package/dist/dist-BCVqQpg2.mjs +0 -2
  221. package/dist/dist-Cp3uJN1x.mjs +0 -48
  222. package/dist/dist-S9K_8gq9.mjs +0 -9
  223. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  224. package/dist/interactive-B2E03Fs-.mjs +0 -11
  225. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  226. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  227. package/dist/logs-CDo7Y5sA.mjs +0 -3
  228. package/dist/oauth-DH3kMXSs.mjs +0 -14
  229. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  230. package/dist/prompt-DjRTpML4.mjs +0 -3
  231. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  232. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  233. package/dist/run-CRfinkSe.mjs +0 -2
  234. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  235. package/dist/spawn-C1AISA2V.mjs +0 -526
  236. package/dist/src-C8phrg-8.mjs +0 -109
  237. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  238. package/dist/workers-BKKxaZcz.mjs +0 -6
  239. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CarPLL8k.mjs} +0 -0
  240. /package/dist/{autorag-iNjZXw1n.mjs → autorag-zK-3harf.mjs} +0 -0
  241. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-Cmw7PZ7a.mjs} +0 -0
  242. /package/dist/{brands-BrVnNrT3.mjs → brands-CpgTsX8h.mjs} +0 -0
  243. /package/dist/{clear-an9o3dJ3.mjs → clear-C5gzBA8G.mjs} +0 -0
  244. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-abvWQN3T.mjs} +0 -0
  245. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-BY-dbhQZ.mjs} +0 -0
  246. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-DoMvHvCO.mjs} +0 -0
  247. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-Cw3G4nap.mjs} +0 -0
  248. /package/dist/{health-CIUg1C5o.mjs → health-DkEXPkS6.mjs} +0 -0
  249. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-nF-0Ze2h.mjs} +0 -0
  250. /package/dist/{internal-DmpATljO.mjs → internal-4fU2r5en.mjs} +0 -0
  251. /package/dist/{live-B66u3_0g.mjs → live-B4iGrwY2.mjs} +0 -0
  252. /package/dist/{metadata-D062SVyy.mjs → metadata-C5fJJr-k.mjs} +0 -0
  253. /package/dist/{output-COcSQsfn.mjs → output-Z2lQmPUW.mjs} +0 -0
  254. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-DNsAFIeM.mjs} +0 -0
  255. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-CsOim7bm.mjs} +0 -0
  256. /package/dist/{ready-C-H2cwp_.mjs → ready-tTe-zcIw.mjs} +0 -0
  257. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-B3eTV5yC.mjs} +0 -0
  258. /package/dist/{refute-uSlzkQKq.mjs → refute-BY76YVrT.mjs} +0 -0
  259. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-DdoF_a5y.mjs} +0 -0
  260. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-sSgLwwZN.mjs} +0 -0
  261. /package/dist/{search-BlKeSfVD.mjs → search-BFvQr-sl.mjs} +0 -0
  262. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-Cr8hiZPJ.mjs} +0 -0
  263. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-DT2mLnu1.mjs} +0 -0
  264. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-6gs5iy9T.mjs} +0 -0
  265. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-D6XKO2EV.mjs} +0 -0
  266. /package/dist/{verify-S-TmhUDr.mjs → verify-CM1NakP0.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,i as p,n as m}from"./prompt-DjRTpML4.mjs";function h(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 g={command:`create`,describe:`Create a new Pipeline.`,builder:h,handler:async l=>s({command:`pipelines create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.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:l.body===void 0?u({name:d(l.name,`name`,`text`),sql:d(l.sql,`sql`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Specifies the name of the Pipeline.`)),l.sql===void 0&&(l.sql=await f(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=u({name:d(l.name,`name`,`text`),sql:d(l.sql,`sql`,`text`)});i(await o(`Creating`,async()=>s.pipelines.create({...m,account_id:p})),{successLabel:`Created`})})};function _(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 v={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async c=>s({command:`pipelines delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${c[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(c[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(c[`pipeline-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,i as p,n as m}from"./prompt-BP8XrQSj.mjs";function h(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 g={command:`create`,describe:`Create a new Pipeline.`,builder:h,handler:async l=>s({command:`pipelines create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.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:l.body===void 0?u({name:d(l.name,`name`,`text`),sql:d(l.sql,`sql`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Specifies the name of the Pipeline.`)),l.sql===void 0&&(l.sql=await f(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=u({name:d(l.name,`name`,`text`),sql:d(l.sql,`sql`,`text`)});i(await o(`Creating`,async()=>s.pipelines.create({...m,account_id:p})),{successLabel:`Created`})})};function _(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 v={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async c=>s({command:`pipelines delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${c[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(c[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(c[`pipeline-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>s.pipelines.delete({account_id:l,pipeline_id:c[`pipeline-id`]})),{successLabel:`Deleted`})})};function y(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 b={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:y,handler:async c=>s({command:`pipelines get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${c[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(c[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(c[`pipeline-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.pipelines.get({account_id:l,pipeline_id:c[`pipeline-id`]})),{successLabel:`Loaded`})})};function x(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 S={command:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:x,handler:async m=>s({command:`pipelines legacy-create`,classification:{safeFlags:[`destination-compression-type`,`destination-format`,`destination-type`,`dry-run`]}},m,async()=>{if(m.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:m.body===void 0?u({destination:{batch:{max_bytes:m[`destination-batch-max-bytes`],max_duration_s:m[`destination-batch-max-duration-s`],max_rows:m[`destination-batch-max-rows`]},compression:{type:d(m[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(m[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(m[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(m[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(m[`destination-format`],`destination-format`,`text`),path:{bucket:d(m[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(m[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(m[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(m[`destination-type`],`destination-type`,`text`)},name:d(m.name,`name`,`text`),source:l(m.source,`source`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Creating`,async()=>s.pipelines.legacyCreate({...e,account_id:h})),{successLabel:`Created`});return}if(m[`destination-credentials-access-key-id`]===void 0&&(m[`destination-credentials-access-key-id`]=await f(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),m[`destination-credentials-endpoint`]===void 0&&(m[`destination-credentials-endpoint`]=await f(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),m[`destination-credentials-secret-access-key`]===void 0&&(m[`destination-credentials-secret-access-key`]=await f(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),m[`destination-format`]===void 0&&(m[`destination-format`]=await p(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),m[`destination-path-bucket`]===void 0&&(m[`destination-path-bucket`]=await f(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`Specifies the type of destination.`,[`r2`])),m.name===void 0&&(m.name=await f(`name`,`Defines the name of the pipeline.`)),m.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=u({destination:{batch:{max_bytes:m[`destination-batch-max-bytes`],max_duration_s:m[`destination-batch-max-duration-s`],max_rows:m[`destination-batch-max-rows`]},compression:{type:d(m[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(m[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(m[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(m[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(m[`destination-format`],`destination-format`,`text`),path:{bucket:d(m[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(m[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(m[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(m[`destination-type`],`destination-type`,`text`)},name:d(m.name,`name`,`text`),source:l(m.source,`source`)});i(await o(`Creating`,async()=>s.pipelines.legacyCreate({...g,account_id:h})),{successLabel:`Created`})})};function C(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 w={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async c=>s({command:`pipelines legacy-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${c[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(c[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(c[`pipeline-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>s.pipelines.legacyDelete({account_id:l,pipeline_name:c[`pipeline-name`]})),{successLabel:`Deleted`})})};function T(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 E={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:T,handler:async c=>s({command:`pipelines legacy-get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${c[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(c[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(c[`pipeline-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.pipelines.legacyGet({account_id:l,pipeline_name:c[`pipeline-name`]})),{successLabel:`Loaded`})})};function D(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 O={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async c=>s({command:`pipelines legacy-list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={search:c.search,page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...s})),{successLabel:`Loaded`})})};function k(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 A={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:k,handler:async m=>s({command:`pipelines legacy-update`,classification:{safeFlags:[`destination-compression-type`,`destination-format`,`destination-type`,`dry-run`]}},m,async()=>{if(m.dryRun){a({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${m[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(m[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(m[`pipeline-name`]??``)},bodyKind:`json`,body:m.body===void 0?u({destination:{batch:{max_bytes:m[`destination-batch-max-bytes`],max_duration_s:m[`destination-batch-max-duration-s`],max_rows:m[`destination-batch-max-rows`]},compression:{type:d(m[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(m[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(m[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(m[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(m[`destination-format`],`destination-format`,`text`),path:{bucket:d(m[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(m[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(m[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(m[`destination-type`],`destination-type`,`text`)},name:d(m.name,`name`,`text`),source:l(m.source,`source`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Updating`,async()=>s.pipelines.legacyUpdate({...e,account_id:h,pipeline_name:m[`pipeline-name`]})),{successLabel:`Updated`});return}if(m[`destination-credentials-access-key-id`]===void 0&&(m[`destination-credentials-access-key-id`]=await f(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),m[`destination-credentials-endpoint`]===void 0&&(m[`destination-credentials-endpoint`]=await f(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),m[`destination-credentials-secret-access-key`]===void 0&&(m[`destination-credentials-secret-access-key`]=await f(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),m[`destination-format`]===void 0&&(m[`destination-format`]=await p(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),m[`destination-path-bucket`]===void 0&&(m[`destination-path-bucket`]=await f(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),m[`destination-type`]===void 0&&(m[`destination-type`]=await p(`destination-type`,`Specifies the type of destination.`,[`r2`])),m.name===void 0&&(m.name=await f(`name`,`Defines the name of the pipeline.`)),m.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=u({destination:{batch:{max_bytes:m[`destination-batch-max-bytes`],max_duration_s:m[`destination-batch-max-duration-s`],max_rows:m[`destination-batch-max-rows`]},compression:{type:d(m[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:d(m[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:d(m[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:d(m[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:d(m[`destination-format`],`destination-format`,`text`),path:{bucket:d(m[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:d(m[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:d(m[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:d(m[`destination-type`],`destination-type`,`text`)},name:d(m.name,`name`,`text`),source:l(m.source,`source`)});i(await o(`Updating`,async()=>s.pipelines.legacyUpdate({...g,account_id:h,pipeline_name:m[`pipeline-name`]})),{successLabel:`Updated`})})};function j(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 M={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:j,handler:async c=>s({command:`pipelines list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],name:c.name};if(c.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:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.pipelines.list({account_id:u,...s})),{successLabel:`Loaded`})})};function N(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 ee={command:`create`,describe:`Create a new Sink.`,builder:N,handler:async l=>s({command:`pipelines sinks create`,classification:{safeFlags:[`config-file-naming-strategy`,`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-compression`,`format-type`,`schema-inferred`,`type`,`dry-run`]}},l,async()=>{if(l.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:l.body===void 0?u({config:{account_id:d(l[`config-account-id`],`config-account-id`,`text`),bucket:d(l[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(l[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(l[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(l[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(l[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(l[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(l[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(l[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(l[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:l[`config-rolling-policy-file-size-bytes`],inactivity_seconds:l[`config-rolling-policy-inactivity-seconds`],interval_seconds:l[`config-rolling-policy-interval-seconds`]},namespace:d(l[`config-namespace`],`config-namespace`,`text`),table_name:d(l[`config-table-name`],`config-table-name`,`text`),token:d(l[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(l[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(l[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:l[`format-unstructured`],compression:d(l[`format-compression`],`format-compression`,`text`),type:d(l[`format-type`],`format-type`,`text`),row_group_bytes:l[`format-row-group-bytes`]},name:d(l.name,`name`,`text`),schema:{inferred:l[`schema-inferred`]},type:d(l.type,`type`,`text`)}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Defines the name of the Sink.`)),l.type===void 0&&(l.type=await p(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=u({config:{account_id:d(l[`config-account-id`],`config-account-id`,`text`),bucket:d(l[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:d(l[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:d(l[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:d(l[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:d(l[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:d(l[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:d(l[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:d(l[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:d(l[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:l[`config-rolling-policy-file-size-bytes`],inactivity_seconds:l[`config-rolling-policy-inactivity-seconds`],interval_seconds:l[`config-rolling-policy-interval-seconds`]},namespace:d(l[`config-namespace`],`config-namespace`,`text`),table_name:d(l[`config-table-name`],`config-table-name`,`text`),token:d(l[`config-token`],`config-token`,`text`)},format:{decimal_encoding:d(l[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(l[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:l[`format-unstructured`],compression:d(l[`format-compression`],`format-compression`,`text`),type:d(l[`format-type`],`format-type`,`text`),row_group_bytes:l[`format-row-group-bytes`]},name:d(l.name,`name`,`text`),schema:{inferred:l[`schema-inferred`]},type:d(l.type,`type`,`text`)});i(await o(`Creating`,async()=>s.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})})};function P(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 F={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:P,handler:async c=>s({command:`pipelines sinks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${c[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(c[`sink-id`]))}`,pathParams:{"sink-id":String(c[`sink-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
5
5
  `);return}i(await o(`Deleting`,async()=>s.pipelines.sinks.delete({account_id:l,sink_id:c[`sink-id`]})),{successLabel:`Deleted`})})};function I(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 L={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:I,handler:async c=>s({command:`pipelines sinks get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${c[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(c[`sink-id`]))}`,pathParams:{"sink-id":String(c[`sink-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.pipelines.sinks.get({account_id:l,sink_id:c[`sink-id`]})),{successLabel:`Loaded`})})};function R(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 z={command:`list`,describe:`List/Filter Sinks in Account.`,builder:R,handler:async c=>s({command:`pipelines sinks list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={pipeline_id:c[`pipeline-id`],name:c.name,page:c.page,per_page:c[`per-page`]};if(c.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:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...s})),{successLabel:`Loaded`})})},B={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,builder:e=>e.command(ee).command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(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 H={command:`create`,describe:`Create a new Stream.`,builder:V,handler:async l=>s({command:`pipelines streams create`,classification:{safeFlags:[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`http-authentication`,`http-enabled`,`schema-inferred`,`worker-binding-enabled`,`dry-run`]}},l,async()=>{if(l.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:l.body===void 0?u({format:{decimal_encoding:d(l[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(l[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:l[`format-unstructured`],type:d(l[`format-type`],`format-type`,`text`),compression:d(l[`format-compression`],`format-compression`,`text`),row_group_bytes:l[`format-row-group-bytes`]},http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},name:d(l.name,`name`,`text`),schema:{inferred:l[`schema-inferred`]},worker_binding:{enabled:l[`worker-binding-enabled`]}}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Specifies the name of the Stream.`));let m=u({format:{decimal_encoding:d(l[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:d(l[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:l[`format-unstructured`],type:d(l[`format-type`],`format-type`,`text`),compression:d(l[`format-compression`],`format-compression`,`text`),row_group_bytes:l[`format-row-group-bytes`]},http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},name:d(l.name,`name`,`text`),schema:{inferred:l[`schema-inferred`]},worker_binding:{enabled:l[`worker-binding-enabled`]}});i(await o(`Creating`,async()=>s.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})})};function U(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 W={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:U,handler:async c=>s({command:`pipelines streams delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf pipelines streams delete`,method:`DELETE`,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:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-DH3kMXSs.mjs";import{r as t}from"./auth-tvDdC1J-.mjs";import{t as n}from"./output-COcSQsfn.mjs";import{t as r}from"./dry-run-DiVy1lVo.mjs";import{t as i}from"./progress-V6SZV3Ux.mjs";import{t as a}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as o,r as s,t as c}from"./body-parser-DIlfApuJ.mjs";import{n as l}from"./input-validation-BxchZ9jE.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:"Retrieve a zone's Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.",builder:u,handler:async o=>a({command:`precursor get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.precursor.get({zone_id:s})),{successLabel:`Loaded`})})};function f(e){return e.option(`default-mode`,{type:`string`,description:`The zone-level Precursor enforcement mode applied to requests that do
2
+ import{h as e}from"./oauth-BdVr2hJp.mjs";import{r as t}from"./auth-DWxtJ918.mjs";import{t as n}from"./output-Z2lQmPUW.mjs";import{t as r}from"./dry-run-YSQndLvt.mjs";import{t as i}from"./progress-a5IKeKni.mjs";import{t as a}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as o,r as s,t as c}from"./body-parser-Cmw7PZ7a.mjs";import{n as l}from"./input-validation-nF-0Ze2h.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:"Retrieve a zone's Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.",builder:u,handler:async o=>a({command:`precursor get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.precursor.get({zone_id:s})),{successLabel:`Loaded`})})};function f(e){return e.option(`default-mode`,{type:`string`,description:`The zone-level Precursor enforcement mode applied to requests that do
3
3
  not match a more specific enforcement rule.
4
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 p={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:f,handler:async u=>a({command:`precursor update`,classification:{safeFlags:[`default-mode`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf precursor update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({default_mode:l(u[`default-mode`],`default-mode`,`text`),enforcement_rules:s(u[`enforcement-rules`],`enforcement-rules`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.precursor.update({body:e,zone_id:d})),{successLabel:`Updated`});return}let f=c({default_mode:l(u[`default-mode`],`default-mode`,`text`),enforcement_rules:s(u[`enforcement-rules`],`enforcement-rules`)});n(await i(`Updating`,async()=>a.precursor.update({body:f,zone_id:d})),{successLabel:`Updated`})})},m={command:`precursor`,describe:`Precursor settings for a zone`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{f as e}from"./oauth-BdVr2hJp.mjs";import{i as t}from"./auth-DWxtJ918.mjs";import{t as n}from"./output-Z2lQmPUW.mjs";import{r}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{E as i}from"./dist-Dr4Hg_Up.mjs";import{i as a,r as o,s,t as c}from"./dist-CFQREIRi.mjs";import{i as l,n as u}from"./build-CP2JUfV1.mjs";import{t as d}from"./deploy-input-BoLTdQzS.mjs";import{readBuildOutput as f}from"@cloudflare/build-output-utils";function p(e){return e.positional(`preview-name`,{type:`string`,description:`Preview name. Defaults to the current CI or Git branch; required if no branch is available.`}).option(`prebuilt`,{type:`boolean`,description:`Use existing Preview Build Output Specification files without building`,default:!1})}function m(e){return{type:`preview`,version:1,preview_id:e.preview.id,preview_name:e.preview.name,preview_slug:e.preview.slug,preview_urls:e.preview.urls,deployment_id:e.deployment.id,deployment_urls:e.deployment.urls}}async function h(n){let r=n[`preview-name`],p=r??o();if(!p||!r&&p===`HEAD`)throw Error(`We couldn't determine a Preview name from CI or Git. The name is optional when a branch is available. Otherwise, run:
3
+
4
+ cf previews deploy PREVIEW_NAME`);n.prebuilt||await u(n.mode,{output:n.quiet?`silent`:`stderr`},{isPreview:!0});let m=await f(process.cwd());c(m.rootConfig),l(n.mode,m.rootConfig.buildContext.mode,{requireRequestedMode:n.prebuilt});let h=m.workers.default,g=await t(),_=await e({isPreview:!0}),v=i(g);return s({...v,logger:{...v.logger,log:()=>{},info:()=>{}}}),a(_,{name:p},{workerConfig:h.config,rootConfig:m.rootConfig,buildResult:h.bundleDir?d(h,h.config):void 0,assets:h.assetsDir?{directory:h.assetsDir}:void 0})}const g={command:`deploy [preview-name]`,describe:`Deploy a Worker Preview`,builder:p,handler:async e=>{n(m(await h(e)),{quiet:e.quiet})}},_={command:`previews`,describe:`Manage Worker Previews`,builder:e=>e.command(r(g,{command:`previews deploy`,classification:{safeFlags:[`prebuilt`]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_ as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{c as e,s as t}from"./src-C8phrg-8.mjs";import{s as n}from"./lifecycle-XswDq0ZB.mjs";import{r}from"./theme-CeVf-5qG.mjs";import{a as i}from"./dist-DW5BPGFs.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`||e()}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(e,r){if(!c())return r();t(n);let a=i({frames:[...s],indicator:`timer`,delay:80});o.setIndeterminate(),a.start(e);try{let t=await r();return o.clear(),a.stop(e),t}catch(t){throw o.clear(),a.error(e),t}}export{l as t};
2
+ import{a as e,o as t}from"./src-BbnV77C4.mjs";import{s as n}from"./lifecycle-CadF_i2n.mjs";import{r}from"./theme-CeVf-5qG.mjs";import{a as i}from"./dist-BRg_z9Ut.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`||t()}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(t,r){if(!c())return r();e(n);let a=i({frames:[...s],indicator:`timer`,delay:80});o.setIndeterminate(),a.start(t);try{let e=await r();return o.clear(),a.stop(t),e}catch(e){throw o.clear(),a.error(t),e}}export{l as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{statSync as e}from"node:fs";import{dirname as t,join as n,resolve as r}from"node:path";const i=`cloudflare.config.ts`;let a,o;function s(e){o=e,a=void 0}function c(a=process.cwd()){let o=r(a);for(;;){let r=n(o,i);try{if(e(r).isFile())return r}catch{}let a=t(o);if(a===o)return null;o=a}}async function l(e=process.cwd(),t={}){let n=r(e),s=t.isPreview??!1;a=void 0;let l=c(n);if(!l)return a={startDir:n,isPreview:s,result:null},null;let{loadAndParseConfigSettings:u}=await import(`@cloudflare/config`),d=await u(l,{isPreview:s,mode:o});if(!d.result.success){let e=d.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 ${i}:\n${e}`)}let f={path:l,settings:d.result.data};return a={startDir:n,isPreview:s,result:f},f}function u(e=process.cwd(),t={}){let n=r(e),i=t.isPreview??!1;return a?.startDir===n&&a.isPreview===i?a.result:void 0}export{s as a,l as i,c as n,u as r,i as t};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import{a as e,t}from"./src-BbnV77C4.mjs";import{s as n}from"./lifecycle-CadF_i2n.mjs";import{n as r,t as i}from"./theme-CeVf-5qG.mjs";import{A as a,n as o}from"./interactive-CGOh-aYq.mjs";import{i as s,o as c,r as l,t as u}from"./dist-BRg_z9Ut.mjs";function d(e){return e.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,` `)}function f(){e(n)}async function p(){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 m(e,n,r){let i=r?.kind??`text`;if(o()){if(i===`secret`){let t=await p();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}`,u=n||r?.question||s,d=e=>e&&e.length>0?r?.validate?.(e):`Value cannot be empty`;f();let m=i===`secret`?await l({message:u,mask:`•`,validate:d}):await c({message:u,validate:d});if(a(m)||typeof m!=`string`)throw new t(130,{cancelled:!0});return m}async function h(e,n,r,i={}){let c=d(e),l=r.map(d);if(o())throw Error(`--${c} is required (one of: ${l.join(`, `)}). Pass --${c} <value> or run interactively.`);let u=`Select value for --${c}`,p=d(n||u);f();let m=await s({message:p,options:r.map(e=>({value:e,label:d((Object.hasOwn(i,e)?i[e]:void 0)??e)}))});if(a(m)||typeof m!=`string`)throw new t(130,{cancelled:!0});return m}async function g(e,n){if(o())throw Error(`--${e} is required and must be true. Pass --${e} or run interactively.`);f();let r=await u({message:n||`Confirm --${e}`,initialValue:!1});if(a(r))throw new t(130,{cancelled:!0});return r===!0}async function _(e,{defaultValue:n=!0,fallbackValue:r=!0}={}){if(o())return process.stderr.write(`? ${e}\n Using fallback value in non-interactive context: ${r?`yes`:`no`}\n`),r;f();let i=await u({message:e,initialValue:n});if(a(i))throw new t(130,{cancelled:!0});return i===!0}async function v(e={}){if(e.force===!0)return!0;let n=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(o()){let e=r();return process.stderr.write(`${e.hex(i.warning)(`?`)} ${n}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}f();let s=await u({message:n,initialValue:!1});if(a(s))throw new t(130,{cancelled:!0});return s===!0}export{m as a,h as i,v as n,d as o,g as r,_ as t};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{n as f}from"./prompt-DjRTpML4.mjs";function p(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 m={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:p,handler:async d=>s({command:`queries bulk create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.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:d.body===void 0?u({queries:l(d.queries,`queries`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queries.bulk.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({queries:l(d.queries,`queries`)});i(await o(`Creating`,async()=>s.queries.bulk.create({...p,account_id:f})),{successLabel:`Created`})})},h={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(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 _={command:`create`,describe:`Return a success message after creating new saved string queries`,builder:g,handler:async l=>s({command:`queries create`,classification:{safeFlags:[`scan`,`dry-run`]}},l,async()=>{let s={id:l.id};if(l.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:s,bodyKind:`json`,body:l.body===void 0?u({max_time:d(l[`max-time`],`max-time`,`text`),min_time:d(l[`min-time`],`min-time`,`text`),scan:l.scan,tag:d(l.tag,`tag`,`text`)}):c(l.body)});return}let f=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...e,account_id:p,...s})),{successLabel:`Created`});return}let m=u({max_time:d(l[`max-time`],`max-time`,`text`),min_time:d(l[`min-time`],`min-time`,`text`),scan:l.scan,tag:d(l.tag,`tag`,`text`)});new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...m,account_id:p,...s})),{successLabel:`Created`})})};function v(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 y={command:`delete`,describe:`Return a success message after deleting saved string queries by ID`,builder:v,handler:async c=>s({command:`queries delete`,classification:{safeFlags:[`scan`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={id:c.id,tag:c.tag,scan:c.scan};if(c.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:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await f({force:!!c.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{n as f}from"./prompt-BP8XrQSj.mjs";function p(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 m={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:p,handler:async d=>s({command:`queries bulk create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.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:d.body===void 0?u({queries:l(d.queries,`queries`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queries.bulk.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({queries:l(d.queries,`queries`)});i(await o(`Creating`,async()=>s.queries.bulk.create({...p,account_id:f})),{successLabel:`Created`})})},h={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(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 _={command:`create`,describe:`Return a success message after creating new saved string queries`,builder:g,handler:async l=>s({command:`queries create`,classification:{safeFlags:[`scan`,`dry-run`]}},l,async()=>{let s={id:l.id};if(l.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:s,bodyKind:`json`,body:l.body===void 0?u({max_time:d(l[`max-time`],`max-time`,`text`),min_time:d(l[`min-time`],`min-time`,`text`),scan:l.scan,tag:d(l.tag,`tag`,`text`)}):c(l.body)});return}let f=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...e,account_id:p,...s})),{successLabel:`Created`});return}let m=u({max_time:d(l[`max-time`],`max-time`,`text`),min_time:d(l[`min-time`],`min-time`,`text`),scan:l.scan,tag:d(l.tag,`tag`,`text`)});new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...m,account_id:p,...s})),{successLabel:`Created`})})};function v(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 y={command:`delete`,describe:`Return a success message after deleting saved string queries by ID`,builder:v,handler:async c=>s({command:`queries delete`,classification:{safeFlags:[`scan`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={id:c.id,tag:c.tag,scan:c.scan};if(c.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:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await f({force:!!c.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>l.queries.delete({account_id:u,...s})),{successLabel:`Deleted`})})},b={command:`queries`,describe:`queries`,builder:e=>e.command(_).command(y).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,i as p,n as m}from"./prompt-DjRTpML4.mjs";import{t as h}from"./cli-types-CrSoSMPF.mjs";function ee(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`,`notification`]}).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 g={command:`create <queue-id>`,describe:`Creates a consumer for a Queue.`,builder:ee,handler:async l=>s({command:`queues consumers create`,classification:{safeFlags:[`type`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.consumers.create({body:e,account_id:m,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}l.type===void 0&&(l.type=await p(`type`,`The type field`,[`worker`,`http_pull`,`notification`])),l.type===`worker`&&l[`script-name`]===void 0&&(l[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)});i(await o(`Creating`,async()=>s.queues.consumers.create({body:h,account_id:m,queue_id:l[`queue-id`]})),{successLabel:`Created`})})};function _(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 v={command:`delete <consumer-id>`,describe:`Deletes a consumer from a Queue.`,builder:_,handler:async c=>s({command:`queues consumers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,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:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,i as p,n as m}from"./prompt-BP8XrQSj.mjs";import{t as h}from"./cli-types-abvWQN3T.mjs";function ee(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`,`notification`]}).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 g={command:`create <queue-id>`,describe:`Creates a consumer for a Queue.`,builder:ee,handler:async l=>s({command:`queues consumers create`,classification:{safeFlags:[`type`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.consumers.create({body:e,account_id:m,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}l.type===void 0&&(l.type=await p(`type`,`The type field`,[`worker`,`http_pull`,`notification`])),l.type===`worker`&&l[`script-name`]===void 0&&(l[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)});i(await o(`Creating`,async()=>s.queues.consumers.create({body:h,account_id:m,queue_id:l[`queue-id`]})),{successLabel:`Created`})})};function _(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 v={command:`delete <consumer-id>`,describe:`Deletes a consumer from a Queue.`,builder:_,handler:async c=>s({command:`queues consumers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf queues consumers delete`,method:`DELETE`,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:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>s.queues.consumers.delete({account_id:l,queue_id:c[`queue-id`],consumer_id:c[`consumer-id`]})),{successLabel:`Deleted`})})};function y(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 b={command:`get <consumer-id>`,describe:`Returns a Queue consumer by identifier.`,builder:y,handler:async c=>s({command:`queues consumers get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf queues consumers get`,method:`GET`,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:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.queues.consumers.get({account_id:l,queue_id:c[`queue-id`],consumer_id:c[`consumer-id`]})),{successLabel:`Loaded`})})};function x(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 S={command:`list`,describe:`Returns the consumers configured for a Queue.`,builder:x,handler:async c=>s({command:`queues consumers list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf queues consumers list`,method:`GET`,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:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.queues.consumers.list({account_id:l,queue_id:c[`queue-id`]})),{successLabel:`Loaded`})})};function C(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`,`notification`]}).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 w={command:`update <consumer-id>`,describe:`Replaces a Queue consumer, or creates it if it does not exist.`,builder:C,handler:async l=>s({command:`queues consumers update`,classification:{safeFlags:[`type`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/consumers/${l[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(l[`consumer-id`]))}`,pathParams:{"consumer-id":String(l[`consumer-id`]??``),"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.queues.consumers.update({body:e,account_id:m,queue_id:l[`queue-id`],consumer_id:l[`consumer-id`]})),{successLabel:`Updated`});return}l.type===void 0&&(l.type=await p(`type`,`The type field`,[`worker`,`http_pull`,`notification`])),l.type===`worker`&&l[`script-name`]===void 0&&(l[`script-name`]=await f(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=u({dead_letter_queue:d(l[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:d(l[`script-name`],`script-name`,`text`),settings:{batch_size:l[`settings-batch-size`],max_concurrency:l[`settings-max-concurrency`],max_retries:l[`settings-max-retries`],max_wait_time_ms:l[`settings-max-wait-time-ms`],retry_delay:l[`settings-retry-delay`],visibility_timeout_ms:l[`settings-visibility-timeout-ms`]},type:d(l.type,`type`,`text`)});i(await o(`Updating`,async()=>s.queues.consumers.update({body:h,account_id:m,queue_id:l[`queue-id`],consumer_id:l[`consumer-id`]})),{successLabel:`Updated`})})},T={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).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 D={command:`create`,describe:`Creates a Queue in the account.`,builder:E,handler:async l=>s({command:`queues create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},l,async()=>{if(l.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:l.body===void 0?u({jurisdiction:d(l.jurisdiction,`jurisdiction`,`text`),queue_name:d(l[`queue-name`],`queue-name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.create({...e,account_id:p})),{successLabel:`Created`});return}l[`queue-name`]===void 0&&(l[`queue-name`]=await f(`queue-name`,`The queue_name field`));let m=u({jurisdiction:d(l.jurisdiction,`jurisdiction`,`text`),queue_name:d(l[`queue-name`],`queue-name`,`text`)});i(await o(`Creating`,async()=>s.queues.create({...m,account_id:p})),{successLabel:`Created`})})};function O(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 k={command:`delete <queue-id>`,describe:`Deletes a Queue.`,builder:O,handler:async c=>s({command:`queues delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf queues delete`,method:`DELETE`,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:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>s.queues.delete({account_id:l,queue_id:c[`queue-id`]})),{successLabel:`Deleted`})})};function A(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).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 j={command:`edit <queue-id>`,describe:`Updates part of a Queue's configuration.`,builder:A,handler:async l=>s({command:`queues edit`,classification:{safeFlags:[`jurisdiction`,`settings-delivery-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({jurisdiction:d(l.jurisdiction,`jurisdiction`,`text`),queue_name:d(l[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:l[`settings-delivery-delay`],delivery_paused:l[`settings-delivery-paused`],message_retention_period:l[`settings-message-retention-period`]}}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.queues.edit({body:e,account_id:f,queue_id:l[`queue-id`]})),{successLabel:`Updated`});return}let p=u({jurisdiction:d(l.jurisdiction,`jurisdiction`,`text`),queue_name:d(l[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:l[`settings-delivery-delay`],delivery_paused:l[`settings-delivery-paused`],message_retention_period:l[`settings-message-retention-period`]}});i(await o(`Updating`,async()=>s.queues.edit({body:p,account_id:f,queue_id:l[`queue-id`]})),{successLabel:`Updated`})})};function M(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 N={command:`get <queue-id>`,describe:`Returns details about a specific Queue.`,builder:M,handler:async c=>s({command:`queues get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf queues get`,method:`GET`,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:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.queues.get({account_id:l,queue_id:c[`queue-id`]})),{successLabel:`Loaded`})})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`Returns the queues owned by an account.`,builder:P,handler:async c=>s({command:`queues list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.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 s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.queues.list({account_id:l})),{successLabel:`Loaded`})})};function I(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 L={command:`ack-preview <queue-id>`,describe:`Delete messages returned by the legacy preview endpoint. This deprecated route is retained for compatibility; use the peek and purge endpoints for new integrations. Deleting messages this way does not count as delivery and does not affect metrics.`,builder:I,handler:async d=>s({command:`queues messages ack-preview`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(d[`queue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({acks:l(d.acks,`acks`),retries:l(d.retries,`retries`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queues.messages.ackPreview({...e,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`});return}let p=u({acks:l(d.acks,`acks`),retries:l(d.retries,`retries`)});i(await o(`Creating`,async()=>s.queues.messages.ackPreview({...p,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`})})};function R(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 z={command:`ack <queue-id>`,describe:`Acknowledges successfully processed Queue messages and retries messages that were not processed successfully.`,builder:R,handler:async d=>s({command:`queues messages ack`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(d[`queue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({acks:l(d.acks,`acks`),retries:l(d.retries,`retries`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queues.messages.ack({...e,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`});return}let p=u({acks:l(d.acks,`acks`),retries:l(d.retries,`retries`)});i(await o(`Creating`,async()=>s.queues.messages.ack({...p,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`})})};function B(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 V={command:`bulk-push`,describe:`Pushes a batch of messages to a Queue.`,builder:B,handler:async d=>s({command:`queues messages bulk-push`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(d[`queue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delay_seconds:d[`delay-seconds`],messages:l(d.messages,`messages`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queues.messages.bulkPush({...e,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`});return}let p=u({delay_seconds:d[`delay-seconds`],messages:l(d.messages,`messages`)});i(await o(`Creating`,async()=>s.queues.messages.bulkPush({...p,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`})})};function H(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 U={command:`extend-leases <queue-id>`,describe:"Extends message leases without incrementing the messages' `attempts` counters. Each message receives a new lease identifier.",builder:H,handler:async d=>s({command:`queues messages extend-leases`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf queues messages extend-leases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(d[`queue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({extend:l(d.extend,`extend`),visibility_timeout_ms:d[`visibility-timeout-ms`]}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.queues.messages.extendLeases({...e,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`});return}let p=u({extend:l(d.extend,`extend`),visibility_timeout_ms:d[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>s.queues.messages.extendLeases({...p,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Created`})})};function te(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 W={command:`peek <queue-id>`,describe:`Peek messages from a Queue without leasing them. Each message includes a ref that can be passed to the purge endpoint, and remains available for subsequent peek or pull operations until it is purged.`,builder:te,handler:async l=>s({command:`queues messages peek`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({batch_size:l[`batch-size`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.messages.peek({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}let f=u({batch_size:l[`batch-size`]});i(await o(`Creating`,async()=>s.queues.messages.peek({...f,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`})})};function G(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 K={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. This deprecated route is retained for compatibility; use the peek endpoint for new integrations.`,builder:G,handler:async l=>s({command:`queues messages preview`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({batch_size:l[`batch-size`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Loading`,async()=>s.queues.messages.preview({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Loaded`});return}let f=u({batch_size:l[`batch-size`]});i(await o(`Loading`,async()=>s.queues.messages.preview({...f,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Loaded`})})};function q(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 J={command:`pull <queue-id>`,describe:`Pulls a batch of messages from a Queue for an HTTP pull consumer.`,builder:q,handler:async l=>s({command:`queues messages pull`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({batch_size:l[`batch-size`],visibility_timeout_ms:l[`visibility-timeout-ms`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.messages.pull({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}let f=u({batch_size:l[`batch-size`],visibility_timeout_ms:l[`visibility-timeout-ms`]});i(await o(`Creating`,async()=>s.queues.messages.pull({...f,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`})})};function Y(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(`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:`purge <queue-id>`,describe:`Delete messages from a Queue by using refs returned by the peek endpoint. Purging messages does not count as delivery and does not affect metrics.`,builder:Y,handler:async d=>s({command:`queues messages purge`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{if(d.dryRun){a({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(d[`queue-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({refs:l(d.refs,`refs`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,!await m({force:!!d.force,message:`This operation permanently deletes the selected messages from the Queue.`})){process.stderr.write(`Aborted.
5
5
  `);return}if(d.body){let e=c(d.body);i(await o(`Deleting`,async()=>s.queues.messages.purge({...e,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Deleted`});return}if(d.refs===void 0)throw Error(`--refs is required (or pass --body with this field set).`);let p=u({refs:l(d.refs,`refs`)});i(await o(`Deleting`,async()=>s.queues.messages.purge({...p,account_id:f,queue_id:d[`queue-id`]})),{successLabel:`Deleted`})})};function Z(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 Q={command:`push <queue-id>`,describe:`Pushes a message to a Queue.`,builder:Z,handler:async l=>s({command:`queues messages push`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({delay_seconds:l[`delay-seconds`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.queues.messages.push({body:e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}let f=u({delay_seconds:l[`delay-seconds`]});i(await o(`Creating`,async()=>s.queues.messages.push({body:f,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`})})},ne={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(z).command(L).command(V).command(U).command(W).command(K).command(J).command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(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 ie={command:`get <queue-id>`,describe:`Returns best-effort metrics for a Queue. Values may be approximate due to the distributed nature of Queues.`,builder:re,handler:async c=>s({command:`queues metrics get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf queues metrics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/metrics`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.queues.metrics.get({account_id:l,queue_id:c[`queue-id`]})),{successLabel:`Loaded`})})},ae={command:`metrics`,describe:`Operations for metrics`,builder:e=>e.command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confirms that all messages will be permanently deleted.`}).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 se={command:`start <queue-id>`,describe:`Starts a purge that deletes all messages from a Queue.`,builder:oe,handler:async l=>s({command:`queues purge start`,classification:{safeFlags:[`delete-messages-permanently`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){a({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/purge`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({delete_messages_permanently:l[`delete-messages-permanently`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,!await m({force:!!l.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p,t as m}from"./input-validation-BxchZ9jE.mjs";import{a as h,i as g,n as _}from"./prompt-DjRTpML4.mjs";import{n as ee,t as te}from"./raw-fetch-BVYQR6C5.mjs";function v(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:v,handler:async l=>c({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-Cmw7PZ7a.mjs";import{n as p,t as m}from"./input-validation-nF-0Ze2h.mjs";import{a as h,i as g,n as _}from"./prompt-BP8XrQSj.mjs";import{n as ee,t as te}from"./raw-fetch-DNH2V8qH.mjs";function v(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:v,handler:async l=>c({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function b(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:b,handler:async l=>c({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function S(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:S,handler:async p=>c({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},w={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`create-by-name <bucket-name>`,describe:"Creates a new R2 bucket using the name from the URL path. Similar to `r2-create-bucket` (POST), but the bucket name comes from the path and the optional storage class is supplied via the `cf-r2-storage-class` header. There is no request body. Unlike the POST variant, this endpoint does not accept a location hint — the bucket is placed in the R2 region for the caller's edge colo. Use the POST variant if you need to set a `locationHint`.",builder:T,handler:async l=>c({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function D(e){return e.option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`location-hint`,{type:`string`,description:`Location of the bucket.`,choices:[`apac`,`eeur`,`enam`,`weur`,`wnam`,`oc`]}).option(`name`,{type:`string`,description:`Name of the bucket.`}).option(`storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,choices:[`Standard`,`InfrequentAccess`],default:`Standard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create`,describe:`Creates a new R2 bucket.`,builder:D,handler:async d=>c({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({locationHint:p(d[`location-hint`],`location-hint`,`text`),name:p(d.name,`name`,`text`),storageClass:p(d[`storage-class`],`storage-class`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await h(`name`,`Name of the bucket.`));let _={};d[`location-hint`]!==void 0&&l(_,[`locationHint`],p(d[`location-hint`],`location-hint`,`text`)),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d[`storage-class`]!==void 0&&l(_,[`storageClass`],p(d[`storage-class`],`storage-class`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function k(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const A={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:k,handler:async l=>c({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function j(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`domain`,{type:`string`,description:`Name of the custom domain to be added.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`zone-id`,{type:`string`,description:`Zone ID of the custom domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:j,handler:async d=>c({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,domain:p(d.domain,`domain`,`text`),enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`),zoneId:p(d[`zone-id`],`zone-id`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(d.domain===void 0&&(d.domain=await h(`domain`,`Name of the custom domain to be added.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`zone-id`]===void 0&&(d[`zone-id`]=await h(`zone-id`,`Zone ID of the custom domain.`));let _={};d.ciphers!==void 0&&l(_,[`ciphers`],d.ciphers),d.domain!==void 0&&l(_,[`domain`],p(d.domain,`domain`,`text`)),d.enabled!==void 0&&l(_,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(_,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),d[`zone-id`]!==void 0&&l(_,[`zoneId`],p(d[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function N(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:N,handler:async l=>c({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function F(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:F,handler:async l=>c({command:`r2 buckets domains custom get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function L(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:L,handler:async l=>c({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function z(e){return e.positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the specified custom domain.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:z,handler:async d=>c({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${d.domain==null?`<domain>`:encodeURIComponent(String(d.domain))}`,pathParams:{"bucket-name":String(d[`bucket-name`]??``),domain:String(d.domain??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d.ciphers!==void 0&&l(g,[`ciphers`],d.ciphers),d.enabled!==void 0&&l(g,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(g,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},V={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(M).command(P).command(I).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:H,handler:async l=>c({command:`r2 buckets domains managed list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function W(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the r2.dev domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:W,handler:async d=>c({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({enabled:d.enabled}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}if(d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};d.enabled!==void 0&&l(h,[`enabled`],d.enabled),a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},K={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(V).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:J,handler:async l=>c({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function X(e){return e.positional(`queue-id`,{type:`string`,description:`Queue ID.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rule-ids`,{type:`string`,array:!0,description:`Array of rule ids to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:X,handler:async d=>c({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}`,pathParams:{"queue-id":String(d[`queue-id`]??``),"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({ruleIds:d[`rule-ids`]}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,!await _({force:!!d.force})){process.stderr.write(`Aborted.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,t as l}from"./body-parser-DIlfApuJ.mjs";import{n as u}from"./input-validation-BxchZ9jE.mjs";import{a as d,n as f}from"./prompt-DjRTpML4.mjs";import{t as p}from"./cli-types-CrSoSMPF.mjs";function m(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const h={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:m,handler:async f=>s({command:`r2-data-catalog credentials create`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?l({token:u(f.token,`token`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`});return}f.token===void 0&&(f.token=await d(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=l({token:u(f.token,`token`,`text`)});i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`})})},g={command:`credentials`,describe:`Catalog access credentials for external query engines (Spark, Trino, etc.)`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`cascade`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:_,handler:async c=>s({command:`r2-data-catalog delete`,classification:{safeFlags:[`cascade`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={force:c.cascade};if(c.dryRun){a({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await f({force:!!c.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,n as f}from"./prompt-BP8XrQSj.mjs";import{t as p}from"./cli-types-abvWQN3T.mjs";function m(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const h={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:m,handler:async f=>s({command:`r2-data-catalog credentials create`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?l({token:u(f.token,`token`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`});return}f.token===void 0&&(f.token=await d(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=l({token:u(f.token,`token`,`text`)});i(await o(`Creating`,async()=>s.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:f[`bucket-name`]})),{successLabel:`Created`})})},g={command:`credentials`,describe:`Catalog access credentials for external query engines (Spark, Trino, etc.)`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`cascade`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:_,handler:async c=>s({command:`r2-data-catalog delete`,classification:{safeFlags:[`cascade`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{let s={force:c.cascade};if(c.dryRun){a({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,!await f({force:!!c.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>l.r2DataCatalog.delete({account_id:u,bucket_name:c[`bucket-name`],...s})),{successLabel:`Deleted`})})};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:y,handler:async c=>s({command:`r2-data-catalog disable`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
4
4
  `);return}i(await o(`Deleting`,async()=>s.r2DataCatalog.disable({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Deleted`})})};function x(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:x,handler:async c=>s({command:`r2-data-catalog enable`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.r2DataCatalog.enable({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Created`})})};function C(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:C,handler:async c=>s({command:`r2-data-catalog get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.get({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Loaded`})})};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:T,handler:async c=>s({command:`r2-data-catalog list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.list({account_id:l})),{successLabel:`Loaded`})})};function D(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:D,handler:async c=>s({command:`r2-data-catalog maintenance-configs get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.r2DataCatalog.maintenanceConfigs.get({account_id:l,bucket_name:c[`bucket-name`]})),{successLabel:`Loaded`})})};function k(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const A={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:k,handler:async d=>s({command:`r2-data-catalog maintenance-configs update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?l({snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}let p=l({snapshot_expiration:{max_snapshot_age:u(d[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:d[`snapshot-expiration-min-snapshots-to-keep`]}});i(await o(`Creating`,async()=>s.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})})},j={command:`maintenance-configs`,describe:`Table maintenance settings — compaction schedules and snapshot expiration policies`,builder:e=>e.command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
5
5
  Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.