cf 1.0.0-beta.17 → 1.0.0-beta.19

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 (319) hide show
  1. package/README.md +7 -0
  2. package/dist/_meta/commands.json +9122 -6086
  3. package/dist/_meta/hand-written-commands.json +6 -0
  4. package/dist/_meta/schemas.json +8392 -5576
  5. package/dist/{abuse-reports-C4LxDvUM.mjs → abuse-reports-DhgunVFo.mjs} +6 -6
  6. package/dist/{access-DnWW2AAT.mjs → access-BDoDq_WZ.mjs} +1 -1
  7. package/dist/{accounts-8UcHNm3S.mjs → accounts-DLTCzZJg.mjs} +17 -13
  8. package/dist/{acm-qRM3iy4Z.mjs → acm-DS1CosYq.mjs} +1 -1
  9. package/dist/{addressing-CAb8z2Dq.mjs → addressing-DFeYj8TY.mjs} +19 -19
  10. package/dist/{agent-memory-oIUP4ZV5.mjs → agent-memory-DXjQ8N0g.mjs} +6 -6
  11. package/dist/{ai-DnhytGdc.mjs → ai-V5YopMkS.mjs} +4 -4
  12. package/dist/{ai-audit-B7_5EOcN.mjs → ai-audit-yg8D0azz.mjs} +2 -2
  13. package/dist/{ai-gateway-b3FFu6UV.mjs → ai-gateway--dkH9qGz.mjs} +42 -42
  14. package/dist/ai-search-BRtsUaUI.mjs +79 -0
  15. package/dist/{ai-security-KUs94UW-.mjs → ai-security-DRJCcLpF.mjs} +5 -5
  16. package/dist/{alerting-CCmyEPzN.mjs → alerting-8DsyMKGG.mjs} +30 -30
  17. package/dist/{analytics-BAvBj6qx.mjs → analytics-BpYUZTtQ.mjs} +7 -7
  18. package/dist/{analytics-engine-DAJp89gM.mjs → analytics-engine-CT2E0Dkw.mjs} +1 -1
  19. package/dist/{api-security-BItVQymb.mjs → api-security-CBhWZE8z.mjs} +26 -26
  20. package/dist/{argo-DsJCvfml.mjs → argo-B0u2N3Dh.mjs} +1 -1
  21. package/dist/{artifacts-DzHXeah6.mjs → artifacts-B6XzjMiM.mjs} +1 -1
  22. package/dist/{audit-logs-D9XxsVZm.mjs → audit-logs-59fCc1aw.mjs} +1 -1
  23. package/dist/auth-5cgi8ePZ.mjs +2 -0
  24. package/dist/auth-BaUNb1Ed.mjs +2 -0
  25. package/dist/auth-ChYOc_rS.mjs +2 -0
  26. package/dist/{auth-token-Cw4c0y89.mjs → auth-token-B1pP2jaK.mjs} +1 -1
  27. package/dist/{autoconfig-9po_tqsS.mjs → autoconfig-Cdm2IFLM.mjs} +20 -20
  28. package/dist/{basin-catalog-DcMiZV9J.mjs → basin-catalog-CV05WlA4.mjs} +1 -1
  29. package/dist/{billing-COgAWTYh.mjs → billing-Ad-rK-JH.mjs} +6 -6
  30. package/dist/{blocks-Bat9A8V_.mjs → blocks-CKb_aLWN.mjs} +1 -1
  31. package/dist/body-parser-ChnyBsfm.mjs +2 -0
  32. package/dist/{bot-management-Dx3lh9Fi.mjs → bot-management-CGpfjQ4w.mjs} +4 -4
  33. package/dist/{botnet-feed-C8496Nhl.mjs → botnet-feed-CMrF6ZGq.mjs} +1 -1
  34. package/dist/{brand-protection-B0p8Sv6s.mjs → brand-protection-CP73_yX8.mjs} +5 -5
  35. package/dist/browser-run-OpUfawh_.mjs +42 -0
  36. package/dist/{build-i8l2qGVZ.mjs → build-CMPlf8mh.mjs} +1 -1
  37. package/dist/build-DQZ2w_dQ.mjs +2 -0
  38. package/dist/builds-DsRNlILV.mjs +71 -0
  39. package/dist/{cache-BUh85NRr.mjs → cache-RppXjxXA.mjs} +3 -3
  40. package/dist/{cf-Bq4pA4n6.mjs → cf-PISMdEje.mjs} +11 -11
  41. package/dist/{chunk-2HLTAS5V-D7COzUOd.mjs → chunk-2HLTAS5V-B92NbX1j.mjs} +1 -1
  42. package/dist/{chunk-2K52M2W5-CYxfQXUq.mjs → chunk-2K52M2W5-c__08AOB.mjs} +7 -7
  43. package/dist/chunk-DSGVRFIS-DfQO1boa.mjs +2 -0
  44. package/dist/{cli-DJhpXf38.mjs → cli-Dd1n2YAJ.mjs} +1 -1
  45. package/dist/{client-side-security-km3-4L_4.mjs → client-side-security-BYfwOkUo.mjs} +1 -1
  46. package/dist/{cloud-connector-BoKFprDD.mjs → cloud-connector-CQZUqAMQ.mjs} +2 -2
  47. package/dist/{cloudflared-By8BzYXc.mjs → cloudflared-C1SdXpYv.mjs} +1 -1
  48. package/dist/cloudforce-one-C1xdpspb.mjs +395 -0
  49. package/dist/{command-RC9WM5jq.mjs → command-BioiZMm9.mjs} +1 -1
  50. package/dist/{command-rx0Kb5pn.mjs → command-C0nJ2LRd.mjs} +1 -1
  51. package/dist/{command-CiApsRql.mjs → command-C5ARgURy.mjs} +1 -1
  52. package/dist/{command-CCq-Z2Ua.mjs → command-C7NIRU-u.mjs} +1 -1
  53. package/dist/{command-B694oLDo.mjs → command-C8DV-x_C.mjs} +1 -1
  54. package/dist/{command-Bmee6uwe.mjs → command-CFV1cqfR.mjs} +1 -1
  55. package/dist/{command-CbQFbfps.mjs → command-ChQXv0jP.mjs} +1 -1
  56. package/dist/{command-DCQgsd2U.mjs → command-D203VrTG.mjs} +1 -1
  57. package/dist/{command-DZfKHiru.mjs → command-D5BUzDX8.mjs} +1 -1
  58. package/dist/{command-CAs3SxlI.mjs → command-DWE7YdeC.mjs} +1 -1
  59. package/dist/{command-C6w1OdoC.mjs → command-DlB10kIb.mjs} +1 -1
  60. package/dist/{command-D1JR8Fb7.mjs → command-DmPQXNRg.mjs} +1 -1
  61. package/dist/{command-Bgb-3yPg.mjs → command-F0jlqvKr.mjs} +1 -1
  62. package/dist/{command-DppVezAB.mjs → command-FOQNhNqP.mjs} +1 -1
  63. package/dist/{command-DerHAjQL.mjs → command-yAXk5NXh.mjs} +1 -1
  64. package/dist/{completions-11latun5.mjs → completions-Bh0Hz-hA.mjs} +3 -3
  65. package/dist/{connector-interrupts-wvQcZsO1.mjs → connector-interrupts-Bd949WX0.mjs} +1 -1
  66. package/dist/{connector-telemetry-events-C0GGCIQk.mjs → connector-telemetry-events-Dw8iIg5Q.mjs} +1 -1
  67. package/dist/{connector-telemetry-snapshots-ZXzsFgea.mjs → connector-telemetry-snapshots-DqEIaz99.mjs} +1 -1
  68. package/dist/{connectors-DXIUG4Zi.mjs → connectors-RUEU1QDB.mjs} +1 -1
  69. package/dist/containers-xU-0EhLO.mjs +78 -0
  70. package/dist/{containers-WMWKhLkp.mjs → containers-yUOvm-4V.mjs} +211 -211
  71. package/dist/{content-scan-CRDmR7rD.mjs → content-scan-Cm2-Xhqo.mjs} +2 -2
  72. package/dist/{context-q-6bMSL-.mjs → context-BQ6KeMgq.mjs} +2 -2
  73. package/dist/cps-CgPduy0H.mjs +6 -0
  74. package/dist/csam-scanner-B0Ra6fXL.mjs +10 -0
  75. package/dist/{custom-csrs-BV017SqE.mjs → custom-csrs-6lfu1-RR.mjs} +1 -1
  76. package/dist/custom-hostnames-Dzov_CPw.mjs +27 -0
  77. package/dist/{custom-nameservers-BLoE8VGG.mjs → custom-nameservers-Bfhv_9_k.mjs} +1 -1
  78. package/dist/custom-pages-DxVD_f10.mjs +21 -0
  79. package/dist/{d1-Dbs8HItA.mjs → d1-D7p4uJ-e.mjs} +17 -19
  80. package/dist/delegate.mjs +1 -1
  81. package/dist/{deploy-5utIiOMN.mjs → deploy-BjWvVZol.mjs} +1 -1
  82. package/dist/deploy-context-C-ZdGP0Z.mjs +56 -0
  83. package/dist/{deploy-input-KK6yyBN_.mjs → deploy-input-B8Nq6Eh6.mjs} +1 -1
  84. package/dist/{dev-CnoMHxf4.mjs → dev-D20UkcYT.mjs} +1 -1
  85. package/dist/{diagnostics-C9B07eJY.mjs → diagnostics-DdhTemYB.mjs} +2 -2
  86. package/dist/{dialog-D4Y9ocuF.mjs → dialog-BnIgdgWi.mjs} +1 -1
  87. package/dist/discover-DEjUARkU.mjs +2 -0
  88. package/dist/{dist-DZRTPMMA.mjs → dist-CnKd5XoR.mjs} +19 -19
  89. package/dist/{dist-uRuGmkMB.mjs → dist-DAeCUX-u.mjs} +3 -3
  90. package/dist/{dls-lbM3i4x-.mjs → dls-BBODA9Rk.mjs} +1 -1
  91. package/dist/{dns-QTMPGYMa.mjs → dns-CK_hyn5q.mjs} +22 -22
  92. package/dist/{dns-firewall-Bfv0S44I.mjs → dns-firewall-DbvX9R-7.mjs} +9 -9
  93. package/dist/{docs-bV3hPwQL.mjs → docs-BDTijwM3.mjs} +1 -1
  94. package/dist/{dot-prop-IITUZ2XW-BnPfnQkb.mjs → dot-prop-IITUZ2XW-C4pkmT-K.mjs} +1 -1
  95. package/dist/{dotenv-usOKkeW7.mjs → dotenv-Ck-6V1hm.mjs} +1 -1
  96. package/dist/{dry-run-C2KjGX10.mjs → dry-run-DQmFkNK_.mjs} +1 -1
  97. package/dist/{durable-objects-0JvGTV27.mjs → durable-objects-DcFbd1Ka.mjs} +1 -1
  98. package/dist/{email-auth-PzRqG0ex.mjs → email-auth-BEgDxU-g.mjs} +1 -1
  99. package/dist/{email-routing-BgHL0Rbz.mjs → email-routing-DKWmPOVo.mjs} +13 -13
  100. package/dist/{email-security-CSTKIecn.mjs → email-security-RWbAp8qa.mjs} +44 -44
  101. package/dist/{email-sending-BSwuAir8.mjs → email-sending-BbJy_vl8.mjs} +18 -18
  102. package/dist/error-sanitization-Byb-_IS9.mjs +2 -0
  103. package/dist/{error-sanitization-pOyzm2F1.mjs → error-sanitization-DWJ5ka7h.mjs} +1 -1
  104. package/dist/{field-extractors-B_lFnwaL.mjs → field-extractors-Bob6udAc.mjs} +2 -2
  105. package/dist/{firewall-BsZxVitA.mjs → firewall-DziiEsR8.mjs} +20 -20
  106. package/dist/{flagship-qBohOZaM.mjs → flagship-xOtgddUK.mjs} +11 -11
  107. package/dist/{fraud-vGNdrSm-.mjs → fraud-BUS7i5Yh.mjs} +1 -1
  108. package/dist/generate-D6V4Q58z.mjs +2 -0
  109. package/dist/get-BTisquA3.mjs +2 -0
  110. package/dist/{google-tag-gateway-BHdOg4VW.mjs → google-tag-gateway-DgSzyeK-.mjs} +1 -1
  111. package/dist/{gt-3bcLGJ7V.mjs → gt-D6YemCLh.mjs} +1 -1
  112. package/dist/healthchecks-CbD2PsnM.mjs +22 -0
  113. package/dist/{hyperdrive-CXTqaIqk.mjs → hyperdrive-Cs_cfSXU.mjs} +1 -1
  114. package/dist/{iam-Dl_n_Lqq.mjs → iam-DvsCztqU.mjs} +9 -9
  115. package/dist/{images-vMtXk2Rf.mjs → images-BipVjHNw.mjs} +37 -37
  116. package/dist/index.mjs +1 -1
  117. package/dist/init-LvFgCsNX.mjs +43 -0
  118. package/dist/{intel-Bq4GGXv-.mjs → intel-D1LPkkBM.mjs} +31 -41
  119. package/dist/{interactive-BW9T1D1q.mjs → interactive-d_lFnSev.mjs} +3 -3
  120. package/dist/interactive-pjVqirHx.mjs +2 -0
  121. package/dist/{ips-BcvZS46g.mjs → ips-2iUGs8ws.mjs} +1 -1
  122. package/dist/{k2-DL4hrVTj.mjs → k2-DGzRm3NJ.mjs} +2 -2
  123. package/dist/{kv-BLo9wMgb.mjs → kv-BW-s9MJY.mjs} +4 -4
  124. package/dist/{lazy-command-CRcT6Dx-.mjs → lazy-command-Bq-rWPQe.mjs} +1 -1
  125. package/dist/{leaked-credential-checks-Dx4RXMyN.mjs → leaked-credential-checks-CnY6ih6p.mjs} +1 -1
  126. package/dist/load-balancers-CtnusAzP.mjs +76 -0
  127. package/dist/{local-Dil4fTWX.mjs → local-B4sZZTRA.mjs} +1 -1
  128. package/dist/local-DCnFIgLJ.mjs +2 -0
  129. package/dist/{local-runtime-B7TKFu6E.mjs → local-runtime-DoBuyriC.mjs} +1 -1
  130. package/dist/login-CqZJgUF1.mjs +5 -0
  131. package/dist/{login-Du_W6b9o.mjs → login-DR60WiAY.mjs} +1 -1
  132. package/dist/{logo-matches-C-1J0Oc3.mjs → logo-matches-C1-6KOkZ.mjs} +1 -1
  133. package/dist/{logos-BuhvSu_H.mjs → logos-Yzhd-VKb.mjs} +2 -2
  134. package/dist/logpush-JYG4gXZ-.mjs +46 -0
  135. package/dist/{logs-CaKOk-1v.mjs → logs-DLblEjK0.mjs} +3 -3
  136. package/dist/{magic-cloud-networking-CKxXYT8r.mjs → magic-cloud-networking-CblQwsQr.mjs} +13 -13
  137. package/dist/{magic-network-monitoring-BykFGQCz.mjs → magic-network-monitoring-D2px4Ep4.mjs} +9 -9
  138. package/dist/{magic-transit-DYULsrUP.mjs → magic-transit-Bnwsi0UQ.mjs} +170 -170
  139. package/dist/{managed-defense-DIb_uN25.mjs → managed-defense-CTtNoxzW.mjs} +9 -9
  140. package/dist/{managed-transforms-an3wQ0DW.mjs → managed-transforms-B92mJi5i.mjs} +2 -2
  141. package/dist/{matches-DkLSWb5X.mjs → matches-CzbL1XD-.mjs} +1 -1
  142. package/dist/{mcp-BcV1XqE8.mjs → mcp-Cic_aMer.mjs} +10 -10
  143. package/dist/{mesh-CSSlZ-0F.mjs → mesh-DZTgD16C.mjs} +14 -14
  144. package/dist/{migrate-DerOyuv2.mjs → migrate-DtNDRcAI.mjs} +1 -1
  145. package/dist/{monetization-B-nJ0SyI.mjs → monetization-DCQ2_niU.mjs} +4 -4
  146. package/dist/{network-ZzxQ_Dcz.mjs → network-BqMqD2qn.mjs} +27 -25
  147. package/dist/{network-interconnects-CI9NXQpe.mjs → network-interconnects-BFQ1yARl.mjs} +2 -2
  148. package/dist/o11y-CS5q1vSh.mjs +93 -0
  149. package/dist/oauth-DPLYUvRl.mjs +2 -0
  150. package/dist/oauth-DdYSPYoE.mjs +4 -0
  151. package/dist/{oauth-clients-BA30rTEl.mjs → oauth-clients-9BPswYm_.mjs} +1 -1
  152. package/dist/{oauth-scopes-hseWES1v.mjs → oauth-scopes-CLOKfQi2.mjs} +1 -1
  153. package/dist/{open-PCXX3ZDZ-5J5IU2MX-CKla-jDt.mjs → open-PCXX3ZDZ-5J5IU2MX-DFe2CQkm.mjs} +1 -1
  154. package/dist/{open-PCXX3ZDZ-D55O2jpQ.mjs → open-PCXX3ZDZ-BD2iNJqn.mjs} +1 -1
  155. package/dist/organization-DFRN2g6z.mjs +75 -0
  156. package/dist/{organizations-CcgZPmFl.mjs → organizations-yiGopnKf.mjs} +1 -1
  157. package/dist/{origin-post-quantum-encryption-BhdlaolV.mjs → origin-post-quantum-encryption-n9gsxikn.mjs} +1 -1
  158. package/dist/output-O6b9MR9R.mjs +2 -0
  159. package/dist/{page-rules-DFfqfllI.mjs → page-rules-F1Jdxx6A.mjs} +4 -4
  160. package/dist/pages-CezC0YrR.mjs +54 -0
  161. package/dist/pay-per-crawl-fZ-kTBbN.mjs +38 -0
  162. package/dist/{pay-per-use-C_HxhpM4.mjs → pay-per-use-B14BTKVI.mjs} +8 -8
  163. package/dist/pipelines-BN7ydBHl.mjs +44 -0
  164. package/dist/precursor-B88RDDZT.mjs +4 -0
  165. package/dist/previews-CiqRIq_k.mjs +7 -0
  166. package/dist/process-DiXf4VPi.mjs +2 -0
  167. package/dist/{progress-DaQ4MzBI.mjs → progress-CdlDthXA.mjs} +1 -1
  168. package/dist/{prompt-KWYZvJWM.mjs → prompt-1AC-qwxS.mjs} +1 -1
  169. package/dist/{queries-DoyhspQf.mjs → queries-C2sgUI9j.mjs} +3 -3
  170. package/dist/{queues-BPxTU2rU.mjs → queues-DCP5x-PZ.mjs} +17 -17
  171. package/dist/{r2-CQt4S7o7.mjs → r2-D7UhzWR7.mjs} +21 -21
  172. package/dist/{radar-CALpR1vq.mjs → radar-osOiFeY_.mjs} +1 -1
  173. package/dist/{raw-fetch-Cy09TjHc.mjs → raw-fetch-1VlXDwwX.mjs} +1 -1
  174. package/dist/{realtime-BiHKBoI4.mjs → realtime-DCnqxiWo.mjs} +90 -87
  175. package/dist/registrar-DAFYjjRa.mjs +43 -0
  176. package/dist/{registrar-sandbox-BttFwYqE.mjs → registrar-sandbox-zeNHABZ0.mjs} +11 -9
  177. package/dist/{registry-CRnk93ur.mjs → registry-DG4ZiuN9.mjs} +1 -1
  178. package/dist/{reporting-8aRJD5HX.mjs → reporting-KehV_PXm.mjs} +1 -1
  179. package/dist/{request-headers-CqfJOkpO.mjs → request-headers-ojAw3pQO.mjs} +1 -1
  180. package/dist/request-tracers-BStCgh6m.mjs +4 -0
  181. package/dist/resolve-BGNMAcGR.mjs +2 -0
  182. package/dist/{resource-sharing-uVVpMW0w.mjs → resource-sharing-3xtSgWG7.mjs} +19 -19
  183. package/dist/{rules-CFOuN3t2.mjs → rules-7F-G2Bg_.mjs} +6 -6
  184. package/dist/{rulesets-DkhV2Hny.mjs → rulesets-B0YtS2br.mjs} +20 -20
  185. package/dist/{rum-BnMW0Tlb.mjs → rum-B3V6tqS-.mjs} +6 -6
  186. package/dist/{run-Clc3P2u7.mjs → run-B_07PrkW.mjs} +1 -1
  187. package/dist/run-D6AJfZT-.mjs +2 -0
  188. package/dist/{schema-S3pUZwpI.mjs → schema-C-tyhSnb.mjs} +1 -1
  189. package/dist/{schema-flags-b096XMpt.mjs → schema-flags-DY3OKCvr.mjs} +4 -4
  190. package/dist/{scim-tvZm6A-r.mjs → scim-CQ9TdajH.mjs} +6 -6
  191. package/dist/{secrets-store-DuNxSh1_.mjs → secrets-store-Dl2hDxXu.mjs} +2 -2
  192. package/dist/{security-insights-C17c9ZYZ.mjs → security-insights-BsLMdo1r.mjs} +2 -2
  193. package/dist/{security-txt-D4pRk7-w.mjs → security-txt-pCAiHvys.mjs} +1 -1
  194. package/dist/session-BsNzFtPi.mjs +2 -0
  195. package/dist/shared-CWBjMZDR.mjs +2 -0
  196. package/dist/smart-shield-BTXQsVxz.mjs +24 -0
  197. package/dist/{snippets-BIcZ6vSW.mjs → snippets-CYVieyc3.mjs} +3 -3
  198. package/dist/source-AlTrHNem.mjs +6 -0
  199. package/dist/{spawn-BW2bJmKO.mjs → spawn-Bdznd0EB.mjs} +2 -2
  200. package/dist/{spectrum-DjDX0geK.mjs → spectrum-DLRr4Q03.mjs} +14 -14
  201. package/dist/{speed-DiPoFJMm.mjs → speed-BJfaDYxz.mjs} +13 -13
  202. package/dist/sql-DQ4xrdc2.mjs +4 -0
  203. package/dist/src-BnMvFE3q.mjs +125 -0
  204. package/dist/ssl-CL1B69Pw.mjs +139 -0
  205. package/dist/startup-profile-DuaJFX1y.mjs +2 -0
  206. package/dist/startup-profile-HMblAiBi.mjs +29 -0
  207. package/dist/{state-Boubf1X6.mjs → state-DN9yfd2C.mjs} +1 -1
  208. package/dist/state-DePlO0Kv.mjs +2 -0
  209. package/dist/{stream-uhn_Zsni.mjs → stream-DrMZOO5u.mjs} +55 -55
  210. package/dist/{submit-C3suIDBX.mjs → submit-DjlLoVk2.mjs} +1 -1
  211. package/dist/tags-DY7Ur1k-.mjs +23 -0
  212. package/dist/{telemetry-DYjsavEr.mjs → telemetry-BG3kcYsV.mjs} +1 -1
  213. package/dist/telemetry-Dpm6GfZD.mjs +2 -0
  214. package/dist/{tenant-DK88yQM4.mjs → tenant-BEMfNMjO.mjs} +1 -1
  215. package/dist/{tenant-custom-nameservers-BZ1JD1Yf.mjs → tenant-custom-nameservers-CCRbb0ch.mjs} +1 -1
  216. package/dist/{tools-BCCRUENY.mjs → tools-ZffhHUDd.mjs} +1 -1
  217. package/dist/tunnels-_JXe-UgM.mjs +29 -0
  218. package/dist/{turnstile-DXrbEy2A.mjs → turnstile-DXEfneQq.mjs} +5 -5
  219. package/dist/ui-CY79jlGZ.mjs +2 -0
  220. package/dist/update-check-DfbYVefm.mjs +2 -0
  221. package/dist/{update-check-BhhtSXVZ.mjs → update-check-atcehhBC.mjs} +1 -1
  222. package/dist/update-check-worker.mjs +1 -1
  223. package/dist/{url-info-a0mY4UsC.mjs → url-info-B1kL9asc.mjs} +1 -1
  224. package/dist/{url-normalization-DiwpDIhc.mjs → url-normalization-CUHKRKJh.mjs} +1 -1
  225. package/dist/url-scanner-OnZP_-jm.mjs +16 -0
  226. package/dist/{user-DDH9lxf5.mjs → user-BBBuFNj4.mjs} +59 -59
  227. package/dist/{vectorize-DaT3amFV.mjs → vectorize-DcctB8bw.mjs} +17 -17
  228. package/dist/version-CLgSHoNm.mjs +2 -0
  229. package/dist/{waiting-rooms-BGMpu9gS.mjs → waiting-rooms-JaFE5wP1.mjs} +13 -13
  230. package/dist/{web-assets-NqNglLSI.mjs → web-assets-Cu0swUPe.mjs} +35 -35
  231. package/dist/{web3-UnCUuIfB.mjs → web3-C67z4OtQ.mjs} +6 -6
  232. package/dist/workers-ClTP0Ysl.mjs +43 -0
  233. package/dist/workers-builds-C5wKhvKe.mjs +14 -0
  234. package/dist/{workers-for-platforms-JscCHivQ.mjs → workers-for-platforms-rxwkYyb3.mjs} +25 -22
  235. package/dist/{workers-vpc-FDZQBqOu.mjs → workers-vpc-B4vyvr1W.mjs} +1 -1
  236. package/dist/{workflows-Dq-k81hU.mjs → workflows-COJ5jwvk.mjs} +24 -24
  237. package/dist/wrangler-migration-Cp546RDG.mjs +946 -0
  238. package/dist/zaraz-BkZ7yW05.mjs +22 -0
  239. package/dist/{zero-trust-CZ685QhO.mjs → zero-trust-lUFLYuL1.mjs} +509 -454
  240. package/dist/{zone-DcZIUTWt.mjs → zone-CC1_qxt-.mjs} +1 -1
  241. package/dist/{zones-BVdvYUCv.mjs → zones-BRiLlTmW.mjs} +45 -36
  242. package/package.json +14 -14
  243. package/dist/account-tags-zvHRQZxb.mjs +0 -15
  244. package/dist/ai-search-CtfW5fzl.mjs +0 -79
  245. package/dist/auth-C530fHKQ.mjs +0 -2
  246. package/dist/auth-Ccm5viK_.mjs +0 -2
  247. package/dist/auth-MNz2D-PD.mjs +0 -2
  248. package/dist/body-parser-DkHKPkJ7.mjs +0 -2
  249. package/dist/browser-run-ChXohmNG.mjs +0 -42
  250. package/dist/build-BRJnyeu8.mjs +0 -2
  251. package/dist/builds-DmEFTQTa.mjs +0 -71
  252. package/dist/certificate-authorities-BTLdA7EQ.mjs +0 -6
  253. package/dist/chunk-DSGVRFIS-C5SqiTOz.mjs +0 -2
  254. package/dist/client-certificates-B3UxH_Au.mjs +0 -13
  255. package/dist/cloudforce-one-DN5N3C3w.mjs +0 -405
  256. package/dist/containers-DCH6MFjY.mjs +0 -78
  257. package/dist/cps-Due0P5IW.mjs +0 -6
  258. package/dist/csam-scanner-DvLrPw45.mjs +0 -10
  259. package/dist/ct-alerting-BtEGkRJi.mjs +0 -5
  260. package/dist/custom-certificates-CMLXTTEc.mjs +0 -17
  261. package/dist/custom-hostnames-DI_dFaof.mjs +0 -27
  262. package/dist/custom-pages-ubava9Qm.mjs +0 -21
  263. package/dist/dcv-delegation-sGGt6UU_.mjs +0 -4
  264. package/dist/deploy-context-C0iVbWRG.mjs +0 -56
  265. package/dist/discover-DIDEGKo3.mjs +0 -2
  266. package/dist/error-sanitization-CIQOep3I.mjs +0 -2
  267. package/dist/generate-D80-1GnZ.mjs +0 -2
  268. package/dist/get-By1q8YlI.mjs +0 -2
  269. package/dist/healthchecks-DAYYLZ6u.mjs +0 -22
  270. package/dist/hostnames-CLlaMqHu.mjs +0 -11
  271. package/dist/init-_7djeBVw.mjs +0 -43
  272. package/dist/interactive-DGUWZ2Gk.mjs +0 -2
  273. package/dist/keyless-certificates-0pzjkZb6.mjs +0 -13
  274. package/dist/keys-BSV5IXdU.mjs +0 -4
  275. package/dist/load-balancers-CCCWoQXv.mjs +0 -76
  276. package/dist/local-DxWDQDnG.mjs +0 -2
  277. package/dist/login-DT6Q1UJw.mjs +0 -5
  278. package/dist/logpush-DgZtF9vG.mjs +0 -46
  279. package/dist/mtls-certificates-ukwDz6Lc.mjs +0 -13
  280. package/dist/o11y-LG6Y9LUZ.mjs +0 -93
  281. package/dist/oauth-Bx693Af5.mjs +0 -2
  282. package/dist/oauth-CP82E1_0.mjs +0 -4
  283. package/dist/organization-DMr_z6n4.mjs +0 -71
  284. package/dist/origin-ca-certificates-BZxUbB5N.mjs +0 -11
  285. package/dist/origin-tls-client-auth-DzbZvtmi.mjs +0 -30
  286. package/dist/output-Co4xdFf6.mjs +0 -2
  287. package/dist/pages-BkcL5rC4.mjs +0 -54
  288. package/dist/pay-per-crawl-Dulm7Xy5.mjs +0 -38
  289. package/dist/pipelines-DUMIVwof.mjs +0 -44
  290. package/dist/precursor-DsGbA_YJ.mjs +0 -4
  291. package/dist/previews-Cma3-M7K.mjs +0 -7
  292. package/dist/process-2wmDCy17.mjs +0 -2
  293. package/dist/registrar-gERQ3b85.mjs +0 -43
  294. package/dist/request-tracers-DcnwQg3K.mjs +0 -4
  295. package/dist/resolve-BpgXeklt.mjs +0 -2
  296. package/dist/resource-tagging-SlsUtLsq.mjs +0 -4
  297. package/dist/run-CHNyLZLG.mjs +0 -2
  298. package/dist/session-Cq3YNLoI.mjs +0 -2
  299. package/dist/shared-zePemxHi.mjs +0 -2
  300. package/dist/smart-shield-2egm1Vaw.mjs +0 -24
  301. package/dist/source-mXUcrTVw.mjs +0 -6
  302. package/dist/sql-DLjCt_R3.mjs +0 -4
  303. package/dist/src-CutrsNl4.mjs +0 -125
  304. package/dist/ssl-vNzK0c9S.mjs +0 -45
  305. package/dist/startup-profile-BOaseXnO.mjs +0 -29
  306. package/dist/startup-profile-BwEZFVGS.mjs +0 -2
  307. package/dist/state-CODDG9Nx.mjs +0 -2
  308. package/dist/tags-Dy2jG-Dt.mjs +0 -4
  309. package/dist/telemetry-Bdv5LZZs.mjs +0 -2
  310. package/dist/tunnels-DjbomhCa.mjs +0 -29
  311. package/dist/ui-BtIBQeaG.mjs +0 -2
  312. package/dist/update-check-Dld7rbLd.mjs +0 -2
  313. package/dist/url-scanner-D0egjBe5.mjs +0 -16
  314. package/dist/values-Bfr5-bL6.mjs +0 -4
  315. package/dist/version-CAuKDZAG.mjs +0 -2
  316. package/dist/workers-DfA9ugmb.mjs +0 -40
  317. package/dist/workers-builds-Cy6fdtm5.mjs +0 -14
  318. package/dist/wrangler-migration-R9TQ_4Qd.mjs +0 -946
  319. package/dist/zaraz-Dpr1pLDx.mjs +0 -22
