cf 0.0.6 → 0.2.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 (276) hide show
  1. package/README.md +2 -4
  2. package/bin/cf +11 -0
  3. package/dist/_meta/agent-context.json +89 -89
  4. package/dist/_meta/commands.json +12866 -4982
  5. package/dist/_meta/schemas.json +33572 -1148
  6. package/dist/abuse-reports-KtfZhi6j.mjs +8 -0
  7. package/dist/accounts-BopMfODC.mjs +21 -0
  8. package/dist/acm-BT4vlnEJ.mjs +3 -0
  9. package/dist/addressing-B3uFxHst.mjs +13 -0
  10. package/dist/{agent-context-BBJnI_Q7.mjs → agent-context-D26woB9J.mjs} +1 -1
  11. package/dist/ai-DWHqwMap.mjs +2 -0
  12. package/dist/ai-gateway-CbKEO-3o.mjs +8 -0
  13. package/dist/ai-search-VnOQ5n--.mjs +7 -0
  14. package/dist/alerting-BmmgIlIO.mjs +6 -0
  15. package/dist/analytics-isY03taL.mjs +20 -0
  16. package/dist/api-gateway-DXurEbA-.mjs +33 -0
  17. package/dist/argo-B02BL_hp.mjs +2 -0
  18. package/dist/audit-logs-DcgR9xUc.mjs +2 -0
  19. package/dist/auth-CQcAgnOy.mjs +135 -0
  20. package/dist/auth-DenWm_X0.mjs +6 -0
  21. package/dist/autorag-CmrwnGVj.mjs +2 -0
  22. package/dist/billing-CaW1ZAB1.mjs +2 -0
  23. package/dist/body-parser-Br-BoYk-.mjs +2 -0
  24. package/dist/bot-management-CeBsFx68.mjs +5 -0
  25. package/dist/botnet-feed-B396vQeQ.mjs +3 -0
  26. package/dist/brand-protection-D4V1v5Kl.mjs +3 -0
  27. package/dist/browser-rendering-GF7rNtKI.mjs +4 -0
  28. package/dist/build-5jmmOZhm.mjs +1054 -0
  29. package/dist/{builds-B5sC8Gh_.mjs → builds-C_ySULja.mjs} +1 -1
  30. package/dist/cache-DmXizSMi.mjs +5 -0
  31. package/dist/calls-x4KQpTB4.mjs +4 -0
  32. package/dist/certificate-authorities-hC0SG-Ga.mjs +2 -0
  33. package/dist/chunk-DH-VkVmc.mjs +2 -0
  34. package/dist/client-certificates-BGVsDyeJ.mjs +3 -0
  35. package/dist/cloud-connector-BClQpEzI.mjs +2 -0
  36. package/dist/cloudforce-one-BfhFrO6M.mjs +21 -0
  37. package/dist/{completions-BSRqbcrz.mjs → completions-BKrxcfhN.mjs} +1 -1
  38. package/dist/config-DYzlVxcB.mjs +2 -0
  39. package/dist/connectivity-G0NP6LtW.mjs +3 -0
  40. package/dist/content-scanning-DEtPJ7aF.mjs +4 -0
  41. package/dist/context-CC0Rhkhy.mjs +2 -0
  42. package/dist/custom-certificates-rJXFpUWu.mjs +5 -0
  43. package/dist/custom-hostnames-Be5mgLeF.mjs +5 -0
  44. package/dist/custom-nameservers-CoFdy6hD.mjs +3 -0
  45. package/dist/custom-pages-D-oErw57.mjs +4 -0
  46. package/dist/d1-C95ckPKI.mjs +3 -0
  47. package/dist/dcv-delegation-CWSkbGuc.mjs +2 -0
  48. package/dist/delegate.mjs +2 -0
  49. package/dist/deploy-DbkiIzUr.mjs +2 -0
  50. package/dist/dev-C6iSuQZm.mjs +6 -0
  51. package/dist/diagnostics-DEEhPnXj.mjs +3 -0
  52. package/dist/dispatch-namespaces-BzXeV7PH.mjs +7 -0
  53. package/dist/dist-CnSubA1Z.mjs +82 -0
  54. package/dist/dist-DNBSHor6.mjs +301 -0
  55. package/dist/dns-firewall-BQXD_NxG.mjs +57 -0
  56. package/dist/dns-qW-3TZOT.mjs +29 -0
  57. package/dist/durable-objects-CgWFYEJJ.mjs +2 -0
  58. package/dist/email-routing-tdNJaCpJ.mjs +10 -0
  59. package/dist/email-security-DTVHNr2h.mjs +60 -0
  60. package/dist/email-sending-DsFTvE31.mjs +3 -0
  61. package/dist/filters-DO1Is_tI.mjs +4 -0
  62. package/dist/firewall-DbUhVTCg.mjs +11 -0
  63. package/dist/fraud-Bzr4njYb.mjs +8 -0
  64. package/dist/google-tag-gateway-BQxkA90M.mjs +2 -0
  65. package/dist/healthchecks-BBAs-lS_.mjs +4 -0
  66. package/dist/hostnames-Dz9PEUKS.mjs +3 -0
  67. package/dist/hyperdrive-B1iUJddG.mjs +18 -0
  68. package/dist/iam-CJM8gHpG.mjs +6 -0
  69. package/dist/images-DEoBmtFS.mjs +5 -0
  70. package/dist/index.mjs +1 -1
  71. package/dist/input-validation-zEO81MWN.mjs +2 -0
  72. package/dist/intel-BM6xkZ0C.mjs +3 -0
  73. package/dist/ips-B8fwxKZD.mjs +2 -0
  74. package/dist/keyless-certificates-DffYnd4b.mjs +3 -0
  75. package/dist/kv-BTceLtWZ.mjs +5 -0
  76. package/dist/leaked-credential-checks-CALfvoCo.mjs +3 -0
  77. package/dist/lib-Eu1wXxuh.mjs +68 -0
  78. package/dist/load-balancers-C1Ho1gCF.mjs +6 -0
  79. package/dist/local-VJaJ3BZ1.mjs +2 -0
  80. package/dist/logpush-CSYhgevA.mjs +4 -0
  81. package/dist/logs-DlIwmMpt.mjs +3 -0
  82. package/dist/magic-cloud-networking-Czu0pZ0a.mjs +5 -0
  83. package/dist/magic-network-monitoring-d7GJE5Yt.mjs +4 -0
  84. package/dist/magic-transit-qQmA-981.mjs +89 -0
  85. package/dist/managed-transforms-Dd6AnbWE.mjs +3 -0
  86. package/dist/mtls-certificates-C0rlCRGs.mjs +3 -0
  87. package/dist/network-interconnects-CxG2deY0.mjs +36 -0
  88. package/dist/organizations-DyEAiGiR.mjs +41 -0
  89. package/dist/origin-ca-certificates-S8RcoMF6.mjs +3 -0
  90. package/dist/origin-post-quantum-encryption-B8ZcpLu5.mjs +2 -0
  91. package/dist/origin-tls-client-auth-BlxMmQrE.mjs +5 -0
  92. package/dist/{output-CqGQp2r6.mjs → output-D7_yAFVR.mjs} +1 -1
  93. package/dist/page-rules-DP-w6TAm.mjs +18 -0
  94. package/dist/page-shield-Bf7kFp8c.mjs +37 -0
  95. package/dist/pages-D0Y_XRqW.mjs +10 -0
  96. package/dist/pipelines-C-SPESAk.mjs +6 -0
  97. package/dist/progress-CjcQ6ato.mjs +2 -0
  98. package/dist/queues-wv6CZsi8.mjs +6 -0
  99. package/dist/r2-DuXjp9n5.mjs +21 -0
  100. package/dist/r2-data-catalog-DQCMrmNO.mjs +14 -0
  101. package/dist/radar-BW_ZHP8X.mjs +2 -0
  102. package/dist/rate-limits-DLTkIvwr.mjs +5 -0
  103. package/dist/raw-fetch-hRv-6P3D.mjs +2 -0
  104. package/dist/realtime-kit-Ch7Vg3vj.mjs +6 -0
  105. package/dist/registrar-DIIv6fWd.mjs +46 -0
  106. package/dist/request-tracers-DMej0Drs.mjs +2 -0
  107. package/dist/resolve-BuJRWSk0.mjs +2 -0
  108. package/dist/resource-sharing-CYJ7cMWq.mjs +5 -0
  109. package/dist/resource-tagging-Dnz65MgH.mjs +16 -0
  110. package/dist/rules-DLJpOYbC.mjs +4 -0
  111. package/dist/rulesets-D9nqEJT5.mjs +8 -0
  112. package/dist/rum-DBVmdPkp.mjs +4 -0
  113. package/dist/{schema-qJlCfmo8.mjs → schema-CHBfkARI.mjs} +1 -1
  114. package/dist/schema-validation-MCd3xdtX.mjs +4 -0
  115. package/dist/scim-DZA3VXog.mjs +3 -0
  116. package/dist/{scm-C872x0C2.mjs → scm-CilfPOue.mjs} +1 -1
  117. package/dist/secrets-store-BrvcZSOM.mjs +21 -0
  118. package/dist/security-center-BU6f3Cm1.mjs +2 -0
  119. package/dist/security-txt-BPIbP3dG.mjs +3 -0
  120. package/dist/session-H7IV2BrM.mjs +2 -0
  121. package/dist/shared-DEzmTsEC.mjs +2 -0
  122. package/dist/smart-shield-e8XFBkiF.mjs +3 -0
  123. package/dist/snippets-B4M3MMb8.mjs +4 -0
  124. package/dist/spawn-13QQ0IwO.mjs +10 -0
  125. package/dist/spectrum-B0adfSRI.mjs +59 -0
  126. package/dist/speed-BVcUtkAz.mjs +4 -0
  127. package/dist/src-B9cKsgsg.mjs +108 -0
  128. package/dist/ssl-BAa91gsc.mjs +15 -0
  129. package/dist/stream-D53sxKb3.mjs +14 -0
  130. package/dist/tenants-bH5pt3dJ.mjs +2 -0
  131. package/dist/{theme-BKCxTQTe.mjs → theme-BklJDrb2.mjs} +2 -2
  132. package/dist/token-validation-M61Vx_Tw.mjs +4 -0
  133. package/dist/{tools-CawscCBu.mjs → tools-B7QiNu-d.mjs} +1 -1
  134. package/dist/turnstile-wAU0Gc2Z.mjs +23 -0
  135. package/dist/{ui-Dj3No2vN.mjs → ui-BXjU1dX1.mjs} +1 -1
  136. package/dist/url-normalization-DZrWDgB5.mjs +3 -0
  137. package/dist/url-scanner-Zo49edNp.mjs +2 -0
  138. package/dist/user-DbXlVReB.mjs +10 -0
  139. package/dist/vectorize-CUnTM0DT.mjs +4 -0
  140. package/dist/versions-DzyrlUAi.mjs +2 -0
  141. package/dist/{vuln-scanner-B1VwCIko.mjs → vuln-scanner-Br_2lQp1.mjs} +1 -1
  142. package/dist/waiting-rooms-BZW0X69-.mjs +11 -0
  143. package/dist/web3-DueyOQtx.mjs +4 -0
  144. package/dist/workers-builds-BM_aoeUR.mjs +7 -0
  145. package/dist/workers-nV_vBCfV.mjs +16 -0
  146. package/dist/workflows-CQITmo-s.mjs +4 -0
  147. package/dist/zaraz-DIbpF5Op.mjs +2 -0
  148. package/dist/zero-trust-CKp8j512.mjs +119 -0
  149. package/dist/zones-BZ5tZDbH.mjs +28 -0
  150. package/package.json +13 -3
  151. package/dist/abuse-reports-DR0yMg-Q.mjs +0 -2
  152. package/dist/accounts-BjGtCB8T.mjs +0 -6
  153. package/dist/acm-h4YPDN7k.mjs +0 -3
  154. package/dist/addressing-BiEnQ1o1.mjs +0 -11
  155. package/dist/ai-BPln2Yka.mjs +0 -2
  156. package/dist/ai-gateway-DgD9nKyd.mjs +0 -8
  157. package/dist/ai-search-EjrONI5a.mjs +0 -7
  158. package/dist/alerting-CPWMKr-m.mjs +0 -6
  159. package/dist/analytics-3dX9-scQ.mjs +0 -2
  160. package/dist/api-gateway-7FKFHdI-.mjs +0 -9
  161. package/dist/argo-Dxz9P37E.mjs +0 -2
  162. package/dist/audit-logs-D_Xw5x8Y.mjs +0 -2
  163. package/dist/auth-BHD_B2p9.mjs +0 -277
  164. package/dist/auth-caVo2j1K.mjs +0 -6
  165. package/dist/autorag-D7nMweNF.mjs +0 -2
  166. package/dist/billing-yaIBp1Xq.mjs +0 -2
  167. package/dist/body-parser-iA3vRFmh.mjs +0 -2
  168. package/dist/bot-management-C0H6U0t4.mjs +0 -2
  169. package/dist/botnet-feed-BXV9GVwF.mjs +0 -3
  170. package/dist/brand-protection-CI0NQa_l.mjs +0 -3
  171. package/dist/browser-rendering-DnKNRJJe.mjs +0 -4
  172. package/dist/cache-B6M_pm_D.mjs +0 -5
  173. package/dist/calls-C5XCC0i1.mjs +0 -4
  174. package/dist/certificate-authorities-BQuHL4dm.mjs +0 -2
  175. package/dist/client-certificates-CwpzEnCT.mjs +0 -3
  176. package/dist/cloud-connector-CU3PLNLe.mjs +0 -2
  177. package/dist/cloudforce-one-DzrArr1o.mjs +0 -21
  178. package/dist/config-BmTd_qeU.mjs +0 -2
  179. package/dist/connectivity-C4tXPkW_.mjs +0 -3
  180. package/dist/content-scanning-CH_YXdlZ.mjs +0 -4
  181. package/dist/context-6lBIck1r.mjs +0 -2
  182. package/dist/custom-certificates-pllRyU2y.mjs +0 -3
  183. package/dist/custom-hostnames-GmF0DfYA.mjs +0 -5
  184. package/dist/custom-nameservers-DPVHUlUQ.mjs +0 -3
  185. package/dist/custom-pages-XWwfn7hV.mjs +0 -4
  186. package/dist/d1-c_zhZGWf.mjs +0 -3
  187. package/dist/dcv-delegation-pXpU48A8.mjs +0 -2
  188. package/dist/dev-Bu26u5Jm.mjs +0 -14
  189. package/dist/diagnostics-BU07Jnku.mjs +0 -3
  190. package/dist/dispatch-namespaces-D_Kq_2gX.mjs +0 -7
  191. package/dist/dns-CrvIxztB.mjs +0 -11
  192. package/dist/dns-firewall-CLtGAQ9x.mjs +0 -3
  193. package/dist/dry-run-FV0pZwdg.mjs +0 -2
  194. package/dist/durable-objects-Y5rLFSQX.mjs +0 -2
  195. package/dist/email-routing-CxU5JlXT.mjs +0 -10
  196. package/dist/email-security-CnpAHWpj.mjs +0 -8
  197. package/dist/email-sending-MeCKsktR.mjs +0 -3
  198. package/dist/filters-Sx2Po1UP.mjs +0 -4
  199. package/dist/firewall-B0_012XO.mjs +0 -9
  200. package/dist/fraud-CG0G_VG-.mjs +0 -2
  201. package/dist/google-tag-gateway-BLbj1y3h.mjs +0 -2
  202. package/dist/healthchecks-C0LgExxa.mjs +0 -4
  203. package/dist/hostnames-D4K6s9EX.mjs +0 -3
  204. package/dist/hyperdrive-D7XvTRys.mjs +0 -3
  205. package/dist/iam-4LhJianW.mjs +0 -6
  206. package/dist/images-BqXyIycX.mjs +0 -5
  207. package/dist/input-validation-BpVQi9rR.mjs +0 -2
  208. package/dist/intel-CiO3Sy4x.mjs +0 -3
  209. package/dist/ips-DLuGN7Mr.mjs +0 -2
  210. package/dist/keyless-certificates-x-87T5SM.mjs +0 -3
  211. package/dist/kv-CVYCrk7L.mjs +0 -5
  212. package/dist/leaked-credential-checks-FvhVCL23.mjs +0 -3
  213. package/dist/load-balancers-cxodJuI2.mjs +0 -6
  214. package/dist/local-OqhVQbv0.mjs +0 -2
  215. package/dist/logpush-BX7z2xWz.mjs +0 -4
  216. package/dist/logs-C7vxr6Kp.mjs +0 -3
  217. package/dist/magic-cloud-networking-C3grROf-.mjs +0 -5
  218. package/dist/magic-network-monitoring-DiZ5ZXxh.mjs +0 -4
  219. package/dist/magic-transit-troGMFb9.mjs +0 -30
  220. package/dist/managed-transforms-B5w_LlVN.mjs +0 -3
  221. package/dist/mtls-certificates-C1S9MciH.mjs +0 -3
  222. package/dist/network-interconnects-CVSiv1fF.mjs +0 -4
  223. package/dist/organizations-BtlEchi-.mjs +0 -4
  224. package/dist/origin-ca-certificates-0XCi4dO6.mjs +0 -3
  225. package/dist/origin-post-quantum-encryption-CTvkdYDG.mjs +0 -2
  226. package/dist/origin-tls-client-auth-qAvRD1BQ.mjs +0 -5
  227. package/dist/page-rules-CcMmrvY4.mjs +0 -3
  228. package/dist/page-shield-Dxh4bJ-w.mjs +0 -3
  229. package/dist/pages-F1vdzqgC.mjs +0 -6
  230. package/dist/pipelines-DsF1HHMY.mjs +0 -6
  231. package/dist/progress-5sHFvwez.mjs +0 -2
  232. package/dist/queues-BuvkxFPX.mjs +0 -6
  233. package/dist/r2-Du-fgHiT.mjs +0 -9
  234. package/dist/r2-data-catalog-BUiMNSwc.mjs +0 -3
  235. package/dist/radar-C0eqNmWR.mjs +0 -2
  236. package/dist/rate-limits-CUv2cxXV.mjs +0 -3
  237. package/dist/raw-fetch-CxFs4i0R.mjs +0 -2
  238. package/dist/realtime-kit-C-jix3I_.mjs +0 -6
  239. package/dist/registrar-B7V7i89n.mjs +0 -2
  240. package/dist/request-tracers-D2V7QUrC.mjs +0 -2
  241. package/dist/resolve-GtphSYWh.mjs +0 -2
  242. package/dist/resource-sharing-BgH0w9wm.mjs +0 -5
  243. package/dist/resource-tagging-BOknFugv.mjs +0 -4
  244. package/dist/rolldown-runtime-CR7SCCRW.mjs +0 -2
  245. package/dist/rules-DzJFHGW1.mjs +0 -4
  246. package/dist/rulesets-BzI1dUiq.mjs +0 -8
  247. package/dist/rum-CQ_rJ96u.mjs +0 -4
  248. package/dist/schema-validation-TmikfxS9.mjs +0 -4
  249. package/dist/scim-ByZ5kqXS.mjs +0 -3
  250. package/dist/secrets-store-D7HL4VXw.mjs +0 -8
  251. package/dist/security-center-OUrILUnx.mjs +0 -2
  252. package/dist/security-txt-Ca13oCJ8.mjs +0 -3
  253. package/dist/session-Dxi_LbAk.mjs +0 -2
  254. package/dist/smart-shield-foPT0J9L.mjs +0 -3
  255. package/dist/snippets-FDPiBMWc.mjs +0 -4
  256. package/dist/spectrum-DPoh_BPx.mjs +0 -3
  257. package/dist/speed-BuEappVX.mjs +0 -4
  258. package/dist/src-D8_cWUwt.mjs +0 -104
  259. package/dist/ssl-bJbzEoRv.mjs +0 -3
  260. package/dist/stream-DuYGiGk6.mjs +0 -13
  261. package/dist/tenants-BYqEutrr.mjs +0 -2
  262. package/dist/token-validation-DwmtbWUB.mjs +0 -4
  263. package/dist/turnstile-Dy91RVTn.mjs +0 -3
  264. package/dist/url-normalization-DoD9iHWH.mjs +0 -3
  265. package/dist/url-scanner-qwL64FIo.mjs +0 -2
  266. package/dist/user-Cduf3VRi.mjs +0 -7
  267. package/dist/vectorize-CMLobU9V.mjs +0 -4
  268. package/dist/waiting-rooms-B4-IAJeT.mjs +0 -5
  269. package/dist/web3-Bcx68Kq3.mjs +0 -4
  270. package/dist/workers-D5fOQsUA.mjs +0 -16
  271. package/dist/workers-builds-2kdzxjlN.mjs +0 -7
  272. package/dist/workflows-qFD80noW.mjs +0 -4
  273. package/dist/zaraz-C0iJimA4.mjs +0 -2
  274. package/dist/zero-trust-Btix6zOy.mjs +0 -73
  275. package/dist/zones-Nu3wMtds.mjs +0 -5
  276. /package/dist/{metadata-DhSO1vle.mjs → metadata-DGdCpUxn.mjs} +0 -0
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import{C as e,T as t,h as n,t as r,x as i}from"./auth-CQcAgnOy.mjs";import{n as a,t as o}from"./body-parser-Br-BoYk-.mjs";import{t as s}from"./output-D7_yAFVR.mjs";import{n as c,t as l}from"./progress-CjcQ6ato.mjs";import{n as u,t as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
3
+ When disabled, no deployments (production or preview) will be triggered automatically.
4
+ `}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].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 --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-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 --source-* flag is set`)}return!0})}const m={command:`create`,describe:`Create a new project.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:{"build-config-build-caching":e[`build-config-build-caching`],"build-config-build-command":e[`build-config-build-command`],"build-config-destination-dir":e[`build-config-destination-dir`],"build-config-root-dir":e[`build-config-root-dir`],"build-config-web-analytics-tag":e[`build-config-web-analytics-tag`],"build-config-web-analytics-token":e[`build-config-web-analytics-token`],"deployment-configs-preview-always-use-latest-compatibility-date":e[`deployment-configs-preview-always-use-latest-compatibility-date`],"deployment-configs-preview-build-image-major-version":e[`deployment-configs-preview-build-image-major-version`],"deployment-configs-preview-compatibility-date":e[`deployment-configs-preview-compatibility-date`],"deployment-configs-preview-compatibility-flags":e[`deployment-configs-preview-compatibility-flags`],"deployment-configs-preview-fail-open":e[`deployment-configs-preview-fail-open`],"deployment-configs-preview-limits-cpu-ms":e[`deployment-configs-preview-limits-cpu-ms`],"deployment-configs-preview-placement-mode":e[`deployment-configs-preview-placement-mode`],"deployment-configs-preview-usage-model":e[`deployment-configs-preview-usage-model`],"deployment-configs-preview-wrangler-config-hash":e[`deployment-configs-preview-wrangler-config-hash`],"deployment-configs-production-always-use-latest-compatibility-date":e[`deployment-configs-production-always-use-latest-compatibility-date`],"deployment-configs-production-build-image-major-version":e[`deployment-configs-production-build-image-major-version`],"deployment-configs-production-compatibility-date":e[`deployment-configs-production-compatibility-date`],"deployment-configs-production-compatibility-flags":e[`deployment-configs-production-compatibility-flags`],"deployment-configs-production-fail-open":e[`deployment-configs-production-fail-open`],"deployment-configs-production-limits-cpu-ms":e[`deployment-configs-production-limits-cpu-ms`],"deployment-configs-production-placement-mode":e[`deployment-configs-production-placement-mode`],"deployment-configs-production-usage-model":e[`deployment-configs-production-usage-model`],"deployment-configs-production-wrangler-config-hash":e[`deployment-configs-production-wrangler-config-hash`],name:e.name,"production-branch":e[`production-branch`],"source-config-deployments-enabled":e[`source-config-deployments-enabled`],"source-config-owner":e[`source-config-owner`],"source-config-owner-id":e[`source-config-owner-id`],"source-config-path-excludes":e[`source-config-path-excludes`],"source-config-path-includes":e[`source-config-path-includes`],"source-config-pr-comments-enabled":e[`source-config-pr-comments-enabled`],"source-config-preview-branch-excludes":e[`source-config-preview-branch-excludes`],"source-config-preview-branch-includes":e[`source-config-preview-branch-includes`],"source-config-preview-deployment-setting":e[`source-config-preview-deployment-setting`],"source-config-production-branch":e[`source-config-production-branch`],"source-config-production-deployments-enabled":e[`source-config-production-deployments-enabled`],"source-config-repo-id":e[`source-config-repo-id`],"source-config-repo-name":e[`source-config-repo-name`],"source-type":e[`source-type`],body:e.body}});return}let d=await r(e),p=e.local?f:await n(d);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Name of the project.`)),e[`production-branch`]===void 0&&(e[`production-branch`]=await t(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m={};e[`build-config-build-caching`]!==void 0&&a(m,[`build_config`,`build_caching`],e[`build-config-build-caching`]),e[`build-config-build-command`]!==void 0&&a(m,[`build_config`,`build_command`],u(e[`build-config-build-command`],`build-config-build-command`,`text`)),e[`build-config-destination-dir`]!==void 0&&a(m,[`build_config`,`destination_dir`],u(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`)),e[`build-config-root-dir`]!==void 0&&a(m,[`build_config`,`root_dir`],u(e[`build-config-root-dir`],`build-config-root-dir`,`text`)),e[`build-config-web-analytics-tag`]!==void 0&&a(m,[`build_config`,`web_analytics_tag`],u(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`)),e[`build-config-web-analytics-token`]!==void 0&&a(m,[`build_config`,`web_analytics_token`],u(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)),e[`deployment-configs-preview-always-use-latest-compatibility-date`]!==void 0&&a(m,[`deployment_configs`,`preview`,`always_use_latest_compatibility_date`],e[`deployment-configs-preview-always-use-latest-compatibility-date`]),e[`deployment-configs-preview-build-image-major-version`]!==void 0&&a(m,[`deployment_configs`,`preview`,`build_image_major_version`],e[`deployment-configs-preview-build-image-major-version`]),e[`deployment-configs-preview-compatibility-date`]!==void 0&&a(m,[`deployment_configs`,`preview`,`compatibility_date`],u(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`)),e[`deployment-configs-preview-compatibility-flags`]!==void 0&&a(m,[`deployment_configs`,`preview`,`compatibility_flags`],e[`deployment-configs-preview-compatibility-flags`]),e[`deployment-configs-preview-fail-open`]!==void 0&&a(m,[`deployment_configs`,`preview`,`fail_open`],e[`deployment-configs-preview-fail-open`]),e[`deployment-configs-preview-limits-cpu-ms`]!==void 0&&a(m,[`deployment_configs`,`preview`,`limits`,`cpu_ms`],e[`deployment-configs-preview-limits-cpu-ms`]),e[`deployment-configs-preview-placement-mode`]!==void 0&&a(m,[`deployment_configs`,`preview`,`placement`,`mode`],u(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)),e[`deployment-configs-preview-usage-model`]!==void 0&&a(m,[`deployment_configs`,`preview`,`usage_model`],u(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`)),e[`deployment-configs-preview-wrangler-config-hash`]!==void 0&&a(m,[`deployment_configs`,`preview`,`wrangler_config_hash`],u(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)),e[`deployment-configs-production-always-use-latest-compatibility-date`]!==void 0&&a(m,[`deployment_configs`,`production`,`always_use_latest_compatibility_date`],e[`deployment-configs-production-always-use-latest-compatibility-date`]),e[`deployment-configs-production-build-image-major-version`]!==void 0&&a(m,[`deployment_configs`,`production`,`build_image_major_version`],e[`deployment-configs-production-build-image-major-version`]),e[`deployment-configs-production-compatibility-date`]!==void 0&&a(m,[`deployment_configs`,`production`,`compatibility_date`],u(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`)),e[`deployment-configs-production-compatibility-flags`]!==void 0&&a(m,[`deployment_configs`,`production`,`compatibility_flags`],e[`deployment-configs-production-compatibility-flags`]),e[`deployment-configs-production-fail-open`]!==void 0&&a(m,[`deployment_configs`,`production`,`fail_open`],e[`deployment-configs-production-fail-open`]),e[`deployment-configs-production-limits-cpu-ms`]!==void 0&&a(m,[`deployment_configs`,`production`,`limits`,`cpu_ms`],e[`deployment-configs-production-limits-cpu-ms`]),e[`deployment-configs-production-placement-mode`]!==void 0&&a(m,[`deployment_configs`,`production`,`placement`,`mode`],u(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)),e[`deployment-configs-production-usage-model`]!==void 0&&a(m,[`deployment_configs`,`production`,`usage_model`],u(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`)),e[`deployment-configs-production-wrangler-config-hash`]!==void 0&&a(m,[`deployment_configs`,`production`,`wrangler_config_hash`],u(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)),e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),e[`production-branch`]!==void 0&&a(m,[`production_branch`],u(e[`production-branch`],`production-branch`,`text`)),e[`source-config-deployments-enabled`]!==void 0&&a(m,[`source`,`config`,`deployments_enabled`],e[`source-config-deployments-enabled`]),e[`source-config-owner`]!==void 0&&a(m,[`source`,`config`,`owner`],u(e[`source-config-owner`],`source-config-owner`,`text`)),e[`source-config-owner-id`]!==void 0&&a(m,[`source`,`config`,`owner_id`],u(e[`source-config-owner-id`],`source-config-owner-id`,`text`)),e[`source-config-path-excludes`]!==void 0&&a(m,[`source`,`config`,`path_excludes`],e[`source-config-path-excludes`]),e[`source-config-path-includes`]!==void 0&&a(m,[`source`,`config`,`path_includes`],e[`source-config-path-includes`]),e[`source-config-pr-comments-enabled`]!==void 0&&a(m,[`source`,`config`,`pr_comments_enabled`],e[`source-config-pr-comments-enabled`]),e[`source-config-preview-branch-excludes`]!==void 0&&a(m,[`source`,`config`,`preview_branch_excludes`],e[`source-config-preview-branch-excludes`]),e[`source-config-preview-branch-includes`]!==void 0&&a(m,[`source`,`config`,`preview_branch_includes`],e[`source-config-preview-branch-includes`]),e[`source-config-preview-deployment-setting`]!==void 0&&a(m,[`source`,`config`,`preview_deployment_setting`],u(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`)),e[`source-config-production-branch`]!==void 0&&a(m,[`source`,`config`,`production_branch`],u(e[`source-config-production-branch`],`source-config-production-branch`,`text`)),e[`source-config-production-deployments-enabled`]!==void 0&&a(m,[`source`,`config`,`production_deployments_enabled`],e[`source-config-production-deployments-enabled`]),e[`source-config-repo-id`]!==void 0&&a(m,[`source`,`config`,`repo_id`],u(e[`source-config-repo-id`],`source-config-repo-id`,`text`)),e[`source-config-repo-name`]!==void 0&&a(m,[`source`,`config`,`repo_name`],u(e[`source-config-repo-name`],`source-config-repo-name`,`text`)),e[`source-type`]!==void 0&&a(m,[`source`,`type`],u(e[`source-type`],`source-type`,`text`)),s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function h(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 g={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let a=await r(t),o=t.local?f:await n(a);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
5
+ `);return}s(await l(`Deleting`,async()=>a.pages.projects.delete(t[`project-name`],o)),{successLabel:`Deleted`})}};function _(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const v={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:_,handler:async e=>{if(e.dryRun){c({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,branch:e.branch,"commit-dirty":e[`commit-dirty`],"commit-hash":e[`commit-hash`],"commit-message":e[`commit-message`],manifest:e.manifest,"pages-build-output-dir":e[`pages-build-output-dir`],"wrangler-config-hash":e[`wrangler-config-hash`]}});return}let t=await r(e),a=e.local?f:await n(t);if(e.accountId=a,e.file!==void 0||e.body!==void 0||e.branch!==void 0||e[`commit-dirty`]!==void 0||e[`commit-hash`]!==void 0||e[`commit-message`]!==void 0||e.manifest!==void 0||e[`pages-build-output-dir`]!==void 0||e[`wrangler-config-hash`]!==void 0){let n=new FormData;if(e.file){let t=d(e.file);n.append(`_headers`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`_headers`,e.body);e.branch!==void 0&&n.append(`branch`,String(u(e.branch,`branch`,`text`)??``)),e[`commit-dirty`]!==void 0&&n.append(`commit_dirty`,String(u(e[`commit-dirty`],`commit-dirty`,`text`)??``)),e[`commit-hash`]!==void 0&&n.append(`commit_hash`,String(u(e[`commit-hash`],`commit-hash`,`text`)??``)),e[`commit-message`]!==void 0&&n.append(`commit_message`,String(u(e[`commit-message`],`commit-message`,`text`)??``)),e.manifest!==void 0&&n.append(`manifest`,String(u(e.manifest,`manifest`,`text`)??``)),e[`pages-build-output-dir`]!==void 0&&n.append(`pages_build_output_dir`,String(u(e[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),e[`wrangler-config-hash`]!==void 0&&n.append(`wrangler_config_hash`,String(u(e[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),s(await l(`Creating`,async()=>t.post(`/accounts/${a}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=u(e.body,`body`,`binary`);s(await l(`Creating`,async()=>t.post(`/accounts/${a}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/deployments`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function y(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:y,handler:async t=>{let a={force:t.force};if(t.dryRun){c({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/deployments/${t[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(t[`deployment-id`]))}`,pathParams:{"deployment-id":String(t[`deployment-id`]??``),"project-name":String(t[`project-name`]??``)},query:a,bodyKind:`none`});return}let o=await r(t),u=t.local?f:await n(o);if(t.accountId=u,!await e({force:!!t.force})){process.stderr.write(`Aborted.
6
+ `);return}s(await l(`Deleting`,async()=>o.pages.projects.deployments.delete(t[`deployment-id`],t[`project-name`],u,a)),{successLabel:`Deleted`})}};function x(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.pages.projects.deployments.get(e[`deployment-id`],e[`project-name`],a)),{successLabel:`Loaded`})}};function C(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:C,handler:async e=>{if(e.dryRun){c({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.pages.projects.deployments.history.logs.get(e[`deployment-id`],e[`project-name`],a)),{successLabel:`Loaded`})}},T={command:`logs`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Fetch a list of project deployments.`,builder:D,handler:async e=>{let t={env:e.env,page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments`,pathParams:{"project-name":String(e[`project-name`]??``)},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?f:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.pages.projects.deployments.list(e[`project-name`],o,t)),{successLabel:`Loaded`})}};function k(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:k,handler:async e=>{if(e.dryRun){c({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Creating`,async()=>t.pages.projects.deployments.retry(e[`deployment-id`],e[`project-name`],a)),{successLabel:`Created`})}};function j(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(e[`deployment-id`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Creating`,async()=>t.pages.projects.deployments.rollback(e[`deployment-id`],e[`project-name`],a)),{successLabel:`Created`})}},M={command:`deployments`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(v).command(b).command(S).command(O).command(A).command(ee).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:{name:e.name,body:e.body}});return}let d=await r(e),p=e.local?f:await n(d);if(e.accountId=p,e.body){let t=o(e.body);s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/domains`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The domain name.`));let m={};e.name!==void 0&&a(m,[`name`],u(e.name,`name`,`text`)),s(await l(`Creating`,async()=>d.post(`/accounts/${p}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}/domains`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function F(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,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 I={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:F,handler:async t=>{if(t.dryRun){c({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/domains/${t[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(t[`domain-name`]))}`,pathParams:{"domain-name":String(t[`domain-name`]??``),"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let a=await r(t),o=t.local?f:await n(a);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
7
+ `);return}s(await l(`Deleting`,async()=>a.pages.projects.domains.delete(t[`domain-name`],t[`project-name`],o)),{successLabel:`Deleted`})}};function L(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:L,handler:async e=>{if(e.dryRun){c({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Updating`,async()=>t.pages.projects.domains.edit(e[`domain-name`],e[`project-name`],a)),{successLabel:`Updated`})}};function z(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:z,handler:async e=>{if(e.dryRun){c({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``),"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.pages.projects.domains.get(e[`domain-name`],e[`project-name`],a)),{successLabel:`Loaded`})}};function V(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}/domains`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.pages.projects.domains.list(e[`project-name`],a)),{successLabel:`Loaded`})}},U={command:`domains`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
8
+ When disabled, no deployments (production or preview) will be triggered automatically.
9
+ `}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].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 --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-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 --source-* flag is set`)}return!0})}const G={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:W,handler:async e=>{if(e.dryRun){c({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`json`,body:{"build-config-build-caching":e[`build-config-build-caching`],"build-config-build-command":e[`build-config-build-command`],"build-config-destination-dir":e[`build-config-destination-dir`],"build-config-root-dir":e[`build-config-root-dir`],"build-config-web-analytics-tag":e[`build-config-web-analytics-tag`],"build-config-web-analytics-token":e[`build-config-web-analytics-token`],"deployment-configs-preview-always-use-latest-compatibility-date":e[`deployment-configs-preview-always-use-latest-compatibility-date`],"deployment-configs-preview-build-image-major-version":e[`deployment-configs-preview-build-image-major-version`],"deployment-configs-preview-compatibility-date":e[`deployment-configs-preview-compatibility-date`],"deployment-configs-preview-compatibility-flags":e[`deployment-configs-preview-compatibility-flags`],"deployment-configs-preview-fail-open":e[`deployment-configs-preview-fail-open`],"deployment-configs-preview-limits-cpu-ms":e[`deployment-configs-preview-limits-cpu-ms`],"deployment-configs-preview-placement-mode":e[`deployment-configs-preview-placement-mode`],"deployment-configs-preview-usage-model":e[`deployment-configs-preview-usage-model`],"deployment-configs-preview-wrangler-config-hash":e[`deployment-configs-preview-wrangler-config-hash`],"deployment-configs-production-always-use-latest-compatibility-date":e[`deployment-configs-production-always-use-latest-compatibility-date`],"deployment-configs-production-build-image-major-version":e[`deployment-configs-production-build-image-major-version`],"deployment-configs-production-compatibility-date":e[`deployment-configs-production-compatibility-date`],"deployment-configs-production-compatibility-flags":e[`deployment-configs-production-compatibility-flags`],"deployment-configs-production-fail-open":e[`deployment-configs-production-fail-open`],"deployment-configs-production-limits-cpu-ms":e[`deployment-configs-production-limits-cpu-ms`],"deployment-configs-production-placement-mode":e[`deployment-configs-production-placement-mode`],"deployment-configs-production-usage-model":e[`deployment-configs-production-usage-model`],"deployment-configs-production-wrangler-config-hash":e[`deployment-configs-production-wrangler-config-hash`],name:e.name,"production-branch":e[`production-branch`],"source-config-deployments-enabled":e[`source-config-deployments-enabled`],"source-config-owner":e[`source-config-owner`],"source-config-owner-id":e[`source-config-owner-id`],"source-config-path-excludes":e[`source-config-path-excludes`],"source-config-path-includes":e[`source-config-path-includes`],"source-config-pr-comments-enabled":e[`source-config-pr-comments-enabled`],"source-config-preview-branch-excludes":e[`source-config-preview-branch-excludes`],"source-config-preview-branch-includes":e[`source-config-preview-branch-includes`],"source-config-preview-deployment-setting":e[`source-config-preview-deployment-setting`],"source-config-production-branch":e[`source-config-production-branch`],"source-config-production-deployments-enabled":e[`source-config-production-deployments-enabled`],"source-config-repo-id":e[`source-config-repo-id`],"source-config-repo-name":e[`source-config-repo-name`],"source-type":e[`source-type`],body:e.body}});return}let t=await r(e),d=e.local?f:await n(t);if(e.accountId=d,e.body){let n=o(e.body);s(await l(`Updating`,async()=>t.patch(`/accounts/${d}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e[`build-config-build-caching`]!==void 0&&a(p,[`build_config`,`build_caching`],e[`build-config-build-caching`]),e[`build-config-build-command`]!==void 0&&a(p,[`build_config`,`build_command`],u(e[`build-config-build-command`],`build-config-build-command`,`text`)),e[`build-config-destination-dir`]!==void 0&&a(p,[`build_config`,`destination_dir`],u(e[`build-config-destination-dir`],`build-config-destination-dir`,`text`)),e[`build-config-root-dir`]!==void 0&&a(p,[`build_config`,`root_dir`],u(e[`build-config-root-dir`],`build-config-root-dir`,`text`)),e[`build-config-web-analytics-tag`]!==void 0&&a(p,[`build_config`,`web_analytics_tag`],u(e[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`)),e[`build-config-web-analytics-token`]!==void 0&&a(p,[`build_config`,`web_analytics_token`],u(e[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)),e[`deployment-configs-preview-always-use-latest-compatibility-date`]!==void 0&&a(p,[`deployment_configs`,`preview`,`always_use_latest_compatibility_date`],e[`deployment-configs-preview-always-use-latest-compatibility-date`]),e[`deployment-configs-preview-build-image-major-version`]!==void 0&&a(p,[`deployment_configs`,`preview`,`build_image_major_version`],e[`deployment-configs-preview-build-image-major-version`]),e[`deployment-configs-preview-compatibility-date`]!==void 0&&a(p,[`deployment_configs`,`preview`,`compatibility_date`],u(e[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`)),e[`deployment-configs-preview-compatibility-flags`]!==void 0&&a(p,[`deployment_configs`,`preview`,`compatibility_flags`],e[`deployment-configs-preview-compatibility-flags`]),e[`deployment-configs-preview-fail-open`]!==void 0&&a(p,[`deployment_configs`,`preview`,`fail_open`],e[`deployment-configs-preview-fail-open`]),e[`deployment-configs-preview-limits-cpu-ms`]!==void 0&&a(p,[`deployment_configs`,`preview`,`limits`,`cpu_ms`],e[`deployment-configs-preview-limits-cpu-ms`]),e[`deployment-configs-preview-placement-mode`]!==void 0&&a(p,[`deployment_configs`,`preview`,`placement`,`mode`],u(e[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)),e[`deployment-configs-preview-usage-model`]!==void 0&&a(p,[`deployment_configs`,`preview`,`usage_model`],u(e[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`)),e[`deployment-configs-preview-wrangler-config-hash`]!==void 0&&a(p,[`deployment_configs`,`preview`,`wrangler_config_hash`],u(e[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)),e[`deployment-configs-production-always-use-latest-compatibility-date`]!==void 0&&a(p,[`deployment_configs`,`production`,`always_use_latest_compatibility_date`],e[`deployment-configs-production-always-use-latest-compatibility-date`]),e[`deployment-configs-production-build-image-major-version`]!==void 0&&a(p,[`deployment_configs`,`production`,`build_image_major_version`],e[`deployment-configs-production-build-image-major-version`]),e[`deployment-configs-production-compatibility-date`]!==void 0&&a(p,[`deployment_configs`,`production`,`compatibility_date`],u(e[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`)),e[`deployment-configs-production-compatibility-flags`]!==void 0&&a(p,[`deployment_configs`,`production`,`compatibility_flags`],e[`deployment-configs-production-compatibility-flags`]),e[`deployment-configs-production-fail-open`]!==void 0&&a(p,[`deployment_configs`,`production`,`fail_open`],e[`deployment-configs-production-fail-open`]),e[`deployment-configs-production-limits-cpu-ms`]!==void 0&&a(p,[`deployment_configs`,`production`,`limits`,`cpu_ms`],e[`deployment-configs-production-limits-cpu-ms`]),e[`deployment-configs-production-placement-mode`]!==void 0&&a(p,[`deployment_configs`,`production`,`placement`,`mode`],u(e[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)),e[`deployment-configs-production-usage-model`]!==void 0&&a(p,[`deployment_configs`,`production`,`usage_model`],u(e[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`)),e[`deployment-configs-production-wrangler-config-hash`]!==void 0&&a(p,[`deployment_configs`,`production`,`wrangler_config_hash`],u(e[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)),e.name!==void 0&&a(p,[`name`],u(e.name,`name`,`text`)),e[`production-branch`]!==void 0&&a(p,[`production_branch`],u(e[`production-branch`],`production-branch`,`text`)),e[`source-config-deployments-enabled`]!==void 0&&a(p,[`source`,`config`,`deployments_enabled`],e[`source-config-deployments-enabled`]),e[`source-config-owner`]!==void 0&&a(p,[`source`,`config`,`owner`],u(e[`source-config-owner`],`source-config-owner`,`text`)),e[`source-config-owner-id`]!==void 0&&a(p,[`source`,`config`,`owner_id`],u(e[`source-config-owner-id`],`source-config-owner-id`,`text`)),e[`source-config-path-excludes`]!==void 0&&a(p,[`source`,`config`,`path_excludes`],e[`source-config-path-excludes`]),e[`source-config-path-includes`]!==void 0&&a(p,[`source`,`config`,`path_includes`],e[`source-config-path-includes`]),e[`source-config-pr-comments-enabled`]!==void 0&&a(p,[`source`,`config`,`pr_comments_enabled`],e[`source-config-pr-comments-enabled`]),e[`source-config-preview-branch-excludes`]!==void 0&&a(p,[`source`,`config`,`preview_branch_excludes`],e[`source-config-preview-branch-excludes`]),e[`source-config-preview-branch-includes`]!==void 0&&a(p,[`source`,`config`,`preview_branch_includes`],e[`source-config-preview-branch-includes`]),e[`source-config-preview-deployment-setting`]!==void 0&&a(p,[`source`,`config`,`preview_deployment_setting`],u(e[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`)),e[`source-config-production-branch`]!==void 0&&a(p,[`source`,`config`,`production_branch`],u(e[`source-config-production-branch`],`source-config-production-branch`,`text`)),e[`source-config-production-deployments-enabled`]!==void 0&&a(p,[`source`,`config`,`production_deployments_enabled`],e[`source-config-production-deployments-enabled`]),e[`source-config-repo-id`]!==void 0&&a(p,[`source`,`config`,`repo_id`],u(e[`source-config-repo-id`],`source-config-repo-id`,`text`)),e[`source-config-repo-name`]!==void 0&&a(p,[`source`,`config`,`repo_name`],u(e[`source-config-repo-name`],`source-config-repo-name`,`text`)),e[`source-type`]!==void 0&&a(p,[`source`,`type`],u(e[`source-type`],`source-type`,`text`)),s(await l(`Updating`,async()=>t.patch(`/accounts/${d}/pages/projects/${encodeURIComponent(String(e[`project-name`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function K(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:K,handler:async e=>{if(e.dryRun){c({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${e[`project-name`]==null?`<project-name>`:encodeURIComponent(String(e[`project-name`]))}`,pathParams:{"project-name":String(e[`project-name`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?f:await n(t);e.accountId=a,s(await l(`Loading`,async()=>t.pages.projects.get(e[`project-name`],a)),{successLabel:`Loaded`})}};function J(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Fetch a list of all user projects.`,builder:J,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),o=e.local?f:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.pages.projects.list(o,t)),{successLabel:`Loaded`})}};function X(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 Z={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:X,handler:async t=>{if(t.dryRun){c({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${i()??`<account-id>`}/pages/projects/${t[`project-name`]==null?`<project-name>`:encodeURIComponent(String(t[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(t[`project-name`]??``)},bodyKind:`none`});return}let a=await r(t),o=t.local?f:await n(a);if(t.accountId=o,!await e({force:!!t.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
10
+ `);return}s(await l(`Deleting`,async()=>a.pages.projects.purgeBuildCache(t[`project-name`],o)),{successLabel:`Deleted`})}},Q={command:`projects`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(m).command(g).command(G).command(q).command(Y).command(Z).command(M).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{C as e,T as t,h as n,t as r,w as i,x as a}from"./auth-CQcAgnOy.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-CjcQ6ato.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(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 m={command:`create-v1`,describe:`Create a new Pipeline.`,builder:p,handler:async e=>{if(e.dryRun){l({command:`cf pipelines create-v1`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:{name:e.name,sql:e.sql,body:e.body}});return}let i=await r(e),p=e.local?f:await n(i);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/pipelines`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Specifies the name of the Pipeline.`)),e.sql===void 0&&(e.sql=await t(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m={};e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),e.sql!==void 0&&o(m,[`sql`],d(e.sql,`sql`,`text`)),c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/pipelines`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function h(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(`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:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:h,handler:async e=>{if(e.dryRun){l({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:{"destination-batch-max-bytes":e[`destination-batch-max-bytes`],"destination-batch-max-duration-s":e[`destination-batch-max-duration-s`],"destination-batch-max-rows":e[`destination-batch-max-rows`],"destination-compression-type":e[`destination-compression-type`],"destination-credentials-access-key-id":e[`destination-credentials-access-key-id`],"destination-credentials-endpoint":e[`destination-credentials-endpoint`],"destination-credentials-secret-access-key":e[`destination-credentials-secret-access-key`],"destination-format":e[`destination-format`],"destination-path-bucket":e[`destination-path-bucket`],"destination-path-filepath":e[`destination-path-filepath`],"destination-path-prefix":e[`destination-path-prefix`],"destination-type":e[`destination-type`],name:e.name,body:e.body}});return}let p=await r(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=s(e.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines`,{body:t})),{successLabel:`Created`});return}e[`destination-credentials-access-key-id`]===void 0&&(e[`destination-credentials-access-key-id`]=await t(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),e[`destination-credentials-endpoint`]===void 0&&(e[`destination-credentials-endpoint`]=await t(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),e[`destination-credentials-secret-access-key`]===void 0&&(e[`destination-credentials-secret-access-key`]=await t(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),e[`destination-format`]===void 0&&(e[`destination-format`]=await i(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),e[`destination-path-bucket`]===void 0&&(e[`destination-path-bucket`]=await t(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),e[`destination-type`]===void 0&&(e[`destination-type`]=await i(`destination-type`,`Specifies the type of destination.`,[`r2`])),e.name===void 0&&(e.name=await t(`name`,`Defines the name of the pipeline.`));let h={};e[`destination-batch-max-bytes`]!==void 0&&o(h,[`destination`,`batch`,`max_bytes`],e[`destination-batch-max-bytes`]),e[`destination-batch-max-duration-s`]!==void 0&&o(h,[`destination`,`batch`,`max_duration_s`],e[`destination-batch-max-duration-s`]),e[`destination-batch-max-rows`]!==void 0&&o(h,[`destination`,`batch`,`max_rows`],e[`destination-batch-max-rows`]),e[`destination-compression-type`]!==void 0&&o(h,[`destination`,`compression`,`type`],d(e[`destination-compression-type`],`destination-compression-type`,`text`)),e[`destination-credentials-access-key-id`]!==void 0&&o(h,[`destination`,`credentials`,`access_key_id`],d(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`)),e[`destination-credentials-endpoint`]!==void 0&&o(h,[`destination`,`credentials`,`endpoint`],d(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`)),e[`destination-credentials-secret-access-key`]!==void 0&&o(h,[`destination`,`credentials`,`secret_access_key`],d(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)),e[`destination-format`]!==void 0&&o(h,[`destination`,`format`],d(e[`destination-format`],`destination-format`,`text`)),e[`destination-path-bucket`]!==void 0&&o(h,[`destination`,`path`,`bucket`],d(e[`destination-path-bucket`],`destination-path-bucket`,`text`)),e[`destination-path-filepath`]!==void 0&&o(h,[`destination`,`path`,`filepath`],d(e[`destination-path-filepath`],`destination-path-filepath`,`text`)),e[`destination-path-prefix`]!==void 0&&o(h,[`destination`,`path`,`prefix`],d(e[`destination-path-prefix`],`destination-path-prefix`,`text`)),e[`destination-type`]!==void 0&&o(h,[`destination`,`type`],d(e[`destination-type`],`destination-type`,`text`)),e.name!==void 0&&o(h,[`name`],d(e.name,`name`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines`,{body:Object.keys(h).length>0?h:void 0})),{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-v1 <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf pipelines delete-v1`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines/${t[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(t[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(t[`pipeline-id`]??``)},bodyKind:`none`});return}let i=await r(t),o=t.local?f:await n(i);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
3
+ `);return}c(await u(`Deleting`,async()=>i.pipelines.deleteV1(o,t[`pipeline-id`])),{successLabel:`Deleted`})}};function y(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 b={command:`delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/${t[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(t[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(t[`pipeline-name`]??``)},bodyKind:`none`});return}let i=await r(t),o=t.local?f:await n(i);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
4
+ `);return}c(await u(`Deleting`,async()=>i.pipelines.delete(o,t[`pipeline-name`])),{successLabel:`Deleted`})}};function x(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 S={command:`get-v1 <pipeline-id>`,describe:`Get Pipelines Details.`,builder:x,handler:async e=>{if(e.dryRun){l({command:`cf pipelines get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines/${e[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(e[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(e[`pipeline-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.pipelines.getV1(i,e[`pipeline-id`])),{successLabel:`Loaded`})}};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})}const w={command:`get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async e=>{if(e.dryRun){l({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.pipelines.get(i,e[`pipeline-name`])),{successLabel:`Loaded`})}};function T(e){return e.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 E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),o=e.local?f:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.listV1(o,t)),{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:`list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async e=>{let t={search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),o=e.local?f:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.list(o,t)),{successLabel:`Loaded`})}};function k(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-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(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).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-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`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-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-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([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-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 --schema-* flag is set`)}return!0})}const A={command:`create`,describe:`Create a new Sink.`,builder:k,handler:async e=>{if(e.dryRun){l({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:{"config-account-id":e[`config-account-id`],"config-bucket":e[`config-bucket`],"config-credentials-access-key-id":e[`config-credentials-access-key-id`],"config-credentials-secret-access-key":e[`config-credentials-secret-access-key`],"config-file-naming-prefix":e[`config-file-naming-prefix`],"config-file-naming-strategy":e[`config-file-naming-strategy`],"config-file-naming-suffix":e[`config-file-naming-suffix`],"config-jurisdiction":e[`config-jurisdiction`],"config-partitioning-time-pattern":e[`config-partitioning-time-pattern`],"config-path":e[`config-path`],"config-rolling-policy-file-size-bytes":e[`config-rolling-policy-file-size-bytes`],"config-rolling-policy-inactivity-seconds":e[`config-rolling-policy-inactivity-seconds`],"config-rolling-policy-interval-seconds":e[`config-rolling-policy-interval-seconds`],"config-namespace":e[`config-namespace`],"config-table-name":e[`config-table-name`],"config-token":e[`config-token`],"format-decimal-encoding":e[`format-decimal-encoding`],"format-timestamp-format":e[`format-timestamp-format`],"format-unstructured":e[`format-unstructured`],"format-type":e[`format-type`],"format-compression":e[`format-compression`],"format-row-group-bytes":e[`format-row-group-bytes`],name:e.name,"schema-format-decimal-encoding":e[`schema-format-decimal-encoding`],"schema-format-timestamp-format":e[`schema-format-timestamp-format`],"schema-format-unstructured":e[`schema-format-unstructured`],"schema-format-type":e[`schema-format-type`],"schema-format-compression":e[`schema-format-compression`],"schema-format-row-group-bytes":e[`schema-format-row-group-bytes`],"schema-inferred":e[`schema-inferred`],type:e.type,body:e.body}});return}let p=await r(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=s(e.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines/v1/sinks`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Defines the name of the Sink.`)),e.type===void 0&&(e.type=await i(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h={};e[`config-account-id`]!==void 0&&o(h,[`config`,`account_id`],d(e[`config-account-id`],`config-account-id`,`text`)),e[`config-bucket`]!==void 0&&o(h,[`config`,`bucket`],d(e[`config-bucket`],`config-bucket`,`text`)),e[`config-credentials-access-key-id`]!==void 0&&o(h,[`config`,`credentials`,`access_key_id`],d(e[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`)),e[`config-credentials-secret-access-key`]!==void 0&&o(h,[`config`,`credentials`,`secret_access_key`],d(e[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)),e[`config-file-naming-prefix`]!==void 0&&o(h,[`config`,`file_naming`,`prefix`],d(e[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`)),e[`config-file-naming-strategy`]!==void 0&&o(h,[`config`,`file_naming`,`strategy`],d(e[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`)),e[`config-file-naming-suffix`]!==void 0&&o(h,[`config`,`file_naming`,`suffix`],d(e[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)),e[`config-jurisdiction`]!==void 0&&o(h,[`config`,`jurisdiction`],d(e[`config-jurisdiction`],`config-jurisdiction`,`text`)),e[`config-partitioning-time-pattern`]!==void 0&&o(h,[`config`,`partitioning`,`time_pattern`],d(e[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)),e[`config-path`]!==void 0&&o(h,[`config`,`path`],d(e[`config-path`],`config-path`,`text`)),e[`config-rolling-policy-file-size-bytes`]!==void 0&&o(h,[`config`,`rolling_policy`,`file_size_bytes`],e[`config-rolling-policy-file-size-bytes`]),e[`config-rolling-policy-inactivity-seconds`]!==void 0&&o(h,[`config`,`rolling_policy`,`inactivity_seconds`],e[`config-rolling-policy-inactivity-seconds`]),e[`config-rolling-policy-interval-seconds`]!==void 0&&o(h,[`config`,`rolling_policy`,`interval_seconds`],e[`config-rolling-policy-interval-seconds`]),e[`config-namespace`]!==void 0&&o(h,[`config`,`namespace`],d(e[`config-namespace`],`config-namespace`,`text`)),e[`config-table-name`]!==void 0&&o(h,[`config`,`table_name`],d(e[`config-table-name`],`config-table-name`,`text`)),e[`config-token`]!==void 0&&o(h,[`config`,`token`],d(e[`config-token`],`config-token`,`text`)),e[`format-decimal-encoding`]!==void 0&&o(h,[`format`,`decimal_encoding`],d(e[`format-decimal-encoding`],`format-decimal-encoding`,`text`)),e[`format-timestamp-format`]!==void 0&&o(h,[`format`,`timestamp_format`],d(e[`format-timestamp-format`],`format-timestamp-format`,`text`)),e[`format-unstructured`]!==void 0&&o(h,[`format`,`unstructured`],e[`format-unstructured`]),e[`format-type`]!==void 0&&o(h,[`format`,`type`],d(e[`format-type`],`format-type`,`text`)),e[`format-compression`]!==void 0&&o(h,[`format`,`compression`],d(e[`format-compression`],`format-compression`,`text`)),e[`format-row-group-bytes`]!==void 0&&o(h,[`format`,`row_group_bytes`],e[`format-row-group-bytes`]),e.name!==void 0&&o(h,[`name`],d(e.name,`name`,`text`)),e[`schema-format-decimal-encoding`]!==void 0&&o(h,[`schema`,`format`,`decimal_encoding`],d(e[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`)),e[`schema-format-timestamp-format`]!==void 0&&o(h,[`schema`,`format`,`timestamp_format`],d(e[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`)),e[`schema-format-unstructured`]!==void 0&&o(h,[`schema`,`format`,`unstructured`],e[`schema-format-unstructured`]),e[`schema-format-type`]!==void 0&&o(h,[`schema`,`format`,`type`],d(e[`schema-format-type`],`schema-format-type`,`text`)),e[`schema-format-compression`]!==void 0&&o(h,[`schema`,`format`,`compression`],d(e[`schema-format-compression`],`schema-format-compression`,`text`)),e[`schema-format-row-group-bytes`]!==void 0&&o(h,[`schema`,`format`,`row_group_bytes`],e[`schema-format-row-group-bytes`]),e[`schema-inferred`]!==void 0&&o(h,[`schema`,`inferred`],e[`schema-inferred`]),e.type!==void 0&&o(h,[`type`],d(e.type,`type`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/pipelines/v1/sinks`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function j(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`delete <sink-id>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async t=>{let i={force:t.force};if(t.dryRun){l({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks/${t[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(t[`sink-id`]))}`,pathParams:{"sink-id":String(t[`sink-id`]??``)},query:i,bodyKind:`none`});return}let o=await r(t),s=t.local?f:await n(o);if(t.accountId=s,!await e({force:!!t.force})){process.stderr.write(`Aborted.
5
+ `);return}c(await u(`Deleting`,async()=>o.pipelines.sinks.delete(s,t[`sink-id`],i)),{successLabel:`Deleted`})}};function N(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 P={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks/${e[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(e[`sink-id`]))}`,pathParams:{"sink-id":String(e[`sink-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.pipelines.sinks.get(i,e[`sink-id`])),{successLabel:`Loaded`})}};function F(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).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 I={command:`list`,describe:`List/Filter Sinks in Account.`,builder:F,handler:async e=>{let t={pipeline_id:e[`pipeline-id`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),o=e.local?f:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.sinks.list(o,t)),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(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-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).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`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-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([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-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 --schema-* 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 z={command:`create`,describe:`Create a new Stream.`,builder:R,handler:async e=>{if(e.dryRun){l({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:{"format-decimal-encoding":e[`format-decimal-encoding`],"format-timestamp-format":e[`format-timestamp-format`],"format-unstructured":e[`format-unstructured`],"format-type":e[`format-type`],"format-compression":e[`format-compression`],"format-row-group-bytes":e[`format-row-group-bytes`],"http-authentication":e[`http-authentication`],"http-cors-origins":e[`http-cors-origins`],"http-enabled":e[`http-enabled`],name:e.name,"schema-format-decimal-encoding":e[`schema-format-decimal-encoding`],"schema-format-timestamp-format":e[`schema-format-timestamp-format`],"schema-format-unstructured":e[`schema-format-unstructured`],"schema-format-type":e[`schema-format-type`],"schema-format-compression":e[`schema-format-compression`],"schema-format-row-group-bytes":e[`schema-format-row-group-bytes`],"schema-inferred":e[`schema-inferred`],"worker-binding-enabled":e[`worker-binding-enabled`],body:e.body}});return}let i=await r(e),p=e.local?f:await n(i);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/streams`,{body:t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`Specifies the name of the Stream.`));let m={};e[`format-decimal-encoding`]!==void 0&&o(m,[`format`,`decimal_encoding`],d(e[`format-decimal-encoding`],`format-decimal-encoding`,`text`)),e[`format-timestamp-format`]!==void 0&&o(m,[`format`,`timestamp_format`],d(e[`format-timestamp-format`],`format-timestamp-format`,`text`)),e[`format-unstructured`]!==void 0&&o(m,[`format`,`unstructured`],e[`format-unstructured`]),e[`format-type`]!==void 0&&o(m,[`format`,`type`],d(e[`format-type`],`format-type`,`text`)),e[`format-compression`]!==void 0&&o(m,[`format`,`compression`],d(e[`format-compression`],`format-compression`,`text`)),e[`format-row-group-bytes`]!==void 0&&o(m,[`format`,`row_group_bytes`],e[`format-row-group-bytes`]),e[`http-authentication`]!==void 0&&o(m,[`http`,`authentication`],e[`http-authentication`]),e[`http-cors-origins`]!==void 0&&o(m,[`http`,`cors`,`origins`],e[`http-cors-origins`]),e[`http-enabled`]!==void 0&&o(m,[`http`,`enabled`],e[`http-enabled`]),e.name!==void 0&&o(m,[`name`],d(e.name,`name`,`text`)),e[`schema-format-decimal-encoding`]!==void 0&&o(m,[`schema`,`format`,`decimal_encoding`],d(e[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`)),e[`schema-format-timestamp-format`]!==void 0&&o(m,[`schema`,`format`,`timestamp_format`],d(e[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`)),e[`schema-format-unstructured`]!==void 0&&o(m,[`schema`,`format`,`unstructured`],e[`schema-format-unstructured`]),e[`schema-format-type`]!==void 0&&o(m,[`schema`,`format`,`type`],d(e[`schema-format-type`],`schema-format-type`,`text`)),e[`schema-format-compression`]!==void 0&&o(m,[`schema`,`format`,`compression`],d(e[`schema-format-compression`],`schema-format-compression`,`text`)),e[`schema-format-row-group-bytes`]!==void 0&&o(m,[`schema`,`format`,`row_group_bytes`],e[`schema-format-row-group-bytes`]),e[`schema-inferred`]!==void 0&&o(m,[`schema`,`inferred`],e[`schema-inferred`]),e[`worker-binding-enabled`]!==void 0&&o(m,[`worker_binding`,`enabled`],e[`worker-binding-enabled`]),c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/streams`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function B(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:B,handler:async t=>{let i={force:t.force};if(t.dryRun){l({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams/${t[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(t[`stream-id`]))}`,pathParams:{"stream-id":String(t[`stream-id`]??``)},query:i,bodyKind:`none`});return}let o=await r(t),s=t.local?f:await n(o);if(t.accountId=s,!await e({force:!!t.force})){process.stderr.write(`Aborted.
6
+ `);return}c(await u(`Deleting`,async()=>o.pipelines.streams.delete(s,t[`stream-id`],i)),{successLabel:`Deleted`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:H,handler:async e=>{if(e.dryRun){l({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.pipelines.streams.get(i,e[`stream-id`])),{successLabel:`Loaded`})}};function W(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).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 G={command:`list`,describe:`List/Filter Streams in Account.`,builder:W,handler:async e=>{let t={pipeline_id:e[`pipeline-id`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),o=e.local?f:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.pipelines.streams.list(o,t)),{successLabel:`Loaded`})}};function K(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const q={command:`update <stream-id>`,describe:`Update a Stream.`,builder:K,handler:async e=>{if(e.dryRun){l({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`json`,body:{"http-authentication":e[`http-authentication`],"http-cors-origins":e[`http-cors-origins`],"http-enabled":e[`http-enabled`],"worker-binding-enabled":e[`worker-binding-enabled`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/pipelines/v1/streams/${encodeURIComponent(String(e[`stream-id`]))}`,{body:n})),{successLabel:`Updated`});return}let d={};e[`http-authentication`]!==void 0&&o(d,[`http`,`authentication`],e[`http-authentication`]),e[`http-cors-origins`]!==void 0&&o(d,[`http`,`cors`,`origins`],e[`http-cors-origins`]),e[`http-enabled`]!==void 0&&o(d,[`http`,`enabled`],e[`http-enabled`]),e[`worker-binding-enabled`]!==void 0&&o(d,[`worker_binding`,`enabled`],e[`worker-binding-enabled`]),c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/pipelines/v1/streams/${encodeURIComponent(String(e[`stream-id`]))}`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Updated`})}},J={command:`streams`,describe:`Inbound data streams that feed events into a pipeline for processing`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:Y,handler:async e=>{if(e.dryRun){l({command:`cf pipelines update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`json`,body:{"destination-batch-max-bytes":e[`destination-batch-max-bytes`],"destination-batch-max-duration-s":e[`destination-batch-max-duration-s`],"destination-batch-max-rows":e[`destination-batch-max-rows`],"destination-compression-type":e[`destination-compression-type`],"destination-credentials-access-key-id":e[`destination-credentials-access-key-id`],"destination-credentials-endpoint":e[`destination-credentials-endpoint`],"destination-credentials-secret-access-key":e[`destination-credentials-secret-access-key`],"destination-format":e[`destination-format`],"destination-path-bucket":e[`destination-path-bucket`],"destination-path-filepath":e[`destination-path-filepath`],"destination-path-prefix":e[`destination-path-prefix`],"destination-type":e[`destination-type`],name:e.name,body:e.body}});return}let p=await r(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=s(e.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/pipelines/${encodeURIComponent(String(e[`pipeline-name`]))}`,{body:t})),{successLabel:`Updated`});return}e[`destination-credentials-access-key-id`]===void 0&&(e[`destination-credentials-access-key-id`]=await t(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),e[`destination-credentials-endpoint`]===void 0&&(e[`destination-credentials-endpoint`]=await t(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),e[`destination-credentials-secret-access-key`]===void 0&&(e[`destination-credentials-secret-access-key`]=await t(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),e[`destination-format`]===void 0&&(e[`destination-format`]=await i(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),e[`destination-path-bucket`]===void 0&&(e[`destination-path-bucket`]=await t(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),e[`destination-type`]===void 0&&(e[`destination-type`]=await i(`destination-type`,`Specifies the type of destination.`,[`r2`])),e.name===void 0&&(e.name=await t(`name`,`Defines the name of the pipeline.`));let h={};e[`destination-batch-max-bytes`]!==void 0&&o(h,[`destination`,`batch`,`max_bytes`],e[`destination-batch-max-bytes`]),e[`destination-batch-max-duration-s`]!==void 0&&o(h,[`destination`,`batch`,`max_duration_s`],e[`destination-batch-max-duration-s`]),e[`destination-batch-max-rows`]!==void 0&&o(h,[`destination`,`batch`,`max_rows`],e[`destination-batch-max-rows`]),e[`destination-compression-type`]!==void 0&&o(h,[`destination`,`compression`,`type`],d(e[`destination-compression-type`],`destination-compression-type`,`text`)),e[`destination-credentials-access-key-id`]!==void 0&&o(h,[`destination`,`credentials`,`access_key_id`],d(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`)),e[`destination-credentials-endpoint`]!==void 0&&o(h,[`destination`,`credentials`,`endpoint`],d(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`)),e[`destination-credentials-secret-access-key`]!==void 0&&o(h,[`destination`,`credentials`,`secret_access_key`],d(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)),e[`destination-format`]!==void 0&&o(h,[`destination`,`format`],d(e[`destination-format`],`destination-format`,`text`)),e[`destination-path-bucket`]!==void 0&&o(h,[`destination`,`path`,`bucket`],d(e[`destination-path-bucket`],`destination-path-bucket`,`text`)),e[`destination-path-filepath`]!==void 0&&o(h,[`destination`,`path`,`filepath`],d(e[`destination-path-filepath`],`destination-path-filepath`,`text`)),e[`destination-path-prefix`]!==void 0&&o(h,[`destination`,`path`,`prefix`],d(e[`destination-path-prefix`],`destination-path-prefix`,`text`)),e[`destination-type`]!==void 0&&o(h,[`destination`,`type`],d(e[`destination-type`],`destination-type`,`text`)),e.name!==void 0&&o(h,[`name`],d(e.name,`name`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/pipelines/${encodeURIComponent(String(e[`pipeline-name`]))}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`validate-sql`,describe:`Validate Arroyo SQL.`,builder:Z,handler:async e=>{if(e.dryRun){l({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:{sql:e.sql,body:e.body}});return}let i=await r(e),p=e.local?f:await n(i);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/validate_sql`,{body:t})),{successLabel:`Created`});return}e.sql===void 0&&(e.sql=await t(`sql`,`Specifies SQL to validate.`));let m={};e.sql!==void 0&&o(m,[`sql`],d(e.sql,`sql`,`text`)),c(await u(`Creating`,async()=>i.post(`/accounts/${p}/pipelines/v1/validate_sql`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(g).command(m).command(b).command(v).command(w).command(S).command(O).command(E).command(X).command(Q).command(L).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{r as e,t}from"./session-H7IV2BrM.mjs";import{r as n}from"./theme-BklJDrb2.mjs";import{a as r}from"./dist-CnSubA1Z.mjs";import{t as i}from"./output-D7_yAFVR.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();t(e);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{C as e,T as t,h as n,t as r,w as i,x as a}from"./auth-CQcAgnOy.mjs";import{n as o,t as s}from"./body-parser-Br-BoYk-.mjs";import{t as c}from"./output-D7_yAFVR.mjs";import{n as l,t as u}from"./progress-CjcQ6ato.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";function p(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const m={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:p,handler:async e=>{if(e.dryRun){l({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"dead-letter-queue":e[`dead-letter-queue`],"script-name":e[`script-name`],"settings-batch-size":e[`settings-batch-size`],"settings-max-concurrency":e[`settings-max-concurrency`],"settings-max-retries":e[`settings-max-retries`],"settings-max-wait-time-ms":e[`settings-max-wait-time-ms`],"settings-retry-delay":e[`settings-retry-delay`],"settings-visibility-timeout-ms":e[`settings-visibility-timeout-ms`],type:e.type,body:e.body}});return}let p=await r(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=s(e.body);c(await u(`Creating`,async()=>p.post(`/accounts/${m}/queues/${encodeURIComponent(String(e[`queue-id`]))}/consumers`,{body:t})),{successLabel:`Created`});return}e.type===void 0&&(e.type=await i(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h={};e[`dead-letter-queue`]!==void 0&&o(h,[`dead_letter_queue`],d(e[`dead-letter-queue`],`dead-letter-queue`,`text`)),e[`script-name`]!==void 0&&o(h,[`script_name`],d(e[`script-name`],`script-name`,`text`)),e[`settings-batch-size`]!==void 0&&o(h,[`settings`,`batch_size`],e[`settings-batch-size`]),e[`settings-max-concurrency`]!==void 0&&o(h,[`settings`,`max_concurrency`],e[`settings-max-concurrency`]),e[`settings-max-retries`]!==void 0&&o(h,[`settings`,`max_retries`],e[`settings-max-retries`]),e[`settings-max-wait-time-ms`]!==void 0&&o(h,[`settings`,`max_wait_time_ms`],e[`settings-max-wait-time-ms`]),e[`settings-retry-delay`]!==void 0&&o(h,[`settings`,`retry_delay`],e[`settings-retry-delay`]),e[`settings-visibility-timeout-ms`]!==void 0&&o(h,[`settings`,`visibility_timeout_ms`],e[`settings-visibility-timeout-ms`]),e.type!==void 0&&o(h,[`type`],d(e.type,`type`,`text`)),c(await u(`Creating`,async()=>p.post(`/accounts/${m}/queues/${encodeURIComponent(String(e[`queue-id`]))}/consumers`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function h(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 ee={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:h,handler:async t=>{if(t.dryRun){l({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/consumers/${t[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(t[`consumer-id`]))}`,pathParams:{"consumer-id":String(t[`consumer-id`]??``),"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let i=await r(t),o=t.local?f:await n(i);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
3
+ `);return}c(await u(`Deleting`,async()=>i.queues.consumers.delete(t[`consumer-id`],t[`queue-id`],o)),{successLabel:`Deleted`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"consumer-id":String(e[`consumer-id`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.consumers.get(e[`consumer-id`],e[`queue-id`],i)),{successLabel:`Loaded`})}};function v(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 y={command:`list`,describe:`Returns the consumers for a Queue`,builder:v,handler:async e=>{if(e.dryRun){l({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.consumers.list(e[`queue-id`],i)),{successLabel:`Loaded`})}};function b(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const x={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:b,handler:async e=>{if(e.dryRun){l({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"consumer-id":String(e[`consumer-id`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"dead-letter-queue":e[`dead-letter-queue`],"script-name":e[`script-name`],"settings-batch-size":e[`settings-batch-size`],"settings-max-concurrency":e[`settings-max-concurrency`],"settings-max-retries":e[`settings-max-retries`],"settings-max-wait-time-ms":e[`settings-max-wait-time-ms`],"settings-retry-delay":e[`settings-retry-delay`],"settings-visibility-timeout-ms":e[`settings-visibility-timeout-ms`],type:e.type,body:e.body}});return}let p=await r(e),m=e.local?f:await n(p);if(e.accountId=m,e.body){let t=s(e.body);c(await u(`Updating`,async()=>p.put(`/accounts/${m}/queues/${encodeURIComponent(String(e[`queue-id`]))}/consumers/${encodeURIComponent(String(e[`consumer-id`]))}`,{body:t})),{successLabel:`Updated`});return}e.type===void 0&&(e.type=await i(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await t(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h={};e[`dead-letter-queue`]!==void 0&&o(h,[`dead_letter_queue`],d(e[`dead-letter-queue`],`dead-letter-queue`,`text`)),e[`script-name`]!==void 0&&o(h,[`script_name`],d(e[`script-name`],`script-name`,`text`)),e[`settings-batch-size`]!==void 0&&o(h,[`settings`,`batch_size`],e[`settings-batch-size`]),e[`settings-max-concurrency`]!==void 0&&o(h,[`settings`,`max_concurrency`],e[`settings-max-concurrency`]),e[`settings-max-retries`]!==void 0&&o(h,[`settings`,`max_retries`],e[`settings-max-retries`]),e[`settings-max-wait-time-ms`]!==void 0&&o(h,[`settings`,`max_wait_time_ms`],e[`settings-max-wait-time-ms`]),e[`settings-retry-delay`]!==void 0&&o(h,[`settings`,`retry_delay`],e[`settings-retry-delay`]),e[`settings-visibility-timeout-ms`]!==void 0&&o(h,[`settings`,`visibility_timeout_ms`],e[`settings-visibility-timeout-ms`]),e.type!==void 0&&o(h,[`type`],d(e.type,`type`,`text`)),c(await u(`Updating`,async()=>p.put(`/accounts/${m}/queues/${encodeURIComponent(String(e[`queue-id`]))}/consumers/${encodeURIComponent(String(e[`consumer-id`]))}`,{body:Object.keys(h).length>0?h:void 0})),{successLabel:`Updated`})}},S={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(m).command(ee).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create a new queue`,builder:C,handler:async e=>{if(e.dryRun){l({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:{"queue-name":e[`queue-name`],body:e.body}});return}let i=await r(e),p=e.local?f:await n(i);if(e.accountId=p,e.body){let t=s(e.body);c(await u(`Creating`,async()=>i.post(`/accounts/${p}/queues`,{body:t})),{successLabel:`Created`});return}e[`queue-name`]===void 0&&(e[`queue-name`]=await t(`queue-name`,`The queue_name field`));let m={};e[`queue-name`]!==void 0&&o(m,[`queue_name`],d(e[`queue-name`],`queue-name`,`text`)),c(await u(`Creating`,async()=>i.post(`/accounts/${p}/queues`,{body:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function T(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 E={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:T,handler:async t=>{if(t.dryRun){l({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`none`});return}let i=await r(t),o=t.local?f:await n(i);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
4
+ `);return}c(await u(`Deleting`,async()=>i.queues.delete(t[`queue-id`],o)),{successLabel:`Deleted`})}};function D(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:D,handler:async e=>{if(e.dryRun){l({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"queue-name":e[`queue-name`],"settings-delivery-delay":e[`settings-delivery-delay`],"settings-delivery-paused":e[`settings-delivery-paused`],"settings-message-retention-period":e[`settings-message-retention-period`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e[`queue-name`]!==void 0&&o(p,[`queue_name`],d(e[`queue-name`],`queue-name`,`text`)),e[`settings-delivery-delay`]!==void 0&&o(p,[`settings`,`delivery_delay`],e[`settings-delivery-delay`]),e[`settings-delivery-paused`]!==void 0&&o(p,[`settings`,`delivery_paused`],e[`settings-delivery-paused`]),e[`settings-message-retention-period`]!==void 0&&o(p,[`settings`,`message_retention_period`],e[`settings-message-retention-period`]),c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}};function k(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 A={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:k,handler:async e=>{if(e.dryRun){l({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.get(e[`queue-id`],i)),{successLabel:`Loaded`})}};function j(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Returns the queues owned by an account.`,builder:j,handler:async e=>{if(e.dryRun){l({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.list(i)),{successLabel:`Loaded`})}};function N(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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/preview/ack`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.queues.messages.ackPreview(e[`queue-id`],i)),{successLabel:`Created`})}};function F(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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:F,handler:async e=>{if(e.dryRun){l({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/ack`,{body:n})),{successLabel:`Created`});return}c(await u(`Creating`,async()=>t.queues.messages.ack(e[`queue-id`],i)),{successLabel:`Created`})}};function L(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"delay-seconds":e[`delay-seconds`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/batch`,{body:n})),{successLabel:`Created`});return}let d={};e[`delay-seconds`]!==void 0&&o(d,[`delay_seconds`],e[`delay-seconds`]),c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/batch`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function z(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:z,handler:async e=>{if(e.dryRun){l({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"batch-size":e[`batch-size`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Loading`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/preview`,{body:n})),{successLabel:`Loaded`});return}let d={};e[`batch-size`]!==void 0&&o(d,[`batch_size`],e[`batch-size`]),c(await u(`Loading`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/preview`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Loaded`})}};function B(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 V={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:B,handler:async e=>{if(e.dryRun){l({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"batch-size":e[`batch-size`],"visibility-timeout-ms":e[`visibility-timeout-ms`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/pull`,{body:n})),{successLabel:`Created`});return}let d={};e[`batch-size`]!==void 0&&o(d,[`batch_size`],e[`batch-size`]),e[`visibility-timeout-ms`]!==void 0&&o(d,[`visibility_timeout_ms`],e[`visibility-timeout-ms`]),c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages/pull`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}};function H(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 U={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:H,handler:async e=>{if(e.dryRun){l({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"delay-seconds":e[`delay-seconds`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages`,{body:n})),{successLabel:`Created`});return}let d={};e[`delay-seconds`]!==void 0&&o(d,[`delay_seconds`],e[`delay-seconds`]),c(await u(`Creating`,async()=>t.post(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}/messages`,{body:Object.keys(d).length>0?d:void 0})),{successLabel:`Created`})}},W={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(I).command(P).command(R).command(te).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:G,handler:async t=>{if(t.dryRun){l({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${t[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(t[`queue-id`]))}/purge`,pathParams:{"queue-id":String(t[`queue-id`]??``)},bodyKind:`json`,body:{"delete-messages-permanently":t[`delete-messages-permanently`],body:t.body}});return}let i=await r(t),d=t.local?f:await n(i);if(t.accountId=d,!await e({force:!!t.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
5
+ `);return}if(t.body){let e=s(t.body);c(await u(`Deleting`,async()=>i.post(`/accounts/${d}/queues/${encodeURIComponent(String(t[`queue-id`]))}/purge`,{body:e})),{successLabel:`Deleted`});return}let p={};t[`delete-messages-permanently`]!==void 0&&o(p,[`delete_messages_permanently`],t[`delete-messages-permanently`]),c(await u(`Deleting`,async()=>i.post(`/accounts/${d}/queues/${encodeURIComponent(String(t[`queue-id`]))}/purge`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Deleted`})}};function q(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 J={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:q,handler:async e=>{if(e.dryRun){l({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.purge.status(e[`queue-id`],i)),{successLabel:`Loaded`})}},Y={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-model-name`,[`source-worker-name`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const Z={command:`create`,describe:`Create a new event subscription for a queue`,builder:X,handler:async e=>{if(e.dryRun){l({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:{"destination-queue-id":e[`destination-queue-id`],"destination-type":e[`destination-type`],enabled:e.enabled,events:e.events,name:e.name,"source-type":e[`source-type`],"source-model-name":e[`source-model-name`],"source-worker-name":e[`source-worker-name`],"source-workflow-name":e[`source-workflow-name`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Creating`,async()=>t.post(`/accounts/${i}/event_subscriptions/subscriptions`,{body:n})),{successLabel:`Created`});return}let p={};e[`destination-queue-id`]!==void 0&&o(p,[`destination`,`queue_id`],d(e[`destination-queue-id`],`destination-queue-id`,`text`)),e[`destination-type`]!==void 0&&o(p,[`destination`,`type`],d(e[`destination-type`],`destination-type`,`text`)),e.enabled!==void 0&&o(p,[`enabled`],e.enabled),e.events!==void 0&&o(p,[`events`],e.events),e.name!==void 0&&o(p,[`name`],d(e.name,`name`,`text`)),e[`source-type`]!==void 0&&o(p,[`source`,`type`],d(e[`source-type`],`source-type`,`text`)),e[`source-model-name`]!==void 0&&o(p,[`source`,`model_name`],d(e[`source-model-name`],`source-model-name`,`text`)),e[`source-worker-name`]!==void 0&&o(p,[`source`,`worker_name`],d(e[`source-worker-name`],`source-worker-name`,`text`)),e[`source-workflow-name`]!==void 0&&o(p,[`source`,`workflow_name`],d(e[`source-workflow-name`],`source-workflow-name`,`text`)),c(await u(`Creating`,async()=>t.post(`/accounts/${i}/event_subscriptions/subscriptions`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function Q(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ne={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:Q,handler:async t=>{if(t.dryRun){l({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${t[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(t[`subscription-id`]))}`,pathParams:{"subscription-id":String(t[`subscription-id`]??``)},bodyKind:`none`});return}let i=await r(t),o=t.local?f:await n(i);if(t.accountId=o,!await e({force:!!t.force})){process.stderr.write(`Aborted.
6
+ `);return}c(await u(`Deleting`,async()=>i.queues.subscriptions.delete(o,t[`subscription-id`])),{successLabel:`Deleted`})}};function re(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:re,handler:async e=>{if(e.dryRun){l({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?f:await n(t);e.accountId=i,c(await u(`Loading`,async()=>t.queues.subscriptions.get(i,e[`subscription-id`])),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:ae,handler:async e=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){l({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),o=e.local?f:await n(i);e.accountId=o,c(await u(`Loading`,async()=>i.queues.subscriptions.list(o,t)),{successLabel:`Loaded`})}};function $(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const se={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:$,handler:async e=>{if(e.dryRun){l({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`json`,body:{"destination-queue-id":e[`destination-queue-id`],"destination-type":e[`destination-type`],enabled:e.enabled,events:e.events,name:e.name,body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/event_subscriptions/subscriptions/${encodeURIComponent(String(e[`subscription-id`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e[`destination-queue-id`]!==void 0&&o(p,[`destination`,`queue_id`],d(e[`destination-queue-id`],`destination-queue-id`,`text`)),e[`destination-type`]!==void 0&&o(p,[`destination`,`type`],d(e[`destination-type`],`destination-type`,`text`)),e.enabled!==void 0&&o(p,[`enabled`],e.enabled),e.events!==void 0&&o(p,[`events`],e.events),e.name!==void 0&&o(p,[`name`],d(e.name,`name`,`text`)),c(await u(`Updating`,async()=>t.patch(`/accounts/${i}/event_subscriptions/subscriptions/${encodeURIComponent(String(e[`subscription-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ce={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(Z).command(ne).command(ie).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:le,handler:async e=>{if(e.dryRun){l({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${a()??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:{"queue-name":e[`queue-name`],"settings-delivery-delay":e[`settings-delivery-delay`],"settings-delivery-paused":e[`settings-delivery-paused`],"settings-message-retention-period":e[`settings-message-retention-period`],body:e.body}});return}let t=await r(e),i=e.local?f:await n(t);if(e.accountId=i,e.body){let n=s(e.body);c(await u(`Updating`,async()=>t.put(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:n})),{successLabel:`Updated`});return}let p={};e[`queue-name`]!==void 0&&o(p,[`queue_name`],d(e[`queue-name`],`queue-name`,`text`)),e[`settings-delivery-delay`]!==void 0&&o(p,[`settings`,`delivery_delay`],e[`settings-delivery-delay`]),e[`settings-delivery-paused`]!==void 0&&o(p,[`settings`,`delivery_paused`],e[`settings-delivery-paused`]),e[`settings-message-retention-period`]!==void 0&&o(p,[`settings`,`message_retention_period`],e[`settings-message-retention-period`]),c(await u(`Updating`,async()=>t.put(`/accounts/${i}/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},de={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(ue).command(S).command(W).command(Y).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};