cf 0.13.0 → 0.15.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 (455) hide show
  1. package/dist/_meta/commands.json +6724 -3970
  2. package/dist/_meta/hand-written-commands.json +150 -32
  3. package/dist/_meta/schemas.json +2083 -2159
  4. package/dist/abuse-reports-BAQR1w79.mjs +26 -0
  5. package/dist/access-C8KMplzp.mjs +27 -0
  6. package/dist/account-B-KQSR0L.mjs +12 -0
  7. package/dist/account-tags-EncLJpLc.mjs +15 -0
  8. package/dist/accounts-BA4Mp3A_.mjs +132 -0
  9. package/dist/acm-ByxUJcqF.mjs +15 -0
  10. package/dist/addressing-C-ym0h0G.mjs +93 -0
  11. package/dist/agent-memory-CkPSiZDI.mjs +34 -0
  12. package/dist/ai-DkE_Q64s.mjs +31 -0
  13. package/dist/ai-audit-pPcjYWI5.mjs +6 -0
  14. package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
  15. package/dist/ai-search-DLD_kDS1.mjs +79 -0
  16. package/dist/ai-security-jyZcBl9g.mjs +10 -0
  17. package/dist/alerting-DOROjm8E.mjs +56 -0
  18. package/dist/analytics-rQ-h-plT.mjs +21 -0
  19. package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
  20. package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
  21. package/dist/api-security-B8p8vp8u.mjs +154 -0
  22. package/dist/argo-g8SjUb_t.mjs +10 -0
  23. package/dist/artifacts-B1PaeF5h.mjs +43 -0
  24. package/dist/audit-logs-DmU_PHy_.mjs +4 -0
  25. package/dist/auth-CZqics6E.mjs +2 -0
  26. package/dist/auth-Cp7gT-AF.mjs +8 -0
  27. package/dist/billing-CvTbUg-H.mjs +23 -0
  28. package/dist/bot-management-z53tbcbH.mjs +9 -0
  29. package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
  30. package/dist/brand-protection-DzV211IQ.mjs +27 -0
  31. package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
  32. package/dist/browser-run-DYQvMAyo.mjs +46 -0
  33. package/dist/build-BPIp8J5F.mjs +2 -0
  34. package/dist/build-OC77a1zq.mjs +2 -0
  35. package/dist/builds-CwKRqjQ5.mjs +71 -0
  36. package/dist/cache-CugNPPsJ.mjs +45 -0
  37. package/dist/certificate-authorities-DaEnJYge.mjs +6 -0
  38. package/dist/cf-oadujOtC.mjs +18 -0
  39. package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
  40. package/dist/chunk-DL5FNmn1.mjs +2 -0
  41. package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
  42. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
  43. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
  44. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
  45. package/dist/client-certificates-DZUIqBTB.mjs +13 -0
  46. package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
  47. package/dist/cloud-connector-avpf86kG.mjs +6 -0
  48. package/dist/cloudflared-DhItYrCq.mjs +2 -0
  49. package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
  50. package/dist/command-B2Qe-WUa.mjs +2 -0
  51. package/dist/command-CF0giIIc.mjs +3 -0
  52. package/dist/command-D45NW-R3.mjs +2 -0
  53. package/dist/command-DIvPLK8x.mjs +2 -0
  54. package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
  55. package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
  56. package/dist/config.d.mts +1 -1729
  57. package/dist/config.mjs +1 -1
  58. package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
  59. package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
  60. package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
  61. package/dist/connectors-BSmhzNB7.mjs +15 -0
  62. package/dist/containers-B5vDcFzo.mjs +78 -0
  63. package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
  64. package/dist/content-scan-CeLZAcbT.mjs +14 -0
  65. package/dist/cps-BlI_Od72.mjs +6 -0
  66. package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
  67. package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
  68. package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
  69. package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
  70. package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
  71. package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
  72. package/dist/custom-pages-BgfhGksj.mjs +21 -0
  73. package/dist/d1-P2kWbdID.mjs +45 -0
  74. package/dist/data-security-pBIozmRL.mjs +71 -0
  75. package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
  76. package/dist/delegate-GctF_lrq.mjs +2 -0
  77. package/dist/delegate.mjs +1 -1
  78. package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
  79. package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
  80. package/dist/dev-PPUBjWcm.mjs +4 -0
  81. package/dist/diagnostics-C62habGQ.mjs +15 -0
  82. package/dist/dialog-C_ccBiZp.mjs +2 -0
  83. package/dist/dist-B4pQ4CXK.mjs +48 -0
  84. package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
  85. package/dist/dist-dc4E1u01.mjs +272 -0
  86. package/dist/dls-CpkcyQ8C.mjs +17 -0
  87. package/dist/dns-DG1X4Wap.mjs +135 -0
  88. package/dist/dns-firewall-B1gGHEDo.mjs +71 -0
  89. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
  90. package/dist/dry-run-CLX6Pbtq.mjs +2 -0
  91. package/dist/durable-objects-D214VhxH.mjs +8 -0
  92. package/dist/email-auth-Ba4ONan2.mjs +6 -0
  93. package/dist/email-routing-BlqKnqNM.mjs +45 -0
  94. package/dist/email-security-Dl1E1Dko.mjs +160 -0
  95. package/dist/email-sending-DIRSSRIz.mjs +47 -0
  96. package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
  97. package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
  98. package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
  99. package/dist/firewall-DdsDh8GD.mjs +56 -0
  100. package/dist/flagship-CkUIVW7c.mjs +28 -0
  101. package/dist/fraud-BUpZgvQT.mjs +22 -0
  102. package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
  103. package/dist/healthchecks-DjQWb3EM.mjs +22 -0
  104. package/dist/hostnames-ClBLPbct.mjs +11 -0
  105. package/dist/hyperdrive-U54xZsWU.mjs +37 -0
  106. package/dist/iam-T-wWmOep.mjs +52 -0
  107. package/dist/images-ia5UG1GW.mjs +71 -0
  108. package/dist/index.mjs +1 -1
  109. package/dist/intel-BhswZLMI.mjs +76 -0
  110. package/dist/interactive-B6woOLo-.mjs +32 -0
  111. package/dist/interactive-DnUvQHjc.mjs +2 -0
  112. package/dist/ips-Dad_EvhM.mjs +4 -0
  113. package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
  114. package/dist/keys-DjIPvqj4.mjs +4 -0
  115. package/dist/kv-DzXVnK94.mjs +21 -0
  116. package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
  117. package/dist/lifecycle-Ichnb2x1.mjs +2 -0
  118. package/dist/load-balancers-3wGHPsYz.mjs +76 -0
  119. package/dist/local-B6b2OIBW.mjs +2 -0
  120. package/dist/local-BrfySqnx.mjs +2 -0
  121. package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
  122. package/dist/login-CEQbOgBM.mjs +5 -0
  123. package/dist/login-DEWvGuaU.mjs +2 -0
  124. package/dist/logo-matches-YGRPstPi.mjs +6 -0
  125. package/dist/logos-BirufUgo.mjs +7 -0
  126. package/dist/logpush-BlNbUHyV.mjs +46 -0
  127. package/dist/logs-DmFlVF9q.mjs +48 -0
  128. package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
  129. package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
  130. package/dist/magic-transit-CBVOK2aa.mjs +387 -0
  131. package/dist/managed-defense-BdW6s483.mjs +18 -0
  132. package/dist/managed-transforms-BIeiofIS.mjs +9 -0
  133. package/dist/matches-CAnwci0P.mjs +6 -0
  134. package/dist/mcp-BfhOMGFE.mjs +32 -0
  135. package/dist/mesh-CxUL2Wf-.mjs +26 -0
  136. package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
  137. package/dist/network-C68psMbz.mjs +50 -0
  138. package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
  139. package/dist/oauth-D4bkeMAw.mjs +14 -0
  140. package/dist/oauth-DouM-qz0.mjs +2 -0
  141. package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
  142. package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
  143. package/dist/observability-DpYxkFeZ.mjs +80 -0
  144. package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
  145. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
  146. package/dist/organization-Dg55Xfz7.mjs +75 -0
  147. package/dist/organizations-QnyzGjB2.mjs +4 -0
  148. package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
  149. package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
  150. package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
  151. package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
  152. package/dist/page-rules--D3eXrCf.mjs +39 -0
  153. package/dist/pages-Ce8DDgNr.mjs +60 -0
  154. package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
  155. package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
  156. package/dist/pipelines-CAqCgBLh.mjs +44 -0
  157. package/dist/precursor-DBnn4Q35.mjs +4 -0
  158. package/dist/previews-y_nSqWK5.mjs +4 -0
  159. package/dist/progress-Bi02B6v4.mjs +2 -0
  160. package/dist/project-settings-DSXevRvj.mjs +3 -0
  161. package/dist/prompt-Bx2PB-tt.mjs +3 -0
  162. package/dist/queries-dg-CVXjf.mjs +9 -0
  163. package/dist/queues-C_ilLbRI.mjs +63 -0
  164. package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
  165. package/dist/r2-hZAkra-l.mjs +127 -0
  166. package/dist/radar-BO9b0aZy.mjs +300 -0
  167. package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
  168. package/dist/realtime-eSavuSeE.mjs +172 -0
  169. package/dist/registrar-Ct30kOXZ.mjs +43 -0
  170. package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
  171. package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
  172. package/dist/reporting-B-F5aWUJ.mjs +14 -0
  173. package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
  174. package/dist/request-tracers-CaubpUFV.mjs +4 -0
  175. package/dist/resolve-BXemCSyA.mjs +2 -0
  176. package/dist/resolve-CUDKxUrW.mjs +2 -0
  177. package/dist/resource-sharing-6Snv-b69.mjs +40 -0
  178. package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
  179. package/dist/rules-C26eyeA5.mjs +18 -0
  180. package/dist/rulesets-BKzIwVtJ.mjs +37 -0
  181. package/dist/rum-Xdw5hyWY.mjs +30 -0
  182. package/dist/run-BBBMrSrs.mjs +2 -0
  183. package/dist/run-BRucX7Rz.mjs +2 -0
  184. package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
  185. package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
  186. package/dist/scim-odJTXiIe.mjs +18 -0
  187. package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
  188. package/dist/secrets-store-RYpWWzaw.mjs +24 -0
  189. package/dist/security-center-B3D95vCa.mjs +30 -0
  190. package/dist/security-txt-BSytVv-9.mjs +9 -0
  191. package/dist/shared-D67owd9x.mjs +2 -0
  192. package/dist/smart-shield-C83Sfnf4.mjs +24 -0
  193. package/dist/snippets-B6oE9WIa.mjs +20 -0
  194. package/dist/source-BR4_k2ad.mjs +6 -0
  195. package/dist/spawn-CKqJ9J4_.mjs +523 -0
  196. package/dist/spectrum-CfxY--X_.mjs +83 -0
  197. package/dist/speed-DzK-kiWt.mjs +24 -0
  198. package/dist/src-B3h6tKMt.mjs +108 -0
  199. package/dist/ssl-dnjzPcSB.mjs +45 -0
  200. package/dist/startup-profile-CYEokTVe.mjs +2 -0
  201. package/dist/startup-profile-CgWHy4rE.mjs +17 -0
  202. package/dist/state-BxCejn42.mjs +2 -0
  203. package/dist/state-DSzkxXML.mjs +2 -0
  204. package/dist/stream-oFyhS4Wi.mjs +102 -0
  205. package/dist/submit-4f-ravmC.mjs +4 -0
  206. package/dist/tags-DrIP6Uiq.mjs +4 -0
  207. package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
  208. package/dist/telemetry-Ds4epd3D.mjs +2 -0
  209. package/dist/telemetry-mKEb8lYB.mjs +2 -0
  210. package/dist/tenant-C-gc3NWv.mjs +12 -0
  211. package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
  212. package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
  213. package/dist/tunnels-D0QYsskp.mjs +29 -0
  214. package/dist/turnstile-C6Q3spRB.mjs +33 -0
  215. package/dist/ui-DH95w1Qk.mjs +5 -0
  216. package/dist/undici-DTSBJHNS.mjs +96 -0
  217. package/dist/update-check-BBS1K1jt.mjs +2 -0
  218. package/dist/update-check-CTLoakFV.mjs +2 -0
  219. package/dist/update-check-worker.mjs +2 -0
  220. package/dist/url-info-Cs0V89qq.mjs +4 -0
  221. package/dist/url-normalization-DaEQYy5h.mjs +9 -0
  222. package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
  223. package/dist/user-BV1VY3Kl.mjs +112 -0
  224. package/dist/values-qDS63E43.mjs +4 -0
  225. package/dist/vectorize-NFzD3mP5.mjs +32 -0
  226. package/dist/version-W6_TN_kN.mjs +2 -0
  227. package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
  228. package/dist/web-assets-Gd6z8dbt.mjs +64 -0
  229. package/dist/web3-DCJx4NRp.mjs +28 -0
  230. package/dist/workers-B-j-1ygi.mjs +36 -0
  231. package/dist/workers-builds-DPrNKjZW.mjs +14 -0
  232. package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
  233. package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
  234. package/dist/workflows-C2KKIJjl.mjs +43 -0
  235. package/dist/zaraz-CVLCs1IX.mjs +22 -0
  236. package/dist/zero-trust-BtJi4OXF.mjs +795 -0
  237. package/dist/zone-hKgt0WzO.mjs +4 -0
  238. package/dist/zones-CCNyaD3J.mjs +124 -0
  239. package/package.json +15 -12
  240. package/dist/_meta/agent-context.json +0 -193
  241. package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
  242. package/dist/access-D6Xz892p.mjs +0 -11
  243. package/dist/account-DvxcqeaK.mjs +0 -2
  244. package/dist/account-tags-CeqfEWpz.mjs +0 -9
  245. package/dist/accounts-Bx-8BMH9.mjs +0 -30
  246. package/dist/acm--0opdSGE.mjs +0 -3
  247. package/dist/addressing-BS1ynzLA.mjs +0 -13
  248. package/dist/agent-context-BPhyrSns.mjs +0 -8
  249. package/dist/agent-memory-DczzpEw5.mjs +0 -6
  250. package/dist/ai-CDdCTcQl.mjs +0 -5
  251. package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
  252. package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
  253. package/dist/ai-search-DRQj1aMu.mjs +0 -7
  254. package/dist/ai-security-C_Rb0lGT.mjs +0 -4
  255. package/dist/alerting-BAR9eFs2.mjs +0 -6
  256. package/dist/analytics-BaUZwNc5.mjs +0 -4
  257. package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
  258. package/dist/api-security-jA0lOk6a.mjs +0 -50
  259. package/dist/argo-Cz4pDagx.mjs +0 -2
  260. package/dist/artifacts-BcLTGfAv.mjs +0 -5
  261. package/dist/audit-logs-DbIv4n6u.mjs +0 -2
  262. package/dist/auth-rW5d3jtr.mjs +0 -5
  263. package/dist/auth-tvDdC1J-.mjs +0 -8
  264. package/dist/billing-Md87QjqW.mjs +0 -3
  265. package/dist/bot-management-VHMo4hpU.mjs +0 -5
  266. package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
  267. package/dist/brand-protection-HUeR6Pof.mjs +0 -3
  268. package/dist/browser-extension-199oZg3X.mjs +0 -3
  269. package/dist/browser-run-DDasyux-.mjs +0 -4
  270. package/dist/build-0QlYUfFS.mjs +0 -2
  271. package/dist/builds-B-lXn6JR.mjs +0 -9
  272. package/dist/cache-CevKpiTM.mjs +0 -9
  273. package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
  274. package/dist/cf-C11NGkjx.mjs +0 -18
  275. package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
  276. package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
  277. package/dist/chunk-vbHwaUoU.mjs +0 -2
  278. package/dist/client-certificates-Bay7oPLE.mjs +0 -3
  279. package/dist/client-side-security-CbU9xn0k.mjs +0 -37
  280. package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
  281. package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
  282. package/dist/command-CMzMsll4.mjs +0 -2
  283. package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
  284. package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
  285. package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
  286. package/dist/connectors-CEAy30E-.mjs +0 -3
  287. package/dist/containers-BsbDqbSn.mjs +0 -58
  288. package/dist/content-scan-BdK936iO.mjs +0 -4
  289. package/dist/cps-oP97-qkm.mjs +0 -2
  290. package/dist/csamScanner-DUNN4INg.mjs +0 -6
  291. package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
  292. package/dist/custom-certificates-DYspvjo4.mjs +0 -5
  293. package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
  294. package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
  295. package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
  296. package/dist/custom-pages-DzKnSgL3.mjs +0 -3
  297. package/dist/d1-JBEqjJoj.mjs +0 -20
  298. package/dist/data-security-CIktWnXt.mjs +0 -7
  299. package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
  300. package/dist/dev-CAubuxCc.mjs +0 -4
  301. package/dist/diagnostics-B0DRh714.mjs +0 -3
  302. package/dist/dist-12KzRsBM.mjs +0 -387
  303. package/dist/dist-BCVqQpg2.mjs +0 -2
  304. package/dist/dist-Cp3uJN1x.mjs +0 -48
  305. package/dist/dist-S9K_8gq9.mjs +0 -9
  306. package/dist/dls-CFzTHcZM.mjs +0 -3
  307. package/dist/dns-Dw6u-NV1.mjs +0 -29
  308. package/dist/dns-firewall-CIPptslp.mjs +0 -57
  309. package/dist/dry-run-DiVy1lVo.mjs +0 -2
  310. package/dist/durable-objects-CCkeqqBq.mjs +0 -2
  311. package/dist/email-auth-kdxO51Oz.mjs +0 -2
  312. package/dist/email-routing-BLggZdQq.mjs +0 -6
  313. package/dist/email-security-DjADlgdM.mjs +0 -18
  314. package/dist/email-sending-Cz7E7GoP.mjs +0 -7
  315. package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
  316. package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
  317. package/dist/firewall-5t6OBIOl.mjs +0 -8
  318. package/dist/flagship-CzG_VoNR.mjs +0 -4
  319. package/dist/fraud-UOg_69Ob.mjs +0 -20
  320. package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
  321. package/dist/healthchecks-BkHZGTp1.mjs +0 -4
  322. package/dist/hostnames-EUYOZm21.mjs +0 -3
  323. package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
  324. package/dist/iam-BQ2xSgYN.mjs +0 -6
  325. package/dist/images-CkEq6ScP.mjs +0 -8
  326. package/dist/intel-DDWEdGyl.mjs +0 -8
  327. package/dist/interactive-B2E03Fs-.mjs +0 -11
  328. package/dist/interactive-_B-EqD0Y.mjs +0 -23
  329. package/dist/ips-54Qmy-Uw.mjs +0 -2
  330. package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
  331. package/dist/keys-rvI4TC3Z.mjs +0 -2
  332. package/dist/kv-CAeN1zBy.mjs +0 -5
  333. package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
  334. package/dist/load-balancers-BFwdwAIU.mjs +0 -6
  335. package/dist/local-C6XsFD_W.mjs +0 -2
  336. package/dist/logexplorer-D8rOPB5I.mjs +0 -17
  337. package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
  338. package/dist/logos-BN8SvJhS.mjs +0 -3
  339. package/dist/logpush-BnLA4WVm.mjs +0 -4
  340. package/dist/logs-CDo7Y5sA.mjs +0 -3
  341. package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
  342. package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
  343. package/dist/magic-transit-6tvVOECW.mjs +0 -111
  344. package/dist/managed-defense-AYwBOYIH.mjs +0 -2
  345. package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
  346. package/dist/matches-Dp91L3dL.mjs +0 -2
  347. package/dist/mcp-P7pcieiT.mjs +0 -4
  348. package/dist/mesh-DjFrk6PL.mjs +0 -4
  349. package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
  350. package/dist/network-7cd1U6-I.mjs +0 -6
  351. package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
  352. package/dist/oauth-DH3kMXSs.mjs +0 -14
  353. package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
  354. package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
  355. package/dist/observability-M1DnLhMR.mjs +0 -10
  356. package/dist/organization-cUE7GDCt.mjs +0 -45
  357. package/dist/organizations-C-Hcpd0w.mjs +0 -2
  358. package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
  359. package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
  360. package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
  361. package/dist/page-rules-B-zq1EUb.mjs +0 -27
  362. package/dist/pages-B6YpkPos.mjs +0 -14
  363. package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
  364. package/dist/pipelines-BJc_RylD.mjs +0 -6
  365. package/dist/precursor-CLQu7suY.mjs +0 -4
  366. package/dist/progress-V6SZV3Ux.mjs +0 -2
  367. package/dist/prompt-DjRTpML4.mjs +0 -3
  368. package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
  369. package/dist/queries-DSrrket-.mjs +0 -3
  370. package/dist/queues-Tf7kPBpn.mjs +0 -7
  371. package/dist/r2-DmKNnxtC.mjs +0 -25
  372. package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
  373. package/dist/radar-Csk7Ab-b.mjs +0 -2
  374. package/dist/realtime-CDehZVhV.mjs +0 -20
  375. package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
  376. package/dist/registrar-vflzeNQ9.mjs +0 -43
  377. package/dist/reporting-BaPZ1PHN.mjs +0 -2
  378. package/dist/request-headers-CC4eHmI2.mjs +0 -3
  379. package/dist/request-tracers-C_UVBexV.mjs +0 -2
  380. package/dist/resolve-B8CyM1mi.mjs +0 -2
  381. package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
  382. package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
  383. package/dist/rules-4O8076_s.mjs +0 -4
  384. package/dist/rulesets-C84MxTYo.mjs +0 -5
  385. package/dist/rum-Bvwkrntx.mjs +0 -4
  386. package/dist/run-CRfinkSe.mjs +0 -2
  387. package/dist/schemas-O_ZNaF8R.mjs +0 -65
  388. package/dist/scim-BvxQmde6.mjs +0 -4
  389. package/dist/secrets-store-DOKWiC-j.mjs +0 -7
  390. package/dist/security-center-Bhy_aC-w.mjs +0 -2
  391. package/dist/security-txt-L7HJ9tq5.mjs +0 -3
  392. package/dist/smart-shield-COMXuQ1S.mjs +0 -4
  393. package/dist/snippets-DffQhlKt.mjs +0 -4
  394. package/dist/spawn-C1AISA2V.mjs +0 -526
  395. package/dist/spectrum-Cmf7SqQE.mjs +0 -63
  396. package/dist/speed-m8cdhLFS.mjs +0 -4
  397. package/dist/src-C8phrg-8.mjs +0 -109
  398. package/dist/ssl-D4ffsdSw.mjs +0 -15
  399. package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
  400. package/dist/state-CHif8Y5I.mjs +0 -2
  401. package/dist/stream-DPF5fojV.mjs +0 -16
  402. package/dist/submit-Br8hfP0_.mjs +0 -2
  403. package/dist/tags-Bnt4JuxQ.mjs +0 -2
  404. package/dist/telemetry-Ch1vCICm.mjs +0 -2
  405. package/dist/tenant-D8u0CxoC.mjs +0 -2
  406. package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
  407. package/dist/tunnels-BkNPpTHa.mjs +0 -5
  408. package/dist/turnstile-MgwRECJv.mjs +0 -23
  409. package/dist/ui-DQSZeaG5.mjs +0 -5
  410. package/dist/url-info-Ddp7MgcI.mjs +0 -2
  411. package/dist/url-normalization-3ptK9ntV.mjs +0 -3
  412. package/dist/url-scanner-Psb9ollR.mjs +0 -2
  413. package/dist/user-DWdshcIu.mjs +0 -12
  414. package/dist/values-CDKQL1z2.mjs +0 -2
  415. package/dist/vectorize-CTYYUyQj.mjs +0 -4
  416. package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
  417. package/dist/web-assets-CpDwDEx8.mjs +0 -8
  418. package/dist/web3-YsjDyAzH.mjs +0 -4
  419. package/dist/workers-BKKxaZcz.mjs +0 -6
  420. package/dist/workers-builds-BWo5vUA9.mjs +0 -2
  421. package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
  422. package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
  423. package/dist/workflows-KrIFI9ns.mjs +0 -5
  424. package/dist/zaraz-DglXbVzZ.mjs +0 -2
  425. package/dist/zero-trust-RilTdSjX.mjs +0 -91
  426. package/dist/zone-DsBtVkvT.mjs +0 -2
  427. package/dist/zones-BFxvWFQW.mjs +0 -44
  428. /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
  429. /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
  430. /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
  431. /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
  432. /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
  433. /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
  434. /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
  435. /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
  436. /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
  437. /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
  438. /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
  439. /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
  440. /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
  441. /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
  442. /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
  443. /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
  444. /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
  445. /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
  446. /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
  447. /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
  448. /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
  449. /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
  450. /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
  451. /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
  452. /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
  453. /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
  454. /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
  455. /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,r as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";function ee(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Lists waiting rooms for account or zone.`,builder:ee,handler:async l=>c({command:`waiting-rooms account-waiting-rooms list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={page:l.page,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf waiting-rooms account-waiting-rooms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/waiting_rooms`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.waitingRooms.accountWaitingRooms.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})},_={command:`account-waiting-rooms`,describe:`Account-scoped waiting room listing`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`additional-routes`,{type:`string`,description:`Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`cookie-attributes-samesite`,{type:`string`,description:"Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.",choices:[`auto`,`lax`,`none`,`strict`]}).option(`cookie-attributes-secure`,{type:`string`,description:"Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.",choices:[`auto`,`always`,`never`]}).option(`cookie-suffix`,{type:`string`,description:"Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is \"abcd\", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`.",default:``}).option(`custom-page-html`,{type:`string`,description:"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:\n1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**.\n2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:\n3. {{`waitTime`}} Number of minutes of estimated wait for a user.\n4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`).\n5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`).\n6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue.\n\nTo view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls.",default:``}).option(`default-template-language`,{type:`string`,description:"The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.",choices:`en-US.es-ES.de-DE.fr-FR.it-IT.ja-JP.ko-KR.pt-BR.zh-CN.zh-TW.nl-NL.pl-PL.id-ID.tr-TR.ar-EG.ru-RU.fa-IR.bg-BG.hr-HR.cs-CZ.da-DK.fi-FI.lt-LT.ms-MY.nb-NO.ro-RO.el-GR.he-IL.hi-IN.hu-HU.sr-BA.sk-SK.sl-SI.sv-SE.tl-PH.th-TH.uk-UA.vi-VN`.split(`.`),default:`en-US`}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the waiting room.`,default:``}).option(`disable-session-renewal`,{type:`boolean`,description:"Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request.",default:!1}).option(`enabled-origin-commands`,{type:`string`,array:!0,description:`A list of enabled origin commands.`}).option(`host`,{type:`string`,description:`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`}).option(`json-response-enabled`,{type:`boolean`,description:'Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user\'s status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields:\n1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room (always **true**).\n2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are accurate. If **false**, they are not available.\n3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When `queueingMethod` is **random**, this is set to `waitTime50Percentile`.\n4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).\n5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before `waitTime50Percentile` and half are expected to be let in after it.\n6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).\n7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display **unavailable**.\n8. `queueIsFull`: Boolean indicating if the waiting room\'s queue is currently full and not accepting new users at the moment.\n9. `queueAll`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.\n10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the user\'s last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after `refreshIntervalSeconds` past this time. If the user makes a request too soon, it will be ignored and `lastUpdated` will not change.\n11. `refreshIntervalSeconds`: Integer indicating the number of seconds after `lastUpdated` until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the `queueingMethod` is `reject`, there is no specified refresh time —\\_it will always be **zero**.\n12. `queueingMethod`: The queueing method currently used by the waiting room. It is either **fifo**, **random**, **passthrough**, or **reject**.\n13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.\n14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.\n15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when `queueAll` is **true** or `isEventPrequeueing` is **true** because in all other cases requests will go directly to the origin.\n16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue.\n17. `isEventActive`: Boolean indicating if an event is currently occurring. Events are able to change a waiting room\'s behavior during a specified period of time. For additional information, look at the event properties `prequeue_start_time`, `event_start_time`, and `event_end_time` in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.\n18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean indicating if an event is currently prequeueing users before it starts.\n19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. Integer indicating the number of minutes until the event starts.\n20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` formatted in English for users. If `isEventPrequeueing` is **false**, `timeUntilEventStartFormatted` will display **unavailable**.\n21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer indicating the number of minutes until the event ends.\n22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` formatted in English for users. If `isEventActive` is **false**, `timeUntilEventEndFormatted` will display **unavailable**.\n23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.\n24. `turnstile`: Empty when turnstile isn\'t enabled. String displaying an html tag to display the Turnstile widget. Please add the `{{{turnstile}}}` tag to the `custom_html` template to ensure the Turnstile widget appears.\n25. `infiniteQueue`: Boolean indicating whether the response is for a user in the infinite queue.\n\nAn example cURL to a waiting room could be:\n\n curl -X GET "https://example.com/waitingroom" \\\n -H "Accept: application/json"\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **fifo** and no event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 0,\n "waitTime50Percentile": 0,\n "waitTime75Percentile": 0,\n "waitTimeFormatted": "10 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "fifo",\n "isFIFOQueue": true,\n "isRandomQueue": false,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": false,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 0,\n "timeUntilEventEndFormatted": "unavailable",\n "shuffleAtEventStart": false\n }\n }\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **random** and an event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 5,\n "waitTime50Percentile": 10,\n "waitTime75Percentile": 15,\n "waitTimeFormatted": "5 minutes to 15 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "random",\n "isFIFOQueue": false,\n "isRandomQueue": true,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": true,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 15,\n "timeUntilEventEndFormatted": "15 minutes",\n "shuffleAtEventStart": true\n }\n }',default:!1}).option(`name`,{type:`string`,description:`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:`Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world.`}).option(`path`,{type:`string`,description:`Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported.`,default:`/`}).option(`queue-all`,{type:`boolean`,description:"If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable.",default:!1}).option(`queueing-method`,{type:`string`,description:"Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.",choices:[`fifo`,`random`,`passthrough`,`reject`],default:`fifo`}).option(`queueing-status-code`,{type:`number`,description:`HTTP status code returned to a user while in the queue.`,default:200}).option(`session-duration`,{type:`number`,description:`Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route.`,default:5}).option(`suspended`,{type:`boolean`,description:"Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room.",default:!1}).option(`total-active-users`,{type:`number`,description:`Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world.`}).option(`turnstile-action`,{type:`string`,description:"Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n",choices:[`log`,`infinite_queue`],default:`log`}).option(`turnstile-mode`,{type:`string`,description:"Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`],default:`invisible`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates a new waiting room.`,builder:v,handler:async e=>c({command:`waiting-rooms create`,classification:{safeFlags:[`cookie-attributes-samesite`,`cookie-attributes-secure`,`default-template-language`,`disable-session-renewal`,`json-response-enabled`,`queue-all`,`queueing-method`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.waitingRooms.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e.host===void 0&&(e.host=await p(`host`,`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`)),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`)),e[`new-users-per-minute`]===void 0)throw Error(`--new-users-per-minute is required (or pass --body with this field set).`);if(e[`total-active-users`]===void 0)throw Error(`--total-active-users is required (or pass --body with this field set).`);let c=d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Creating`,async()=>t.waitingRooms.create({body:c,zone_id:n})),{successLabel:`Created`})})};function b(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <waiting-room-id>`,describe:`Deletes a waiting room.`,builder:b,handler:async e=>c({command:`waiting-rooms delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>t.waitingRooms.delete({zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Deleted`})})};function S(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`additional-routes`,{type:`string`,description:`Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`cookie-attributes-samesite`,{type:`string`,description:"Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.",choices:[`auto`,`lax`,`none`,`strict`]}).option(`cookie-attributes-secure`,{type:`string`,description:"Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.",choices:[`auto`,`always`,`never`]}).option(`cookie-suffix`,{type:`string`,description:"Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is \"abcd\", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`."}).option(`custom-page-html`,{type:`string`,description:"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:\n1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**.\n2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:\n3. {{`waitTime`}} Number of minutes of estimated wait for a user.\n4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`).\n5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`).\n6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue.\n\nTo view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls."}).option(`default-template-language`,{type:`string`,description:"The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.",choices:`en-US.es-ES.de-DE.fr-FR.it-IT.ja-JP.ko-KR.pt-BR.zh-CN.zh-TW.nl-NL.pl-PL.id-ID.tr-TR.ar-EG.ru-RU.fa-IR.bg-BG.hr-HR.cs-CZ.da-DK.fi-FI.lt-LT.ms-MY.nb-NO.ro-RO.el-GR.he-IL.hi-IN.hu-HU.sr-BA.sk-SK.sl-SI.sv-SE.tl-PH.th-TH.uk-UA.vi-VN`.split(`.`)}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the waiting room.`}).option(`disable-session-renewal`,{type:`boolean`,description:"Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request."}).option(`enabled-origin-commands`,{type:`string`,array:!0,description:`A list of enabled origin commands.`}).option(`host`,{type:`string`,description:`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`}).option(`json-response-enabled`,{type:`boolean`,description:'Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user\'s status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields:\n1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room (always **true**).\n2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are accurate. If **false**, they are not available.\n3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When `queueingMethod` is **random**, this is set to `waitTime50Percentile`.\n4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).\n5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before `waitTime50Percentile` and half are expected to be let in after it.\n6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).\n7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display **unavailable**.\n8. `queueIsFull`: Boolean indicating if the waiting room\'s queue is currently full and not accepting new users at the moment.\n9. `queueAll`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.\n10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the user\'s last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after `refreshIntervalSeconds` past this time. If the user makes a request too soon, it will be ignored and `lastUpdated` will not change.\n11. `refreshIntervalSeconds`: Integer indicating the number of seconds after `lastUpdated` until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the `queueingMethod` is `reject`, there is no specified refresh time —\\_it will always be **zero**.\n12. `queueingMethod`: The queueing method currently used by the waiting room. It is either **fifo**, **random**, **passthrough**, or **reject**.\n13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.\n14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.\n15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when `queueAll` is **true** or `isEventPrequeueing` is **true** because in all other cases requests will go directly to the origin.\n16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue.\n17. `isEventActive`: Boolean indicating if an event is currently occurring. Events are able to change a waiting room\'s behavior during a specified period of time. For additional information, look at the event properties `prequeue_start_time`, `event_start_time`, and `event_end_time` in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.\n18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean indicating if an event is currently prequeueing users before it starts.\n19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. Integer indicating the number of minutes until the event starts.\n20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` formatted in English for users. If `isEventPrequeueing` is **false**, `timeUntilEventStartFormatted` will display **unavailable**.\n21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer indicating the number of minutes until the event ends.\n22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` formatted in English for users. If `isEventActive` is **false**, `timeUntilEventEndFormatted` will display **unavailable**.\n23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.\n24. `turnstile`: Empty when turnstile isn\'t enabled. String displaying an html tag to display the Turnstile widget. Please add the `{{{turnstile}}}` tag to the `custom_html` template to ensure the Turnstile widget appears.\n25. `infiniteQueue`: Boolean indicating whether the response is for a user in the infinite queue.\n\nAn example cURL to a waiting room could be:\n\n curl -X GET "https://example.com/waitingroom" \\\n -H "Accept: application/json"\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **fifo** and no event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 0,\n "waitTime50Percentile": 0,\n "waitTime75Percentile": 0,\n "waitTimeFormatted": "10 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "fifo",\n "isFIFOQueue": true,\n "isRandomQueue": false,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": false,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 0,\n "timeUntilEventEndFormatted": "unavailable",\n "shuffleAtEventStart": false\n }\n }\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **random** and an event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 5,\n "waitTime50Percentile": 10,\n "waitTime75Percentile": 15,\n "waitTimeFormatted": "5 minutes to 15 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "random",\n "isFIFOQueue": false,\n "isRandomQueue": true,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": true,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 15,\n "timeUntilEventEndFormatted": "15 minutes",\n "shuffleAtEventStart": true\n }\n }'}).option(`name`,{type:`string`,description:`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:`Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world.`}).option(`path`,{type:`string`,description:`Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported.`}).option(`queue-all`,{type:`boolean`,description:"If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable."}).option(`queueing-method`,{type:`string`,description:"Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.",choices:[`fifo`,`random`,`passthrough`,`reject`]}).option(`queueing-status-code`,{type:`number`,description:`HTTP status code returned to a user while in the queue.`}).option(`session-duration`,{type:`number`,description:`Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route.`}).option(`suspended`,{type:`boolean`,description:"Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room."}).option(`total-active-users`,{type:`number`,description:`Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world.`}).option(`turnstile-action`,{type:`string`,description:"Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n",choices:[`log`,`infinite_queue`]}).option(`turnstile-mode`,{type:`string`,description:"Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`edit <waiting-room-id>`,describe:`Patches a configured waiting room.`,builder:S,handler:async e=>c({command:`waiting-rooms edit`,classification:{safeFlags:[`cookie-attributes-samesite`,`cookie-attributes-secure`,`default-template-language`,`disable-session-renewal`,`json-response-enabled`,`queue-all`,`queueing-method`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.edit({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Updated`});return}if(e.host===void 0&&(e.host=await p(`host`,`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`)),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`)),e[`new-users-per-minute`]===void 0)throw Error(`--new-users-per-minute is required (or pass --body with this field set).`);if(e[`total-active-users`]===void 0)throw Error(`--total-active-users is required (or pass --body with this field set).`);let c=d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Updating`,async()=>t.waitingRooms.edit({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Updated`})})};function w(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`custom-page-html`,{type:`string`,description:"If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it."}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the event.`,default:``}).option(`disable-session-renewal`,{type:`boolean`,description:"If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it."}).option(`event-end-time`,{type:`string`,description:`An ISO 8601 timestamp that marks the end of the event.`}).option(`event-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`."}).option(`name`,{type:`string`,description:`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:"If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set."}).option(`prequeue-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`."}).option(`queueing-method`,{type:`string`,description:"If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it."}).option(`session-duration`,{type:`number`,description:"If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it."}).option(`shuffle-at-event-start`,{type:`boolean`,description:"If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary.",default:!1}).option(`suspended`,{type:`boolean`,description:"Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration.",default:!1}).option(`total-active-users`,{type:`number`,description:"If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set."}).option(`turnstile-action`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it.",choices:[`log`,`infinite_queue`]}).option(`turnstile-mode`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it.",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create <waiting-room-id>`,describe:`Only available for the Waiting Room Advanced subscription. Creates an event for a waiting room. An event takes place during a specified period of time, temporarily changing the behavior of a waiting room. While the event is active, some of the properties in the event's configuration may either override or inherit from the waiting room's configuration. Note that events cannot overlap with each other, so only one event can be active at a time.`,builder:w,handler:async e=>c({command:`waiting-rooms events create`,classification:{safeFlags:[`disable-session-renewal`,`shuffle-at-event-start`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.waitingRooms.events.create({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Created`});return}e[`event-end-time`]===void 0&&(e[`event-end-time`]=await p(`event-end-time`,`An ISO 8601 timestamp that marks the end of the event.`)),e[`event-start-time`]===void 0&&(e[`event-start-time`]=await p(`event-start-time`,"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`.")),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`));let c=d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Creating`,async()=>t.waitingRooms.events.create({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Created`})})};function E(e){return e.positional(`event-id`,{type:`string`,description:`Event ID`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <event-id>`,describe:`Deletes an event for a waiting room.`,builder:E,handler:async e=>c({command:`waiting-rooms events delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events/${e[`event-id`]==null?`<event-id>`:encodeURIComponent(String(e[`event-id`]))}`,pathParams:{"event-id":String(e[`event-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>t.waitingRooms.events.delete({zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Deleted`})})};function O(e){return e.positional(`event-id`,{type:`string`,description:`Event ID`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <event-id>`,describe:`Previews an event's configuration as if it was active. Inherited fields from the waiting room will be displayed with their current values.`,builder:O,handler:async e=>c({command:`waiting-rooms events details get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events details get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events/${e[`event-id`]==null?`<event-id>`:encodeURIComponent(String(e[`event-id`]))}/details`,pathParams:{"event-id":String(e[`event-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.events.details.get({zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Loaded`})})},A={command:`details`,describe:`Operations for events.details`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`event-id`,{type:`string`,description:`Event ID`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`custom-page-html`,{type:`string`,description:"If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it."}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the event.`}).option(`disable-session-renewal`,{type:`boolean`,description:"If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it."}).option(`event-end-time`,{type:`string`,description:`An ISO 8601 timestamp that marks the end of the event.`}).option(`event-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`."}).option(`name`,{type:`string`,description:`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:"If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set."}).option(`prequeue-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`."}).option(`queueing-method`,{type:`string`,description:"If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it."}).option(`session-duration`,{type:`number`,description:"If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it."}).option(`shuffle-at-event-start`,{type:`boolean`,description:"If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary."}).option(`suspended`,{type:`boolean`,description:"Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration."}).option(`total-active-users`,{type:`number`,description:"If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set."}).option(`turnstile-action`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it.",choices:[`log`,`infinite_queue`]}).option(`turnstile-mode`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it.",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`]}).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:`edit <event-id>`,describe:`Patches a configured event for a waiting room.`,builder:j,handler:async e=>c({command:`waiting-rooms events edit`,classification:{safeFlags:[`disable-session-renewal`,`shuffle-at-event-start`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events/${e[`event-id`]==null?`<event-id>`:encodeURIComponent(String(e[`event-id`]))}`,pathParams:{"event-id":String(e[`event-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.events.edit({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Updated`});return}e[`event-end-time`]===void 0&&(e[`event-end-time`]=await p(`event-end-time`,`An ISO 8601 timestamp that marks the end of the event.`)),e[`event-start-time`]===void 0&&(e[`event-start-time`]=await p(`event-start-time`,"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`.")),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`));let c=d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Updating`,async()=>t.waitingRooms.events.edit({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Updated`})})};function N(e){return e.positional(`event-id`,{type:`string`,description:`Event ID`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <event-id>`,describe:`Fetches a single configured event for a waiting room.`,builder:N,handler:async e=>c({command:`waiting-rooms events get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events/${e[`event-id`]==null?`<event-id>`:encodeURIComponent(String(e[`event-id`]))}`,pathParams:{"event-id":String(e[`event-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.events.get({zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Loaded`})})};function F(e){return e.option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists events for a waiting room.`,builder:F,handler:async e=>c({command:`waiting-rooms events list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf waiting-rooms events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.waitingRooms.events.list({zone_id:c,waiting_room_id:e[`waiting-room-id`],...t})),{successLabel:`Loaded`})})};function L(e){return e.positional(`event-id`,{type:`string`,description:`Event ID`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`custom-page-html`,{type:`string`,description:"If set, the event will override the waiting room's `custom_page_html` property while it is active. If null, the event will inherit it."}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the event.`}).option(`disable-session-renewal`,{type:`boolean`,description:"If set, the event will override the waiting room's `disable_session_renewal` property while it is active. If null, the event will inherit it."}).option(`event-end-time`,{type:`string`,description:`An ISO 8601 timestamp that marks the end of the event.`}).option(`event-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`."}).option(`name`,{type:`string`,description:`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:"If set, the event will override the waiting room's `new_users_per_minute` property while it is active. If null, the event will inherit it. This can only be set if the event's `total_active_users` property is also set."}).option(`prequeue-start-time`,{type:`string`,description:"An ISO 8601 timestamp that marks when to begin queueing all users before the event starts. The prequeue must start at least five minutes before `event_start_time`."}).option(`queueing-method`,{type:`string`,description:"If set, the event will override the waiting room's `queueing_method` property while it is active. If null, the event will inherit it."}).option(`session-duration`,{type:`number`,description:"If set, the event will override the waiting room's `session_duration` property while it is active. If null, the event will inherit it."}).option(`shuffle-at-event-start`,{type:`boolean`,description:"If enabled, users in the prequeue will be shuffled randomly at the `event_start_time`. Requires that `prequeue_start_time` is not null. This is useful for situations when many users will join the event prequeue at the same time and you want to shuffle them to ensure fairness. Naturally, it makes the most sense to enable this feature when the `queueing_method` during the event respects ordering such as **fifo**, or else the shuffling may be unnecessary."}).option(`suspended`,{type:`boolean`,description:"Suspends or allows an event. If set to `true`, the event is ignored and traffic will be handled based on the waiting room configuration."}).option(`total-active-users`,{type:`number`,description:"If set, the event will override the waiting room's `total_active_users` property while it is active. If null, the event will inherit it. This can only be set if the event's `new_users_per_minute` property is also set."}).option(`turnstile-action`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_action` property while it is active. If null, the event will inherit it.",choices:[`log`,`infinite_queue`]}).option(`turnstile-mode`,{type:`string`,description:"If set, the event will override the waiting room's `turnstile_mode` property while it is active. If null, the event will inherit it.",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`update <event-id>`,describe:`Updates a configured event for a waiting room.`,builder:L,handler:async e=>c({command:`waiting-rooms events update`,classification:{safeFlags:[`disable-session-renewal`,`shuffle-at-event-start`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms events update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/events/${e[`event-id`]==null?`<event-id>`:encodeURIComponent(String(e[`event-id`]))}`,pathParams:{"event-id":String(e[`event-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.events.update({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Updated`});return}e[`event-end-time`]===void 0&&(e[`event-end-time`]=await p(`event-end-time`,`An ISO 8601 timestamp that marks the end of the event.`)),e[`event-start-time`]===void 0&&(e[`event-start-time`]=await p(`event-start-time`,"An ISO 8601 timestamp that marks the start of the event. At this time, queued users will be processed with the event's configuration. The start time must be at least one minute before `event_end_time`.")),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the event. Only alphanumeric characters, hyphens and underscores are allowed.`));let c=d({custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],event_end_time:f(e[`event-end-time`],`event-end-time`,`text`),event_start_time:f(e[`event-start-time`],`event-start-time`,`text`),name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],prequeue_start_time:f(e[`prequeue-start-time`],`prequeue-start-time`,`text`),queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),session_duration:e[`session-duration`],shuffle_at_event_start:e[`shuffle-at-event-start`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Updating`,async()=>t.waitingRooms.events.update({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`],event_id:e[`event-id`]})),{successLabel:`Updated`})})},z={command:`events`,describe:`Scheduled events that temporarily override waiting room settings for sales, launches, etc.`,builder:e=>e.command(T).command(D).command(M).command(P).command(I).command(R).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <waiting-room-id>`,describe:`Fetches a single configured waiting room.`,builder:te,handler:async e=>c({command:`waiting-rooms get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.get({zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Loaded`})})};function V(e){return e.option(`custom-html`,{type:`string`,description:"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:\n1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**.\n2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:\n3. {{`waitTime`}} Number of minutes of estimated wait for a user.\n4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`).\n5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`).\n6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue.\n\nTo view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls.",default:``}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`preview`,describe:'Creates a waiting room page preview. Upload a custom waiting room page for preview. You will receive a preview URL in the form `http://waitingrooms.dev/preview/<uuid>`. You can use the following query parameters to change the state of the preview: 1. `force_queue`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website (also known as queueAll). 2. `queue_is_full`: Boolean indicating if the waiting room\'s queue is currently full and not accepting new users at the moment. 3. `queueing_method`: The queueing method currently used by the waiting room. - **fifo** indicates a FIFO queue. - **random** indicates a Random queue. - **passthrough** indicates a Passthrough queue. Keep in mind that the waiting room page will only be displayed if `force_queue=true` or `event=prequeueing` — for other cases the request will pass through to the origin. For our preview, this will be a fake origin website returning \\"Welcome\\". - **reject** indicates a Reject queue. 4. `event`: Used to preview a waiting room event. - **none** indicates no event is occurring. - **prequeueing** indicates that an event is prequeueing (between `prequeue_start_time` and `event_start_time`). - **started** indicates that an event has started (between `event_start_time` and `event_end_time`). 5. `shuffle_at_event_start`: Boolean indicating if the event will shuffle users in the prequeue when it starts. This can only be set to **true** if an event is active (`event` is not **none**). For example, you can make a request to `http://waitingrooms.dev/preview/<uuid>?force_queue=false&queue_is_full=false&queueing_method=random&event=started&shuffle_at_event_start=true` 6. `waitTime`: Non-zero, positive integer indicating the estimated wait time in minutes. The default value is 10 minutes. For example, you can make a request to `http://waitingrooms.dev/preview/<uuid>?waitTime=50` to configure the estimated wait time as 50 minutes.',builder:V,handler:async e=>c({command:`waiting-rooms page preview`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms page preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({custom_html:f(e[`custom-html`],`custom-html`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Loading`,async()=>t.waitingRooms.page.preview({...r,zone_id:n})),{successLabel:`Loaded`});return}e[`custom-html`]===void 0&&(e[`custom-html`]=await p(`custom-html`,"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge: 1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**. 2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use: 3. {{`waitTime`}} Number of minutes of estimated wait for a user. 4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`). 5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`). 6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue. To view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls."));let c=d({custom_html:f(e[`custom-html`],`custom-html`,`text`)});a(await s(`Loading`,async()=>t.waitingRooms.page.preview({...c,zone_id:n})),{successLabel:`Loaded`})})},U={command:`page`,describe:`Custom HTML waiting page templates and preview rendering`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take when the expression matches.`,choices:[`bypass_waiting_room`]}).option(`description`,{type:`string`,description:`The description of the rule.`,default:``}).option(`enabled`,{type:`boolean`,description:`When set to true, the rule is enabled.`,default:!0}).option(`expression`,{type:`string`,description:`Criteria defining when there is a match for the current rule.`}).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 <waiting-room-id>`,describe:`Only available for the Waiting Room Advanced subscription. Creates a rule for a waiting room.`,builder:W,handler:async e=>c({command:`waiting-rooms rules create`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({action:f(e.action,`action`,`text`),description:f(e.description,`description`,`text`),enabled:e.enabled,expression:f(e.expression,`expression`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.waitingRooms.rules.create({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,`The action to take when the expression matches.`,[`bypass_waiting_room`])),e.expression===void 0&&(e.expression=await p(`expression`,`Criteria defining when there is a match for the current rule.`));let c=d({action:f(e.action,`action`,`text`),description:f(e.description,`description`,`text`),enabled:e.enabled,expression:f(e.expression,`expression`,`text`)});a(await s(`Creating`,async()=>t.waitingRooms.rules.create({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Created`})})};function K(e){return e.positional(`rule-id`,{type:`string`,description:`The ID of the rule.`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const q={command:`delete <rule-id>`,describe:`Deletes a rule for a waiting room.`,builder:K,handler:async e=>c({command:`waiting-rooms rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}a(await s(`Deleting`,async()=>t.waitingRooms.rules.delete({zone_id:n,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]})),{successLabel:`Deleted`})})};function J(e){return e.positional(`rule-id`,{type:`string`,description:`The ID of the rule.`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take when the expression matches.`,choices:[`bypass_waiting_room`]}).option(`description`,{type:`string`,description:`The description of the rule.`}).option(`enabled`,{type:`boolean`,description:`When set to true, the rule is enabled.`}).option(`expression`,{type:`string`,description:`Criteria defining when there is a match for the current rule.`}).option(`position-index`,{type:`number`,description:`Places the rule in the exact position specified by the integer number <POSITION_NUMBER>. Position numbers start with 1. Existing rules in the ruleset from the specified position number onward are shifted one position (no rule is overwritten).`}).option(`position-before`,{type:`string`,description:`Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the first rule in the ruleset.`}).option(`position-after`,{type:`string`,description:`Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the last rule in the ruleset.`}).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(`position-index`,[`position-before`,`position-after`]).conflicts(`position-before`,[`position-index`,`position-after`]).conflicts(`position-after`,[`position-index`,`position-before`])}const Y={command:`edit <rule-id>`,describe:`Patches a rule for a waiting room.`,builder:J,handler:async e=>c({command:`waiting-rooms rules edit`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({action:f(e.action,`action`,`text`),description:f(e.description,`description`,`text`),enabled:e.enabled,expression:f(e.expression,`expression`,`text`),position:{index:e[`position-index`],before:f(e[`position-before`],`position-before`,`text`),after:f(e[`position-after`],`position-after`,`text`)}}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.rules.edit({...r,zone_id:n,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]})),{successLabel:`Updated`});return}e.action===void 0&&(e.action=await m(`action`,`The action to take when the expression matches.`,[`bypass_waiting_room`])),e.expression===void 0&&(e.expression=await p(`expression`,`Criteria defining when there is a match for the current rule.`));let c=d({action:f(e.action,`action`,`text`),description:f(e.description,`description`,`text`),enabled:e.enabled,expression:f(e.expression,`expression`,`text`),position:{index:e[`position-index`],before:f(e[`position-before`],`position-before`,`text`),after:f(e[`position-after`],`position-after`,`text`)}});a(await s(`Updating`,async()=>t.waitingRooms.rules.edit({...c,zone_id:n,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]})),{successLabel:`Updated`})})};function X(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <waiting-room-id>`,describe:`Lists rules for a waiting room.`,builder:X,handler:async e=>c({command:`waiting-rooms rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.rules.get({zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Loaded`})})};function Q(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,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 ne={command:`update <waiting-room-id>`,describe:`Only available for the Waiting Room Advanced subscription. Replaces all rules for a waiting room.`,builder:Q,handler:async e=>c({command:`waiting-rooms rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.rules.update({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},re={command:`rules`,describe:`Rules that bypass or modify waiting room behavior for specific request patterns`,builder:e=>e.command(G).command(q).command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.option(`search-engine-crawler-bypass`,{type:`boolean`,description:`Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.
6
- Verified search engine crawlers will not be tracked or counted by the waiting room system,
7
- and will not appear in waiting room analytics.
8
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`edit`,describe:`Patch zone-level Waiting Room settings.`,builder:ie,handler:async e=>c({command:`waiting-rooms settings edit`,classification:{safeFlags:[`search-engine-crawler-bypass`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({search_engine_crawler_bypass:e[`search-engine-crawler-bypass`]}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.settings.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let c=d({search_engine_crawler_bypass:e[`search-engine-crawler-bypass`]});a(await s(`Updating`,async()=>t.waitingRooms.settings.edit({body:c,zone_id:n})),{successLabel:`Updated`})})};function oe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get`,describe:`Get zone-level Waiting Room settings.`,builder:oe,handler:async e=>c({command:`waiting-rooms settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.settings.get({zone_id:n})),{successLabel:`Loaded`})})};function se(e){return e.option(`search-engine-crawler-bypass`,{type:`boolean`,description:`Whether to allow verified search engine crawlers to bypass all waiting rooms on this zone.
9
- Verified search engine crawlers will not be tracked or counted by the waiting room system,
10
- and will not appear in waiting room analytics.
11
- `}).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 ce={command:`update`,describe:`Replace zone-level Waiting Room settings.`,builder:se,handler:async e=>c({command:`waiting-rooms settings update`,classification:{safeFlags:[`search-engine-crawler-bypass`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({search_engine_crawler_bypass:e[`search-engine-crawler-bypass`]}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.settings.update({body:r,zone_id:n})),{successLabel:`Updated`});return}let c=d({search_engine_crawler_bypass:e[`search-engine-crawler-bypass`]});a(await s(`Updating`,async()=>t.waitingRooms.settings.update({body:c,zone_id:n})),{successLabel:`Updated`})})},le={command:`settings`,describe:`Zone-level waiting room defaults and cookie configuration`,builder:e=>e.command(ae).command($).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <waiting-room-id>`,describe:"Fetches the status of a configured waiting room. Response fields include: 1. `status`: String indicating the status of the waiting room. The possible status are: - **not_queueing** indicates that the configured thresholds have not been met and all users are going through to the origin. - **queueing** indicates that the thresholds have been met and some users are held in the waiting room. - **event_prequeueing** indicates that an event is active and is currently prequeueing users before it starts. - **suspended** indicates that the room is suspended. 2. `event_id`: String of the current event's `id` if an event is active, otherwise an empty string. 3. `estimated_queued_users`: Integer of the estimated number of users currently waiting in the queue. 4. `estimated_total_active_users`: Integer of the estimated number of users currently active on the origin. 5. `max_estimated_time_minutes`: Integer of the maximum estimated time currently presented to the users.",builder:ue,handler:async e=>c({command:`waiting-rooms statuses get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms statuses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/status`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.waitingRooms.statuses.get({zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Loaded`})})},fe={command:`statuses`,describe:`Real-time queue status showing active users, queued users, and estimated wait times`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`additional-routes`,{type:`string`,description:`Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`cookie-attributes-samesite`,{type:`string`,description:"Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.",choices:[`auto`,`lax`,`none`,`strict`]}).option(`cookie-attributes-secure`,{type:`string`,description:"Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.",choices:[`auto`,`always`,`never`]}).option(`cookie-suffix`,{type:`string`,description:"Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is \"abcd\", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`."}).option(`custom-page-html`,{type:`string`,description:"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:\n1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**.\n2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:\n3. {{`waitTime`}} Number of minutes of estimated wait for a user.\n4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`).\n5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`).\n6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue.\n\nTo view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls."}).option(`default-template-language`,{type:`string`,description:"The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.",choices:`en-US.es-ES.de-DE.fr-FR.it-IT.ja-JP.ko-KR.pt-BR.zh-CN.zh-TW.nl-NL.pl-PL.id-ID.tr-TR.ar-EG.ru-RU.fa-IR.bg-BG.hr-HR.cs-CZ.da-DK.fi-FI.lt-LT.ms-MY.nb-NO.ro-RO.el-GR.he-IL.hi-IN.hu-HU.sr-BA.sk-SK.sl-SI.sv-SE.tl-PH.th-TH.uk-UA.vi-VN`.split(`.`)}).option(`description`,{type:`string`,description:`A note that you can use to add more details about the waiting room.`}).option(`disable-session-renewal`,{type:`boolean`,description:"Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request."}).option(`enabled-origin-commands`,{type:`string`,array:!0,description:`A list of enabled origin commands.`}).option(`host`,{type:`string`,description:`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`}).option(`json-response-enabled`,{type:`boolean`,description:'Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user\'s status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields:\n1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room (always **true**).\n2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are accurate. If **false**, they are not available.\n3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When `queueingMethod` is **random**, this is set to `waitTime50Percentile`.\n4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).\n5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before `waitTime50Percentile` and half are expected to be let in after it.\n6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).\n7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display **unavailable**.\n8. `queueIsFull`: Boolean indicating if the waiting room\'s queue is currently full and not accepting new users at the moment.\n9. `queueAll`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.\n10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the user\'s last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after `refreshIntervalSeconds` past this time. If the user makes a request too soon, it will be ignored and `lastUpdated` will not change.\n11. `refreshIntervalSeconds`: Integer indicating the number of seconds after `lastUpdated` until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the `queueingMethod` is `reject`, there is no specified refresh time —\\_it will always be **zero**.\n12. `queueingMethod`: The queueing method currently used by the waiting room. It is either **fifo**, **random**, **passthrough**, or **reject**.\n13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.\n14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.\n15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when `queueAll` is **true** or `isEventPrequeueing` is **true** because in all other cases requests will go directly to the origin.\n16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue.\n17. `isEventActive`: Boolean indicating if an event is currently occurring. Events are able to change a waiting room\'s behavior during a specified period of time. For additional information, look at the event properties `prequeue_start_time`, `event_start_time`, and `event_end_time` in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.\n18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean indicating if an event is currently prequeueing users before it starts.\n19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. Integer indicating the number of minutes until the event starts.\n20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` formatted in English for users. If `isEventPrequeueing` is **false**, `timeUntilEventStartFormatted` will display **unavailable**.\n21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer indicating the number of minutes until the event ends.\n22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` formatted in English for users. If `isEventActive` is **false**, `timeUntilEventEndFormatted` will display **unavailable**.\n23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.\n24. `turnstile`: Empty when turnstile isn\'t enabled. String displaying an html tag to display the Turnstile widget. Please add the `{{{turnstile}}}` tag to the `custom_html` template to ensure the Turnstile widget appears.\n25. `infiniteQueue`: Boolean indicating whether the response is for a user in the infinite queue.\n\nAn example cURL to a waiting room could be:\n\n curl -X GET "https://example.com/waitingroom" \\\n -H "Accept: application/json"\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **fifo** and no event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 0,\n "waitTime50Percentile": 0,\n "waitTime75Percentile": 0,\n "waitTimeFormatted": "10 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "fifo",\n "isFIFOQueue": true,\n "isRandomQueue": false,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": false,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 0,\n "timeUntilEventEndFormatted": "unavailable",\n "shuffleAtEventStart": false\n }\n }\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **random** and an event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 5,\n "waitTime50Percentile": 10,\n "waitTime75Percentile": 15,\n "waitTimeFormatted": "5 minutes to 15 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "random",\n "isFIFOQueue": false,\n "isRandomQueue": true,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": true,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 15,\n "timeUntilEventEndFormatted": "15 minutes",\n "shuffleAtEventStart": true\n }\n }'}).option(`name`,{type:`string`,description:`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:`Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world.`}).option(`path`,{type:`string`,description:`Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported.`}).option(`queue-all`,{type:`boolean`,description:"If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable."}).option(`queueing-method`,{type:`string`,description:"Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.",choices:[`fifo`,`random`,`passthrough`,`reject`]}).option(`queueing-status-code`,{type:`number`,description:`HTTP status code returned to a user while in the queue.`}).option(`session-duration`,{type:`number`,description:`Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route.`}).option(`suspended`,{type:`boolean`,description:"Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room."}).option(`total-active-users`,{type:`number`,description:`Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world.`}).option(`turnstile-action`,{type:`string`,description:"Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n",choices:[`log`,`infinite_queue`]}).option(`turnstile-mode`,{type:`string`,description:"Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`]}).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 me={command:`update <waiting-room-id>`,describe:`Updates a configured waiting room.`,builder:pe,handler:async e=>c({command:`waiting-rooms update`,classification:{safeFlags:[`cookie-attributes-samesite`,`cookie-attributes-secure`,`default-template-language`,`disable-session-renewal`,`json-response-enabled`,`queue-all`,`queueing-method`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf waiting-rooms update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}`,pathParams:{"waiting-room-id":String(e[`waiting-room-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.waitingRooms.update({body:r,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Updated`});return}if(e.host===void 0&&(e.host=await p(`host`,`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`)),e.name===void 0&&(e.name=await p(`name`,`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`)),e[`new-users-per-minute`]===void 0)throw Error(`--new-users-per-minute is required (or pass --body with this field set).`);if(e[`total-active-users`]===void 0)throw Error(`--total-active-users is required (or pass --body with this field set).`);let c=d({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:f(e[`cookie-attributes-samesite`],`cookie-attributes-samesite`,`text`),secure:f(e[`cookie-attributes-secure`],`cookie-attributes-secure`,`text`)},cookie_suffix:f(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:f(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:f(e[`default-template-language`],`default-template-language`,`text`),description:f(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:f(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:f(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:f(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:f(e[`queueing-method`],`queueing-method`,`text`),queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:f(e[`turnstile-action`],`turnstile-action`,`text`),turnstile_mode:f(e[`turnstile-mode`],`turnstile-mode`,`text`)});a(await s(`Updating`,async()=>t.waitingRooms.update({body:c,zone_id:n,waiting_room_id:e[`waiting-room-id`]})),{successLabel:`Updated`})})},he={command:`waiting-rooms`,describe:`Virtual queues that throttle traffic to your site during peak demand with customizable waiting pages`,builder:e=>e.command(y).command(x).command(C).command(B).command(me).command(_).command(z).command(U).command(re).command(le).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{he as default};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-DH3kMXSs.mjs";import{r as t}from"./auth-tvDdC1J-.mjs";import{t as n}from"./output-COcSQsfn.mjs";import{t as r}from"./dry-run-DiVy1lVo.mjs";import{t as i}from"./progress-V6SZV3Ux.mjs";import{t as a}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as o,t as s}from"./body-parser-DIlfApuJ.mjs";import{n as c}from"./input-validation-BxchZ9jE.mjs";import{a as l,i as u,n as d}from"./prompt-DjRTpML4.mjs";import{t as f}from"./cli-types-CrSoSMPF.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get`,describe:`Returns the latest API operations discovered from zone traffic, rendered as OpenAPI schemas.`,builder:p,handler:async o=>a({command:`web-assets discovery get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web-assets discovery get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/discovery`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.webAssets.discovery.get({zone_id:s})),{successLabel:`Loaded`})})};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`bulk-edit`,describe:`Updates the state of one or more discovered web and API operations.`,builder:m,handler:async s=>a({command:`web-assets discovery operations bulk-edit`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web-assets discovery operations bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/discovery/operations`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.webAssets.discovery.operations.bulkEdit({body:e,zone_id:c})),{successLabel:`Updated`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function g(e){return e.positional(`discovery-id`,{type:`string`,description:`Discovery ID of a discovered operation`,demandOption:!0}).option(`state`,{type:`string`,description:"Mark state of operation in API Discovery\n * `review` - Mark operation as for review\n * `ignored` - Mark operation as ignored\n",choices:[`review`,`ignored`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <discovery-id>`,describe:`Updates the state of a discovered web or API operation.`,builder:g,handler:async l=>a({command:`web-assets discovery operations edit`,classification:{safeFlags:[`state`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf web-assets discovery operations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/api_gateway/discovery/operations/${l[`discovery-id`]==null?`<discovery-id>`:encodeURIComponent(String(l[`discovery-id`]))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),"discovery-id":String(l[`discovery-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({state:c(l.state,`state`,`text`)}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Updating`,async()=>a.webAssets.discovery.operations.edit({...e,zone_id:u,discovery_id:l[`discovery-id`]})),{successLabel:`Updated`});return}let d=s({state:c(l.state,`state`,`text`)});n(await i(`Updating`,async()=>a.webAssets.discovery.operations.edit({...d,zone_id:u,discovery_id:l[`discovery-id`]})),{successLabel:`Updated`})})};function v(e){return e.positional(`discovery-id`,{type:`string`,description:`Discovery ID of a discovered operation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <discovery-id>`,describe:`Returns a discovered web or API operation by discovery ID.`,builder:v,handler:async o=>a({command:`web-assets discovery operations get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web-assets discovery operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/discovery/operations/${o[`discovery-id`]==null?`<discovery-id>`:encodeURIComponent(String(o[`discovery-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"discovery-id":String(o[`discovery-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.webAssets.discovery.operations.get({zone_id:s,discovery_id:o[`discovery-id`]})),{successLabel:`Loaded`})})};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`order`,{type:`string`,description:`Field to order by`,choices:[`host`,`method`,`endpoint`,`traffic_stats.requests`,`traffic_stats.last_updated`]}).option(`diff`,{type:`boolean`,description:"When `true`, only return API Discovery results that are not saved into API Shield Endpoint Management"}).option(`origin`,{type:`string`,description:"Filter results to only include discovery results sourced from a particular discovery engine\n * `ML` - Discovered operations that were sourced using ML API Discovery\n * `SessionIdentifier` - Discovered operations that were sourced using Session Identifier API Discovery",choices:[`ML`,`SessionIdentifier`,`LabelDiscovery`]}).option(`state`,{type:`string`,description:"Filter results to only include discovery results in a particular state. States are as follows\n * `review` - Discovered operations that are not saved into API Shield Endpoint Management\n * `saved` - Discovered operations that are already saved into API Shield Endpoint Management\n * `ignored` - Discovered operations that have been marked as ignored",choices:[`review`,`saved`,`ignored`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Returns the latest web and API operations discovered from zone traffic.`,builder:f(b),handler:async o=>a({command:`web-assets discovery operations list`,classification:{safeFlags:[`direction`,`order`,`diff`,`origin`,`state`,`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],host:o.host,method:o.method,endpoint:o.endpoint,direction:o.direction,order:o.order,diff:o.diff,origin:o.origin,state:o.state};if(o.dryRun){r({command:`cf web-assets discovery operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/discovery/operations`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.discovery.operations.list({zone_id:c,...a})),{successLabel:`Loaded`})})},S={command:`operations`,describe:`Operations for discovery.operations`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`discovery`,describe:`Operations for discovery`,builder:e=>e.command(ee).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`order`,{type:`string`,description:`Field to order by`,choices:[`name`,`description`,`created_at`,`last_updated`,`mapped_resources.operations`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`source`,{type:`string`,description:`Filter for labels with source`,choices:[`user`,`managed`]}).option(`filter`,{type:`string`,description:`Filter for labels where the name or description matches using substring match`}).option(`with-mapped-resource-counts`,{type:`boolean`,description:"Include `mapped_resources` for each label"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`Returns all managed and user-defined labels available for web and API operations in the zone.`,builder:f(w),handler:async o=>a({command:`web-assets labels list`,classification:{safeFlags:[`order`,`direction`,`source`,`with-mapped-resource-counts`,`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],order:o.order,direction:o.direction,source:o.source,filter:o.filter,with_mapped_resource_counts:o[`with-mapped-resource-counts`]};if(o.dryRun){r({command:`cf web-assets labels list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/labels`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.labels.list({zone_id:c,...a})),{successLabel:`Loaded`})})};function E(e){return e.positional(`name`,{type:`string`,description:`The label name`,demandOption:!0}).option(`with-mapped-resource-counts`,{type:`boolean`,description:"Include `mapped_resources` for each label"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <name>`,describe:`Returns a managed label and the web and API operations associated with it.`,builder:E,handler:async o=>a({command:`web-assets labels managed get`,classification:{safeFlags:[`with-mapped-resource-counts`,`dry-run`]}},o,async()=>{let a={with_mapped_resource_counts:o[`with-mapped-resource-counts`]};if(o.dryRun){r({command:`cf web-assets labels managed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/labels/managed/${o.name==null?`<name>`:encodeURIComponent(String(o.name))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),name:String(o.name??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.labels.managed.get({zone_id:c,name:o.name,...a})),{successLabel:`Loaded`})})};function O(e){return e.positional(`name`,{type:`string`,description:`The label name`,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 k={command:`update <name>`,describe:`Replaces the complete set of web and API operations attached to the managed label.`,builder:O,handler:async s=>a({command:`web-assets labels managed operations update`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web-assets labels managed operations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/labels/managed/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/resources/operation`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``),name:String(s.name??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.webAssets.labels.managed.operations.update({body:e,zone_id:c,name:s.name})),{successLabel:`Updated`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},A={command:`operations`,describe:`Operations for labels.managed.operations`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`managed`,describe:`Operations for labels.managed`,builder:e=>e.command(D).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`bulk-create`,describe:`Creates one or more user-defined labels for classifying web and API operations.`,builder:M,handler:async s=>a({command:`web-assets labels user bulk-create`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web-assets labels user bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/labels/user`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.webAssets.labels.user.bulkCreate({body:e,zone_id:c})),{successLabel:`Created`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`bulk-delete`,describe:`Deletes one or more user-defined labels and removes their associations with web and API operations.`,builder:P,handler:async s=>a({command:`web-assets labels user bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},s,async()=>{if(s.dryRun){r({command:`cf web-assets labels user bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/labels/user`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,!await d({force:!!s.force,message:`This operation deletes the selected user-defined labels and removes them from associated web and API operations.`})){process.stderr.write(`Aborted.
3
- `);return}if(s.body){let e=o(s.body);n(await i(`Deleting`,async()=>a.webAssets.labels.user.bulkDelete({body:e,zone_id:c})),{successLabel:`Deleted`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function I(e){return e.positional(`name`,{type:`string`,description:`The label name`,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 L={command:`delete <name>`,describe:`Deletes a user-defined label and removes its associations with web and API operations.`,builder:I,handler:async o=>a({command:`web-assets labels user delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf web-assets labels user delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/labels/user/${o.name==null?`<name>`:encodeURIComponent(String(o.name))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),name:String(o.name??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force,message:`This operation deletes the user-defined label and removes it from associated web and API operations.`})){process.stderr.write(`Aborted.
4
- `);return}n(await i(`Deleting`,async()=>a.webAssets.labels.user.delete({zone_id:s,name:o.name})),{successLabel:`Deleted`})})};function R(e){return e.positional(`name`,{type:`string`,description:`The label name`,demandOption:!0}).option(`description`,{type:`string`,description:`The description of the label`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`edit <name>`,describe:`Updates only the supplied fields on a user-defined label.`,builder:R,handler:async l=>a({command:`web-assets labels user edit`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf web-assets labels user edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/api_gateway/labels/user/${l.name==null?`<name>`:encodeURIComponent(String(l.name))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),name:String(l.name??``)},bodyKind:`json`,body:l.body===void 0?s({description:c(l.description,`description`,`text`)}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Updating`,async()=>a.webAssets.labels.user.edit({...e,zone_id:u,name:l.name})),{successLabel:`Updated`});return}let d=s({description:c(l.description,`description`,`text`)});n(await i(`Updating`,async()=>a.webAssets.labels.user.edit({...d,zone_id:u,name:l.name})),{successLabel:`Updated`})})};function B(e){return e.positional(`name`,{type:`string`,description:`The label name`,demandOption:!0}).option(`with-mapped-resource-counts`,{type:`boolean`,description:"Include `mapped_resources` for each label"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <name>`,describe:`Returns a user-defined label and the web and API operations associated with it.`,builder:B,handler:async o=>a({command:`web-assets labels user get`,classification:{safeFlags:[`with-mapped-resource-counts`,`dry-run`]}},o,async()=>{let a={with_mapped_resource_counts:o[`with-mapped-resource-counts`]};if(o.dryRun){r({command:`cf web-assets labels user get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/labels/user/${o.name==null?`<name>`:encodeURIComponent(String(o.name))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),name:String(o.name??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.labels.user.get({zone_id:c,name:o.name,...a})),{successLabel:`Loaded`})})};function H(e){return e.positional(`name`,{type:`string`,description:`The label name`,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 U={command:`update <name>`,describe:`Replaces the complete set of web and API operations attached to the user-defined label.`,builder:H,handler:async s=>a({command:`web-assets labels user operations update`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web-assets labels user operations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/labels/user/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/resources/operation`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``),name:String(s.name??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.webAssets.labels.user.operations.update({body:e,zone_id:c,name:s.name})),{successLabel:`Updated`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},W={command:`operations`,describe:`Operations for labels.user.operations`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`name`,{type:`string`,description:`The label name`,demandOption:!0}).option(`description`,{type:`string`,description:`The description of the label`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <name>`,describe:`Replaces all editable fields on a user-defined label.`,builder:G,handler:async l=>a({command:`web-assets labels user update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf web-assets labels user update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/api_gateway/labels/user/${l.name==null?`<name>`:encodeURIComponent(String(l.name))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),name:String(l.name??``)},bodyKind:`json`,body:l.body===void 0?s({description:c(l.description,`description`,`text`)}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Updating`,async()=>a.webAssets.labels.user.update({...e,zone_id:u,name:l.name})),{successLabel:`Updated`});return}let d=s({description:c(l.description,`description`,`text`)});n(await i(`Updating`,async()=>a.webAssets.labels.user.update({...d,zone_id:u,name:l.name})),{successLabel:`Updated`})})},q={command:`user`,describe:`Operations for labels.user`,builder:e=>e.command(N).command(F).command(L).command(z).command(V).command(K).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`labels`,describe:`Operations for labels`,builder:e=>e.command(T).command(j).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.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:`bulk-create`,describe:`Creates one or more web or API operations. Hosts, methods, and paths are normalized; an existing matching operation is returned instead of duplicated.`,builder:Y,handler:async s=>a({command:`web-assets operations bulk-create`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web-assets operations bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/operations`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.webAssets.operations.bulkCreate({body:e,zone_id:c})),{successLabel:`Created`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`bulk-delete`,describe:`Deletes multiple web or API operations from endpoint management in one request.`,builder:X,handler:async s=>a({command:`web-assets operations bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},s,async()=>{if(s.dryRun){r({command:`cf web-assets operations bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/api_gateway/operations`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,!await d({force:!!s.force,message:`This operation deletes the selected web or API operations.`})){process.stderr.write(`Aborted.
5
- `);return}if(s.body){let e=o(s.body);n(await i(`Deleting`,async()=>a.webAssets.operations.bulkDelete({body:e,zone_id:c})),{successLabel:`Deleted`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Q(e){return e.option(`endpoint`,{type:`string`,description:`The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.`}).option(`host`,{type:`string`,description:`RFC3986-compliant host.`}).option(`method`,{type:`string`,description:`The HTTP method used to access the endpoint.`,choices:[`GET`,`POST`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`CONNECT`,`PATCH`,`TRACE`]}).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 ne={command:`create`,describe:`Creates one web or API operation. The host, method, and path are normalized; an existing matching operation is returned instead of duplicated.`,builder:Q,handler:async d=>a({command:`web-assets operations create`,classification:{safeFlags:[`method`,`dry-run`]}},d,async()=>{if(d.dryRun){r({command:`cf web-assets operations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${d.zone??d.zoneId??`<zone>`}/api_gateway/operations/item`,pathParams:{"zone-id":String(d.zone??d[`zone-id`]??``)},bodyKind:`json`,body:d.body===void 0?s({endpoint:c(d.endpoint,`endpoint`,`text`),host:c(d.host,`host`,`text`),method:c(d.method,`method`,`text`)}):o(d.body)});return}let a=await t(d),f=await e({zone:d.zone},a,{quiet:d.quiet});if(d.zoneId=f,d.body){let e=o(d.body);n(await i(`Creating`,async()=>a.webAssets.operations.create({body:e,zone_id:f})),{successLabel:`Created`});return}d.endpoint===void 0&&(d.endpoint=await l(`endpoint`,`The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.`)),d.host===void 0&&(d.host=await l(`host`,`RFC3986-compliant host.`)),d.method===void 0&&(d.method=await u(`method`,`The HTTP method used to access the endpoint.`,[`GET`,`POST`,`HEAD`,`OPTIONS`,`PUT`,`DELETE`,`CONNECT`,`PATCH`,`TRACE`]));let p=s({endpoint:c(d.endpoint,`endpoint`,`text`),host:c(d.host,`host`,`text`),method:c(d.method,`method`,`text`)});n(await i(`Creating`,async()=>a.webAssets.operations.create({body:p,zone_id:f})),{successLabel:`Created`})})};function re(e){return e.positional(`operation-id`,{type:`string`,description:`Identifier for the operation`,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 ie={command:`delete <operation-id>`,describe:`Deletes a web or API operation from endpoint management so its feature configuration is no longer tracked.`,builder:re,handler:async o=>a({command:`web-assets operations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf web-assets operations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/operations/${o[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(o[`operation-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"operation-id":String(o[`operation-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force,message:`This operation deletes the web or API operation.`})){process.stderr.write(`Aborted.
6
- `);return}n(await i(`Deleting`,async()=>a.webAssets.operations.delete({zone_id:s,operation_id:o[`operation-id`]})),{successLabel:`Deleted`})})};function ae(e){return e.positional(`operation-id`,{type:`string`,description:`Identifier for the operation`,demandOption:!0}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`with-schemas`,{type:`boolean`,description:`When true, includes OpenAPI schemas (both uploaded and learned) for the operation in the response. Due to the conversion overhead, this parameter is only supported on single-operation retrieval.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <operation-id>`,describe:`Returns a web or API operation, including its schema validation settings and requested feature data.`,builder:f(ae),handler:async o=>a({command:`web-assets operations get`,classification:{safeFlags:[`with-schemas`,`dry-run`]}},o,async()=>{let a={feature:o.feature,with_schemas:o[`with-schemas`]};if(o.dryRun){r({command:`cf web-assets operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/operations/${o[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(o[`operation-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"operation-id":String(o[`operation-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.operations.get({zone_id:c,operation_id:o[`operation-id`],...a})),{successLabel:`Loaded`})})};function se(e){return e.option(`managed-labels`,{type:`string`,array:!0,description:`List of managed label names.`}).option(`user-labels`,{type:`string`,array:!0,description:`List of user label names.`}).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 ce={command:`bulk-create`,describe:`Attaches labels to multiple web or API operations in one request.`,builder:se,handler:async c=>a({command:`web-assets operations labels bulk-create`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Creating`,async()=>a.webAssets.operations.labels.bulkCreate({...e,zone_id:l})),{successLabel:`Created`});return}let u=s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}});n(await i(`Creating`,async()=>a.webAssets.operations.labels.bulkCreate({...u,zone_id:l})),{successLabel:`Created`})})};function le(e){return e.option(`managed-labels`,{type:`string`,array:!0,description:`List of managed label names.`}).option(`user-labels`,{type:`string`,array:!0,description:`List of user label names.`}).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 ue={command:`bulk-delete`,describe:`Removes labels from multiple web or API operations in one request.`,builder:le,handler:async c=>a({command:`web-assets operations labels bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,!await d({force:!!c.force,message:`This operation removes the selected labels from the selected web and API operations.`})){process.stderr.write(`Aborted.
7
- `);return}if(c.body){let e=o(c.body);n(await i(`Deleting`,async()=>a.webAssets.operations.labels.bulkDelete({...e,zone_id:l})),{successLabel:`Deleted`});return}let u=s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}});n(await i(`Deleting`,async()=>a.webAssets.operations.labels.bulkDelete({...u,zone_id:l})),{successLabel:`Deleted`})})};function de(e){return e.option(`managed-labels`,{type:`string`,array:!0,description:`List of managed label names. Providing an empty array will result in all managed labels being removed from all affected operations`}).option(`user-labels`,{type:`string`,array:!0,description:`List of user label names. Providing an empty array will result in all user labels being removed from all affected operations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`bulk-update`,describe:`Replaces the complete label sets on multiple web or API operations in one request.`,builder:de,handler:async c=>a({command:`web-assets operations labels bulk-update`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.webAssets.operations.labels.bulkUpdate({...e,zone_id:l})),{successLabel:`Updated`});return}if(c[`managed-labels`]===void 0)throw Error(`--managed-labels is required (or pass --body with this field set).`);if(c[`user-labels`]===void 0)throw Error(`--user-labels is required (or pass --body with this field set).`);let u=s({managed:{labels:c[`managed-labels`]},user:{labels:c[`user-labels`]}});n(await i(`Updating`,async()=>a.webAssets.operations.labels.bulkUpdate({...u,zone_id:l})),{successLabel:`Updated`})})};function pe(e){return e.positional(`operation-id`,{type:`string`,description:`Identifier for the operation`,demandOption:!0}).option(`managed`,{type:`string`,array:!0,description:`List of managed label names.`}).option(`user`,{type:`string`,array:!0,description:`List of user label names.`}).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 me={command:`create <operation-id>`,describe:`Attaches one or more labels to a web or API operation.`,builder:pe,handler:async c=>a({command:`web-assets operations labels create`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"operation-id":String(c[`operation-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:c.managed,user:c.user}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Creating`,async()=>a.webAssets.operations.labels.create({...e,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Created`});return}let u=s({managed:c.managed,user:c.user});n(await i(`Creating`,async()=>a.webAssets.operations.labels.create({...u,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Created`})})};function he(e){return e.positional(`operation-id`,{type:`string`,description:`Identifier for the operation`,demandOption:!0}).option(`managed`,{type:`string`,array:!0,description:`List of managed label names.`}).option(`user`,{type:`string`,array:!0,description:`List of user label names.`}).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 ge={command:`delete <operation-id>`,describe:`Removes one or more labels from a web or API operation.`,builder:he,handler:async c=>a({command:`web-assets operations labels delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"operation-id":String(c[`operation-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:c.managed,user:c.user}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,!await d({force:!!c.force,message:`This operation removes the selected labels from the web or API operation.`})){process.stderr.write(`Aborted.
8
- `);return}if(c.body){let e=o(c.body);n(await i(`Deleting`,async()=>a.webAssets.operations.labels.delete({...e,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Deleted`});return}let u=s({managed:c.managed,user:c.user});n(await i(`Deleting`,async()=>a.webAssets.operations.labels.delete({...u,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Deleted`})})};function _e(e){return e.positional(`operation-id`,{type:`string`,description:`Identifier for the operation`,demandOption:!0}).option(`managed`,{type:`string`,array:!0,description:`List of managed label names. Omitting this property or passing an empty array will result in all managed labels being removed from the operation`}).option(`user`,{type:`string`,array:!0,description:`List of user label names. Omitting this property or passing an empty array will result in all user labels being removed from the operation`}).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 ve={command:`update <operation-id>`,describe:`Replaces the complete label set on a web or API operation.`,builder:_e,handler:async c=>a({command:`web-assets operations labels update`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf web-assets operations labels update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/api_gateway/operations/${c[`operation-id`]==null?`<operation-id>`:encodeURIComponent(String(c[`operation-id`]))}/labels`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"operation-id":String(c[`operation-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({managed:c.managed,user:c.user}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.webAssets.operations.labels.update({...e,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Updated`});return}let u=s({managed:c.managed,user:c.user});n(await i(`Updating`,async()=>a.webAssets.operations.labels.update({...u,zone_id:l,operation_id:c[`operation-id`]})),{successLabel:`Updated`})})},ye={command:`labels`,describe:`Operations for operations.labels`,builder:e=>e.command(ce).command(ue).command(fe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`order`,{type:`string`,description:"Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., `thresholds.suggested_threshold`.",choices:[`method`,`host`,`endpoint`,`thresholds.$key`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`host`,{type:`string`,description:`Filter results to only include the specified hosts.`}).option(`method`,{type:`string`,description:`Filter results to only include the specified HTTP methods.`}).option(`endpoint`,{type:`string`,description:`Filter results to only include endpoints containing this pattern.`}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Lists web and API operations tracked for the zone, including each operation's method, path, and feature configuration.`,builder:f(be),handler:async o=>a({command:`web-assets operations list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],order:o.order,direction:o.direction,host:o.host,method:o.method,endpoint:o.endpoint,feature:o.feature};if(o.dryRun){r({command:`cf web-assets operations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/operations`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.operations.list({zone_id:c,...a})),{successLabel:`Loaded`})})},xe={command:`operations`,describe:`Operations for operations`,builder:e=>e.command(te).command(Z).command(ne).command(ie).command(oe).command($).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`host`,{type:`string`,description:`Receive schema only for the given host(s).`}).option(`feature`,{type:`string`,description:`Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.`}).option(`include-schema-kind`,{type:`string`,description:`Schema kinds to include in exported OpenAPI schemas.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`Returns tracked web and API operations and their feature configuration rendered as OpenAPI schemas.`,builder:f(Se),handler:async o=>a({command:`web-assets schemas list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={host:o.host,feature:o.feature,include_schema_kind:o[`include-schema-kind`]};if(o.dryRun){r({command:`cf web-assets schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/api_gateway/schemas`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.webAssets.schemas.list({zone_id:c,...a})),{successLabel:`Loaded`})})},we={command:`schemas`,describe:`Operations for schemas`,builder:e=>e.command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Te={command:`web-assets`,describe:`web-assets`,builder:e=>e.command(C).command(J).command(xe).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Te as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-DH3kMXSs.mjs";import{r as t}from"./auth-tvDdC1J-.mjs";import{t as n}from"./output-COcSQsfn.mjs";import{t as r}from"./dry-run-DiVy1lVo.mjs";import{t as i}from"./progress-V6SZV3Ux.mjs";import{t as a}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as o,r as s,t as c}from"./body-parser-DIlfApuJ.mjs";import{n as l}from"./input-validation-BxchZ9jE.mjs";import{a as u,i as d,n as f}from"./prompt-DjRTpML4.mjs";function p(e){return e.option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).option(`name`,{type:`string`,description:`Specify the hostname that points to the target gateway via CNAME.`}).option(`target`,{type:`string`,description:`Specify the target gateway of the hostname.`,choices:[`ethereum`,`ipfs`,`ipfs_universal_path`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create Web3 Hostname`,builder:p,handler:async s=>a({command:`web3 hostnames create`,classification:{safeFlags:[`target`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web3 hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/web3/hostnames`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({description:l(s.description,`description`,`text`),dnslink:l(s.dnslink,`dnslink`,`text`),name:l(s.name,`name`,`text`),target:l(s.target,`target`,`text`)}):o(s.body)});return}let a=await t(s),f=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=f,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.web3.hostnames.create({...e,zone_id:f})),{successLabel:`Created`});return}s.name===void 0&&(s.name=await u(`name`,`Specify the hostname that points to the target gateway via CNAME.`)),s.target===void 0&&(s.target=await d(`target`,`Specify the target gateway of the hostname.`,[`ethereum`,`ipfs`,`ipfs_universal_path`]));let p=c({description:l(s.description,`description`,`text`),dnslink:l(s.dnslink,`dnslink`,`text`),name:l(s.name,`name`,`text`),target:l(s.target,`target`,`text`)});n(await i(`Creating`,async()=>a.web3.hostnames.create({...p,zone_id:f})),{successLabel:`Created`})})};function h(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,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 <identifier>`,describe:`Delete Web3 Hostname`,builder:h,handler:async o=>a({command:`web3 hostnames delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}`,pathParams:{identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await f({force:!!o.force})){process.stderr.write(`Aborted.
3
- `);return}n(await i(`Deleting`,async()=>a.web3.hostnames.delete({zone_id:s,identifier:o.identifier})),{successLabel:`Deleted`})})};function _(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).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:`edit <identifier>`,describe:`Edit Web3 Hostname`,builder:_,handler:async s=>a({command:`web3 hostnames edit`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web3 hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/web3/hostnames/${s.identifier==null?`<identifier>`:encodeURIComponent(String(s.identifier))}`,pathParams:{identifier:String(s.identifier??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({description:l(s.description,`description`,`text`),dnslink:l(s.dnslink,`dnslink`,`text`)}):o(s.body)});return}let a=await t(s),u=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=u,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.web3.hostnames.edit({...e,zone_id:u,identifier:s.identifier})),{successLabel:`Updated`});return}let d=c({description:l(s.description,`description`,`text`),dnslink:l(s.dnslink,`dnslink`,`text`)});n(await i(`Updating`,async()=>a.web3.hostnames.edit({...d,zone_id:u,identifier:s.identifier})),{successLabel:`Updated`})})};function y(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <identifier>`,describe:`Web3 Hostname Details`,builder:y,handler:async o=>a({command:`web3 hostnames get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}`,pathParams:{identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.web3.hostnames.get({zone_id:s,identifier:o.identifier})),{successLabel:`Loaded`})})};function x(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create <identifier>`,describe:`Create IPFS Universal Path Gateway Content List Entry`,builder:x,handler:async s=>a({command:`web3 hostnames ipfs-universal-paths content-lists entries create`,classification:{safeFlags:[`type`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/web3/hostnames/${s.identifier==null?`<identifier>`:encodeURIComponent(String(s.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{identifier:String(s.identifier??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({content:l(s.content,`content`,`text`),description:l(s.description,`description`,`text`),type:l(s.type,`type`,`text`)}):o(s.body)});return}let a=await t(s),f=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=f,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create({body:e,zone_id:f,identifier:s.identifier})),{successLabel:`Created`});return}s.content===void 0&&(s.content=await u(`content`,`Specify the CID or content path of content to block.`)),s.type===void 0&&(s.type=await d(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=c({content:l(s.content,`content`,`text`),description:l(s.description,`description`,`text`),type:l(s.type,`type`,`text`)});n(await i(`Creating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create({body:p,zone_id:f,identifier:s.identifier})),{successLabel:`Created`})})};function C(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <content-list-entry-identifier>`,describe:`Delete IPFS Universal Path Gateway Content List Entry`,builder:C,handler:async o=>a({command:`web3 hostnames ipfs-universal-paths content-lists entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}/ipfs_universal_path/content_list/entries/${o[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(o[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(o[`content-list-entry-identifier`]??``),identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await f({force:!!o.force})){process.stderr.write(`Aborted.
4
- `);return}n(await i(`Deleting`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete({zone_id:s,identifier:o.identifier,content_list_entry_identifier:o[`content-list-entry-identifier`]})),{successLabel:`Deleted`})})};function T(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <content-list-entry-identifier>`,describe:`IPFS Universal Path Gateway Content List Entry Details`,builder:T,handler:async o=>a({command:`web3 hostnames ipfs-universal-paths content-lists entries get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}/ipfs_universal_path/content_list/entries/${o[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(o[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(o[`content-list-entry-identifier`]??``),identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get({zone_id:s,identifier:o.identifier,content_list_entry_identifier:o[`content-list-entry-identifier`]})),{successLabel:`Loaded`})})};function D(e){return e.option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List IPFS Universal Path Gateway Content List Entries`,builder:D,handler:async o=>a({command:`web3 hostnames ipfs-universal-paths content-lists entries list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list({zone_id:s,identifier:o.identifier})),{successLabel:`Loaded`})})};function k(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`update <content-list-entry-identifier>`,describe:`Edit IPFS Universal Path Gateway Content List Entry`,builder:k,handler:async s=>a({command:`web3 hostnames ipfs-universal-paths content-lists entries update`,classification:{safeFlags:[`type`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/web3/hostnames/${s.identifier==null?`<identifier>`:encodeURIComponent(String(s.identifier))}/ipfs_universal_path/content_list/entries/${s[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(s[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(s[`content-list-entry-identifier`]??``),identifier:String(s.identifier??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({content:l(s.content,`content`,`text`),description:l(s.description,`description`,`text`),type:l(s.type,`type`,`text`)}):o(s.body)});return}let a=await t(s),f=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=f,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update({body:e,zone_id:f,identifier:s.identifier,content_list_entry_identifier:s[`content-list-entry-identifier`]})),{successLabel:`Updated`});return}s.content===void 0&&(s.content=await u(`content`,`Specify the CID or content path of content to block.`)),s.type===void 0&&(s.type=await d(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=c({content:l(s.content,`content`,`text`),description:l(s.description,`description`,`text`),type:l(s.type,`type`,`text`)});n(await i(`Updating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update({body:p,zone_id:f,identifier:s.identifier,content_list_entry_identifier:s[`content-list-entry-identifier`]})),{successLabel:`Updated`})})},j={command:`entries`,describe:`Operations for hostnames.ipfs-universal-paths.content-lists.entries`,builder:e=>e.command(S).command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <identifier>`,describe:`IPFS Universal Path Gateway Content List Details`,builder:M,handler:async o=>a({command:`web3 hostnames ipfs-universal-paths content-lists get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames/${o.identifier==null?`<identifier>`:encodeURIComponent(String(o.identifier))}/ipfs_universal_path/content_list`,pathParams:{identifier:String(o.identifier??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.get({zone_id:s,identifier:o.identifier})),{successLabel:`Loaded`})})};function P(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`action`,{type:`string`,description:`Behavior of the content list.`,choices:[`block`]}).option(`entries`,{type:`string`,description:`Provides content list entries. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`update <identifier>`,describe:`Update IPFS Universal Path Gateway Content List`,builder:P,handler:async u=>a({command:`web3 hostnames ipfs-universal-paths content-lists update`,classification:{safeFlags:[`action`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/web3/hostnames/${u.identifier==null?`<identifier>`:encodeURIComponent(String(u.identifier))}/ipfs_universal_path/content_list`,pathParams:{identifier:String(u.identifier??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({action:l(u.action,`action`,`text`),entries:s(u.entries,`entries`)}):o(u.body)});return}let a=await t(u),f=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.update({...e,zone_id:f,identifier:u.identifier})),{successLabel:`Updated`});return}if(u.action===void 0&&(u.action=await d(`action`,`Behavior of the content list.`,[`block`])),u.entries===void 0)throw Error(`--entries is required (or pass --body with this field set).`);let p=c({action:l(u.action,`action`,`text`),entries:s(u.entries,`entries`)});n(await i(`Updating`,async()=>a.web3.hostnames.ipfsUniversalPaths.contentLists.update({...p,zone_id:f,identifier:u.identifier})),{successLabel:`Updated`})})},I={command:`content-lists`,describe:`Operations for hostnames.ipfs-universal-paths.content-lists`,builder:e=>e.command(N).command(F).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`ipfs-universal-paths`,describe:`Operations for hostnames.ipfs-universal-paths`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`List Web3 Hostnames`,builder:R,handler:async o=>a({command:`web3 hostnames list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf web3 hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/web3/hostnames`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.web3.hostnames.list({zone_id:s})),{successLabel:`Loaded`})})},B={command:`hostnames`,describe:`Operations for hostnames`,builder:e=>e.command(m).command(g).command(v).command(b).command(z).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`web3`,describe:`web3`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{l as e}from"./src-C8phrg-8.mjs";import{a as t,o as n}from"./theme-CeVf-5qG.mjs";import"./ui-DQSZeaG5.mjs";import{t as r}from"./local-C6XsFD_W.mjs";import{f as i,g as a,m as o}from"./oauth-DH3kMXSs.mjs";import{n as s}from"./dist-DW5BPGFs.mjs";import{i as c,r as l}from"./auth-tvDdC1J-.mjs";import{t as u}from"./output-COcSQsfn.mjs";import{t as d}from"./dry-run-DiVy1lVo.mjs";import{t as f}from"./progress-V6SZV3Ux.mjs";import{r as p,t as m}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as h,r as g,t as _}from"./body-parser-DIlfApuJ.mjs";import{n as v}from"./input-validation-BxchZ9jE.mjs";import{i as ee,n as y}from"./prompt-DjRTpML4.mjs";import{t as b}from"./cli-types-CrSoSMPF.mjs";import{E as x}from"./dist-Cp3uJN1x.mjs";import{r as S}from"./dist-BCVqQpg2.mjs";import{i as C,n as w,r as T,t as E}from"./shared-YJtB5KZB.mjs";import{n as D,r as O}from"./build-0QlYUfFS.mjs";import{r as k}from"./deploy-input-C7W1Bsji.mjs";var A=e(`check`,`Profile a Worker's startup performance`,()=>import(`./command-CMzMsll4.mjs`),{command:`workers check`,classification:{safeFlags:[`prebuilt`]}});function j(e){return e.option(`prebuilt`,{type:`boolean`,description:`Use existing Build Output Specification files without building`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Run checks without applying triggers`,default:!1})}const M={command:`deploy`,describe:`Apply triggers (Routes, Workflows, Cron triggers etc.)`,builder:j,handler:async e=>{e.prebuilt||(await D(e.mode),s.message(``,{spacing:0}));let{workers:{default:r},rootConfig:a}=await S(process.cwd()),{wranglerConfig:o}=O(r,a),l=await c(),u=await i();C(x(l)),s.message(t.bold(`Deploy triggers`),{symbol:n.dim(`├`),spacing:0}),await T(k(r,o,u,e)),s.success(e[`dry-run`]?`Dry run complete`:`Trigger deploy complete`)}},N={command:`triggers`,describe:`Manage triggers (Routes, Workflows, Cron triggers etc.)`,builder:e=>e.command(p(M,{command:`workers triggers deploy`,classification:{safeFlags:[`dry-run`,`prebuilt`]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <worker-id>`,describe:`Delete a Worker and all its associated resources (versions, deployments, etc.).`,builder:P,handler:async e=>m({command:`workers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){d({command:`cf workers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();if(e.accountId=n,!await y({force:!!e.force,message:`This will permanently delete the Worker and its associated versions and deployments.`})){process.stderr.write(`Aborted.
3
- `);return}u(await f(`Deleting`,async()=>t.workers.delete({account_id:n,worker_id:e[`worker-id`]})),{successLabel:`Deleted`})})};function I(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`force`,{type:`boolean`,description:`If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed.`}).option(`strategy`,{type:`string`,description:`The strategy field`,choices:[`percentage`]}).option(`versions`,{type:`string`,description:'Worker versions included in this deployment. Each object must contain a `version_id` UUID and a `percentage`; percentages across all objects must total 100. In the `cf` CLI, pass the entire array as one JSON value to `--versions`, either inline, for example `--versions \'[{"version_id":"023e105f-2a42-4f8b-a1c1-73f6a2a30c0f","percentage":100}]\'`, or from a JSON file with `--versions @versions.json`. Provide as a JSON array of objects or @path/to/file.json.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`create`,describe:`Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) are deployed to traffic. A deployment can consist of multiple versions of a Worker.`,builder:I,handler:async e=>m({command:`workers deployments create`,classification:{safeFlags:[`force`,`strategy`,`dry-run`]}},e,async()=>{let t={force:e.force};if(e.dryRun){d({command:`cf workers deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(e[`script-name`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?_({strategy:v(e.strategy,`strategy`,`text`),versions:g(e.versions,`versions`)}):h(e.body)});return}let n=await l(e),s=e.local?r:await i();e.accountId=s;let c=o({scriptName:e.worker});if(e.worker=c,e.body){let r=h(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u(await f(`Creating`,async()=>n.workers.deployments.create({body:r,account_id:s,script_name:c,...t})),{successLabel:`Created`});return}if(e.strategy===void 0&&(e.strategy=await ee(`strategy`,`The strategy field`,[`percentage`])),e.versions===void 0)throw Error(`--versions is required (or pass --body with this field set).`);let p=_({strategy:v(e.strategy,`strategy`,`text`),versions:g(e.versions,`versions`)});new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u(await f(`Creating`,async()=>n.workers.deployments.create({body:p,account_id:s,script_name:c,...t})),{successLabel:`Created`})})};function R(e){return e.positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).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:`delete <deployment-id>`,describe:`Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.`,builder:R,handler:async e=>m({command:`workers deployments delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){d({command:`cf workers deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();e.accountId=n;let s=o({scriptName:e.worker});if(e.worker=s,!await y({force:!!e.force,message:`This will permanently delete the Worker deployment.`})){process.stderr.write(`Aborted.
4
- `);return}u(await f(`Deleting`,async()=>t.workers.deployments.delete({account_id:n,script_name:s,deployment_id:e[`deployment-id`]})),{successLabel:`Deleted`})})};function B(e){return e.positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <deployment-id>`,describe:`Get information about a Worker Deployment.`,builder:B,handler:async e=>m({command:`workers deployments get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){d({command:`cf workers deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();e.accountId=n;let s=o({scriptName:e.worker});e.worker=s,u(await f(`Loading`,async()=>t.workers.deployments.get({account_id:n,script_name:s,deployment_id:e[`deployment-id`]})),{successLabel:`Loaded`})})};function H(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`since`,{type:`string`,description:`Start of the deployment creation time range, inclusive.`}).option(`until`,{type:`string`,description:`End of the deployment creation time range, inclusive.`}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`List Worker deployments. The first deployment in the list is the latest deployment actively serving traffic.`,builder:H,handler:async e=>m({command:`workers deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={since:e.since,until:e.until,page:e.page,per_page:e[`per-page`]};if(e.dryRun){d({command:`cf workers deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(e[`script-name`]??``)},query:t,bodyKind:`none`});return}let n=await l(e),s=e.local?r:await i();e.accountId=s;let c=o({scriptName:e.worker});e.worker=c,u(await f(`Loading`,async()=>n.workers.deployments.list({account_id:s,script_name:c,...t})),{successLabel:`Loaded`})})},W={command:`deployments`,describe:`Operations for deployments`,builder:e=>e.command(L).command(z).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <worker-id>`,describe:`Get details about a specific Worker.`,builder:te,handler:async e=>m({command:`workers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){d({command:`cf workers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();e.accountId=n,u(await f(`Loading`,async()=>t.workers.get({account_id:n,worker_id:e[`worker-id`]})),{successLabel:`Loaded`})})};function K(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`order-by`,{type:`string`,description:`Property to sort results by.`,choices:[`deployed_on`,`updated_on`,`created_on`,`name`]}).option(`order`,{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 q={command:`list`,describe:`List all Workers for an account.`,builder:b(K),handler:async e=>m({command:`workers list`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order:e.order};if(e.dryRun){d({command:`cf workers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers`,pathParams:{},query:t,bodyKind:`none`});return}let n=await l(e),o=e.local?r:await i();e.accountId=o,u(await f(`Loading`,async()=>n.workers.list({account_id:o,...t})),{successLabel:`Loaded`})})};function J(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Returns a list of available placement regions organized by cloud provider. These regions can be used to configure Smart Placement for Workers.`,builder:J,handler:async e=>m({command:`workers placement regions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){d({command:`cf workers placement regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/placement/regions`,pathParams:{},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();e.accountId=n,u(await f(`Loading`,async()=>t.workers.placement.regions.list({account_id:n})),{successLabel:`Loaded`})})},X={command:`regions`,describe:`Operations for placement.regions`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`placement`,describe:`Operations for placement`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`name`,{type:`string`,description:`Worker name to search for. Both exact and partial matches are returned.`}).option(`id`,{type:`string`,description:`Worker ID (also called tag) to search for. Only exact matches are returned.`}).option(`order-by`,{type:`string`,description:`Property to sort results by. Results are sorted in ascending order.`,choices:[`created_on`,`modified_on`,`name`]}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`search`,describe:`Search for Worker scripts in an account.`,builder:b(Q),handler:async e=>m({command:`workers scripts search`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let t={name:e.name,id:e.id,order_by:e[`order-by`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){d({command:`cf workers scripts search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts-search`,pathParams:{},query:t,bodyKind:`none`});return}let n=await l(e),o=e.local?r:await i();e.accountId=o,u(await f(`Loading`,async()=>n.workers.scripts.search({account_id:o,...t})),{successLabel:`Loaded`})})},re={command:`scripts`,describe:`Operations for scripts`,builder:e=>e.command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).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 ae={command:`delete <secret-name>`,describe:`Remove a secret from a Worker script by creating a new version without that secret. When changing more than one secret at a time, prefer the "Patch multiple script secrets" API instead of changing many secrets individually.`,builder:ie,handler:async e=>m({command:`workers secrets delete`,classification:{safeFlags:[`url-encoded`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={url_encoded:e[`url-encoded`]};if(e.dryRun){d({command:`cf workers secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:t,bodyKind:`none`});return}let n=await l(e),s=e.local?r:await i();e.accountId=s;let c=o({scriptName:e.worker});if(e.worker=c,!await y({force:!!e.force,message:`This will permanently delete the Worker script secret.`})){process.stderr.write(`Aborted.
5
- `);return}u(await f(`Deleting`,async()=>n.workers.secrets.delete({account_id:s,script_name:c,secret_name:e[`secret-name`],...t})),{successLabel:`Deleted`})})};function oe(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <secret-name>`,describe:`Get a given secret binding (value omitted) on a Worker script.`,builder:oe,handler:async e=>m({command:`workers secrets get`,classification:{safeFlags:[`url-encoded`,`dry-run`]}},e,async()=>{let t={url_encoded:e[`url-encoded`]};if(e.dryRun){d({command:`cf workers secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:t,bodyKind:`none`});return}let n=await l(e),s=e.local?r:await i();e.accountId=s;let c=o({scriptName:e.worker});e.worker=c,u(await f(`Loading`,async()=>n.workers.secrets.get({account_id:s,script_name:c,secret_name:e[`secret-name`],...t})),{successLabel:`Loaded`})})};function ce(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`List the names of secrets bound to a Worker script.`,builder:ce,handler:async e=>m({command:`workers secrets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){d({command:`cf workers secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets`,pathParams:{"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();e.accountId=n;let s=o({scriptName:e.worker});e.worker=s,u(await f(`Loading`,async()=>t.workers.secrets.list({account_id:n,script_name:s})),{successLabel:`Loaded`})})},ue={command:`secrets`,describe:`Operations for secrets`,builder:e=>e.command(ae).command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return w(e).option(`preview-alias`,{type:`string`,description:`Preview alias for this Worker Version`,requiresArg:!0})}var fe=p({command:`create`,describe:`Upload a new Worker Version without deploying it`,builder:de,handler:async e=>{await E(e,{command:`Version upload`})}},{command:`workers versions create`,classification:{safeFlags:[`dry-run`,`prebuilt`]}});function pe(e){return e.positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const $={command:`delete <version-id>`,describe:`Delete a Worker version.`,builder:pe,handler:async e=>m({command:`workers versions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){d({command:`cf workers versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let t=await l(e),n=e.local?r:await i();if(e.accountId=n,!await y({force:!!e.force,message:`This will permanently delete the Worker version.`})){process.stderr.write(`Aborted.
6
- `);return}u(await f(`Deleting`,async()=>t.workers.versions.delete({account_id:n,worker_id:e[`worker-id`],version_id:e[`version-id`]})),{successLabel:`Deleted`})})};function me(e){return e.positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`include`,{type:`string`,description:"Whether to include the `modules` property of the version in the response, which contains code and sourcemap content and may add several megabytes to the response size.",choices:[`modules`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <version-id>`,describe:`Get details about a specific Worker version.`,builder:b(me),handler:async e=>m({command:`workers versions get`,classification:{safeFlags:[`include`,`dry-run`]}},e,async()=>{let t={include:e.include};if(e.dryRun){d({command:`cf workers versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``),"version-id":String(e[`version-id`]??``)},query:t,bodyKind:`none`});return}let n=await l(e),o=e.local?r:await i();e.accountId=o,u(await f(`Loading`,async()=>n.workers.versions.get({account_id:o,worker_id:e[`worker-id`],version_id:e[`version-id`],...t})),{successLabel:`Loaded`})})};function ge(e){return e.option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`List all versions for a Worker.`,builder:ge,handler:async e=>m({command:`workers versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){d({command:`cf workers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await a()??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions`,pathParams:{"worker-id":String(e[`worker-id`]??``)},query:t,bodyKind:`none`});return}let n=await l(e),o=e.local?r:await i();e.accountId=o,u(await f(`Loading`,async()=>n.workers.versions.list({account_id:o,worker_id:e[`worker-id`],...t})),{successLabel:`Loaded`})})},ve={command:`versions`,describe:`Operations for versions`,builder:e=>e.command(fe).command($).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ye={command:`workers`,describe:`workers`,builder:e=>e.command(A).command(F).command(G).command(q).command(W).command(Z).command(re).command(ue).command(N).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ye as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,t as l}from"./body-parser-DIlfApuJ.mjs";import{n as u}from"./input-validation-BxchZ9jE.mjs";function d(e){return e.positional(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`deploy-command`,{type:`string`,description:`Deploy command for the migrated Preview settings. Omit it to have the existing 'wrangler versions upload' command rewritten to 'wrangler preview' automatically, which fails with 400 when the existing command cannot be rewritten.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for migrating a Worker's legacy non-production trigger to Previews.`})}const f={command:`migrate-to-previews <script-tag>`,describe:`Migrate a Worker's legacy non-production trigger to Previews. The legacy build settings become the Previews base config and the legacy trigger is removed.`,builder:d,handler:async d=>s({command:`workers-builds workers migrate-to-previews`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf workers-builds workers migrate-to-previews`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${d[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(d[`script-tag`]))}/migrate_to_previews`,pathParams:{"script-tag":String(d[`script-tag`]??``)},bodyKind:`json`,body:d.body===void 0?l({deploy_command:u(d[`deploy-command`],`deploy-command`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.workersBuilds.workers.migrateToPreviews({...e,account_id:f,script_tag:d[`script-tag`]})),{successLabel:`Created`});return}let p=l({deploy_command:u(d[`deploy-command`],`deploy-command`,`text`)});i(await o(`Creating`,async()=>s.workersBuilds.workers.migrateToPreviews({...p,account_id:f,script_tag:d[`script-tag`]})),{successLabel:`Created`})})};function p(e){return e.positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`seed-repo-owner`,{type:`string`,description:`Repository owner or namespace.`}).option(`seed-repo-path`,{type:`string`,description:`Path within the repository to seed.`}).option(`seed-repo-provider`,{type:`string`,description:`Source control provider for the seed repository.`,choices:[`github`,`gitlab`]}).option(`seed-repo-repository`,{type:`string`,description:`Repository 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)`}).check(e=>{if([`seed-repo-owner`,`seed-repo-path`,`seed-repo-provider`,`seed-repo-repository`].some(t=>e[t]!==void 0)){let t=[`seed-repo-owner`,`seed-repo-provider`,`seed-repo-repository`].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 --seed_repo-* flag is set`)}return!0})}const m={command:`create-build <preview-id>`,describe:`Trigger a build for a single Preview.`,builder:p,handler:async d=>s({command:`workers-builds workers previews create-build`,classification:{safeFlags:[`seed-repo-provider`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf workers-builds workers previews create-build`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${d[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(d[`script-tag`]))}/previews/${d[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(d[`preview-id`]))}/builds`,pathParams:{"script-tag":String(d[`script-tag`]??``),"preview-id":String(d[`preview-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({seed_repo:{owner:u(d[`seed-repo-owner`],`seed-repo-owner`,`text`),path:u(d[`seed-repo-path`],`seed-repo-path`,`text`),provider:u(d[`seed-repo-provider`],`seed-repo-provider`,`text`),repository:u(d[`seed-repo-repository`],`seed-repo-repository`,`text`)}}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.workersBuilds.workers.previews.createBuild({body:e,account_id:f,script_tag:d[`script-tag`],preview_id:d[`preview-id`]})),{successLabel:`Created`});return}let p=l({seed_repo:{owner:u(d[`seed-repo-owner`],`seed-repo-owner`,`text`),path:u(d[`seed-repo-path`],`seed-repo-path`,`text`),provider:u(d[`seed-repo-provider`],`seed-repo-provider`,`text`),repository:u(d[`seed-repo-repository`],`seed-repo-repository`,`text`)}});i(await o(`Creating`,async()=>s.workersBuilds.workers.previews.createBuild({body:p,account_id:f,script_tag:d[`script-tag`],preview_id:d[`preview-id`]})),{successLabel:`Created`})})};function h(e){return e.positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`auto-build`,{type:`boolean`,description:`Whether pushes to the git branch build this Preview. Deploy hooks, manual builds, and retries run regardless of this setting.`}).option(`auto-delete`,{type:`boolean`,description:`Whether deleting the git branch also deletes this Preview.`}).option(`branch`,{type:`string`,description:`Git branch this Preview tracks`}).option(`settings-build-caching-enabled`,{type:`boolean`,description:`Whether builds reuse cached dependencies and build artifacts.`}).option(`settings-build-command`,{type:`string`,description:`Command to build the Worker.`}).option(`settings-build-token-uuid`,{type:`string`,description:`UUID of the build token used when deploying the Worker.`}).option(`settings-deploy-command`,{type:`string`,description:`Command to deploy the Worker.`}).option(`settings-path-excludes`,{type:`string`,array:!0,description:`Path patterns that must not start builds.`}).option(`settings-path-includes`,{type:`string`,array:!0,description:`Path patterns that can start builds.`}).option(`settings-root-directory`,{type:`string`,description:`Repository directory in which build and deploy commands run.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a Preview. At least one field must be provided, and omitted fields are left unchanged.`})}const g={command:`edit <preview-id>`,describe:`Update a single Preview of a Worker. Supports partial updates to the tracked branch, the automation flags, and the build settings.`,builder:h,handler:async d=>s({command:`workers-builds workers previews edit`,classification:{safeFlags:[`auto-build`,`auto-delete`,`settings-build-caching-enabled`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf workers-builds workers previews edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${d[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(d[`script-tag`]))}/previews/${d[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(d[`preview-id`]))}`,pathParams:{"script-tag":String(d[`script-tag`]??``),"preview-id":String(d[`preview-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({auto_build:d[`auto-build`],auto_delete:d[`auto-delete`],branch:u(d.branch,`branch`,`text`),settings:{build_caching_enabled:d[`settings-build-caching-enabled`],build_command:u(d[`settings-build-command`],`settings-build-command`,`text`),build_token_uuid:u(d[`settings-build-token-uuid`],`settings-build-token-uuid`,`text`),deploy_command:u(d[`settings-deploy-command`],`settings-deploy-command`,`text`),path_excludes:d[`settings-path-excludes`],path_includes:d[`settings-path-includes`],root_directory:u(d[`settings-root-directory`],`settings-root-directory`,`text`)}}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.workersBuilds.workers.previews.edit({...e,account_id:f,script_tag:d[`script-tag`],preview_id:d[`preview-id`]})),{successLabel:`Updated`});return}let p=l({auto_build:d[`auto-build`],auto_delete:d[`auto-delete`],branch:u(d.branch,`branch`,`text`),settings:{build_caching_enabled:d[`settings-build-caching-enabled`],build_command:u(d[`settings-build-command`],`settings-build-command`,`text`),build_token_uuid:u(d[`settings-build-token-uuid`],`settings-build-token-uuid`,`text`),deploy_command:u(d[`settings-deploy-command`],`settings-deploy-command`,`text`),path_excludes:d[`settings-path-excludes`],path_includes:d[`settings-path-includes`],root_directory:u(d[`settings-root-directory`],`settings-root-directory`,`text`)}});i(await o(`Updating`,async()=>s.workersBuilds.workers.previews.edit({...p,account_id:f,script_tag:d[`script-tag`],preview_id:d[`preview-id`]})),{successLabel:`Updated`})})};function _(e){return e.positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <preview-id>`,describe:`Retrieve a single Preview of a Worker, including the build settings it currently uses.`,builder:_,handler:async c=>s({command:`workers-builds workers previews get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf workers-builds workers previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${c[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(c[`script-tag`]))}/previews/${c[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(c[`preview-id`]))}`,pathParams:{"script-tag":String(c[`script-tag`]??``),"preview-id":String(c[`preview-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.workersBuilds.workers.previews.get({account_id:l,script_tag:c[`script-tag`],preview_id:c[`preview-id`]})),{successLabel:`Loaded`})})};function y(e){return e.positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list-builds <preview-id>`,describe:`List the builds of a single Preview with pagination.`,builder:y,handler:async c=>s({command:`workers-builds workers previews list-builds`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf workers-builds workers previews list-builds`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${c[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(c[`script-tag`]))}/previews/${c[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(c[`preview-id`]))}/builds`,pathParams:{"script-tag":String(c[`script-tag`]??``),"preview-id":String(c[`preview-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.workersBuilds.workers.previews.listBuilds({account_id:u,script_tag:c[`script-tag`],preview_id:c[`preview-id`],...s})),{successLabel:`Loaded`})})};function x(e){return e.option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List the Previews of a Worker with pagination.`,builder:x,handler:async c=>s({command:`workers-builds workers previews list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf workers-builds workers previews list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/builds/workers/${c[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(c[`script-tag`]))}/previews`,pathParams:{"script-tag":String(c[`script-tag`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.workersBuilds.workers.previews.list({account_id:u,script_tag:c[`script-tag`],...s})),{successLabel:`Loaded`})})},C={command:`previews`,describe:`Operations for workers.previews`,builder:e=>e.command(m).command(g).command(v).command(S).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`workers`,describe:`Operations for workers`,builder:e=>e.command(f).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`workers-builds`,describe:`workers-builds`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};