@@ -1,80 +1,80 @@
1
1
  #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-MNz2D-PD.mjs";import{a as i,t as a}from"./context-q-6bMSL-.mjs";import{t as o}from"./output-Co4xdFf6.mjs";import{t as s}from"./dry-run-C2KjGX10.mjs";import{t as c}from"./progress-DaQ4MzBI.mjs";import{t as l}from"./run-Clc3P2u7.mjs";import"./telemetry-Bdv5LZZs.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,n as g}from"./prompt-KWYZvJWM.mjs";var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains`,body:`json`,errors:{400:`BadRequestError`}};function v(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
2
+ import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-B4sZZTRA.mjs";import{i as n,n as r}from"./auth-BaUNb1Ed.mjs";import{a as i,t as a}from"./context-BQ6KeMgq.mjs";import{t as o}from"./output-O6b9MR9R.mjs";import{t as s}from"./dry-run-DQmFkNK_.mjs";import{t as c}from"./progress-CdlDthXA.mjs";import{t as l}from"./run-B_07PrkW.mjs";import"./telemetry-Dpm6GfZD.mjs";import{a as u,n as d,r as f,s as p,t as m}from"./body-parser-ChnyBsfm.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,n as _}from"./prompt-1AC-qwxS.mjs";var v={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains`,body:`json`,errors:{400:`BadRequestError`}};function y(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
3
3
 
4
- Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`domain`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`."}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>m(e,`min-tls`,`text`)).option(`zone-id`,{type:`string`,description:`ID of the Cloudflare zone that contains the custom hostname.`}).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 <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:v,handler:async e=>l({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({domain:m(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:m(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(_,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}e.domain===void 0&&(e.domain=await h(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),e[`zone-id`]===void 0&&(e[`zone-id`]=await h(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let u=p({domain:m(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:m(e[`zone-id`],`zone-id`,`text`)}),f=await c(`Creating`,async()=>n.send(_,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(f,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function x(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
4
+ Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`domain`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`."}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>h(e,`min-tls`,`text`)).option(`zone-id`,{type:`string`,description:`ID of the Cloudflare zone that contains the custom hostname.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:y,handler:async e=>l({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({domain:h(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:h(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(v,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}e.domain===void 0&&(e.domain=await g(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let u=m({domain:h(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:h(e[`zone-id`],`zone-id`,`text`)}),f=await c(`Creating`,async()=>n.send(v,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(f,{successLabel:`Created`})})};var x={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function S(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
5
5
 
6
- Deletes a custom domain from an AI Gateway and removes its Cloudflare for SaaS custom hostname.`).positional(`hostname`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`.",demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ee={command:`delete <hostname>`,describe:`Delete a custom domain`,builder:x,handler:async e=>l({command:`ai-gateway custom-domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`This deletes the custom domain and its custom hostname. Requests to this hostname will stop reaching the gateway.`})){process.stderr.write(`Aborted.
7
- `);return}let u=await c(`Deleting`,async()=>n.send(b,{account_id:l,gateway_id:e[`gateway-id`],hostname:e.hostname}));o(u,{successLabel:`Deleted`})})};var te={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function ne(e){return e.usage(`$0 ai-gateway custom-domains get <hostname>
6
+ Deletes a custom domain from an AI Gateway and removes its Cloudflare for SaaS custom hostname.`).positional(`hostname`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`.",demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ee={command:`delete <hostname>`,describe:`Delete a custom domain`,builder:S,handler:async e=>l({command:`ai-gateway custom-domains delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force,message:`This deletes the custom domain and its custom hostname. Requests to this hostname will stop reaching the gateway.`})){process.stderr.write(`Aborted.
7
+ `);return}let u=await c(`Deleting`,async()=>n.send(x,{account_id:l,gateway_id:e[`gateway-id`],hostname:e.hostname}));o(u,{successLabel:`Deleted`})})};var te={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function ne(e){return e.usage(`$0 ai-gateway custom-domains get <hostname>
8
8
 
9
9
  Retrieves a custom domain attached to an AI Gateway, including its status and CNAME target.`).positional(`hostname`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`.",demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <hostname>`,describe:`Get a custom domain`,builder:ne,handler:async e=>l({command:`ai-gateway custom-domains get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(te,{account_id:l,gateway_id:e[`gateway-id`],hostname:e.hostname}));o(u,{successLabel:`Loaded`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains`,query:[`page`,`per_page`,`status`,`search`],errors:{400:`BadRequestError`}};function ae(e){return e.usage(`$0 ai-gateway custom-domains list
10
10
 
11
- Lists the custom domains attached to an AI Gateway, including the certificate and validation status of each domain.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Status`,choices:[`initializing`,`pending_dcv`,`active`,`blocked`,`error`]}).option(`search`,{type:`string`,description:`Search by hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List custom domains`,builder:ae,handler:async e=>l({command:`ai-gateway custom-domains list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],status:e.status,search:e.search};if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ie,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})},se={command:`custom-domains`,describe:`Manage custom hostnames that route requests through an AI Gateway`,builder:e=>e.command(y).command(ee).command(re).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers`,body:`json`,errors:{400:`BadRequestError`}};function C(e){return e.usage(`$0 ai-gateway custom-providers create
11
+ Lists the custom domains attached to an AI Gateway, including the certificate and validation status of each domain.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`status`,{type:`string`,description:`Status`,choices:[`initializing`,`pending_dcv`,`active`,`blocked`,`error`]}).option(`search`,{type:`string`,description:`Search by hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List custom domains`,builder:ae,handler:async e=>l({command:`ai-gateway custom-domains list`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],status:e.status,search:e.search};if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ie,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})},se={command:`custom-domains`,describe:`Manage custom hostnames that route requests through an AI Gateway`,builder:e=>e.command(b).command(ee).command(re).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers`,body:`json`,errors:{400:`BadRequestError`}};function w(e){return e.usage(`$0 ai-gateway custom-providers create
12
12
 
13
- Creates an account-level custom provider that forwards AI Gateway requests to the HTTPS base URL you supply. Requests reference the provider as \`custom-{slug}\`, so the slug must be unique within the account.`).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create a custom provider`,builder:C,handler:async e=>l({command:`ai-gateway custom-providers create`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({base_url:m(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:m(e[`curl-example`],`curl-example`,`text`),description:m(e.description,`description`,`text`),enable:e.enable,headers:m(e.headers,`headers`,`text`),js_example:m(e[`js-example`],`js-example`,`text`),link:m(e.link,`link`,`text`),name:m(e.name,`name`,`text`),position:e.position,slug:m(e.slug,`slug`,`text`)}):d(e.body),sensitiveBodyPaths:[[`headers`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(S,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`base-url`]===void 0&&(e[`base-url`]=await h(`base-url`,`The base_url field`)),e.name===void 0&&(e.name=await h(`name`,`The name field`)),e.slug===void 0&&(e.slug=await h(`slug`,`The slug field`));let u=p({base_url:m(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:m(e[`curl-example`],`curl-example`,`text`),description:m(e.description,`description`,`text`),enable:e.enable,headers:m(e.headers,`headers`,`text`),js_example:m(e[`js-example`],`js-example`,`text`),link:m(e.link,`link`,`text`),name:m(e.name,`name`,`text`),position:e.position,slug:m(e.slug,`slug`,`text`)}),f=await c(`Creating`,async()=>n.send(S,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var T={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,errors:{404:`NotFoundError`}};function E(e){return e.usage(`$0 ai-gateway custom-providers delete <id>
13
+ Creates an account-level custom provider that forwards AI Gateway requests to the HTTPS base URL you supply. Requests reference the provider as \`custom-{slug}\`, so the slug must be unique within the account.`).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Create a custom provider`,builder:w,handler:async e=>l({command:`ai-gateway custom-providers create`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({base_url:h(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:h(e[`curl-example`],`curl-example`,`text`),description:h(e.description,`description`,`text`),enable:e.enable,headers:h(e.headers,`headers`,`text`),js_example:h(e[`js-example`],`js-example`,`text`),link:h(e.link,`link`,`text`),name:h(e.name,`name`,`text`),position:e.position,slug:h(e.slug,`slug`,`text`)}):d(e.body),sensitiveBodyPaths:[[`headers`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(C,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}e[`base-url`]===void 0&&(e[`base-url`]=await g(`base-url`,`The base_url field`)),e.name===void 0&&(e.name=await g(`name`,`The name field`)),e.slug===void 0&&(e.slug=await g(`slug`,`The slug field`));let u=m({base_url:h(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:h(e[`curl-example`],`curl-example`,`text`),description:h(e.description,`description`,`text`),enable:e.enable,headers:h(e.headers,`headers`,`text`),js_example:h(e[`js-example`],`js-example`,`text`),link:h(e.link,`link`,`text`),name:h(e.name,`name`,`text`),position:e.position,slug:h(e.slug,`slug`,`text`)}),f=await c(`Creating`,async()=>n.send(C,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var E={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,errors:{404:`NotFoundError`}};function D(e){return e.usage(`$0 ai-gateway custom-providers delete <id>
14
14
 
15
- Deletes a custom provider and every pricing rule that belongs to it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <id>`,describe:`Delete a custom provider`,builder:E,handler:async e=>l({command:`ai-gateway custom-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:"This permanently deletes the custom provider and all of its pricing rules. Gateway requests that use `custom-{slug}` for this provider will stop routing."})){process.stderr.write(`Aborted.
16
- `);return}let u=await c(`Deleting`,async()=>n.send(T,{account_id:l,id:e.id}));o(u,{successLabel:`Deleted`})})};var O={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,errors:{404:`NotFoundError`}};function k(e){return e.usage(`$0 ai-gateway custom-providers get <id>
15
+ Deletes a custom provider and every pricing rule that belongs to it.`).positional(`id`,{type:`string`,description:`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 O={command:`delete <id>`,describe:`Delete a custom provider`,builder:D,handler:async e=>l({command:`ai-gateway custom-providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force,message:"This permanently deletes the custom provider and all of its pricing rules. Gateway requests that use `custom-{slug}` for this provider will stop routing."})){process.stderr.write(`Aborted.
16
+ `);return}let u=await c(`Deleting`,async()=>n.send(E,{account_id:l,id:e.id}));o(u,{successLabel:`Deleted`})})};var k={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,errors:{404:`NotFoundError`}};function A(e){return e.usage(`$0 ai-gateway custom-providers get <id>
17
17
 
18
- Retrieves a custom provider, including its slug, base URL, and custom headers.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <id>`,describe:`Get a custom provider`,builder:k,handler:async e=>l({command:`ai-gateway custom-providers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(O,{account_id:l,id:e.id}));o(u,{successLabel:`Loaded`})})};var j={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers`,query:[`page`,`per_page`,`beta`,`enable`,`search`],errors:{400:`BadRequestError`}};function M(e){return e.usage(`$0 ai-gateway custom-providers list
18
+ Retrieves a custom provider, including its slug, base URL, and custom headers.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <id>`,describe:`Get a custom provider`,builder:A,handler:async e=>l({command:`ai-gateway custom-providers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(k,{account_id:l,id:e.id}));o(u,{successLabel:`Loaded`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers`,query:[`page`,`per_page`,`beta`,`enable`,`search`],errors:{400:`BadRequestError`}};function N(e){return e.usage(`$0 ai-gateway custom-providers list
19
19
 
20
- Lists the custom providers configured for the account, ordered by position and then name.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`beta`,{type:`boolean`,description:`Beta`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, slug`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List custom providers`,builder:M,handler:async e=>l({command:`ai-gateway custom-providers list`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],beta:e.beta,enable:e.enable,search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-gateway custom-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(j,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var P={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function F(e){return e.usage(`$0 ai-gateway custom-providers update <id>
20
+ Lists the custom providers configured for the account, ordered by position and then name.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`beta`,{type:`boolean`,description:`Beta`}).option(`enable`,{type:`boolean`,description:`Enable`}).option(`search`,{type:`string`,description:`Search by id, name, slug`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List custom providers`,builder:N,handler:async e=>l({command:`ai-gateway custom-providers list`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],beta:e.beta,enable:e.enable,search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-gateway custom-providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/custom-providers`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(M,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var F={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/custom-providers/${t.id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function I(e){return e.usage(`$0 ai-gateway custom-providers update <id>
21
21
 
22
- Updates the specified fields of a custom provider. Changes clear cached entries for the provider.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`logo`,{type:`string`,description:`The logo field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <id>`,describe:`Update a custom provider`,builder:F,handler:async e=>l({command:`ai-gateway custom-providers update`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({base_url:m(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:m(e[`curl-example`],`curl-example`,`text`),description:m(e.description,`description`,`text`),enable:e.enable,headers:m(e.headers,`headers`,`text`),js_example:m(e[`js-example`],`js-example`,`text`),link:m(e.link,`link`,`text`),logo:m(e.logo,`logo`,`text`),name:m(e.name,`name`,`text`),position:e.position,slug:m(e.slug,`slug`,`text`)}):d(e.body),sensitiveBodyPaths:[[`headers`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(P,{body:t,account_id:l,id:e.id}));o(r,{successLabel:`Updated`});return}let u=p({base_url:m(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:m(e[`curl-example`],`curl-example`,`text`),description:m(e.description,`description`,`text`),enable:e.enable,headers:m(e.headers,`headers`,`text`),js_example:m(e[`js-example`],`js-example`,`text`),link:m(e.link,`link`,`text`),logo:m(e.logo,`logo`,`text`),name:m(e.name,`name`,`text`),position:e.position,slug:m(e.slug,`slug`,`text`)}),f=await c(`Updating`,async()=>n.send(P,{body:u,account_id:l,id:e.id}));o(f,{successLabel:`Updated`})})},L={command:`custom-providers`,describe:`Manage account-level custom AI providers and their endpoint settings`,builder:e=>e.command(w).command(D).command(A).command(N).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes`,body:`json`,errors:{400:`BadRequestError`}};function z(e){return e.usage(`$0 ai-gateway dynamic-routing create <gateway-id>
22
+ Updates the specified fields of a custom provider. Changes clear cached entries for the provider.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`base-url`,{type:`string`,description:`The base_url field`}).option(`beta`,{type:`boolean`,description:`The beta field`}).option(`curl-example`,{type:`string`,description:`The curl_example field`}).option(`description`,{type:`string`,description:`The description field`}).option(`enable`,{type:`boolean`,description:`The enable field`}).option(`headers`,{type:`string`,description:`JSON object of extra HTTP headers that AI Gateway sends to the provider. Values can contain credentials.`}).option(`js-example`,{type:`string`,description:`The js_example field`}).option(`link`,{type:`string`,description:`The link field`}).option(`logo`,{type:`string`,description:`The logo field`}).option(`name`,{type:`string`,description:`The name field`}).option(`position`,{type:`number`,description:`The position field`}).option(`slug`,{type:`string`,description:`The slug field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`update <id>`,describe:`Update a custom provider`,builder:I,handler:async e=>l({command:`ai-gateway custom-providers update`,classification:{safeFlags:[`beta`,`enable`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway custom-providers update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/custom-providers/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({base_url:h(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:h(e[`curl-example`],`curl-example`,`text`),description:h(e.description,`description`,`text`),enable:e.enable,headers:h(e.headers,`headers`,`text`),js_example:h(e[`js-example`],`js-example`,`text`),link:h(e.link,`link`,`text`),logo:h(e.logo,`logo`,`text`),name:h(e.name,`name`,`text`),position:e.position,slug:h(e.slug,`slug`,`text`)}):d(e.body),sensitiveBodyPaths:[[`headers`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(F,{body:t,account_id:l,id:e.id}));o(r,{successLabel:`Updated`});return}let u=m({base_url:h(e[`base-url`],`base-url`,`text`),beta:e.beta,curl_example:h(e[`curl-example`],`curl-example`,`text`),description:h(e.description,`description`,`text`),enable:e.enable,headers:h(e.headers,`headers`,`text`),js_example:h(e[`js-example`],`js-example`,`text`),link:h(e.link,`link`,`text`),logo:h(e.logo,`logo`,`text`),name:h(e.name,`name`,`text`),position:e.position,slug:h(e.slug,`slug`,`text`)}),f=await c(`Updating`,async()=>n.send(F,{body:u,account_id:l,id:e.id}));o(f,{successLabel:`Updated`})})},R={command:`custom-providers`,describe:`Manage account-level custom AI providers and their endpoint settings`,builder:e=>e.command(T).command(O).command(j).command(P).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes`,body:`json`,errors:{400:`BadRequestError`}};function B(e){return e.usage(`$0 ai-gateway dynamic-routing create <gateway-id>
23
23
 
24
- Creates a dynamic route on an AI Gateway from the specified routing elements. Clients call the route by using \`dynamic/{name}\` as the model name.`).positional(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create <gateway-id>`,describe:`Create a dynamic route`,builder:z,handler:async e=>l({command:`ai-gateway dynamic-routing create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({elements:f(e.elements,`elements`),name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(R,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}if(e.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await h(`name`,`The name field`));let u=p({elements:f(e.elements,`elements`),name:m(e.name,`name`,`text`)}),g=await c(`Creating`,async()=>n.send(R,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(g,{successLabel:`Created`})})};var V={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,errors:{400:`BadRequestError`}};function H(e){return e.usage(`$0 ai-gateway dynamic-routing delete <id>
24
+ Creates a dynamic route on an AI Gateway from the specified routing elements. Clients call the route by using \`dynamic/{name}\` as the model name.`).positional(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`create <gateway-id>`,describe:`Create a dynamic route`,builder:B,handler:async e=>l({command:`ai-gateway dynamic-routing create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({elements:u(e.elements,`elements`),name:h(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(z,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}if(e.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await g(`name`,`The name field`));let f=m({elements:u(e.elements,`elements`),name:h(e.name,`name`,`text`)}),p=await c(`Creating`,async()=>n.send(z,{body:f,account_id:l,gateway_id:e[`gateway-id`]}));o(p,{successLabel:`Created`})})};var H={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,errors:{400:`BadRequestError`}};function U(e){return e.usage(`$0 ai-gateway dynamic-routing delete <id>
25
25
 
26
- Deletes a dynamic route from an AI Gateway.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway 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 U={command:`delete <id>`,describe:`Delete a dynamic route`,builder:H,handler:async e=>l({command:`ai-gateway dynamic-routing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force})){process.stderr.write(`Aborted.
27
- `);return}let u=await c(`Deleting`,async()=>n.send(V,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Deleted`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,body:`json`,errors:{400:`BadRequestError`}};function G(e){return e.usage(`$0 ai-gateway dynamic-routing deployments create <id>
26
+ Deletes a dynamic route from an AI Gateway.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway 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 W={command:`delete <id>`,describe:`Delete a dynamic route`,builder:U,handler:async e=>l({command:`ai-gateway dynamic-routing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force})){process.stderr.write(`Aborted.
27
+ `);return}let u=await c(`Deleting`,async()=>n.send(H,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Deleted`})})};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,body:`json`,errors:{400:`BadRequestError`}};function K(e){return e.usage(`$0 ai-gateway dynamic-routing deployments create <id>
28
28
 
29
- Deploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create <id>`,describe:`Deploy a dynamic route version`,builder:G,handler:async e=>l({command:`ai-gateway dynamic-routing deployments create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({version_id:m(e[`version-id`],`version-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(W,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Created`});return}e[`version-id`]===void 0&&(e[`version-id`]=await h(`version-id`,`The version_id field`));let u=p({version_id:m(e[`version-id`],`version-id`,`text`)}),f=await c(`Creating`,async()=>n.send(W,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Created`})})};var ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,errors:{400:`BadRequestError`}};function le(e){return e.usage(`$0 ai-gateway dynamic-routing deployments list
29
+ Deploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create <id>`,describe:`Deploy a dynamic route version`,builder:K,handler:async e=>l({command:`ai-gateway dynamic-routing deployments create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({version_id:h(e[`version-id`],`version-id`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(G,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Created`});return}e[`version-id`]===void 0&&(e[`version-id`]=await g(`version-id`,`The version_id field`));let u=m({version_id:h(e[`version-id`],`version-id`,`text`)}),f=await c(`Creating`,async()=>n.send(G,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Created`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,errors:{400:`BadRequestError`}};function ue(e){return e.usage(`$0 ai-gateway dynamic-routing deployments list
30
30
 
31
- Lists the deployment history of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list`,describe:`List dynamic route deployments`,builder:le,handler:async e=>l({command:`ai-gateway dynamic-routing deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ce,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})},de={command:`deployments`,describe:`Deploy dynamic route versions and view deployment history`,builder:e=>e.command(K).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,errors:{400:`BadRequestError`}};function pe(e){return e.usage(`$0 ai-gateway dynamic-routing get <id>
31
+ Lists the deployment history of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List dynamic route deployments`,builder:ue,handler:async e=>l({command:`ai-gateway dynamic-routing deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(le,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})},fe={command:`deployments`,describe:`Deploy dynamic route versions and view deployment history`,builder:e=>e.command(ce).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,errors:{400:`BadRequestError`}};function me(e){return e.usage(`$0 ai-gateway dynamic-routing get <id>
32
32
 
33
- Retrieves a dynamic route with its routing elements, active version, and current deployment.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <id>`,describe:`Get a dynamic route`,builder:pe,handler:async e=>l({command:`ai-gateway dynamic-routing get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(fe,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var he={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function ge(e){return e.usage(`$0 ai-gateway dynamic-routing list
33
+ Retrieves a dynamic route with its routing elements, active version, and current deployment.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <id>`,describe:`Get a dynamic route`,builder:me,handler:async e=>l({command:`ai-gateway dynamic-routing get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(pe,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var ge={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function _e(e){return e.usage(`$0 ai-gateway dynamic-routing list
34
34
 
35
- Lists the dynamic routes configured on an AI Gateway.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of routes per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`List dynamic routes`,builder:ge,handler:async e=>l({command:`ai-gateway dynamic-routing list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(he,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var q={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,body:`json`,errors:{400:`BadRequestError`}};function ve(e){return e.usage(`$0 ai-gateway dynamic-routing update <id>
35
+ Lists the dynamic routes configured on an AI Gateway.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of routes per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`list`,describe:`List dynamic routes`,builder:_e,handler:async e=>l({command:`ai-gateway dynamic-routing list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ge,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var q={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,body:`json`,errors:{400:`BadRequestError`}};function ye(e){return e.usage(`$0 ai-gateway dynamic-routing update <id>
36
36
 
37
- Updates the name of a dynamic route. To change routing behaviour, create and deploy a new version.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ye={command:`update <id>`,describe:`Rename a dynamic route`,builder:ve,handler:async e=>l({command:`ai-gateway dynamic-routing update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(q,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await h(`name`,`The name field`));let u=p({name:m(e.name,`name`,`text`)}),f=await c(`Updating`,async()=>n.send(q,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Updated`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,body:`json`,errors:{400:`BadRequestError`}};function be(e){return e.usage(`$0 ai-gateway dynamic-routing versions create <id>
37
+ Updates the name of a dynamic route. To change routing behaviour, create and deploy a new version.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`update <id>`,describe:`Rename a dynamic route`,builder:ye,handler:async e=>l({command:`ai-gateway dynamic-routing update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({name:h(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(q,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await g(`name`,`The name field`));let u=m({name:h(e.name,`name`,`text`)}),f=await c(`Updating`,async()=>n.send(q,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Updated`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,body:`json`,errors:{400:`BadRequestError`}};function xe(e){return e.usage(`$0 ai-gateway dynamic-routing versions create <id>
38
38
 
39
- Creates a new version of a dynamic route from the specified routing elements. The version does not serve traffic until you deploy it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`create <id>`,describe:`Create a dynamic route version`,builder:be,handler:async e=>l({command:`ai-gateway dynamic-routing versions create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({elements:f(e.elements,`elements`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(J,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Created`});return}if(e.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);let u=p({elements:f(e.elements,`elements`)}),m=await c(`Creating`,async()=>n.send(J,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(m,{successLabel:`Created`})})};var Se={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions/${t.version_id}`,errors:{400:`BadRequestError`}};function Ce(e){return e.usage(`$0 ai-gateway dynamic-routing versions get <version-id>
39
+ Creates a new version of a dynamic route from the specified routing elements. The version does not serve traffic until you deploy it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`create <id>`,describe:`Create a dynamic route version`,builder:xe,handler:async e=>l({command:`ai-gateway dynamic-routing versions create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({elements:u(e.elements,`elements`)}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(J,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Created`});return}if(e.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);let f=m({elements:u(e.elements,`elements`)}),p=await c(`Creating`,async()=>n.send(J,{body:f,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(p,{successLabel:`Created`})})};var Ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions/${t.version_id}`,errors:{400:`BadRequestError`}};function we(e){return e.usage(`$0 ai-gateway dynamic-routing versions get <version-id>
40
40
 
41
- Retrieves a saved version of a dynamic route, including its routing elements.`).positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <version-id>`,describe:`Get a dynamic route version`,builder:Ce,handler:async e=>l({command:`ai-gateway dynamic-routing versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Se,{account_id:l,gateway_id:e[`gateway-id`],id:e.id,version_id:e[`version-id`]}));o(u,{successLabel:`Loaded`})})};var Te={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,errors:{400:`BadRequestError`}};function Ee(e){return e.usage(`$0 ai-gateway dynamic-routing versions list
41
+ Retrieves a saved version of a dynamic route, including its routing elements.`).positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <version-id>`,describe:`Get a dynamic route version`,builder:we,handler:async e=>l({command:`ai-gateway dynamic-routing versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ce,{account_id:l,gateway_id:e[`gateway-id`],id:e.id,version_id:e[`version-id`]}));o(u,{successLabel:`Loaded`})})};var Ee={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,errors:{400:`BadRequestError`}};function De(e){return e.usage(`$0 ai-gateway dynamic-routing versions list
42
42
 
43
- Lists the saved versions of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`list`,describe:`List dynamic route versions`,builder:Ee,handler:async e=>l({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Te,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})},Oe={command:`versions`,describe:`Create and inspect saved versions of a dynamic route`,builder:e=>e.command(xe).command(we).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(B).command(U).command(me).command(_e).command(ye).command(de).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways`,body:`json`,errors:{400:`BadRequestError`}};function Ae(e){return e.usage(`$0 ai-gateway gateways create
43
+ Lists the saved versions of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List dynamic route versions`,builder:De,handler:async e=>l({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway dynamic-routing versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ee,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})},ke={command:`versions`,describe:`Create and inspect saved versions of a dynamic route`,builder:e=>e.command(Se).command(Te).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ae={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(V).command(W).command(he).command(ve).command(be).command(fe).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways`,body:`json`,errors:{400:`BadRequestError`}};function je(e){return e.usage(`$0 ai-gateway gateways create
44
44
 
45
- Creates an AI Gateway in the account with the specified caching, rate limiting, logging, and authentication settings. The gateway ID appears in request URLs and must be unique within the account.`).option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>m(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>m(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>m(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>m(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>m(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>m(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>m(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>m(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>m(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>m(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>m(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>m(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>m(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>m(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>m(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>m(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>m(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>m(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>m(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>m(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>m(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>m(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>m(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>m(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>m(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>m(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>m(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>m(e,`guardrails-response-s9`,`text`)).option(`id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`}).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>m(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>m(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>m(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`],default:`postpaid`}).coerce(`workers-ai-billing-mode`,e=>m(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`stripe-authorization`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const je={command:`create`,describe:`Create a gateway`,builder:Ae,handler:async e=>l({command:`ai-gateway gateways create`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:m(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:m(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:f(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`]},store_id:m(e[`store-id`],`store-id`,`text`),stripe:{authorization:m(e[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Y,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e.id===void 0&&(e.id=await h(`id`,`Unique identifier of the AI Gateway within the account.`)),e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let u=p({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:m(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:m(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:f(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`]},store_id:m(e[`store-id`],`store-id`,`text`),stripe:{authorization:m(e[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}),g=await c(`Creating`,async()=>n.send(Y,{body:u,account_id:l}));o(g,{successLabel:`Created`})})};function Me(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
45
+ Creates an AI Gateway in the account with the specified caching, rate limiting, logging, and authentication settings. The gateway ID appears in request URLs and must be unique within the account.`).option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>h(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>h(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>h(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>h(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>h(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>h(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>h(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>h(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>h(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>h(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>h(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>h(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>h(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>h(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>h(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>h(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>h(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>h(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>h(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>h(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>h(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>h(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>h(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>h(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>h(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>h(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>h(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>h(e,`guardrails-response-s9`,`text`)).option(`id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`}).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>h(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>h(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>h(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`spend-limits-rules`,{type:`string`,description:`The spend_limits.rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`stripe-usage-events`,{type:`string`,description:`The stripe.usage_events field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`],default:`postpaid`}).coerce(`workers-ai-billing-mode`,e=>h(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`stripe-authorization`,`stripe-usage-events`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`,`stripe-usage-events`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const Me={command:`create`,describe:`Create a gateway`,builder:je,handler:async e=>l({command:`ai-gateway gateways create`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:h(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:h(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:u(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:u(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:h(e[`store-id`],`store-id`,`text`),stripe:{authorization:h(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:u(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(Y,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e.id===void 0&&(e.id=await g(`id`,`Unique identifier of the AI Gateway within the account.`)),e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let f=m({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:h(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:h(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:u(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:u(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:h(e[`store-id`],`store-id`,`text`),stripe:{authorization:h(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:u(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}),p=await c(`Creating`,async()=>n.send(Y,{body:f,account_id:l}));o(p,{successLabel:`Created`})})};function Ne(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
46
46
 
47
- Permanently deletes an AI Gateway, its configuration, and its stored logs.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <gateway-id>`,describe:`Delete a gateway`,builder:Me,handler:async e=>l({command:`ai-gateway gateways delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await g({force:!!e.force,message:`This permanently deletes the gateway, its configuration, and its stored logs. Requests sent to this gateway will fail. This action cannot be undone.`})){process.stderr.write(`Aborted.
48
- `);return}let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`));o(d,{successLabel:`Deleted`})})};function Pe(e){return e.usage(`$0 ai-gateway gateways get-url <ai-gateway-provider>
47
+ Permanently deletes an AI Gateway, its configuration, and its stored logs.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Pe={command:`delete <gateway-id>`,describe:`Delete a gateway`,builder:Ne,handler:async e=>l({command:`ai-gateway gateways delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await _({force:!!e.force,message:`This permanently deletes the gateway, its configuration, and its stored logs. Requests sent to this gateway will fail. This action cannot be undone.`})){process.stderr.write(`Aborted.
48
+ `);return}let d=await c(`Deleting`,async()=>n(l,`DELETE`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`));o(d,{successLabel:`Deleted`})})};function Fe(e){return e.usage(`$0 ai-gateway gateways get-url <ai-gateway-provider>
49
49
 
50
- Retrieves the endpoint URL for an AI Gateway.`).positional(`ai-gateway-provider`,{type:`string`,description:`Provider`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Fe={command:`get-url <ai-gateway-provider>`,describe:`Get Gateway URL`,builder:Pe,handler:async e=>l({command:`ai-gateway gateways get-url`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways get-url`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/url/${e[`ai-gateway-provider`]==null?`<ai-gateway-provider>`:encodeURIComponent(String(e[`ai-gateway-provider`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),"ai-gateway-provider":String(e[`ai-gateway-provider`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}/url/${encodeURIComponent(String(e[`ai-gateway-provider`]))}`));o(d,{successLabel:`Loaded`})})};function Ie(e){return e.usage(`$0 ai-gateway gateways get <gateway-id>
50
+ Retrieves the endpoint URL for an AI Gateway.`).positional(`ai-gateway-provider`,{type:`string`,description:`Provider`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ie={command:`get-url <ai-gateway-provider>`,describe:`Get Gateway URL`,builder:Fe,handler:async e=>l({command:`ai-gateway gateways get-url`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways get-url`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/url/${e[`ai-gateway-provider`]==null?`<ai-gateway-provider>`:encodeURIComponent(String(e[`ai-gateway-provider`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),"ai-gateway-provider":String(e[`ai-gateway-provider`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}/url/${encodeURIComponent(String(e[`ai-gateway-provider`]))}`));o(d,{successLabel:`Loaded`})})};function Le(e){return e.usage(`$0 ai-gateway gateways get <gateway-id>
51
51
 
52
- Retrieves the configuration of an AI Gateway.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <gateway-id>`,describe:`Get a gateway`,builder:Ie,handler:async e=>l({command:`ai-gateway gateways get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`));o(d,{successLabel:`Loaded`})})};var Re={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways`,query:[`page`,`per_page`,`search`],errors:{400:`BadRequestError`}};function ze(e){return e.usage(`$0 ai-gateway gateways list
52
+ Retrieves the configuration of an AI Gateway.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <gateway-id>`,describe:`Get a gateway`,builder:Le,handler:async e=>l({command:`ai-gateway gateways get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>n(l,`GET`,`/accounts/${u}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`));o(d,{successLabel:`Loaded`})})};var ze={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways`,query:[`page`,`per_page`,`search`],errors:{400:`BadRequestError`}};function Be(e){return e.usage(`$0 ai-gateway gateways list
53
53
 
54
- Lists the AI Gateways in the account. Use \`search\` to filter by gateway ID.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List gateways`,builder:ze,handler:async e=>l({command:`ai-gateway gateways list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-gateway gateways list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Re,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs`,body:`json`,errors:{400:`BadRequestError`}};function Ve(e){return e.usage(`$0 ai-gateway gateways providers create <gateway-id>
54
+ Lists the AI Gateways in the account. Use \`search\` to filter by gateway ID.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`list`,describe:`List gateways`,builder:Be,handler:async e=>l({command:`ai-gateway gateways list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],search:e.search};if(e.dryRun){let e=await i();s({command:`cf ai-gateway gateways list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-gateway/gateways`,pathParams:{},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ze,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs`,body:`json`,errors:{400:`BadRequestError`}};function He(e){return e.usage(`$0 ai-gateway gateways providers create <gateway-id>
55
55
 
56
- Stores an upstream AI provider API key for an AI Gateway in the Secrets Store configured on the gateway, with an optional rate limit. Pass \`secret\` to store a new key, or omit it to use an existing Secrets Store secret.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`alias`,{type:`string`,description:`The alias field`}).option(`default-config`,{type:`boolean`,description:`The default_config field`}).option(`provider-slug`,{type:`string`,description:`The provider_slug field`}).option(`rate-limit`,{type:`number`,description:`The rate_limit field`}).option(`rate-limit-period`,{type:`number`,description:`The rate_limit_period field`,default:60}).option(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).option(`secret-id`,{type:`string`,description:`The secret_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`create <gateway-id>`,describe:`Store a provider key`,builder:Ve,handler:async e=>l({command:`ai-gateway gateways providers create`,classification:{safeFlags:[`default-config`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({alias:m(e.alias,`alias`,`text`),default_config:e[`default-config`],provider_slug:m(e[`provider-slug`],`provider-slug`,`text`),rate_limit:e[`rate-limit`],rate_limit_period:e[`rate-limit-period`],secret:m(e.secret,`secret`,`text`),secret_id:m(e[`secret-id`],`secret-id`,`text`)}):d(e.body),sensitiveBodyPaths:[[`secret`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(X,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}if(e.alias===void 0&&(e.alias=await h(`alias`,`The alias field`)),e[`default-config`]===void 0)throw Error(`--default-config is required (or pass --body with this field set).`);e[`provider-slug`]===void 0&&(e[`provider-slug`]=await h(`provider-slug`,`The provider_slug field`));let u=p({alias:m(e.alias,`alias`,`text`),default_config:e[`default-config`],provider_slug:m(e[`provider-slug`],`provider-slug`,`text`),rate_limit:e[`rate-limit`],rate_limit_period:e[`rate-limit-period`],secret:m(e.secret,`secret`,`text`),secret_id:m(e[`secret-id`],`secret-id`,`text`)}),f=await c(`Creating`,async()=>n.send(X,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(f,{successLabel:`Created`})})};var Ue={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,errors:{404:`NotFoundError`}};function We(e){return e.usage(`$0 ai-gateway gateways providers delete <id>
56
+ Stores an upstream AI provider API key for an AI Gateway in the Secrets Store configured on the gateway, with an optional rate limit. Pass \`secret\` to store a new key, or omit it to use an existing Secrets Store secret.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`alias`,{type:`string`,description:`The alias field`}).option(`default-config`,{type:`boolean`,description:`The default_config field`}).option(`provider-slug`,{type:`string`,description:`The provider_slug field`}).option(`rate-limit`,{type:`number`,description:`The rate_limit field`}).option(`rate-limit-period`,{type:`number`,description:`The rate_limit_period field`,default:60}).option(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).option(`secret-id`,{type:`string`,description:`The secret_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ue={command:`create <gateway-id>`,describe:`Store a provider key`,builder:He,handler:async e=>l({command:`ai-gateway gateways providers create`,classification:{safeFlags:[`default-config`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({alias:h(e.alias,`alias`,`text`),default_config:e[`default-config`],provider_slug:h(e[`provider-slug`],`provider-slug`,`text`),rate_limit:e[`rate-limit`],rate_limit_period:e[`rate-limit-period`],secret:h(e.secret,`secret`,`text`),secret_id:h(e[`secret-id`],`secret-id`,`text`)}):d(e.body),sensitiveBodyPaths:[[`secret`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(X,{body:t,account_id:l,gateway_id:e[`gateway-id`]}));o(r,{successLabel:`Created`});return}if(e.alias===void 0&&(e.alias=await g(`alias`,`The alias field`)),e[`default-config`]===void 0)throw Error(`--default-config is required (or pass --body with this field set).`);e[`provider-slug`]===void 0&&(e[`provider-slug`]=await g(`provider-slug`,`The provider_slug field`));let u=m({alias:h(e.alias,`alias`,`text`),default_config:e[`default-config`],provider_slug:h(e[`provider-slug`],`provider-slug`,`text`),rate_limit:e[`rate-limit`],rate_limit_period:e[`rate-limit-period`],secret:h(e.secret,`secret`,`text`),secret_id:h(e[`secret-id`],`secret-id`,`text`)}),f=await c(`Creating`,async()=>n.send(X,{body:u,account_id:l,gateway_id:e[`gateway-id`]}));o(f,{successLabel:`Created`})})};var We={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,errors:{404:`NotFoundError`}};function Ge(e){return e.usage(`$0 ai-gateway gateways providers delete <id>
57
57
 
58
- Deletes a provider key configuration from an AI Gateway and deletes its secret from the Secrets Store.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,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 Ge={command:`delete <id>`,describe:`Delete a provider key`,builder:We,handler:async e=>l({command:`ai-gateway gateways providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await g({force:!!e.force,message:`This deletes the stored provider key and its Secrets Store secret. Requests that rely on this key will stop authenticating with it.`})){process.stderr.write(`Aborted.
59
- `);return}let u=await c(`Deleting`,async()=>n.send(Ue,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Deleted`})})};var Ke={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,errors:{404:`NotFoundError`}};function qe(e){return e.usage(`$0 ai-gateway gateways providers get <id>
58
+ Deletes a provider key configuration from an AI Gateway and deletes its secret from the Secrets Store.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,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 Ke={command:`delete <id>`,describe:`Delete a provider key`,builder:Ge,handler:async e=>l({command:`ai-gateway gateways providers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,!await _({force:!!e.force,message:`This deletes the stored provider key and its Secrets Store secret. Requests that rely on this key will stop authenticating with it.`})){process.stderr.write(`Aborted.
59
+ `);return}let u=await c(`Deleting`,async()=>n.send(We,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Deleted`})})};var qe={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,errors:{404:`NotFoundError`}};function Je(e){return e.usage(`$0 ai-gateway gateways providers get <id>
60
60
 
61
- Retrieves a provider key configuration for an AI Gateway. The response shows a masked preview of the key, never the key itself.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Je={command:`get <id>`,describe:`Get a provider key`,builder:qe,handler:async e=>l({command:`ai-gateway gateways providers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ke,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var Ye={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function Xe(e){return e.usage(`$0 ai-gateway gateways providers list
61
+ Retrieves a provider key configuration for an AI Gateway. The response shows a masked preview of the key, never the key itself.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`get <id>`,describe:`Get a provider key`,builder:Je,handler:async e=>l({command:`ai-gateway gateways providers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(qe,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var Xe={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function Ze(e){return e.usage(`$0 ai-gateway gateways providers list
62
62
 
63
- Lists the provider keys stored for an AI Gateway. Responses show a masked preview of each key, never the key itself.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).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 Ze={command:`list`,describe:`List provider keys`,builder:Xe,handler:async e=>l({command:`ai-gateway gateways providers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Ye,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function Qe(e){return e.usage(`$0 ai-gateway gateways providers update <id>
63
+ Lists the provider keys stored for an AI Gateway. Responses show a masked preview of each key, never the key itself.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).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 Qe={command:`list`,describe:`List provider keys`,builder:Ze,handler:async e=>l({command:`ai-gateway gateways providers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Xe,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/provider_configs/${t.id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function $e(e){return e.usage(`$0 ai-gateway gateways providers update <id>
64
64
 
65
- Replaces the stored API key of a provider key configuration. Only the key can change.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`update <id>`,describe:`Rotate a provider key`,builder:Qe,handler:async e=>l({command:`ai-gateway gateways providers update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({secret:m(e.secret,`secret`,`text`)}):d(e.body),sensitiveBodyPaths:[[`secret`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Z,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}e.secret===void 0&&(e.secret=await h(`secret`,`Provider API key to store in the Secrets Store configured on the gateway.`,{kind:`secret`}));let u=p({secret:m(e.secret,`secret`,`text`)}),f=await c(`Updating`,async()=>n.send(Z,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Updated`})})},et={command:`providers`,describe:`Store and rotate upstream AI provider keys for a gateway`,builder:e=>e.command(He).command(Ge).command(Je).command(Ze).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.usage(`$0 ai-gateway gateways update <gateway-id>
65
+ Replaces the stored API key of a provider key configuration. Only the key can change.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`secret`,{type:`string`,description:`Provider API key to store in the Secrets Store configured on the gateway.`}).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 et={command:`update <id>`,describe:`Rotate a provider key`,builder:$e,handler:async e=>l({command:`ai-gateway gateways providers update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways providers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/provider_configs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({secret:h(e.secret,`secret`,`text`)}):d(e.body),sensitiveBodyPaths:[[`secret`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Z,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}e.secret===void 0&&(e.secret=await g(`secret`,`Provider API key to store in the Secrets Store configured on the gateway.`,{kind:`secret`}));let u=m({secret:h(e.secret,`secret`,`text`)}),f=await c(`Updating`,async()=>n.send(Z,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Updated`})})},tt={command:`providers`,describe:`Store and rotate upstream AI provider keys for a gateway`,builder:e=>e.command(Ue).command(Ke).command(Ye).command(Qe).command(et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function nt(e){return e.usage(`$0 ai-gateway gateways update <gateway-id>
66
66
 
67
- Updates the configuration of an AI Gateway, such as its caching, rate limiting, logging, and authentication settings.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>m(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>m(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>m(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>m(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>m(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>m(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>m(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>m(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>m(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>m(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>m(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>m(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>m(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>m(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>m(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>m(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>m(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>m(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>m(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>m(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>m(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>m(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>m(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>m(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>m(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>m(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>m(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>m(e,`guardrails-response-s9`,`text`)).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>m(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>m(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>m(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`]}).coerce(`workers-ai-billing-mode`,e=>m(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`stripe-authorization`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const nt={command:`update <gateway-id>`,describe:`Update a gateway`,builder:tt,handler:async e=>l({command:`ai-gateway gateways update`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:m(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:f(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`]},store_id:m(e[`store-id`],`store-id`,`text`),stripe:{authorization:m(e[`stripe-authorization`],`stripe-authorization`,`text`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):d(e.body)});return}let l=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let g={};e.authentication!==void 0&&u(g,[`authentication`],e.authentication),e[`byok-only`]!==void 0&&u(g,[`byok_only`],e[`byok-only`]),e[`cache-invalidate-on-update`]!==void 0&&u(g,[`cache_invalidate_on_update`],e[`cache-invalidate-on-update`]),e[`cache-ttl`]!==void 0&&u(g,[`cache_ttl`],e[`cache-ttl`]),e[`collect-logs`]!==void 0&&u(g,[`collect_logs`],e[`collect-logs`]),e[`guardrails-prompt-p1`]!==void 0&&u(g,[`guardrails`,`prompt`,`P1`],e[`guardrails-prompt-p1`]),e[`guardrails-prompt-s1`]!==void 0&&u(g,[`guardrails`,`prompt`,`S1`],e[`guardrails-prompt-s1`]),e[`guardrails-prompt-s10`]!==void 0&&u(g,[`guardrails`,`prompt`,`S10`],e[`guardrails-prompt-s10`]),e[`guardrails-prompt-s11`]!==void 0&&u(g,[`guardrails`,`prompt`,`S11`],e[`guardrails-prompt-s11`]),e[`guardrails-prompt-s12`]!==void 0&&u(g,[`guardrails`,`prompt`,`S12`],e[`guardrails-prompt-s12`]),e[`guardrails-prompt-s13`]!==void 0&&u(g,[`guardrails`,`prompt`,`S13`],e[`guardrails-prompt-s13`]),e[`guardrails-prompt-s2`]!==void 0&&u(g,[`guardrails`,`prompt`,`S2`],e[`guardrails-prompt-s2`]),e[`guardrails-prompt-s3`]!==void 0&&u(g,[`guardrails`,`prompt`,`S3`],e[`guardrails-prompt-s3`]),e[`guardrails-prompt-s4`]!==void 0&&u(g,[`guardrails`,`prompt`,`S4`],e[`guardrails-prompt-s4`]),e[`guardrails-prompt-s5`]!==void 0&&u(g,[`guardrails`,`prompt`,`S5`],e[`guardrails-prompt-s5`]),e[`guardrails-prompt-s6`]!==void 0&&u(g,[`guardrails`,`prompt`,`S6`],e[`guardrails-prompt-s6`]),e[`guardrails-prompt-s7`]!==void 0&&u(g,[`guardrails`,`prompt`,`S7`],e[`guardrails-prompt-s7`]),e[`guardrails-prompt-s8`]!==void 0&&u(g,[`guardrails`,`prompt`,`S8`],e[`guardrails-prompt-s8`]),e[`guardrails-prompt-s9`]!==void 0&&u(g,[`guardrails`,`prompt`,`S9`],e[`guardrails-prompt-s9`]),e[`guardrails-response-p1`]!==void 0&&u(g,[`guardrails`,`response`,`P1`],e[`guardrails-response-p1`]),e[`guardrails-response-s1`]!==void 0&&u(g,[`guardrails`,`response`,`S1`],e[`guardrails-response-s1`]),e[`guardrails-response-s10`]!==void 0&&u(g,[`guardrails`,`response`,`S10`],e[`guardrails-response-s10`]),e[`guardrails-response-s11`]!==void 0&&u(g,[`guardrails`,`response`,`S11`],e[`guardrails-response-s11`]),e[`guardrails-response-s12`]!==void 0&&u(g,[`guardrails`,`response`,`S12`],e[`guardrails-response-s12`]),e[`guardrails-response-s13`]!==void 0&&u(g,[`guardrails`,`response`,`S13`],e[`guardrails-response-s13`]),e[`guardrails-response-s2`]!==void 0&&u(g,[`guardrails`,`response`,`S2`],e[`guardrails-response-s2`]),e[`guardrails-response-s3`]!==void 0&&u(g,[`guardrails`,`response`,`S3`],e[`guardrails-response-s3`]),e[`guardrails-response-s4`]!==void 0&&u(g,[`guardrails`,`response`,`S4`],e[`guardrails-response-s4`]),e[`guardrails-response-s5`]!==void 0&&u(g,[`guardrails`,`response`,`S5`],e[`guardrails-response-s5`]),e[`guardrails-response-s6`]!==void 0&&u(g,[`guardrails`,`response`,`S6`],e[`guardrails-response-s6`]),e[`guardrails-response-s7`]!==void 0&&u(g,[`guardrails`,`response`,`S7`],e[`guardrails-response-s7`]),e[`guardrails-response-s8`]!==void 0&&u(g,[`guardrails`,`response`,`S8`],e[`guardrails-response-s8`]),e[`guardrails-response-s9`]!==void 0&&u(g,[`guardrails`,`response`,`S9`],e[`guardrails-response-s9`]),e[`log-classification`]!==void 0&&u(g,[`log_classification`],e[`log-classification`]),e[`log-management`]!==void 0&&u(g,[`log_management`],e[`log-management`]),e[`log-management-strategy`]!==void 0&&u(g,[`log_management_strategy`],e[`log-management-strategy`]),e.logpush!==void 0&&u(g,[`logpush`],e.logpush),e[`logpush-public-key`]!==void 0&&u(g,[`logpush_public_key`],m(e[`logpush-public-key`],`logpush-public-key`,`text`)),e.otel!==void 0&&u(g,[`otel`],f(e.otel,`otel`)),e[`rate-limiting-interval`]!==void 0&&u(g,[`rate_limiting_interval`],e[`rate-limiting-interval`]),e[`rate-limiting-limit`]!==void 0&&u(g,[`rate_limiting_limit`],e[`rate-limiting-limit`]),e[`rate-limiting-technique`]!==void 0&&u(g,[`rate_limiting_technique`],e[`rate-limiting-technique`]),e[`retry-backoff`]!==void 0&&u(g,[`retry_backoff`],e[`retry-backoff`]),e[`retry-delay`]!==void 0&&u(g,[`retry_delay`],e[`retry-delay`]),e[`retry-max-attempts`]!==void 0&&u(g,[`retry_max_attempts`],e[`retry-max-attempts`]),e[`spend-limits-enabled`]!==void 0&&u(g,[`spend_limits`,`enabled`],e[`spend-limits-enabled`]),e[`store-id`]!==void 0&&u(g,[`store_id`],m(e[`store-id`],`store-id`,`text`)),e[`stripe-authorization`]!==void 0&&u(g,[`stripe`,`authorization`],m(e[`stripe-authorization`],`stripe-authorization`,`text`)),e[`workers-ai-billing-mode`]!==void 0&&u(g,[`workers_ai_billing_mode`],e[`workers-ai-billing-mode`]),e.zdr!==void 0&&u(g,[`zdr`],e.zdr);let _=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${h}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:g}));o(_,{successLabel:`Updated`})})},rt={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(je).command(Ne).command(Le).command(Fe).command(Be).command(nt).command(et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var it={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:[`order_by`,`order_by_direction`,`filters`,`limit`],errors:{400:`BadRequestError`}};function at(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
67
+ Updates the configuration of an AI Gateway, such as its caching, rate limiting, logging, and authentication settings.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`authentication`,{type:`boolean`,description:`The authentication field`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>h(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>h(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>h(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>h(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>h(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>h(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>h(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>h(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>h(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>h(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>h(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>h(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>h(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>h(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>h(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>h(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>h(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>h(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>h(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>h(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>h(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>h(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>h(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>h(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>h(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>h(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>h(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>h(e,`guardrails-response-s9`,`text`)).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>h(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>h(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>h(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`spend-limits-rules`,{type:`string`,description:`The spend_limits.rules field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`store-id`,{type:`string`,description:`The store_id field`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`stripe-usage-events`,{type:`string`,description:`The stripe.usage_events field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`]}).coerce(`workers-ai-billing-mode`,e=>h(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`stripe-authorization`,`stripe-usage-events`].some(t=>e[t]!==void 0)){let t=[`stripe-authorization`,`stripe-usage-events`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const rt={command:`update <gateway-id>`,describe:`Update a gateway`,builder:nt,handler:async e=>l({command:`ai-gateway gateways update`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway gateways update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:h(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:u(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:u(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:h(e[`store-id`],`store-id`,`text`),stripe:{authorization:h(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:u(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):d(e.body)});return}let l=await r(e),f=e.local?t:await a();if(e.accountId=f,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${f}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:t}));o(r,{successLabel:`Updated`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let g={};e.authentication!==void 0&&p(g,[`authentication`],e.authentication),e[`byok-only`]!==void 0&&p(g,[`byok_only`],e[`byok-only`]),e[`cache-invalidate-on-update`]!==void 0&&p(g,[`cache_invalidate_on_update`],e[`cache-invalidate-on-update`]),e[`cache-ttl`]!==void 0&&p(g,[`cache_ttl`],e[`cache-ttl`]),e[`collect-logs`]!==void 0&&p(g,[`collect_logs`],e[`collect-logs`]),e[`guardrails-prompt-p1`]!==void 0&&p(g,[`guardrails`,`prompt`,`P1`],e[`guardrails-prompt-p1`]),e[`guardrails-prompt-s1`]!==void 0&&p(g,[`guardrails`,`prompt`,`S1`],e[`guardrails-prompt-s1`]),e[`guardrails-prompt-s10`]!==void 0&&p(g,[`guardrails`,`prompt`,`S10`],e[`guardrails-prompt-s10`]),e[`guardrails-prompt-s11`]!==void 0&&p(g,[`guardrails`,`prompt`,`S11`],e[`guardrails-prompt-s11`]),e[`guardrails-prompt-s12`]!==void 0&&p(g,[`guardrails`,`prompt`,`S12`],e[`guardrails-prompt-s12`]),e[`guardrails-prompt-s13`]!==void 0&&p(g,[`guardrails`,`prompt`,`S13`],e[`guardrails-prompt-s13`]),e[`guardrails-prompt-s2`]!==void 0&&p(g,[`guardrails`,`prompt`,`S2`],e[`guardrails-prompt-s2`]),e[`guardrails-prompt-s3`]!==void 0&&p(g,[`guardrails`,`prompt`,`S3`],e[`guardrails-prompt-s3`]),e[`guardrails-prompt-s4`]!==void 0&&p(g,[`guardrails`,`prompt`,`S4`],e[`guardrails-prompt-s4`]),e[`guardrails-prompt-s5`]!==void 0&&p(g,[`guardrails`,`prompt`,`S5`],e[`guardrails-prompt-s5`]),e[`guardrails-prompt-s6`]!==void 0&&p(g,[`guardrails`,`prompt`,`S6`],e[`guardrails-prompt-s6`]),e[`guardrails-prompt-s7`]!==void 0&&p(g,[`guardrails`,`prompt`,`S7`],e[`guardrails-prompt-s7`]),e[`guardrails-prompt-s8`]!==void 0&&p(g,[`guardrails`,`prompt`,`S8`],e[`guardrails-prompt-s8`]),e[`guardrails-prompt-s9`]!==void 0&&p(g,[`guardrails`,`prompt`,`S9`],e[`guardrails-prompt-s9`]),e[`guardrails-response-p1`]!==void 0&&p(g,[`guardrails`,`response`,`P1`],e[`guardrails-response-p1`]),e[`guardrails-response-s1`]!==void 0&&p(g,[`guardrails`,`response`,`S1`],e[`guardrails-response-s1`]),e[`guardrails-response-s10`]!==void 0&&p(g,[`guardrails`,`response`,`S10`],e[`guardrails-response-s10`]),e[`guardrails-response-s11`]!==void 0&&p(g,[`guardrails`,`response`,`S11`],e[`guardrails-response-s11`]),e[`guardrails-response-s12`]!==void 0&&p(g,[`guardrails`,`response`,`S12`],e[`guardrails-response-s12`]),e[`guardrails-response-s13`]!==void 0&&p(g,[`guardrails`,`response`,`S13`],e[`guardrails-response-s13`]),e[`guardrails-response-s2`]!==void 0&&p(g,[`guardrails`,`response`,`S2`],e[`guardrails-response-s2`]),e[`guardrails-response-s3`]!==void 0&&p(g,[`guardrails`,`response`,`S3`],e[`guardrails-response-s3`]),e[`guardrails-response-s4`]!==void 0&&p(g,[`guardrails`,`response`,`S4`],e[`guardrails-response-s4`]),e[`guardrails-response-s5`]!==void 0&&p(g,[`guardrails`,`response`,`S5`],e[`guardrails-response-s5`]),e[`guardrails-response-s6`]!==void 0&&p(g,[`guardrails`,`response`,`S6`],e[`guardrails-response-s6`]),e[`guardrails-response-s7`]!==void 0&&p(g,[`guardrails`,`response`,`S7`],e[`guardrails-response-s7`]),e[`guardrails-response-s8`]!==void 0&&p(g,[`guardrails`,`response`,`S8`],e[`guardrails-response-s8`]),e[`guardrails-response-s9`]!==void 0&&p(g,[`guardrails`,`response`,`S9`],e[`guardrails-response-s9`]),e[`log-classification`]!==void 0&&p(g,[`log_classification`],e[`log-classification`]),e[`log-management`]!==void 0&&p(g,[`log_management`],e[`log-management`]),e[`log-management-strategy`]!==void 0&&p(g,[`log_management_strategy`],e[`log-management-strategy`]),e.logpush!==void 0&&p(g,[`logpush`],e.logpush),e[`logpush-public-key`]!==void 0&&p(g,[`logpush_public_key`],h(e[`logpush-public-key`],`logpush-public-key`,`text`)),e.otel!==void 0&&p(g,[`otel`],u(e.otel,`otel`)),e[`rate-limiting-interval`]!==void 0&&p(g,[`rate_limiting_interval`],e[`rate-limiting-interval`]),e[`rate-limiting-limit`]!==void 0&&p(g,[`rate_limiting_limit`],e[`rate-limiting-limit`]),e[`rate-limiting-technique`]!==void 0&&p(g,[`rate_limiting_technique`],e[`rate-limiting-technique`]),e[`retry-backoff`]!==void 0&&p(g,[`retry_backoff`],e[`retry-backoff`]),e[`retry-delay`]!==void 0&&p(g,[`retry_delay`],e[`retry-delay`]),e[`retry-max-attempts`]!==void 0&&p(g,[`retry_max_attempts`],e[`retry-max-attempts`]),e[`spend-limits-enabled`]!==void 0&&p(g,[`spend_limits`,`enabled`],e[`spend-limits-enabled`]),e[`spend-limits-rules`]!==void 0&&p(g,[`spend_limits`,`rules`],u(e[`spend-limits-rules`],`spend-limits-rules`)),e[`store-id`]!==void 0&&p(g,[`store_id`],h(e[`store-id`],`store-id`,`text`)),e[`stripe-authorization`]!==void 0&&p(g,[`stripe`,`authorization`],h(e[`stripe-authorization`],`stripe-authorization`,`text`)),e[`stripe-usage-events`]!==void 0&&p(g,[`stripe`,`usage_events`],u(e[`stripe-usage-events`],`stripe-usage-events`)),e[`workers-ai-billing-mode`]!==void 0&&p(g,[`workers_ai_billing_mode`],e[`workers-ai-billing-mode`]),e.zdr!==void 0&&p(g,[`zdr`],e.zdr);let _=await c(`Updating`,async()=>n(l,`PUT`,`/accounts/${f}/ai-gateway/gateways/${encodeURIComponent(String(e[`gateway-id`]))}`,{body:g}));o(_,{successLabel:`Updated`})})},it={command:`gateways`,describe:`Create and configure AI Gateways for an account`,builder:e=>e.command(Me).command(Pe).command(Re).command(Ie).command(Ve).command(rt).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var at={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:[`order_by`,`order_by_direction`,`filters`,`limit`],errors:{400:`BadRequestError`}};function ot(e){return e.usage(`$0 ai-gateway logs delete <gateway-id>
68
68
 
69
- Deletes gateway log entries matching the specified criteria.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`,`cost`,`tokens_in`,`tokens_out`,`duration`,`feedback`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`limit`,{type:`number`,description:`Limit`}).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 ot={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:at,handler:async e=>l({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,limit:e.limit};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await g({force:!!e.force,message:`This permanently deletes every stored log entry on the gateway that matches the filters. Deleted logs cannot be recovered.`})){process.stderr.write(`Aborted.
70
- `);return}let d=await c(`Deleting`,async()=>l.send(it,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Deleted`})})};var st={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/request`,errors:{404:`NotFoundError`}};function ct(e){return e.usage(`$0 ai-gateway logs get-request <id>
69
+ Deletes gateway log entries matching the specified criteria.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`,`cost`,`tokens_in`,`tokens_out`,`duration`,`feedback`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const st={command:`delete <gateway-id>`,describe:`Delete Gateway Logs`,builder:ot,handler:async e=>l({command:`ai-gateway logs delete`,classification:{safeFlags:[`order-by`,`order-by-direction`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let n={order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,limit:e.limit};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,!await _({force:!!e.force,message:`This permanently deletes every stored log entry on the gateway that matches the filters. Deleted logs cannot be recovered.`})){process.stderr.write(`Aborted.
70
+ `);return}let d=await c(`Deleting`,async()=>l.send(at,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Deleted`})})};var ct={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/request`,errors:{404:`NotFoundError`}};function lt(e){return e.usage(`$0 ai-gateway logs get-request <id>
71
71
 
72
- Retrieves the original request payload for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const lt={command:`get-request <id>`,describe:`Get Gateway Log Request`,builder:ct,handler:async e=>l({command:`ai-gateway logs get-request`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get-request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/request`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(st,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var ut={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/response`,errors:{404:`NotFoundError`}};function dt(e){return e.usage(`$0 ai-gateway logs get-response <id>
72
+ Retrieves the original request payload for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`get-request <id>`,describe:`Get Gateway Log Request`,builder:lt,handler:async e=>l({command:`ai-gateway logs get-request`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get-request`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/request`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ct,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var dt={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}/response`,errors:{404:`NotFoundError`}};function ft(e){return e.usage(`$0 ai-gateway logs get-response <id>
73
73
 
74
- Retrieves the response payload for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get-response <id>`,describe:`Get Gateway Log Response`,builder:dt,handler:async e=>l({command:`ai-gateway logs get-response`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get-response`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/response`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(ut,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var pt={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,errors:{404:`NotFoundError`}};function Q(e){return e.usage(`$0 ai-gateway logs get <id>
74
+ Retrieves the response payload for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`get-response <id>`,describe:`Get Gateway Log Response`,builder:ft,handler:async e=>l({command:`ai-gateway logs get-response`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get-response`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/response`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(dt,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var Q={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,errors:{404:`NotFoundError`}};function mt(e){return e.usage(`$0 ai-gateway logs get <id>
75
75
 
76
- Retrieves detailed information for a specific AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mt={command:`get <id>`,describe:`Get Gateway Log Detail`,builder:Q,handler:async e=>l({command:`ai-gateway logs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(pt,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var ht={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:/* @__PURE__ */ `search.page.per_page.order_by.order_by_direction.filters.meta_info.direction.start_date.end_date.min_cost.max_cost.min_tokens_in.max_tokens_in.min_tokens_out.max_tokens_out.min_total_tokens.max_total_tokens.min_duration.max_duration.feedback.success.cached.model.model_type.provider.request_content_type.response_content_type`.split(`.`),errors:{400:`BadRequestError`}};function gt(e){return e.usage(`$0 ai-gateway logs list
76
+ Retrieves detailed information for a specific AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`get <id>`,describe:`Get Gateway Log Detail`,builder:mt,handler:async e=>l({command:`ai-gateway logs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Q,{account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(u,{successLabel:`Loaded`})})};var gt={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs`,query:/* @__PURE__ */ `search.page.per_page.order_by.order_by_direction.filters.meta_info.direction.start_date.end_date.min_cost.max_cost.min_tokens_in.max_tokens_in.min_tokens_out.max_tokens_out.min_total_tokens.max_total_tokens.min_duration.max_duration.feedback.success.cached.model.model_type.provider.request_content_type.response_content_type`.split(`.`),errors:{400:`BadRequestError`}};function _t(e){return e.usage(`$0 ai-gateway logs list
77
77
 
78
- Lists request/response log entries for the AI gateway with filtering and pagination.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`search`,{type:`string`,description:`Free-text search over log metadata.`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`meta-info`,{type:`boolean`,description:`Meta info`}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`start-date`,{type:`string`,description:`Start date`}).option(`end-date`,{type:`string`,description:`End date`}).option(`min-cost`,{type:`number`,description:`Min cost`}).option(`max-cost`,{type:`number`,description:`Max cost`}).option(`min-tokens-in`,{type:`number`,description:`Min tokens in`}).option(`max-tokens-in`,{type:`number`,description:`Max tokens in`}).option(`min-tokens-out`,{type:`number`,description:`Min tokens out`}).option(`max-tokens-out`,{type:`number`,description:`Max tokens out`}).option(`min-total-tokens`,{type:`number`,description:`Min total tokens`}).option(`max-total-tokens`,{type:`number`,description:`Max total tokens`}).option(`min-duration`,{type:`number`,description:`Min duration`}).option(`max-duration`,{type:`number`,description:`Max duration`}).option(`feedback`,{type:`string`,description:`Feedback`,choices:[`-1`,`0`,`1`]}).option(`success`,{type:`boolean`,description:`Success`}).option(`cached`,{type:`boolean`,description:`Cached`}).option(`model`,{type:`string`,description:`Model filter.`}).option(`model-type`,{type:`string`,description:`Model type`}).option(`ai-gateway-provider`,{type:`string`,description:`Provider`}).option(`request-content-type`,{type:`string`,description:`Request content type`}).option(`response-content-type`,{type:`string`,description:`Response content type`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _t={command:`list`,describe:`List Gateway Logs`,builder:gt,handler:async e=>l({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},e,async()=>{let n={search:e.search,page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,meta_info:e[`meta-info`],direction:e.direction,start_date:e[`start-date`],end_date:e[`end-date`],min_cost:e[`min-cost`],max_cost:e[`max-cost`],min_tokens_in:e[`min-tokens-in`],max_tokens_in:e[`max-tokens-in`],min_tokens_out:e[`min-tokens-out`],max_tokens_out:e[`max-tokens-out`],min_total_tokens:e[`min-total-tokens`],max_total_tokens:e[`max-total-tokens`],min_duration:e[`min-duration`],max_duration:e[`max-duration`],feedback:e.feedback,success:e.success,cached:e.cached,model:e.model,model_type:e[`model-type`],provider:e[`ai-gateway-provider`],request_content_type:e[`request-content-type`],response_content_type:e[`response-content-type`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ht,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,body:`json`,errors:{404:`NotFoundError`}};function vt(e){return e.usage(`$0 ai-gateway logs update <id>
78
+ Lists request/response log entries for the AI gateway with filtering and pagination.`).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`search`,{type:`string`,description:`Free-text search over log metadata.`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`order-by`,{type:`string`,description:`Order by`,choices:[`created_at`,`provider`,`model`,`model_type`,`success`,`cached`]}).option(`order-by-direction`,{type:`string`,description:`Order by direction`,choices:[`asc`,`desc`]}).option(`filters`,{type:`string`,description:`Filters`}).option(`meta-info`,{type:`boolean`,description:`Meta info`}).option(`direction`,{type:`string`,description:`Direction`,choices:[`asc`,`desc`]}).option(`start-date`,{type:`string`,description:`Start date`}).option(`end-date`,{type:`string`,description:`End date`}).option(`min-cost`,{type:`number`,description:`Min cost`}).option(`max-cost`,{type:`number`,description:`Max cost`}).option(`min-tokens-in`,{type:`number`,description:`Min tokens in`}).option(`max-tokens-in`,{type:`number`,description:`Max tokens in`}).option(`min-tokens-out`,{type:`number`,description:`Min tokens out`}).option(`max-tokens-out`,{type:`number`,description:`Max tokens out`}).option(`min-total-tokens`,{type:`number`,description:`Min total tokens`}).option(`max-total-tokens`,{type:`number`,description:`Max total tokens`}).option(`min-duration`,{type:`number`,description:`Min duration`}).option(`max-duration`,{type:`number`,description:`Max duration`}).option(`feedback`,{type:`string`,description:`Feedback`,choices:[`-1`,`0`,`1`]}).option(`success`,{type:`boolean`,description:`Success`}).option(`cached`,{type:`boolean`,description:`Cached`}).option(`model`,{type:`string`,description:`Model filter.`}).option(`model-type`,{type:`string`,description:`Model type`}).option(`ai-gateway-provider`,{type:`string`,description:`Provider`}).option(`request-content-type`,{type:`string`,description:`Request content type`}).option(`response-content-type`,{type:`string`,description:`Response content type`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`list`,describe:`List Gateway Logs`,builder:_t,handler:async e=>l({command:`ai-gateway logs list`,classification:{safeFlags:[`order-by`,`order-by-direction`,`meta-info`,`direction`,`feedback`,`success`,`cached`,`dry-run`]}},e,async()=>{let n={search:e.search,page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order_by_direction:e[`order-by-direction`],filters:e.filters,meta_info:e[`meta-info`],direction:e.direction,start_date:e[`start-date`],end_date:e[`end-date`],min_cost:e[`min-cost`],max_cost:e[`max-cost`],min_tokens_in:e[`min-tokens-in`],max_tokens_in:e[`max-tokens-in`],min_tokens_out:e[`min-tokens-out`],max_tokens_out:e[`max-tokens-out`],min_total_tokens:e[`min-total-tokens`],max_total_tokens:e[`max-total-tokens`],min_duration:e[`min-duration`],max_duration:e[`max-duration`],feedback:e.feedback,success:e.success,cached:e.cached,model:e.model,model_type:e[`model-type`],provider:e[`ai-gateway-provider`],request_content_type:e[`request-content-type`],response_content_type:e[`response-content-type`]};if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},query:n,bodyKind:`none`});return}let l=await r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(gt,{account_id:u,gateway_id:e[`gateway-id`],...n}));o(d,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/logs/${t.id}`,body:`json`,errors:{404:`NotFoundError`}};function yt(e){return e.usage(`$0 ai-gateway logs update <id>
79
79
 
80
- Updates metadata for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`feedback`,{type:`number`,description:`The feedback field`}).option(`score`,{type:`number`,description:`The score field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const yt={command:`update <id>`,describe:`Patch Gateway Log`,builder:vt,handler:async e=>l({command:`ai-gateway logs update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?p({feedback:e.feedback,score:e.score}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send($,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}let u=p({feedback:e.feedback,score:e.score}),f=await c(`Updating`,async()=>n.send($,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(f,{successLabel:`Updated`})})},bt={command:`logs`,describe:`Inspect, annotate, and delete gateway request logs stored by Legacy Logs`,builder:e=>e.command(ot).command(mt).command(lt).command(ft).command(_t).command(yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},xt={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(se).command(L).command(ke).command(rt).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{xt as default};
80
+ Updates metadata for an AI Gateway log entry.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`feedback`,{type:`number`,description:`The feedback field`}).option(`metadata`,{type:`string`,description:`The metadata field. Provide as a JSON object or @path/to/file.json.`}).option(`score`,{type:`number`,description:`The score field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const bt={command:`update <id>`,describe:`Patch Gateway Log`,builder:yt,handler:async e=>l({command:`ai-gateway logs update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf ai-gateway logs update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/logs/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?m({feedback:e.feedback,metadata:f(e.metadata,`metadata`),score:e.score},[[`metadata`]]):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send($,{body:t,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(r,{successLabel:`Updated`});return}let u=m({feedback:e.feedback,metadata:f(e.metadata,`metadata`),score:e.score},[[`metadata`]]),p=await c(`Updating`,async()=>n.send($,{body:u,account_id:l,gateway_id:e[`gateway-id`],id:e.id}));o(p,{successLabel:`Updated`})})},xt={command:`logs`,describe:`Inspect, annotate, and delete gateway request logs stored by Legacy Logs`,builder:e=>e.command(st).command(ht).command(ut).command(pt).command(vt).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},St={command:`ai-gateway`,describe:`Proxy, cache, rate-limit, and observe requests to AI providers — OpenAI, Anthropic, Workers AI, and more`,builder:e=>e.command(se).command(R).command(Ae).command(it).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{St as default};