cf 0.6.0 → 0.7.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 (299) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-CKb6w43K.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-CwFrx-Dr.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/{api-gateway-D9PMVVqL.mjs → api-gateway-D4AIEtUq.mjs} +10 -10
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BvQ9uwuy.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-DX9KnJ0P.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/{cache-CeN5t6_W.mjs → cache-DVhkiIGK.mjs} +4 -4
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-Bvzav4Mj.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/{custom-certificates-CfRj7QZb.mjs → custom-certificates-CWUrPYLP.mjs} +4 -4
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/{custom-hostnames-CcK7_17e.mjs → custom-hostnames-CVQSksqq.mjs} +4 -4
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-BYsNl3qc.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-BzlPv3ro.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-IOg-_s5_.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-BH-4NQOV.mjs +134 -0
  63. package/dist/dns-D7VAaCyO.mjs +29 -0
  64. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  65. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  66. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  67. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  68. package/dist/email-routing-CiDbivcN.mjs +10 -0
  69. package/dist/email-security-BYeAuSc6.mjs +12 -0
  70. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  71. package/dist/{filters-DKs-wEzt.mjs → filters-DZ8YnQ90.mjs} +3 -3
  72. package/dist/firewall-DEd1hs_I.mjs +11 -0
  73. package/dist/flagship-DVw7xGoP.mjs +4 -0
  74. package/dist/{fraud-D8WmLKyH.mjs → fraud-BbGS3FZs.mjs} +2 -2
  75. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  76. package/dist/{healthchecks-BBtW8vRh.mjs → healthchecks-Da9N3ix4.mjs} +3 -3
  77. package/dist/{hostnames-Bh2IFxIw.mjs → hostnames-mimZu2tB.mjs} +2 -2
  78. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  79. package/dist/iam-DGQ-OgRl.mjs +6 -0
  80. package/dist/images-CI6Iy9ho.mjs +7 -0
  81. package/dist/index.mjs +1 -1
  82. package/dist/intel-BDB-aRtU.mjs +3 -0
  83. package/dist/internal-Czlp5Ekb.mjs +2 -0
  84. package/dist/{ips-BE7JbAnc.mjs → ips-B9UuPvsY.mjs} +1 -1
  85. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  86. package/dist/kv-BHerx4dZ.mjs +5 -0
  87. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  88. package/dist/live-Ce7dZW7p.mjs +2 -0
  89. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  90. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  91. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  92. package/dist/logos-CJLhx1go.mjs +3 -0
  93. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  94. package/dist/logs-DMvtchc6.mjs +3 -0
  95. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  96. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  97. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  98. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  99. package/dist/matches-B0yHbQ2I.mjs +2 -0
  100. package/dist/moq-UgBawOXe.mjs +13 -0
  101. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  102. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  103. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  104. package/dist/observability-B-1y36QS.mjs +4 -0
  105. package/dist/organization-Dq3PClZ7.mjs +41 -0
  106. package/dist/organizations-AhsQkHyX.mjs +2 -0
  107. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  108. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  109. package/dist/{origin-tls-client-auth-B30_2_dO.mjs → origin-tls-client-auth-BDw5q-6G.mjs} +3 -3
  110. package/dist/{page-rules-zQJGmTCd.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  111. package/dist/{page-shield-CxQk5k9X.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  112. package/dist/pages-BsXF11Kv.mjs +11 -0
  113. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  114. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  115. package/dist/progress-O88q63Bk.mjs +2 -0
  116. package/dist/{prompt-q3B7sM2A.mjs → prompt-DTAWiEm2.mjs} +1 -1
  117. package/dist/queries-CAE95-OH.mjs +3 -0
  118. package/dist/queues-BBz35Mqd.mjs +6 -0
  119. package/dist/r2-Zp99S5xF.mjs +21 -0
  120. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  121. package/dist/radar-Cij-XVQJ.mjs +2 -0
  122. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  123. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  124. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  125. package/dist/ready-DMpJvyaz.mjs +2 -0
  126. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  127. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  128. package/dist/refute-BGTpr5sy.mjs +2 -0
  129. package/dist/registrar-CXViZlah.mjs +83 -0
  130. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  131. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  132. package/dist/{resolve-DGD57PFH.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  133. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  134. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  135. package/dist/rules-ens3OHme.mjs +4 -0
  136. package/dist/rulesets-bkreZRao.mjs +8 -0
  137. package/dist/rum-CpgXFcwl.mjs +4 -0
  138. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  139. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  140. package/dist/{schema-D8o6HcCr.mjs → schema-DCF4yEp_.mjs} +1 -1
  141. package/dist/{schema-validation-BWNDnnIT.mjs → schema-validation-Ca6o94ts.mjs} +5 -5
  142. package/dist/scim-C4oT8TMc.mjs +4 -0
  143. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  144. package/dist/search-C4T5riPh.mjs +2 -0
  145. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  146. package/dist/security-center-BOvm7xy6.mjs +2 -0
  147. package/dist/{security-txt-CVpmJo29.mjs → security-txt-BCAUBctN.mjs} +2 -2
  148. package/dist/session-B1ARgLG7.mjs +2 -0
  149. package/dist/share-DhmVspmL.mjs +5 -0
  150. package/dist/{shared-DQI8NGja.mjs → shared-Bod3-Exx.mjs} +332 -332
  151. package/dist/signed-url-DA509wgp.mjs +2 -0
  152. package/dist/{smart-shield-BreBC1Ap.mjs → smart-shield-DZm4fn6z.mjs} +2 -2
  153. package/dist/{snippets-BAJoWMSJ.mjs → snippets-oQ0u26-z.mjs} +3 -3
  154. package/dist/{spawn-pmGERpdB.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  155. package/dist/{spectrum-DnIRLY95.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  156. package/dist/speed-DqNnvLBD.mjs +4 -0
  157. package/dist/{src-BQ1dr9xR.mjs → src-By-zTCHz.mjs} +9 -9
  158. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  159. package/dist/state-OsdDJvdj.mjs +2 -0
  160. package/dist/stream-Bud9Os5V.mjs +14 -0
  161. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  162. package/dist/submit-BtP8she2.mjs +2 -0
  163. package/dist/tenant-CMwHa-tU.mjs +2 -0
  164. package/dist/{token-validation-DUvtXWur.mjs → token-validation-BYC7HTok.mjs} +5 -5
  165. package/dist/{tools-CQtA5-cr.mjs → tools-Dru4l8yh.mjs} +1 -1
  166. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  167. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  168. package/dist/turnstile-CP4nScaL.mjs +23 -0
  169. package/dist/{ui-BrNwNHX9.mjs → ui-BNoF0KpD.mjs} +2 -2
  170. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  171. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  172. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  173. package/dist/user-DtefniLc.mjs +11 -0
  174. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  175. package/dist/verify-D7J3F_NZ.mjs +2 -0
  176. package/dist/{versions-NUXxCr0s.mjs → versions-dMW3bLVv.mjs} +1 -1
  177. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  178. package/dist/{web3-n3GW50u-.mjs → web3-Dhw79l4S.mjs} +3 -3
  179. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  180. package/dist/workers-l3zMNOU6.mjs +20 -0
  181. package/dist/workflows-rb7RYBKP.mjs +6 -0
  182. package/dist/{zaraz-9l7KuLqh.mjs → zaraz-CHecMYuo.mjs} +1 -1
  183. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  184. package/dist/zone-BnnqJwW-.mjs +2 -0
  185. package/dist/zones-DpI2YikF.mjs +21 -0
  186. package/package.json +1 -1
  187. package/dist/abuse-reports-DUs4SKVx.mjs +0 -8
  188. package/dist/accounts-BIY8wNGA.mjs +0 -22
  189. package/dist/acm-SqcV8o5o.mjs +0 -3
  190. package/dist/addressing-CygRm0pN.mjs +0 -12
  191. package/dist/ai-BAmEAjN3.mjs +0 -2
  192. package/dist/ai-gateway-BENwPvvB.mjs +0 -8
  193. package/dist/ai-search-Bv_Whw3E.mjs +0 -7
  194. package/dist/ai_gateway-C6WP9oBH.mjs +0 -4
  195. package/dist/alerting-D_qWrsoY.mjs +0 -6
  196. package/dist/analytics_engine-BjV6XLyG.mjs +0 -2
  197. package/dist/argo-DwYGbyld.mjs +0 -2
  198. package/dist/artifacts-DKAjY_n4.mjs +0 -4
  199. package/dist/auth-TYwGydWg.mjs +0 -5
  200. package/dist/billing-CRTlRU88.mjs +0 -2
  201. package/dist/bot-management-DgW--8wM.mjs +0 -5
  202. package/dist/botnet-feed-CIX6ZORT.mjs +0 -3
  203. package/dist/brand-protection-ZikBtl0y.mjs +0 -3
  204. package/dist/browser-rendering-D_ZQVWn8.mjs +0 -4
  205. package/dist/build-Bgw8TV1p.mjs +0 -134
  206. package/dist/calls-Cv0ieVg4.mjs +0 -4
  207. package/dist/certificate-authorities-BzZnWCac.mjs +0 -2
  208. package/dist/client-certificates-BFuzeBrj.mjs +0 -3
  209. package/dist/cloud-connector-D5h8Dzzg.mjs +0 -2
  210. package/dist/cloudforce-one-aqDCIBMp.mjs +0 -21
  211. package/dist/config-B5k-XbwS.mjs +0 -2
  212. package/dist/connectivity-CjkXmEhO.mjs +0 -3
  213. package/dist/connector-interrupts-B7eSface.mjs +0 -2
  214. package/dist/connector-telemetry-events-F3Co8HUf.mjs +0 -2
  215. package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +0 -2
  216. package/dist/connectors-YYu_Vx3H.mjs +0 -3
  217. package/dist/content-scanning-BorfRGKT.mjs +0 -4
  218. package/dist/context-C-WbewL6.mjs +0 -2
  219. package/dist/custom-nameservers-BkKx0THn.mjs +0 -3
  220. package/dist/custom-pages-DamGVA75.mjs +0 -4
  221. package/dist/d1-sK0O5THv.mjs +0 -4
  222. package/dist/data-security-DsWpoWiS.mjs +0 -6
  223. package/dist/diagnostics-CH7T2WR3.mjs +0 -3
  224. package/dist/dispatch-namespaces-Bgj9XCRx.mjs +0 -7
  225. package/dist/dist-C6zxsVdY.mjs +0 -306
  226. package/dist/dns-firewall-VmQf3UVP.mjs +0 -57
  227. package/dist/dns-o7hUPMCG.mjs +0 -29
  228. package/dist/durable-objects-DgrTbvoF.mjs +0 -2
  229. package/dist/email-routing-owCvAEpf.mjs +0 -10
  230. package/dist/email-security-Dng3DVuf.mjs +0 -8
  231. package/dist/email-sending-bExMH4lu.mjs +0 -3
  232. package/dist/firewall-BLaTtX3r.mjs +0 -11
  233. package/dist/google-tag-gateway-DyCY43k0.mjs +0 -2
  234. package/dist/hyperdrive-DJm1eD-M.mjs +0 -18
  235. package/dist/iam-apCCcy7R.mjs +0 -6
  236. package/dist/images-Cxe45OHm.mjs +0 -7
  237. package/dist/intel-8V4h6H46.mjs +0 -3
  238. package/dist/keyless-certificates-CfJmXccT.mjs +0 -3
  239. package/dist/kv-Dz6then8.mjs +0 -5
  240. package/dist/leaked-credential-checks-BJ-zQMlx.mjs +0 -3
  241. package/dist/load-balancers-ilsGgudX.mjs +0 -6
  242. package/dist/logpush-BH14TtuA.mjs +0 -4
  243. package/dist/logs-B8-mkf_I.mjs +0 -3
  244. package/dist/magic-cloud-networking-DylCXoG4.mjs +0 -5
  245. package/dist/magic-network-monitoring-DnyrZy77.mjs +0 -4
  246. package/dist/magic-transit-B-kU5e3s.mjs +0 -89
  247. package/dist/managed-transforms-GC9Pq5dg.mjs +0 -3
  248. package/dist/mtls-certificates-BRlhWw_G.mjs +0 -3
  249. package/dist/network-interconnects-DuyoFD9_.mjs +0 -36
  250. package/dist/oauth-B5k80sip.mjs +0 -61
  251. package/dist/observability-9APhqFHo.mjs +0 -4
  252. package/dist/organizations-Dy3kiV_z.mjs +0 -41
  253. package/dist/origin-ca-certificates-2rwPoQdG.mjs +0 -3
  254. package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +0 -2
  255. package/dist/pages-5DKLs7CQ.mjs +0 -11
  256. package/dist/pipelines-DfGE44xo.mjs +0 -6
  257. package/dist/progress-CL8I-7YK.mjs +0 -2
  258. package/dist/queues-BoenUGIw.mjs +0 -6
  259. package/dist/r2-Cq_JCjK0.mjs +0 -21
  260. package/dist/r2-data-catalog-eLxltWdO.mjs +0 -14
  261. package/dist/radar-YNOCio6T.mjs +0 -2
  262. package/dist/rate-limits-CcAF3tMl.mjs +0 -5
  263. package/dist/raw-fetch-bIXC9D1m.mjs +0 -2
  264. package/dist/realtime-kit-4bCGviO5.mjs +0 -18
  265. package/dist/registrar-CfHlaOOf.mjs +0 -46
  266. package/dist/request-tracers-DlHawg5l.mjs +0 -2
  267. package/dist/resource-sharing-7FhuboJE.mjs +0 -5
  268. package/dist/resource-tagging-divcugVb.mjs +0 -16
  269. package/dist/rules-CAXkege8.mjs +0 -4
  270. package/dist/rulesets-CBsdc8IV.mjs +0 -8
  271. package/dist/rum-D0hHPNl9.mjs +0 -4
  272. package/dist/scim-CWLli4fi.mjs +0 -3
  273. package/dist/sdk-DhIhH6GB.mjs +0 -5
  274. package/dist/secrets-store-B7_HkE8I.mjs +0 -25
  275. package/dist/security-center-BQT21oiM.mjs +0 -2
  276. package/dist/session-B8r8LNQN.mjs +0 -93
  277. package/dist/speed-UYEVue28.mjs +0 -4
  278. package/dist/ssl-D3Pixs8M.mjs +0 -15
  279. package/dist/stream-BUsuOfQh.mjs +0 -14
  280. package/dist/tenants-BdWJTtcg.mjs +0 -2
  281. package/dist/turnstile-CAKVnS1L.mjs +0 -23
  282. package/dist/url-normalization-DA-RAxs4.mjs +0 -3
  283. package/dist/url-scanner-DmYu43f7.mjs +0 -2
  284. package/dist/user-Bah4wGGN.mjs +0 -10
  285. package/dist/vectorize-DhvVG2By.mjs +0 -4
  286. package/dist/waiting-rooms-DoOkT4Mu.mjs +0 -11
  287. package/dist/workers-D6IaQ_F0.mjs +0 -18
  288. package/dist/workers-builds-DYi0OMMU.mjs +0 -7
  289. package/dist/workflows-DrdXUQ2g.mjs +0 -4
  290. package/dist/zero-trust-D6V9GH2W.mjs +0 -118
  291. package/dist/zero_trust-BzXKAX_x.mjs +0 -3
  292. package/dist/zones-0MTkuaFk.mjs +0 -21
  293. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  294. /package/dist/{cli-types-DGgEbf8K.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  295. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  296. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  297. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  298. /package/dist/{metadata-MPDDi08e.mjs → metadata-Cnyws6iO.mjs} +0 -0
  299. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{n as c}from"./prompt-q3B7sM2A.mjs";function l(e){return e.option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const u={command:`edit`,describe:`Configures the value of the Argo Smart Routing enablement setting.`,builder:l,handler:async l=>{if(l.dryRun){a({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({value:s(l.value,`value`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Updating`,async()=>u.argo.smartRouting.edit({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let f=r({value:s(l.value,`value`,`text`)});i(await o(`Updating`,async()=>u.argo.smartRouting.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Retrieves the value of Argo Smart Routing enablement setting.`,builder:d,handler:async n=>{if(n.dryRun){a({command:`cf argo smart-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.argo.smartRouting.get({zone_id:s})),{successLabel:`Loaded`})}},p={command:`smart-routing`,describe:`Route traffic through the fastest network paths to your origin using real-time latency data`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`value`,{type:`string`,description:`Enables Tiered Caching.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Tiered Caching.`})}const h={command:`edit`,describe:`Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`,builder:m,handler:async l=>{if(l.dryRun){a({command:`cf argo tiered-caching edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({value:s(l.value,`value`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Updating`,async()=>u.argo.tieredCaching.edit({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Enables Tiered Caching.`,[`on`,`off`]));let f=r({value:s(l.value,`value`,`text`)});i(await o(`Updating`,async()=>u.argo.tieredCaching.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of lower-tiers and upper-tiers. If content is not cached in lower-tier data centers (generally the ones closest to a visitor), the lower-tier must ask an upper-tier to see if it has the content. If the upper-tier does not have the content, only the upper-tier can ask the origin for content. This practice improves bandwidth efficiency by limiting the number of data centers that can ask the origin for content, which reduces origin load and makes websites more cost-effective to operate. Additionally, Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. This results in fewer open connections using server resources.`,builder:g,handler:async n=>{if(n.dryRun){a({command:`cf argo tiered-caching get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/argo/tiered_caching`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.argo.tieredCaching.get({zone_id:s})),{successLabel:`Loaded`})}},v={command:`tiered-caching`,describe:`Reduce origin load by having upper-tier data centers serve cache misses before reaching your origin`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`argo`,describe:`Network optimization features that speed up and improve reliability of traffic to your origins`,builder:e=>e.command(p).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{t as o}from"./local-CYc9q7l2.mjs";import{t as s}from"./prompt-q3B7sM2A.mjs";import{t as c}from"./cli-types-DGgEbf8K.mjs";import{n as l,t as u}from"./raw-fetch-bIXC9D1m.mjs";function d(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`artifactsNamespacesGet <namespace>`,describe:`Returns an Artifacts namespace summary.`,builder:d,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsNamespacesGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}`,pathParams:{namespace:String(s.namespace??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.artifacts.namespaces.artifactsNamespacesGet({account_id:l,namespace:s.namespace})),{successLabel:`Loaded`})}};function p(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`artifactsNamespacesList`,describe:`Lists Artifacts namespaces for an account.`,builder:p,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf artifacts namespaces artifactsNamespacesList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.artifacts.namespaces.artifactsNamespacesList({account_id:u,...c})),{successLabel:`Loaded`})}};function h(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const g={command:`artifactsReposBlobGet <hash>`,describe:`Returns raw bytes for an immutable Git blob object. Blob responses are cacheable forever by hash.`,builder:h,handler:async r=>{if(r.dryRun){i({command:`cf artifacts namespaces artifactsReposBlobGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${r.namespace==null?`<namespace>`:encodeURIComponent(String(r.namespace))}/repos/${r.name==null?`<name>`:encodeURIComponent(String(r.name))}/blob/${r.hash==null?`<hash>`:encodeURIComponent(String(r.hash))}`,pathParams:{namespace:String(r.namespace??``),name:String(r.name??``),hash:String(r.hash??``)},bodyKind:`none`});return}await n(r);let s=r.local?o:await e();r.accountId=s;let c=await a(`Loading`,async()=>u(`/accounts/${s}/artifacts/namespaces/${encodeURIComponent(String(r.namespace))}/repos/${encodeURIComponent(String(r.name))}/blob/${encodeURIComponent(String(r.hash))}`,{method:`GET`,localEndpoint:r.local?r.localEndpoint:void 0}));l(r.text===!0?c.toString(`utf-8`):c)}};function _(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`artifactsReposCommitGet <hash>`,describe:`Returns decoded metadata for an immutable Git commit object. Commit responses are cacheable forever by hash.`,builder:_,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposCommitGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/commit/${s.hash==null?`<hash>`:encodeURIComponent(String(s.hash))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``),hash:String(s.hash??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.artifacts.namespaces.artifactsReposCommitGet({account_id:l,namespace:s.namespace,name:s.name,hash:s.hash})),{successLabel:`Loaded`})}};function y(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`artifactsReposCreate <namespace>`,describe:`Creates a Git-compatible Artifacts repository in a namespace.`,builder:y,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposCreate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos`,pathParams:{namespace:String(s.namespace??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Creating`,async()=>c.artifacts.namespaces.artifactsReposCreate({account_id:l,namespace:s.namespace})),{successLabel:`Created`})}};function x(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace 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 S={command:`artifactsReposDelete <name>`,describe:`Deletes a repository and schedules cleanup of its backing data.`,builder:x,handler:async c=>{if(c.dryRun){i({command:`cf artifacts namespaces artifactsReposDelete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/repos/${c.name==null?`<name>`:encodeURIComponent(String(c.name))}`,pathParams:{namespace:String(c.namespace??``),name:String(c.name??``)},bodyKind:`none`});return}let l=await n(c),u=c.local?o:await e();if(c.accountId=u,!await s({force:!!c.force})){process.stderr.write(`Aborted.
3
- `);return}r(await a(`Deleting`,async()=>l.artifacts.namespaces.artifactsReposDelete({account_id:u,namespace:c.namespace,name:c.name})),{successLabel:`Deleted`})}};function C(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or commit hash.`,demandOption:!0}).option(`path`,{type:`string`,description:`File path.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const w={command:`artifactsReposFileGet <name>`,describe:`Returns raw bytes for a file resolved by ref and path.`,builder:C,handler:async r=>{let s={ref:r.ref,path:r.path};if(r.dryRun){i({command:`cf artifacts namespaces artifactsReposFileGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${r.namespace==null?`<namespace>`:encodeURIComponent(String(r.namespace))}/repos/${r.name==null?`<name>`:encodeURIComponent(String(r.name))}/file`,pathParams:{namespace:String(r.namespace??``),name:String(r.name??``)},query:s,bodyKind:`none`});return}await n(r);let c=r.local?o:await e();r.accountId=c;let d=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),f=await a(`Loading`,async()=>u(`/accounts/${c}/artifacts/namespaces/${encodeURIComponent(String(r.namespace))}/repos/${encodeURIComponent(String(r.name))}/file${d?`?`+d:``}`,{method:`GET`,localEndpoint:r.local?r.localEndpoint:void 0}));l(r.text===!0?f.toString(`utf-8`):f)}};function T(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`artifactsReposFork <name>`,describe:`Forks a source repository into a new repository.`,builder:T,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposFork`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/fork`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Creating`,async()=>c.artifacts.namespaces.artifactsReposFork({account_id:l,namespace:s.namespace,name:s.name})),{successLabel:`Created`})}};function D(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`artifactsReposGet <name>`,describe:`Returns repository metadata.`,builder:D,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.artifacts.namespaces.artifactsReposGet({account_id:l,namespace:s.namespace,name:s.name})),{successLabel:`Loaded`})}};function k(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`artifactsReposImport <name>`,describe:`Imports an HTTPS Git repository into an Artifacts repository.`,builder:k,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposImport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/import`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Creating`,async()=>c.artifacts.namespaces.artifactsReposImport({account_id:l,namespace:s.namespace,name:s.name})),{successLabel:`Created`})}};function j(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`search`,{type:`string`,description:`Search`}).option(`sort`,{type:`string`,description:`Sort`,choices:[`created_at`,`updated_at`,`last_push_at`,`name`]}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`artifactsReposList <namespace>`,describe:`Lists repositories in a namespace.`,builder:c(j),handler:async s=>{let c={limit:s.limit,cursor:s.cursor,search:s.search,sort:s.sort,direction:s.direction};if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos`,pathParams:{namespace:String(s.namespace??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.artifacts.namespaces.artifactsReposList({account_id:u,namespace:s.namespace,...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or commit hash. Defaults to HEAD.`}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`artifactsReposLogGet <name>`,describe:`Returns commit metadata walking backwards from a ref, branch, tag, or HEAD.`,builder:N,handler:async s=>{let c={ref:s.ref,limit:s.limit,offset:s.offset};if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposLogGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/log`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.artifacts.namespaces.artifactsReposLogGet({account_id:u,namespace:s.namespace,name:s.name,...c})),{successLabel:`Loaded`})}};function F(e){return e.positional(`path`,{type:`string`,description:`File path. May contain slashes.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`ref`,{type:`string`,description:`Git ref, branch, tag, or 40-character commit hash.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const I={command:`artifactsReposRawGet <path>`,describe:`Returns file bytes resolved by ref and path, with a sniffed content type and browser-safe response headers.`,builder:F,handler:async r=>{if(r.dryRun){i({command:`cf artifacts namespaces artifactsReposRawGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${r.namespace==null?`<namespace>`:encodeURIComponent(String(r.namespace))}/repos/${r.name==null?`<name>`:encodeURIComponent(String(r.name))}/raw/${r.ref==null?`<ref>`:encodeURIComponent(String(r.ref))}/${r.path==null?`<path>`:encodeURIComponent(String(r.path))}`,pathParams:{namespace:String(r.namespace??``),name:String(r.name??``),ref:String(r.ref??``),path:String(r.path??``)},bodyKind:`none`});return}await n(r);let s=r.local?o:await e();r.accountId=s;let c=await a(`Loading`,async()=>u(`/accounts/${s}/artifacts/namespaces/${encodeURIComponent(String(r.namespace))}/repos/${encodeURIComponent(String(r.name))}/raw/${encodeURIComponent(String(r.ref))}/${encodeURIComponent(String(r.path))}`,{method:`GET`,localEndpoint:r.local?r.localEndpoint:void 0}));l(r.text===!0?c.toString(`utf-8`):c)}};function L(e){return e.positional(`hash`,{type:`string`,description:`40-character lowercase hexadecimal Git object hash.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`artifactsReposTreeGet <hash>`,describe:`Returns decoded entries for an immutable Git tree object. Tree responses are cacheable forever by hash.`,builder:L,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsReposTreeGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/tree/${s.hash==null?`<hash>`:encodeURIComponent(String(s.hash))}`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``),hash:String(s.hash??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.artifacts.namespaces.artifactsReposTreeGet({account_id:l,namespace:s.namespace,name:s.name,hash:s.hash})),{successLabel:`Loaded`})}};function z(e){return e.positional(`name`,{type:`string`,description:`Repository name.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`state`,{type:`string`,description:`State`,choices:[`active`,`expired`,`revoked`,`all`]}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`artifactsRepoTokensList <name>`,describe:`Lists tokens for a repository.`,builder:c(z),handler:async s=>{let c={state:s.state,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf artifacts namespaces artifactsRepoTokensList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/repos/${s.name==null?`<name>`:encodeURIComponent(String(s.name))}/tokens`,pathParams:{namespace:String(s.namespace??``),name:String(s.name??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.artifacts.namespaces.artifactsRepoTokensList({account_id:u,namespace:s.namespace,name:s.name,...c})),{successLabel:`Loaded`})}};function V(e){return e.positional(`namespace`,{type:`string`,description:`Artifacts namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`artifactsTokensCreate <namespace>`,describe:`Creates a scoped Git token for a repository.`,builder:V,handler:async s=>{if(s.dryRun){i({command:`cf artifacts namespaces artifactsTokensCreate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${s.namespace==null?`<namespace>`:encodeURIComponent(String(s.namespace))}/tokens`,pathParams:{namespace:String(s.namespace??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Creating`,async()=>c.artifacts.namespaces.artifactsTokensCreate({account_id:l,namespace:s.namespace})),{successLabel:`Created`})}};function U(e){return e.positional(`id`,{type:`string`,description:`Token ID. Must match /^[0-9a-z]{16}$/.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Artifacts namespace 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 W={command:`artifactsTokensRevoke <id>`,describe:`Revokes an Artifacts repository token.`,builder:U,handler:async c=>{if(c.dryRun){i({command:`cf artifacts namespaces artifactsTokensRevoke`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/artifacts/namespaces/${c.namespace==null?`<namespace>`:encodeURIComponent(String(c.namespace))}/tokens/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{namespace:String(c.namespace??``),id:String(c.id??``)},bodyKind:`none`});return}let l=await n(c),u=c.local?o:await e();if(c.accountId=u,!await s({force:!!c.force})){process.stderr.write(`Aborted.
4
- `);return}r(await a(`Deleting`,async()=>l.artifacts.namespaces.artifactsTokensRevoke({account_id:u,namespace:c.namespace,id:c.id})),{successLabel:`Deleted`})}},G={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(f).command(m).command(B).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(M).command(P).command(I).command(R).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`artifacts`,describe:`artifacts`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{g as e,l as t}from"./session-B8r8LNQN.mjs";import{a as n}from"./theme-DbNbIY4d.mjs";import{i as r,n as i,t as a}from"./ui-BrNwNHX9.mjs";import{a as o,i as s,l as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./oauth-B5k80sip.mjs";import{r as h,t as g}from"./auth-DX9KnJ0P.mjs";import{t as _}from"./output-B6fBFRqe.mjs";import v from"node:path";function y(e,t,n){if(!e.profile)return;let r=n?` ${n}`:``;throw Error(`The --profile flag cannot be used with \`cf auth ${t}\`.${r}`)}function b(){if(t({allowGlobalAuthKey:!1})!==void 0)throw Error(`Cannot manage auth profiles while CLOUDFLARE_API_TOKEN is set. Unset CLOUDFLARE_API_TOKEN and try again.`)}const x={command:`create <name>`,describe:`Create or re-authenticate a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name for the auth profile`,demandOption:!0}).option(`browser`,{type:`boolean`,description:`Open a browser to complete login (use --no-browser to print the URL instead)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async t=>{y(t,`create`,"Pass the profile name as the command argument: `cf auth create <name>`."),b(),e(t.name);let r=d().configs.exists(t.name);await u({browser:t.browser,scopes:t.scopes,profile:t.name}),console.log(i(r?`Profile "${t.name}" re-authenticated.`:`Profile "${t.name}" created.`)),console.log(a(`Run ${n.code(`cf auth activate ${t.name}`)} to use this profile in a directory.`))}},S={command:`delete <name>`,describe:`Delete a named auth profile`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to delete`,demandOption:!0}),handler:async t=>{y(t,`delete`),b(),e(t.name);let r=d();if(!r.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist.`);let o=r.bindings.removeAllBindingsForProfile(t.name);if(o.length>0){console.log(i(`Removed directory bindings:`));for(let e of o)console.log(` ${e}`)}await f(t.name),r.configs.delete(t.name),console.log(i(`Profile "${t.name}" deleted.`));let s=r.bindings.getProfileForDirectory(process.cwd());s?console.log(i(`Active profile for this directory: ${s}.`)):r.configs.exists(`default`)?console.log(i(`This directory now uses the default profile.`)):console.log(a(`No active profile for this directory. Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`))}},C={command:`activate <name> [dir]`,describe:`Bind a named auth profile to a directory`,builder:e=>e.positional(`name`,{type:`string`,description:`Name of the auth profile to activate`,demandOption:!0}).positional(`dir`,{type:`string`,description:`Directory to bind the profile to (defaults to current directory)`}),handler:t=>{y(t,`activate`,"Pass the profile name as the command argument: `cf auth activate <name>`."),b(),e(t.name);let n=d();if(!n.configs.exists(t.name))throw Error(`Profile "${t.name}" does not exist. Run \`cf auth create ${t.name}\` first.`);let r=t.dir??process.cwd();n.bindings.activate(t.name,r),console.log(i(`Profile "${t.name}" activated for "${v.resolve(r)}".`))}},w={command:`deactivate [dir]`,describe:`Remove the auth profile binding from a directory`,builder:e=>e.positional(`dir`,{type:`string`,description:`Directory to unbind (defaults to current directory). Must be the exact directory the profile was bound to.`}),handler:e=>{y(e,`deactivate`),b();let t=d(),r=e.dir??process.cwd(),{removedProfile:o,newResolution:s}=t.bindings.deactivate(r);console.log(i(`Profile "${o}" deactivated from "${v.resolve(r)}".`)),s.profile===void 0?console.log(a(`Run ${n.code(`cf auth login`)} to set up the default profile, or ${n.code(`cf auth create <name>`)} to create a named profile.`)):s.profile===`default`?console.log(i(`This directory now uses the default profile.`)):console.log(i(`Now using: ${s.profile} (${s.source}).`))}},T={command:`list`,describe:`List all auth profiles`,handler:e=>{y(e,`list`);let t=d(),n=t.bindings.read(),r={};for(let[e,t]of Object.entries(n))(r[t]??=[]).push(e);_(t.configs.list().map(e=>({name:e,boundDirectories:r[e]??[]})))}},E={command:`login`,describe:`Authenticate with Cloudflare`,builder:e=>e.option(`force`,{type:`boolean`,alias:`f`,description:`Force re-authentication even if already logged in`,default:!1}).option(`browser`,{type:`boolean`,description:`Open a browser to complete login (use --no-browser to print the URL instead)`,default:!0}).option(`scopes`,{type:`string`,array:!0,description:`The set of OAuth scopes to request`}),handler:async e=>{y(e,`login`,"Run `cf auth create <name>` to authenticate a named profile.");let t=p();if(t!==`default`&&console.log(r(`This directory has profile "${t}" active. \`cf auth login\` updates the default profile, not "${t}".\nTo re-authenticate "${t}", run \`cf auth create ${t}\`.`)),m(`default`),!e.force&&o()){if(await s()){let e=c();console.log(i(`You are already logged in.`)),console.log(`${n.info(`Config file:`)} ${n.muted(l())}`),e?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(e.expiration_time).toLocaleString()}`),console.log(a(`Run ${n.code(`cf auth login --force`)} to re-authenticate, or ${n.code(`cf auth logout`)} to log out.`));return}console.log(r(`Existing tokens are invalid or expired. Starting fresh login...
3
- `))}else e.force&&o()&&console.log(i(`Re-authenticating...
4
- `));if(console.log(i(`Starting OAuth login flow...
5
- `)),!await u({browser:e.browser,scopes:e.scopes,profile:`default`})){console.log(r(`CLOUDFLARE_API_TOKEN is set and takes precedence. Unset it to log in via OAuth.`));return}let d=c();console.log(`${n.info(`Config file:`)} ${n.muted(l())}`),d?.scopes&&console.log(`${n.info(`Scopes:`)} ${d.scopes.join(`, `)}`),d?.expiration_time&&console.log(`${n.info(`Token expires:`)} ${new Date(d.expiration_time).toLocaleString()}`)}},D={command:`logout`,describe:`Log out and remove stored credentials`,handler:async e=>{y(e,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let t=p();t!==`default`&&console.log(r(`This directory has profile "${t}" active. \`cf auth logout\` removes the default profile's token, not "${t}".\nTo delete "${t}", run \`cf auth delete ${t}\`.`)),m(`default`);let s=o(),c=!!process.env.CLOUDFLARE_API_TOKEN;if(!s){c?(console.log(i(`No cf OAuth credentials found, but CLOUDFLARE_API_TOKEN environment variable is set.`)),console.log(i(`Unset it with: unset CLOUDFLARE_API_TOKEN`))):(console.log(i(`You are not currently logged in.`)),console.log(a(`Run ${n.code(`cf auth login`)} to authenticate.`)));return}console.log(i(`Logging out...`)),await f(`default`),console.log(`${n.info(`Removed:`)} OAuth tokens from ${n.muted(l())}`),c&&(console.log(``),console.log(r(`CLOUDFLARE_API_TOKEN environment variable is still set.`)),console.log(i(`You will remain authenticated via the env var. Unset it with: unset CLOUDFLARE_API_TOKEN`)))}},O={command:`whoami`,describe:`Show current user and authentication status`,builder:e=>e,handler:async e=>{let t=process.env.CLOUDFLARE_API_TOKEN,n=c(),r;r=t?`CLOUDFLARE_API_TOKEN environment variable`:n?.oauth_token?`OAuth token from ${l()}`:`none`;let i;try{i=await h()}catch{_({authenticated:!1,error:`Not logged in`});return}let a=g({apiToken:i}),o=!1,s;try{let e=await a.user.get();o=!0,e&&`email`in e&&typeof e.email==`string`&&(s=e.email)}catch(e){o=!1,process.env.DEBUG&&console.error(`Token verification error:`,e)}let u={authenticated:!0,authSource:r,tokenValid:o,...s&&{email:s}};n?.oauth_token&&(u.scopes=n.scopes,u.expiresAt=n.expiration_time),_(u)}},k={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(E).command(D).command(O).command(x).command(S).command(C).command(w).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{k as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{t as o}from"./local-CYc9q7l2.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Gets the current billing profile for the account.`,builder:s,handler:async s=>{if(s.dryRun){i({command:`cf billing profiles get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/billing/profile`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.billing.profiles.get({account_id:l})),{successLabel:`Loaded`})}},l={command:`profiles`,describe:`Billing profile with payment method, address, and invoice preferences`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`from`,{type:`string`,description:`Start date for the usage query (ISO 8601).`}).option(`to`,{type:`string`,description:`End date for the usage query (ISO 8601).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`paygo`,describe:`Returns billable usage data for PayGo (self-serve) accounts. When no query parameters are provided, returns usage for the current billing period.`,builder:u,handler:async s=>{let c={from:s.from,to:s.to};if(s.dryRun){i({command:`cf billing usage paygo`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/paygo-usage`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.billing.usage.paygo({account_id:u,...c})),{successLabel:`Loaded`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`paygo_info`,describe:`Returns high-level usage information for the account, including coverage, and subscription metadata.`,builder:f,handler:async s=>{if(s.dryRun){i({command:`cf billing usage paygo_info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/paygo-usage-info`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.billing.usage.paygoInfo({account_id:l})),{successLabel:`Loaded`})}},m={command:`usage`,describe:`Operations for usage`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`billing`,describe:`Account billing profiles and usage data for Cloudflare subscriptions and add-on services`,builder:e=>e.command(l).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{n as c,r as l}from"./prompt-q3B7sM2A.mjs";function u(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`Wirefilter expression describing the traffic being reported.`}).option(`first-request-seen-at`,{type:`string`,description:`The first_request_seen_at field`}).option(`last-request-seen-at`,{type:`string`,description:`The last_request_seen_at field`}).option(`requests`,{type:`number`,description:`The requests field`}).option(`subtype`,{type:`string`,description:`The subtype field`}).option(`type`,{type:`string`,description:`Type of feedback report.`,choices:[`false_positive`,`false_negative`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:"Submit a feedback report for the specified zone. Use `type` to indicate whether the report is a false positive (good traffic flagged as bot) or a false negative (bot traffic missed). Furthermore, you can also use `expression` as a wirefilter to identify the affected traffic sample. See more accepted API fields and expression types at https://developers.cloudflare.com/bots/concepts/feedback-loop/#api-fields and https://developers.cloudflare.com/bots/concepts/feedback-loop/#expression-fields, respectively.",builder:u,handler:async u=>{if(u.dryRun){a({command:`cf bot-management feedback create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?r({description:s(u.description,`description`,`text`),expression:s(u.expression,`expression`,`text`),first_request_seen_at:s(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:s(u.subtype,`subtype`,`text`),type:s(u.type,`type`,`text`)}):n(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=n(u.body);i(await o(`Creating`,async()=>d.botManagement.feedback.create({body:e,zone_id:f})),{successLabel:`Created`});return}if(u.description===void 0&&(u.description=await l(`description`,`The description field`)),u.expression===void 0&&(u.expression=await l(`expression`,`Wirefilter expression describing the traffic being reported.`)),u[`first-request-seen-at`]===void 0&&(u[`first-request-seen-at`]=await l(`first-request-seen-at`,`The first_request_seen_at field`)),u[`last-request-seen-at`]===void 0&&(u[`last-request-seen-at`]=await l(`last-request-seen-at`,`The last_request_seen_at field`)),u.requests===void 0)throw Error(`--requests is required (or pass --body with this field set).`);u.type===void 0&&(u.type=await c(`type`,`Type of feedback report.`,[`false_positive`,`false_negative`]));let p=r({description:s(u.description,`description`,`text`),expression:s(u.expression,`expression`,`text`),first_request_seen_at:s(u[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(u[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:u.requests,subtype:s(u.subtype,`subtype`,`text`),type:s(u.type,`type`,`text`)});i(await o(`Creating`,async()=>d.botManagement.feedback.create({body:p,zone_id:f})),{successLabel:`Created`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`Returns all feedback reports previously submitted for the specified zone. Feedback reports help improve detection by sharing samples of traffic that were misclassified as bots or humans.`,builder:f,handler:async n=>{if(n.dryRun){a({command:`cf bot-management feedback list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.botManagement.feedback.list({zone_id:s})),{successLabel:`Loaded`})}},m={command:`feedback`,describe:`Feedback operations`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Retrieve a zone's Bot Management Config`,builder:h,handler:async n=>{if(n.dryRun){a({command:`cf bot-management get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.botManagement.get({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.option(`ai-bots-protection`,{type:`string`,description:`Enable rule to block AI Scrapers and Crawlers.`,choices:[`block`,`disabled`,`only_on_ad_pages`]}).option(`cf-robots-variant`,{type:`string`,description:`Specifies the Robots Access Control License variant to use.`,choices:[`off`,`policy_only`]}).option(`content-bots-protection`,{type:`string`,description:`Enable rule to block content bots. When enabled, blocks automated traffic with low bot scores, excluding safe verified bot categories. Exceptions should be managed via skip rules.`,choices:[`block`,`disabled`]}).option(`crawler-protection`,{type:`string`,description:`Enable rule to punish AI Scrapers and Crawlers via a link maze.`,choices:[`enabled`,`disabled`]}).option(`enable-js`,{type:`boolean`,description:`Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).`}).option(`is-robots-txt-managed`,{type:`boolean`,description:`Enable cloudflare managed robots.txt. If an existing robots.txt is detected, then managed robots.txt will be prepended to the existing robots.txt.`}).option(`fight-mode`,{type:`boolean`,description:`Whether to enable Bot Fight Mode.`}).option(`stale-zone-configuration-optimize-wordpress`,{type:`boolean`,description:`Indicates that the zone's wordpress optimization for SBFM is turned on.`}).option(`stale-zone-configuration-sbfm-definitely-automated`,{type:`string`,description:`Indicates that the zone's definitely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-likely-automated`,{type:`string`,description:`Indicates that the zone's likely automated requests are being blocked or challenged.`}).option(`stale-zone-configuration-sbfm-static-resource-protection`,{type:`string`,description:`Indicates that the zone's static resource protection is turned on.`}).option(`stale-zone-configuration-sbfm-verified-bots`,{type:`string`,description:`Indicates that the zone's verified bot requests are being blocked.`}).option(`stale-zone-configuration-suppress-session-score`,{type:`boolean`,description:`Indicates that the zone's session score tracking is disabled.`}).option(`stale-zone-configuration-fight-mode`,{type:`boolean`,description:`Indicates that the zone's Bot Fight Mode is turned on.`}).option(`optimize-wordpress`,{type:`boolean`,description:`Whether to optimize Super Bot Fight Mode protections for Wordpress.`}).option(`sbfm-definitely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on definitely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`sbfm-static-resource-protection`,{type:`boolean`,description:`Super Bot Fight Mode (SBFM) to enable static resource protection.
3
- Enable if static resources on your application need bot protection.
4
- Note: Static resource protection can also result in legitimate traffic being blocked.
5
- `}).option(`sbfm-verified-bots`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on verified bots requests.`,choices:[`allow`,`block`]}).option(`sbfm-likely-automated`,{type:`string`,description:`Super Bot Fight Mode (SBFM) action to take on likely automated requests.`,choices:[`allow`,`block`,`managed_challenge`]}).option(`auto-update-model`,{type:`boolean`,description:`Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes)`}).option(`bm-cookie-enabled`,{type:`boolean`,description:`Indicates that the bot management cookie can be placed on end user devices accessing the site. Defaults to true`}).option(`suppress-session-score`,{type:`boolean`,description:`Whether to disable tracking the highest bot score for a session in the Bot Management cookie.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update`,describe:'Updates the Bot Management configuration for a zone. This API is used to update: - **Bot Fight Mode** - **Super Bot Fight Mode** - **Bot Management for Enterprise** See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more information on the different plans \\ If you recently upgraded or downgraded your plan, refer to the following examples to clean up old configurations. Copy and paste the example body to remove old zone configurations based on your current plan. #### Clean up configuration for Bot Fight Mode plan ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "suppress_session_score": false } ``` #### Clean up configuration for SBFM Pro plan ```json { "sbfm_likely_automated": "allow", "fight_mode": false } ``` #### Clean up configuration for SBFM Biz plan ```json { "fight_mode": false } ``` #### Clean up configuration for BM Enterprise Subscription plan It is strongly recommended that you ensure you have [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to protect your zone before disabling the SBFM rules. Without these protections, your zone is vulnerable to attacks. ```json { "sbfm_likely_automated": "allow", "sbfm_definitely_automated": "allow", "sbfm_verified_bots": "allow", "sbfm_static_resource_protection": false, "optimize_wordpress": false, "fight_mode": false } ```',builder:_,handler:async c=>{if(c.dryRun){a({command:`cf bot-management update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/bot_management`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?r({ai_bots_protection:s(c[`ai-bots-protection`],`ai-bots-protection`,`text`),cf_robots_variant:s(c[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:s(c[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:s(c[`crawler-protection`],`crawler-protection`,`text`),enable_js:c[`enable-js`],is_robots_txt_managed:c[`is-robots-txt-managed`],fight_mode:c[`fight-mode`],stale_zone_configuration:{optimize_wordpress:c[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:s(c[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:s(c[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:s(c[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:s(c[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:c[`stale-zone-configuration-suppress-session-score`],fight_mode:c[`stale-zone-configuration-fight-mode`]},optimize_wordpress:c[`optimize-wordpress`],sbfm_definitely_automated:s(c[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:c[`sbfm-static-resource-protection`],sbfm_verified_bots:s(c[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:s(c[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:c[`auto-update-model`],bm_cookie_enabled:c[`bm-cookie-enabled`],suppress_session_score:c[`suppress-session-score`]}):n(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=n(c.body);i(await o(`Updating`,async()=>l.botManagement.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=r({ai_bots_protection:s(c[`ai-bots-protection`],`ai-bots-protection`,`text`),cf_robots_variant:s(c[`cf-robots-variant`],`cf-robots-variant`,`text`),content_bots_protection:s(c[`content-bots-protection`],`content-bots-protection`,`text`),crawler_protection:s(c[`crawler-protection`],`crawler-protection`,`text`),enable_js:c[`enable-js`],is_robots_txt_managed:c[`is-robots-txt-managed`],fight_mode:c[`fight-mode`],stale_zone_configuration:{optimize_wordpress:c[`stale-zone-configuration-optimize-wordpress`],sbfm_definitely_automated:s(c[`stale-zone-configuration-sbfm-definitely-automated`],`stale-zone-configuration-sbfm-definitely-automated`,`text`),sbfm_likely_automated:s(c[`stale-zone-configuration-sbfm-likely-automated`],`stale-zone-configuration-sbfm-likely-automated`,`text`),sbfm_static_resource_protection:s(c[`stale-zone-configuration-sbfm-static-resource-protection`],`stale-zone-configuration-sbfm-static-resource-protection`,`text`),sbfm_verified_bots:s(c[`stale-zone-configuration-sbfm-verified-bots`],`stale-zone-configuration-sbfm-verified-bots`,`text`),suppress_session_score:c[`stale-zone-configuration-suppress-session-score`],fight_mode:c[`stale-zone-configuration-fight-mode`]},optimize_wordpress:c[`optimize-wordpress`],sbfm_definitely_automated:s(c[`sbfm-definitely-automated`],`sbfm-definitely-automated`,`text`),sbfm_static_resource_protection:c[`sbfm-static-resource-protection`],sbfm_verified_bots:s(c[`sbfm-verified-bots`],`sbfm-verified-bots`,`text`),sbfm_likely_automated:s(c[`sbfm-likely-automated`],`sbfm-likely-automated`,`text`),auto_update_model:c[`auto-update-model`],bm_cookie_enabled:c[`bm-cookie-enabled`],suppress_session_score:c[`suppress-session-score`]});i(await o(`Updating`,async()=>l.botManagement.update({body:d,zone_id:u})),{successLabel:`Updated`})}},y={command:`bot-management`,describe:`Bot detection and mitigation settings — configure bot scores, JavaScript detections, and challenge behavior`,builder:e=>e.command(g).command(v).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{t as o}from"./local-CYc9q7l2.mjs";import{t as s}from"./prompt-q3B7sM2A.mjs";import{t as c}from"./cli-types-DGgEbf8K.mjs";function l(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`date`,{type:`string`,description:`Date`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`day-report <asn-id>`,describe:`Gets all the data the botnet tracking database has for a given ASN registered to user account for given date. If no date is given, it will return results for the previous day.`,builder:c(l),handler:async s=>{let c={date:s.date};if(s.dryRun){i({command:`cf botnet-feed asn day-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/botnet_feed/asn/${s[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(s[`asn-id`]))}/day_report`,pathParams:{"asn-id":String(s[`asn-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await e();s.accountId=u,r(await a(`Loading`,async()=>l.botnetFeed.asn.dayReport({account_id:u,asn_id:s[`asn-id`],...c})),{successLabel:`Loaded`})}};function d(e){return e.positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`full-report <asn-id>`,describe:`Gets all the data the botnet threat feed tracking database has for a given ASN registered to user account.`,builder:c(d),handler:async s=>{if(s.dryRun){i({command:`cf botnet-feed asn full-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/botnet_feed/asn/${s[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(s[`asn-id`]))}/full_report`,pathParams:{"asn-id":String(s[`asn-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.botnetFeed.asn.fullReport({account_id:l,asn_id:s[`asn-id`]})),{successLabel:`Loaded`})}},p={command:`asn`,describe:`ASN-level botnet activity data showing networks with known C2 infrastructure`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.positional(`asn-id`,{type:`string`,description:`Asn 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 h={command:`delete <asn-id>`,describe:`Delete an ASN from botnet threat feed for a given user.`,builder:c(m),handler:async c=>{if(c.dryRun){i({command:`cf botnet-feed configs asn delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/botnet_feed/configs/asn/${c[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(c[`asn-id`]))}`,pathParams:{"asn-id":String(c[`asn-id`]??``)},bodyKind:`none`});return}let l=await n(c),u=c.local?o:await e();if(c.accountId=u,!await s({force:!!c.force})){process.stderr.write(`Aborted.
3
- `);return}r(await a(`Deleting`,async()=>l.botnetFeed.configs.asn.delete({account_id:u,asn_id:c[`asn-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf botnet-feed configs asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/botnet_feed/configs/asn`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await e();s.accountId=l,r(await a(`Loading`,async()=>c.botnetFeed.configs.asn.get({account_id:l})),{successLabel:`Loaded`})}},v={command:`asn`,describe:`Botnet feed subscription configuration and notification preferences`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`configs`,describe:`Operations for configs`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`botnet-feed`,describe:`Botnet threat intelligence feeds — IP and ASN-level data on known command-and-control infrastructure`,builder:e=>e.command(p).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./local-CYc9q7l2.mjs";import{r as u,t as d}from"./prompt-q3B7sM2A.mjs";import{t as f}from"./cli-types-DGgEbf8K.mjs";function p(e){return e.option(`show-historic`,{type:`string`,description:`Include scanned images without domain metadata (historic data). Default: false (only show images with domain)`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score threshold for matches (0-1, default: 0)`,default:0}).option(`top-k`,{type:`number`,description:`Number of closest matches to return (1-100, default: 10)`,default:10}).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:`submit`,describe:`Submit an image and find the n closest matches from the scanned images index without creating any match records. Returns similarity scores and metadata for each match.`,builder:p,handler:async d=>{let f={showHistoric:d[`show-historic`],download:d.download};if(d.dryRun){o({command:`cf brand-protection submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/search`,pathParams:{},query:f,bodyKind:`json`,body:d.body===void 0?i({image_data:c(d[`image-data`],`image-data`,`text`),score_threshold:d[`score-threshold`],top_k:d[`top-k`]}):r(d.body)});return}let p=await n(d),m=d.local?l:await e();if(d.accountId=m,d.body){let e=r(d.body);new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.brandProtection.submit({...e,account_id:m,...f})),{successLabel:`Created`});return}d[`image-data`]===void 0&&(d[`image-data`]=await u(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`));let h=i({image_data:c(d[`image-data`],`image-data`,`text`),score_threshold:d[`score-threshold`],top_k:d[`top-k`]});new URLSearchParams(Object.entries(f).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.brandProtection.submit({...h,account_id:m,...f})),{successLabel:`Created`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`url-info`,describe:`Get the total number of saved brand protection queries (domain + logo) for an account`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf brand-protection url-info`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/total-queries`,pathParams:{},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.brandProtection.urlInfo({account_id:c})),{successLabel:`Loaded`})}};function _(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID`,demandOption:!0}).option(`download`,{type:`string`,description:`Download`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'matchedAt', 'domain', 'similarityScore', or 'registrar'`,choices:[`matchedAt`,`domain`,`similarityScore`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get paginated list of logo matches for a specific brand protection logo query`,builder:f(_),handler:async r=>{let i={offset:r.offset,limit:r.limit,query_id:r[`query-id`],download:r.download,orderBy:r[`order-by`],order:r.order};if(r.dryRun){o({command:`cf brand-protection v2 logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/matches`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.brandProtection.v2.logoMatches.get({account_id:u,...i})),{successLabel:`Loaded`})}},y={command:`logo-matches`,describe:`Detected visual logo matches found on potentially infringing websites`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`search-lookback`,{type:`boolean`,description:`If true, search historic scanned images for matches above the similarity threshold`,default:!0}).option(`similarity-threshold`,{type:`number`,description:`Minimum similarity score (0-1) required for visual matches`}).option(`tag`,{type:`string`,description:`Unique identifier for the logo query`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Create a new saved brand protection logo query for visual similarity matching`,builder:b,handler:async d=>{if(d.dryRun){o({command:`cf brand-protection v2 logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},bodyKind:`json`,body:d.body===void 0?i({image_data:c(d[`image-data`],`image-data`,`text`),search_lookback:d[`search-lookback`],similarity_threshold:d[`similarity-threshold`],tag:c(d.tag,`tag`,`text`)}):r(d.body)});return}let f=await n(d),p=d.local?l:await e();if(d.accountId=p,d.body){let e=r(d.body);a(await s(`Creating`,async()=>f.brandProtection.v2.logos.create({...e,account_id:p})),{successLabel:`Created`});return}if(d[`image-data`]===void 0&&(d[`image-data`]=await u(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`)),d[`similarity-threshold`]===void 0)throw Error(`--similarity-threshold is required (or pass --body with this field set).`);d.tag===void 0&&(d.tag=await u(`tag`,`Unique identifier for the logo query`));let m=i({image_data:c(d[`image-data`],`image-data`,`text`),search_lookback:d[`search-lookback`],similarity_threshold:d[`similarity-threshold`],tag:c(d.tag,`tag`,`text`)});a(await s(`Creating`,async()=>f.brandProtection.v2.logos.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`query-id`,{type:`string`,description:`Query 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 C={command:`delete <query-id>`,describe:`Delete a saved brand protection logo query. Returns 404 if the query ID doesn't exist.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf brand-protection v2 logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${r[`query-id`]==null?`<query-id>`:encodeURIComponent(String(r[`query-id`]))}`,pathParams:{"query-id":String(r[`query-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await d({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.brandProtection.v2.logos.delete({account_id:c,query_id:r[`query-id`]})),{successLabel:`Deleted`})}};function w(e){return e.option(`id`,{type:`string`,description:`Optional query ID to retrieve a specific logo query`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Get all saved brand protection logo queries for an account. Optionally specify id to get a single query. Set download=true to include base64-encoded image data.`,builder:w,handler:async r=>{let i={id:r.id,download:r.download};if(r.dryRun){o({command:`cf brand-protection v2 logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.brandProtection.v2.logos.get({account_id:u,...i})),{successLabel:`Loaded`})}},E={command:`logos`,describe:`Brand monitoring queries that define search patterns for detecting brand abuse`,builder:e=>e.command(x).command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`offset`,{type:`string`,description:`Offset`}).option(`limit`,{type:`string`,description:`Limit`}).option(`query-id`,{type:`string`,description:`Query ID or comma-separated list of Query IDs. When multiple IDs are provided, matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and dismissed state.`,demandOption:!0}).option(`include-domain-id`,{type:`string`,description:`Include domain ID`}).option(`include-dismissed`,{type:`string`,description:`Include dismissed`}).option(`domain-search`,{type:`string`,description:`Filter matches by domain name (substring match)`}).option(`order-by`,{type:`string`,description:`Column to sort by. Options: 'domain', 'first_seen', or 'registrar'`,choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:`Sort order. Options: 'asc' (ascending) or 'desc' (descending)`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated across queries and each match includes a match_details array with per-match query metadata and individual dismissed state.`,builder:f(D),handler:async r=>{let i={offset:r.offset,limit:r.limit,query_id:r[`query-id`],include_domain_id:r[`include-domain-id`],include_dismissed:r[`include-dismissed`],domain_search:r[`domain-search`],orderBy:r[`order-by`],order:r.order};if(r.dryRun){o({command:`cf brand-protection v2 matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.brandProtection.v2.matches.get({account_id:u,...i})),{successLabel:`Loaded`})}},k={command:`matches`,describe:`Detected brand abuse matches from monitoring queries with evidence downloads`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get`,describe:`Get all saved brand protection queries for an account`,builder:A,handler:async r=>{let i={id:r.id};if(r.dryRun){o({command:`cf brand-protection v2 queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.brandProtection.v2.queries.get({account_id:u,...i})),{successLabel:`Loaded`})}},M={command:`queries`,describe:`Brand monitoring queries that define search patterns for detecting brand abuse`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`v2`,describe:`Operations for v2`,builder:e=>e.command(y).command(E).command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`brand-protection`,describe:`Monitor the Internet for phishing sites, lookalike domains, and unauthorized use of your brand assets`,builder:e=>e.command(m).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{i as n,n as r}from"./auth-DX9KnJ0P.mjs";import{n as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{t as c}from"./local-CYc9q7l2.mjs";import{t as l}from"./prompt-q3B7sM2A.mjs";import{t as u}from"./cli-types-DGgEbf8K.mjs";import{n as d,t as f}from"./raw-fetch-bIXC9D1m.mjs";function p(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 ee={command:`create`,describe:"Returns the page's accessibility tree. Use `interestingOnly` to only return semantically meaningful nodes; use `root` to scope the tree to a CSS-selector-anchored subtree. Control page loading with `gotoOptions` and `waitFor*` options.",builder:p,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering accessibilityTree create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/accessibilityTree`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.accessibilityTree.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/accessibilityTree`,{query:u})),{successLabel:`Created`})}},m={command:`accessibilityTree`,describe:`Operations for accessibilityTree`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:"Fetches rendered HTML content from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:h,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering content create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/content`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.content.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/content`,{query:u})),{successLabel:`Created`})}},_={command:`content`,describe:`Operations for content`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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:"Starts a crawl job for the provided URL and its children. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:v,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering crawl create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/crawl`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.crawl.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/crawl`,{query:u})),{successLabel:`Created`})}};function b(e){return e.positional(`job-id`,{type:`string`,description:`The ID of the crawl job to cancel.`,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 <job-id>`,describe:`Cancels an ongoing crawl job by setting its status to cancelled and stopping all queued URLs.`,builder:b,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering crawl delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/crawl/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}`,pathParams:{"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let i=await r(n),u=n.local?c:await e();if(n.accountId=u,!await l({force:!!n.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.browserRendering.crawl.delete({account_id:u,job_id:n[`job-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`job-id`,{type:`string`,description:`Crawl job ID.`,demandOption:!0}).option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`status`,{type:`string`,description:`Filter by URL status.`,choices:[`queued`,`errored`,`completed`,`disallowed`,`skipped`,`cancelled`]}).option(`cursor`,{type:`number`,description:`Cursor for pagination.`}).option(`limit`,{type:`number`,description:`Limit for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <job-id>`,describe:`Returns the result of a crawl job.`,builder:u(S),handler:async n=>{let i={cacheTTL:n[`cache-ttl`],status:n.status,cursor:n.cursor,limit:n.limit};if(n.dryRun){o({command:`cf browser-rendering crawl get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/crawl/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}`,pathParams:{"job-id":String(n[`job-id`]??``)},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.crawl.get({account_id:u,job_id:n[`job-id`],...i})),{successLabel:`Loaded`})}},w={command:`crawl`,describe:`Operations for crawl`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID to connect to.`,demandOption:!0}).option(`keep-alive`,{type:`number`,description:`Keep-alive time in ms (only valid when acquiring new session).`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`connect <session-id>`,describe:`Establishes a WebSocket connection to an existing browser session.`,builder:T,handler:async n=>{let i={keep_alive:n[`keep-alive`],lab:n.lab,recording:n.recording};if(n.dryRun){o({command:`cf browser-rendering devtools browser connect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``)},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.devtools.browser.connect({account_id:u,session_id:n[`session-id`],...i})),{successLabel:`Loaded`})}};function D(e){return e.option(`keep-alive`,{type:`number`,description:`Keep-alive time in milliseconds.`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`targets`,{type:`boolean`,description:`Include browser targets in response.`}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URL remains valid, in milliseconds (max 60 minutes). Only used when targets is true.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`create`,describe:`Acquires a browser and returns its session ID and websocket URL.`,builder:D,handler:async n=>{let i={keep_alive:n[`keep-alive`],lab:n.lab,targets:n.targets,liveViewUrlExpiresInMs:n[`live-view-url-expires-in-ms`],recording:n.recording};if(n.dryRun){o({command:`cf browser-rendering devtools browser create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser`,pathParams:{},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Creating`,async()=>l.browserRendering.devtools.browser.create({account_id:u,...i})),{successLabel:`Created`})}};function k(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID to close.`,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 A={command:`delete <session-id>`,describe:`Closes an existing browser session.`,builder:k,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``)},bodyKind:`none`});return}let i=await r(n),u=n.local?c:await e();if(n.accountId=u,!await l({force:!!n.force})){process.stderr.write(`Aborted.
4
- `);return}a(await s(`Deleting`,async()=>i.browserRendering.devtools.browser.delete({account_id:u,session_id:n[`session-id`]})),{successLabel:`Deleted`})}};function j(e){return e.option(`keep-alive`,{type:`number`,description:`Keep-alive time in ms (only valid when acquiring new session).`}).option(`lab`,{type:`boolean`,description:`Use experimental browser.`}).option(`recording`,{type:`boolean`,description:`Recording`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`launch`,describe:`Acquires and establishes a WebSocket connection to a browser session.`,builder:j,handler:async n=>{let i={keep_alive:n[`keep-alive`],lab:n.lab,recording:n.recording};if(n.dryRun){o({command:`cf browser-rendering devtools browser launch`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser`,pathParams:{},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.devtools.browser.launch({account_id:u,...i})),{successLabel:`Loaded`})}};function N(e){return e.positional(`target-id`,{type:`string`,description:`Target ID, e.g. page ID.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <target-id>`,describe:`Establishes a WebSocket connection to a specific Chrome DevTools target or page.`,builder:N,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser page get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/page/${n[`target-id`]==null?`<target-id>`:encodeURIComponent(String(n[`target-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``),"target-id":String(n[`target-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.page.get({account_id:l,session_id:n[`session-id`],target_id:n[`target-id`]})),{successLabel:`Loaded`})}},F={command:`page`,describe:`Operations for devtools.browser.page`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`protocol <session-id>`,describe:`Returns the complete Chrome DevTools Protocol schema including all domains, commands, events, and types. This schema describes the entire CDP API surface.`,builder:I,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser protocol`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/protocol`,pathParams:{"session-id":String(n[`session-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.protocol({account_id:l,session_id:n[`session-id`]})),{successLabel:`Loaded`})}};function R(e){return e.positional(`target-id`,{type:`string`,description:`Target ID to activate.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`activate <target-id>`,describe:`Activates (brings to front) a specific browser target by its ID.`,builder:R,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser targets activate`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/activate/${n[`target-id`]==null?`<target-id>`:encodeURIComponent(String(n[`target-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``),"target-id":String(n[`target-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.targets.activate({account_id:l,session_id:n[`session-id`],target_id:n[`target-id`]})),{successLabel:`Loaded`})}};function B(e){return e.positional(`target-id`,{type:`string`,description:`Target ID to close.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`close <target-id>`,describe:`Closes a specific browser target (tab, page, etc.) by its ID. Returns 'Target is closing' on success or an error if the target is not found.`,builder:B,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser targets close`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/close/${n[`target-id`]==null?`<target-id>`:encodeURIComponent(String(n[`target-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``),"target-id":String(n[`target-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.targets.close({account_id:l,session_id:n[`session-id`],target_id:n[`target-id`]})),{successLabel:`Loaded`})}};function H(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`url`,{type:`string`,description:`Url`}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URL remains valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`create <session-id>`,describe:`Opens a new tab in the browser. Optionally specify a URL to navigate to.`,builder:H,handler:async n=>{let i={url:n.url,liveViewUrlExpiresInMs:n[`live-view-url-expires-in-ms`]};if(n.dryRun){o({command:`cf browser-rendering devtools browser targets create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/new`,pathParams:{"session-id":String(n[`session-id`]??``)},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Updating`,async()=>l.browserRendering.devtools.browser.targets.create({account_id:u,session_id:n[`session-id`],...i})),{successLabel:`Updated`})}};function W(e){return e.positional(`target-id`,{type:`string`,description:`Target ID.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <target-id>`,describe:`Returns the debuggable target with the given ID.`,builder:W,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser targets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/list/${n[`target-id`]==null?`<target-id>`:encodeURIComponent(String(n[`target-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``),"target-id":String(n[`target-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.targets.get({account_id:l,session_id:n[`session-id`],target_id:n[`target-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URLs remain valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.`,builder:K,handler:async n=>{let i={liveViewUrlExpiresInMs:n[`live-view-url-expires-in-ms`]};if(n.dryRun){o({command:`cf browser-rendering devtools browser targets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/list`,pathParams:{"session-id":String(n[`session-id`]??``)},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.devtools.browser.targets.list({account_id:u,session_id:n[`session-id`],...i})),{successLabel:`Loaded`})}},J={command:`targets`,describe:`Operations for devtools.browser.targets`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`version <session-id>`,describe:`Get browser version metadata.`,builder:Y,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools browser version`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json/version`,pathParams:{"session-id":String(n[`session-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.browser.version({account_id:l,session_id:n[`session-id`]})),{successLabel:`Loaded`})}},X={command:`browser`,describe:`Operations for devtools.browser`,builder:e=>e.command(E).command(O).command(A).command(M).command(L).command(te).command(F).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`session-id`,{type:`string`,description:`Browser session ID.`,demandOption:!0}).option(`live-view-url-expires-in-ms`,{type:`number`,description:`How long the live view URLs remain valid, in milliseconds (max 60 minutes)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <session-id>`,describe:`Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.`,builder:Z,handler:async n=>{let i={liveViewUrlExpiresInMs:n[`live-view-url-expires-in-ms`]};if(n.dryRun){o({command:`cf browser-rendering devtools json get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/browser/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}/json`,pathParams:{"session-id":String(n[`session-id`]??``)},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.devtools.json.get({account_id:u,session_id:n[`session-id`],...i})),{successLabel:`Loaded`})}},ne={command:`json`,describe:`Operations for devtools.json`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.positional(`session-id`,{type:`string`,description:`Session ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <session-id>`,describe:`Get details for a specific browser session.`,builder:re,handler:async n=>{if(n.dryRun){o({command:`cf browser-rendering devtools session get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/session/${n[`session-id`]==null?`<session-id>`:encodeURIComponent(String(n[`session-id`]))}`,pathParams:{"session-id":String(n[`session-id`]??``)},bodyKind:`none`});return}let i=await r(n),l=n.local?c:await e();n.accountId=l,a(await s(`Loading`,async()=>i.browserRendering.devtools.session.get({account_id:l,session_id:n[`session-id`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List active browser sessions.`,builder:ae,handler:async n=>{let i={limit:n.limit,offset:n.offset};if(n.dryRun){o({command:`cf browser-rendering devtools session list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/devtools/session`,pathParams:{},query:i,bodyKind:`none`});return}let l=await r(n),u=n.local?c:await e();n.accountId=u,a(await s(`Loading`,async()=>l.browserRendering.devtools.session.list({account_id:u,...i})),{successLabel:`Loaded`})}},se={command:`session`,describe:`Operations for devtools.session`,builder:e=>e.command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ce={command:`devtools`,describe:`Operations for devtools`,builder:e=>e.command(X).command(ne).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`create`,describe:"Gets json from a webpage from a provided URL or HTML. Pass `prompt` or `schema` in the body. Control page loading with `gotoOptions` and `waitFor*` options.",builder:le,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering json create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/json`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.json.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/json`,{query:u})),{successLabel:`Created`})}},de={command:`json`,describe:`Operations for json`,builder:e=>e.command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function fe(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 pe={command:`create`,describe:`Get links from a web page.`,builder:fe,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering links create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/links`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.links.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/links`,{query:u})),{successLabel:`Created`})}},me={command:`links`,describe:`Operations for links`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 ge={command:`create`,describe:"Gets markdown of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options.",builder:he,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering markdown create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/markdown`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.markdown.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/markdown`,{query:u})),{successLabel:`Created`})}},_e={command:`markdown`,describe:`Operations for markdown`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ye={command:`create`,describe:"Fetches rendered PDF from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.",builder:ve,handler:async n=>{let a={cacheTTL:n[`cache-ttl`]};if(n.dryRun){o({command:`cf browser-rendering pdf create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/pdf`,pathParams:{},query:a,bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}await r(n);let l=n.local?c:await e();if(n.accountId=l,n.body){let e=i(n.body),t=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r=await s(`Creating`,async()=>f(`/accounts/${l}/browser-rendering/pdf${t?`?`+t:``}`,{method:`POST`,localEndpoint:n.local?n.localEndpoint:void 0,body:JSON.stringify(e),contentType:`application/json`}));d(n.text===!0?r.toString(`utf-8`):r);return}let u=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),p=await s(`Creating`,async()=>f(`/accounts/${l}/browser-rendering/pdf${u?`?`+u:``}`,{method:`POST`,localEndpoint:n.local?n.localEndpoint:void 0}));d(n.text===!0?p.toString(`utf-8`):p)}},be={command:`pdf`,describe:`Operations for pdf`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`create`,describe:`Get meta attributes like height, width, text and others of selected elements.`,builder:$,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering scrape create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/scrape`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.scrape.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/scrape`,{query:u})),{successLabel:`Created`})}},Se={command:`scrape`,describe:`Operations for scrape`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const we={command:`create`,describe:"Takes a screenshot of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.",builder:Ce,handler:async n=>{let a={cacheTTL:n[`cache-ttl`]};if(n.dryRun){o({command:`cf browser-rendering screenshot create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/screenshot`,pathParams:{},query:a,bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}await r(n);let l=n.local?c:await e();if(n.accountId=l,n.body){let e=i(n.body),t=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),r=await s(`Creating`,async()=>f(`/accounts/${l}/browser-rendering/screenshot${t?`?`+t:``}`,{method:`POST`,localEndpoint:n.local?n.localEndpoint:void 0,body:JSON.stringify(e),contentType:`application/json`}));d(n.text===!0?r.toString(`utf-8`):r);return}let u=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),p=await s(`Creating`,async()=>f(`/accounts/${l}/browser-rendering/screenshot${u?`?`+u:``}`,{method:`POST`,localEndpoint:n.local?n.localEndpoint:void 0}));d(n.text===!0?p.toString(`utf-8`):p)}},Te={command:`screenshot`,describe:`Operations for screenshot`,builder:e=>e.command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).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 De={command:`create`,describe:"Returns the page's HTML content and screenshot. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.",builder:Ee,handler:async l=>{let u={cacheTTL:l[`cache-ttl`]};if(l.dryRun){o({command:`cf browser-rendering snapshot create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/browser-rendering/snapshot`,pathParams:{},query:u,bodyKind:`json`,body:l.body===void 0?void 0:i(l.body)});return}let d=await r(l),f=l.local?c:await e();if(l.accountId=f,l.body){let e=i(l.body);new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>d.browserRendering.snapshot.create({body:e,account_id:f,...u})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>n(d,`POST`,`/accounts/${f}/browser-rendering/snapshot`,{query:u})),{successLabel:`Created`})}},Oe={command:`snapshot`,describe:`Operations for snapshot`,builder:e=>e.command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`browser-rendering`,describe:`browser-rendering`,builder:e=>e.command(m).command(_).command(w).command(ce).command(de).command(me).command(_e).command(be).command(Se).command(Te).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ke as default};