cf 1.0.0-beta.4 → 1.0.0-beta.6

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 (261) hide show
  1. package/dist/_meta/commands.json +5047 -5068
  2. package/dist/_meta/hand-written-commands.json +1 -1
  3. package/dist/_meta/schemas.json +3026 -3123
  4. package/dist/abuse-reports-BtI6fvRl.mjs +24 -0
  5. package/dist/{access-DUQisFsH.mjs → access-CqOyTHw4.mjs} +1 -1
  6. package/dist/{account-tags-DMmTopgx.mjs → account-tags-7I77Dwsd.mjs} +1 -1
  7. package/dist/{accounts-DbZdpH5e.mjs → accounts-Cq-eOPzL.mjs} +32 -26
  8. package/dist/{acm-BtXPdUqH.mjs → acm-CSXnlN6o.mjs} +1 -1
  9. package/dist/{addressing-Bc_ZSmrK.mjs → addressing-C5XvjNhk.mjs} +1 -1
  10. package/dist/{agent-memory-CEUI1wKI.mjs → agent-memory-CSzr9gty.mjs} +1 -1
  11. package/dist/{ai-CFHaVQcc.mjs → ai-C0xWIvsG.mjs} +7 -9
  12. package/dist/{ai-audit-guygqmOl.mjs → ai-audit-B43vm1KJ.mjs} +1 -1
  13. package/dist/{ai-gateway-BcKOL4WQ.mjs → ai-gateway-BK3MbIzT.mjs} +1 -1
  14. package/dist/{ai-search-DJvNkX2o.mjs → ai-search-TrFTxBbn.mjs} +1 -1
  15. package/dist/{ai-security-CVaHbGzn.mjs → ai-security-JrYa27qd.mjs} +1 -1
  16. package/dist/{alerting-wy4IuGs7.mjs → alerting-B1-ZwfVT.mjs} +1 -1
  17. package/dist/{analytics-Do4VMrPX.mjs → analytics-B-wlVtDV.mjs} +1 -1
  18. package/dist/{analytics_engine-Cv7IF8ex.mjs → analytics_engine-DWzzQzOs.mjs} +1 -1
  19. package/dist/{api-security-fuzV322d.mjs → api-security-BWFWWmXl.mjs} +1 -1
  20. package/dist/{argo-BBf-Jw0O.mjs → argo-DHPGTvCT.mjs} +1 -1
  21. package/dist/{artifacts-B7_OhBxW.mjs → artifacts-mmBDk3wO.mjs} +1 -1
  22. package/dist/{audit-logs-DyARgcxN.mjs → audit-logs-CCF5e500.mjs} +1 -1
  23. package/dist/{auth-CiOv7s9F.mjs → auth-Dnp10uLy.mjs} +1 -1
  24. package/dist/{auth-BYFcxn1F.mjs → auth-gOCL6Pm0.mjs} +2 -2
  25. package/dist/{autoconfig-DbL_FL5k.mjs → autoconfig-DqEPKpj0.mjs} +2 -2
  26. package/dist/basin-catalog-hRY01t_Z.mjs +44 -0
  27. package/dist/{billing-07_VIO4X.mjs → billing-C_ev-9nh.mjs} +1 -1
  28. package/dist/{bot-management-CmkPUu2I.mjs → bot-management-CyYsXkZt.mjs} +1 -1
  29. package/dist/{botnet-feed-Bn5pE_rx.mjs → botnet-feed-Dj5R5v2o.mjs} +1 -1
  30. package/dist/{brand-protection-CWDqPOXe.mjs → brand-protection-CmQ6Iu0I.mjs} +1 -1
  31. package/dist/{browser-run-CfEIfpnQ.mjs → browser-run-sWHTsCSB.mjs} +1 -1
  32. package/dist/build-Dyt1M_Ib.mjs +2 -0
  33. package/dist/{build-DEbkHHVh.mjs → build-_qqitpn0.mjs} +1 -1
  34. package/dist/{builds-mgouQLUs.mjs → builds-c21rTfcg.mjs} +1 -1
  35. package/dist/{cache-DXLofz5T.mjs → cache-CuNjJl6m.mjs} +27 -27
  36. package/dist/{certificate-authorities-BfW-rEpf.mjs → certificate-authorities-DRUUzvI3.mjs} +1 -1
  37. package/dist/{cli-Dgk9bd8j.mjs → cli-Caa776EB.mjs} +1 -1
  38. package/dist/{client-certificates-By2A46a2.mjs → client-certificates-BSi1CEGk.mjs} +1 -1
  39. package/dist/{client-side-security-Bo6ZwJOS.mjs → client-side-security-BdxUX3Y8.mjs} +1 -1
  40. package/dist/{cloud-connector-DYb_3u-M.mjs → cloud-connector-B46ajuAj.mjs} +1 -1
  41. package/dist/{cloudforce-one-D8l0I5PL.mjs → cloudforce-one-adbVR2Ah.mjs} +47 -56
  42. package/dist/{command-DaAGN9uP.mjs → command-B47VlNBp.mjs} +1 -1
  43. package/dist/{command-BPfW-yE4.mjs → command-B5Itp2BM.mjs} +1 -1
  44. package/dist/{command-DjNcY4cf.mjs → command-BDCTd8Ra.mjs} +1 -1
  45. package/dist/{command-CJR1CUK_.mjs → command-BmXnByw9.mjs} +1 -1
  46. package/dist/{command-C3Qhz4kU.mjs → command-Bw-M_qxb.mjs} +1 -1
  47. package/dist/{command-BgBsFEYv.mjs → command-C2bU5Etc.mjs} +1 -1
  48. package/dist/{command-DJJN9xaA.mjs → command-CHcCSvVz.mjs} +1 -1
  49. package/dist/{command-C7cOrHdI.mjs → command-CRgQ0dM3.mjs} +1 -1
  50. package/dist/{command-DH67hNLj.mjs → command-CVg0qT13.mjs} +1 -1
  51. package/dist/{command-DRlUj6lW.mjs → command-CkJvjkfK.mjs} +1 -1
  52. package/dist/{command-C_lQtSPg.mjs → command-DV196MKR.mjs} +1 -1
  53. package/dist/{command-gSmdvn_d.mjs → command-Du3MiYA7.mjs} +1 -1
  54. package/dist/{command-CGD1oByJ.mjs → command-eBmGBTA7.mjs} +1 -1
  55. package/dist/{command-DYeBZ5mA.mjs → command-eqgT8zz4.mjs} +1 -1
  56. package/dist/{completions-DUDx3DwX.mjs → completions-DbT6O2ol.mjs} +1 -1
  57. package/dist/{connector-interrupts-DIMvaZhN.mjs → connector-interrupts-BhfMiPcq.mjs} +1 -1
  58. package/dist/{connector-telemetry-events-TWQvm-cj.mjs → connector-telemetry-events-CxKECRgO.mjs} +1 -1
  59. package/dist/{connector-telemetry-snapshots-Dyoe-_R3.mjs → connector-telemetry-snapshots-BHi-jHE5.mjs} +1 -1
  60. package/dist/{connectors-D7ZFg3hB.mjs → connectors-gkP2aNSN.mjs} +1 -1
  61. package/dist/{containers-CduXjFBJ.mjs → containers-BY8pinEV.mjs} +1 -1
  62. package/dist/{containers-Bu3tLjU1.mjs → containers-DUvBpnRo.mjs} +1 -1
  63. package/dist/{content-scan-CVBD6mUI.mjs → content-scan-BCPhAjMZ.mjs} +1 -1
  64. package/dist/{context-BsGrhAqB.mjs → context-CE7QFX-z.mjs} +1 -1
  65. package/dist/{cps-CgiRKmTe.mjs → cps-B35EPUAk.mjs} +1 -1
  66. package/dist/{csamScanner-BlXIOFFe.mjs → csamScanner-DcTA9oLR.mjs} +1 -1
  67. package/dist/{ct-alerting-CJZK0uSQ.mjs → ct-alerting-B3CS-CPk.mjs} +1 -1
  68. package/dist/{custom-certificates-DFaj_czg.mjs → custom-certificates-IjJJhl7_.mjs} +1 -1
  69. package/dist/{custom-csrs-BnFQpjOo.mjs → custom-csrs-ChYOaEQg.mjs} +1 -1
  70. package/dist/{custom-hostnames-DSnE6xOT.mjs → custom-hostnames-Bai3cqAD.mjs} +1 -1
  71. package/dist/{custom-nameservers-CdQOt_qU.mjs → custom-nameservers-DsukmLNZ.mjs} +1 -1
  72. package/dist/{custom-pages-TWGlS6Ms.mjs → custom-pages-CiboX-9D.mjs} +1 -1
  73. package/dist/d1-s293SFAJ.mjs +41 -0
  74. package/dist/{dcv-delegation-DM3oGGio.mjs → dcv-delegation-BfgvmpQT.mjs} +1 -1
  75. package/dist/{deploy-BZUWZ888.mjs → deploy-CvxNMDbS.mjs} +1 -1
  76. package/dist/{deploy-input-ChEbf2Kp.mjs → deploy-input-CNrImP7B.mjs} +1 -1
  77. package/dist/{dev-OsbQIdD8.mjs → dev-Z6vYszaT.mjs} +1 -1
  78. package/dist/{diagnostics-8bbleTmW.mjs → diagnostics-Ops0RjxG.mjs} +1 -1
  79. package/dist/discover-CcGReXr0.mjs +2 -0
  80. package/dist/{dist-DTN-pqSs.mjs → dist-Dgnf_i4w.mjs} +1 -1
  81. package/dist/{dls-TzQpry2j.mjs → dls-uo7NYEqE.mjs} +1 -1
  82. package/dist/{dns-Bzv4YLeg.mjs → dns-B-NwBOpQ.mjs} +52 -43
  83. package/dist/{dns-firewall-BjWwOmDR.mjs → dns-firewall-LTIP13nb.mjs} +1 -1
  84. package/dist/durable-objects-o7uB3YYg.mjs +6 -0
  85. package/dist/{email-auth-Bth4_FHy.mjs → email-auth-BUdBDCaE.mjs} +1 -1
  86. package/dist/{email-routing-CkTh4F5j.mjs → email-routing-BPRliM3z.mjs} +1 -1
  87. package/dist/{email-security-C-2jADxE.mjs → email-security-dbLE3I5c.mjs} +50 -50
  88. package/dist/{email-sending-B_sd4ouE.mjs → email-sending-BLlGy5Mn.mjs} +1 -1
  89. package/dist/error-sanitization-CEf4JTNN.mjs +2 -0
  90. package/dist/{error-sanitization-Dc4bLj8k.mjs → error-sanitization-CcNUzN1f.mjs} +1 -1
  91. package/dist/{fieldExtractors-z92V55-Y.mjs → fieldExtractors-M-KfLOGw.mjs} +1 -1
  92. package/dist/{firewall-0yKpxdjj.mjs → firewall-DzbLwqo3.mjs} +1 -1
  93. package/dist/flagship-DcXWEywy.mjs +28 -0
  94. package/dist/{fraud-BpJ_aoIE.mjs → fraud-CGXRWANi.mjs} +1 -1
  95. package/dist/generate-t4dFfFRV.mjs +2 -0
  96. package/dist/{google-tag-gateway-DA_7SCC3.mjs → google-tag-gateway-B3Z3Puwl.mjs} +1 -1
  97. package/dist/{healthchecks-C-GthoQz.mjs → healthchecks-BIiV29q7.mjs} +1 -1
  98. package/dist/{hostnames-CH6utzVv.mjs → hostnames-ueWsZFwv.mjs} +1 -1
  99. package/dist/{hyperdrive-_rIC33bB.mjs → hyperdrive-Bxk9LZf5.mjs} +1 -1
  100. package/dist/{iam-sseKl99z.mjs → iam-kA9gcv79.mjs} +1 -1
  101. package/dist/{images-CvIOwtg0.mjs → images-CK4J5as7.mjs} +1 -1
  102. package/dist/index.mjs +1 -1
  103. package/dist/{init-DEIhItNF.mjs → init-COcG8sp5.mjs} +2 -2
  104. package/dist/{intel-Da84oZMO.mjs → intel-z7DkM9Xc.mjs} +1 -1
  105. package/dist/{ips-zTTd_3jg.mjs → ips-BXdBK4Co.mjs} +1 -1
  106. package/dist/{keyless-certificates-BGOUKdJc.mjs → keyless-certificates-Dp9xTYtD.mjs} +1 -1
  107. package/dist/{keys-CDnrfmiS.mjs → keys-DrVlj4VI.mjs} +1 -1
  108. package/dist/{kv-C5jR7vjM.mjs → kv-WX-dlUT1.mjs} +1 -1
  109. package/dist/{lazy-command-DZtpMsVB.mjs → lazy-command-g04RHlS2.mjs} +1 -1
  110. package/dist/{leaked-credential-checks-B7WSzVG3.mjs → leaked-credential-checks-BMQ0VhCd.mjs} +1 -1
  111. package/dist/{load-balancers-DG9wMQUM.mjs → load-balancers-BbkSL89c.mjs} +1 -1
  112. package/dist/local-BWhuu9TH.mjs +2 -0
  113. package/dist/{local-B3OyWKkW.mjs → local-Cyk8fPvL.mjs} +1 -1
  114. package/dist/{local-runtime-Co5vVDlI.mjs → local-runtime-CWWJJB2E.mjs} +1 -1
  115. package/dist/{login-k3QLVysD.mjs → login-CyU_ZTNI.mjs} +1 -1
  116. package/dist/{login-rJanUgdL.mjs → login-DYQ8UgJQ.mjs} +1 -1
  117. package/dist/{logo-matches-5nijgkg7.mjs → logo-matches-HFmD2hK6.mjs} +1 -1
  118. package/dist/{logos-BRRqg8_2.mjs → logos-Di2PABE_.mjs} +1 -1
  119. package/dist/{logpush-Br7H8sRD.mjs → logpush-DEqdt0I0.mjs} +1 -1
  120. package/dist/logs-Ckfw-3Q_.mjs +37 -0
  121. package/dist/{magic-cloud-networking-Bu7O7wKz.mjs → magic-cloud-networking-C0yBJKMb.mjs} +1 -1
  122. package/dist/{magic-network-monitoring-Bnc--4Jr.mjs → magic-network-monitoring-CLvaiI7s.mjs} +1 -1
  123. package/dist/{magic-transit-Dxr86HKN.mjs → magic-transit-Bhb1kxYj.mjs} +108 -112
  124. package/dist/{managed-defense-Bm_jKFTN.mjs → managed-defense-COL3aqXw.mjs} +1 -1
  125. package/dist/{managed-transforms-D5mvHv_N.mjs → managed-transforms-cK0strTK.mjs} +1 -1
  126. package/dist/{matches-Dhc1eSWw.mjs → matches-Df4WEz0x.mjs} +1 -1
  127. package/dist/{mcp-B-PBoBl5.mjs → mcp-DK_5OUVl.mjs} +1 -1
  128. package/dist/{mesh-CW8B4naI.mjs → mesh-CVXpTYED.mjs} +1 -1
  129. package/dist/{migrate-B4kBnkpV.mjs → migrate-CipwWhJE.mjs} +1 -1
  130. package/dist/monetization-BHk0S5BF.mjs +20 -0
  131. package/dist/{mtls-certificates-swvfPqA2.mjs → mtls-certificates-8pzdxzOX.mjs} +1 -1
  132. package/dist/{network-iwRBn0i7.mjs → network-ClNeXTvG.mjs} +1 -1
  133. package/dist/{network-interconnects-CjXYZC4g.mjs → network-interconnects-t3jSoV7o.mjs} +1 -1
  134. package/dist/{oauth-CrTr-mRe.mjs → oauth-CJamdfrC.mjs} +1 -1
  135. package/dist/{oauth-DJW_HyaL.mjs → oauth-CNSirGUu.mjs} +1 -1
  136. package/dist/{oauth-clients-DGUJzFFu.mjs → oauth-clients-DBxdvlJC.mjs} +1 -1
  137. package/dist/{oauth-scopes-Bl0YUOHt.mjs → oauth-scopes-D39GYkt6.mjs} +1 -1
  138. package/dist/{observability-DRHiMrLy.mjs → observability-ZV1yPflB.mjs} +1 -1
  139. package/dist/{organization-BoMJzks7.mjs → organization-Bk-TkQlB.mjs} +7 -7
  140. package/dist/{organizations-UGtCHzSq.mjs → organizations-hXITNpPl.mjs} +1 -1
  141. package/dist/{origin-ca-certificates-CdByaOCe.mjs → origin-ca-certificates-DsLR_Z2e.mjs} +1 -1
  142. package/dist/{origin-post-quantum-encryption-GjmifGkF.mjs → origin-post-quantum-encryption-C_egsVQu.mjs} +1 -1
  143. package/dist/{origin-tls-client-auth-CCIqSj_C.mjs → origin-tls-client-auth-DPG6A6kz.mjs} +1 -1
  144. package/dist/{page-rules-Btn-r3QF.mjs → page-rules-B8lrkiiF.mjs} +1 -1
  145. package/dist/pages-Cx4doLvQ.mjs +54 -0
  146. package/dist/{pay-per-crawl-DcAZuk9T.mjs → pay-per-crawl-BUVHqPPA.mjs} +1 -1
  147. package/dist/{pay-per-use-z0Iwy9rN.mjs → pay-per-use-CzYgryid.mjs} +1 -1
  148. package/dist/{pipelines-YRPwntqo.mjs → pipelines-CGHmwc4a.mjs} +1 -1
  149. package/dist/{precursor-Bcww14RH.mjs → precursor--Jim5u4y.mjs} +1 -1
  150. package/dist/{previews-BBn-IiQu.mjs → previews-BKO1pZyG.mjs} +1 -1
  151. package/dist/{progress-5nsUpQL6.mjs → progress-CRjK46r1.mjs} +1 -1
  152. package/dist/{prompt-Ba_bys2F.mjs → prompt-C_90YsVE.mjs} +1 -1
  153. package/dist/{queries-lxdncISw.mjs → queries-z2pjzXlA.mjs} +1 -1
  154. package/dist/{queues-Egb0KXYK.mjs → queues-D0IXxSa7.mjs} +1 -1
  155. package/dist/{r2-BD4NOkR7.mjs → r2-DQ7w9dCM.mjs} +1 -1
  156. package/dist/r2-data-catalog-DpktRU5y.mjs +2 -0
  157. package/dist/{radar-B4dtfeBP.mjs → radar-DyLO7Zg1.mjs} +1 -1
  158. package/dist/{raw-fetch-AX_Gz3c3.mjs → raw-fetch-C8SdmQBp.mjs} +1 -1
  159. package/dist/{realtime-CtLXkW8l.mjs → realtime-mQzLbDxe.mjs} +1 -1
  160. package/dist/{registrar-I9XClUOe.mjs → registrar-ClbtM5Dy.mjs} +2 -2
  161. package/dist/{registrar-sandbox-DAqK58QS.mjs → registrar-sandbox-BIEHm_Jp.mjs} +2 -2
  162. package/dist/{reporting-BYsEUCIE.mjs → reporting-CjkMzSsZ.mjs} +1 -1
  163. package/dist/{request-headers-sc4CaZX0.mjs → request-headers-jr2VznA9.mjs} +1 -1
  164. package/dist/{request-tracers-DXr9Dr2z.mjs → request-tracers-BoSXOTox.mjs} +1 -1
  165. package/dist/{resource-sharing-DgbnNgCQ.mjs → resource-sharing-CFS39nJq.mjs} +1 -1
  166. package/dist/{resource-tagging-CjPU8PpX.mjs → resource-tagging-CZ5mvMhE.mjs} +1 -1
  167. package/dist/{rules-BrshTdy1.mjs → rules-CfqumI45.mjs} +4 -4
  168. package/dist/{rulesets-BZulblVp.mjs → rulesets-o3jsPv4U.mjs} +20 -20
  169. package/dist/{rum-B4IRlWgy.mjs → rum-BZ0rYlun.mjs} +1 -1
  170. package/dist/run-D0_7wBp2.mjs +2 -0
  171. package/dist/{run-UHTbUldP.mjs → run-huwFFwXd.mjs} +1 -1
  172. package/dist/{schema-flags-C4KmiKur.mjs → schema-flags-nL7pHvaE.mjs} +1 -1
  173. package/dist/{scim-BL2TVEZM.mjs → scim-0-eR9pvC.mjs} +1 -1
  174. package/dist/{sdk-Bx29ZKK3.mjs → sdk-Bmz7t_CD.mjs} +1 -1
  175. package/dist/{secrets-store-BcyhU7Kj.mjs → secrets-store-Duc29Zs-.mjs} +1 -1
  176. package/dist/security-insights-5CuLC-Yo.mjs +40 -0
  177. package/dist/{security-txt-BGIj4nU3.mjs → security-txt-qm2PqCPz.mjs} +1 -1
  178. package/dist/{shared-jqlTaG5K.mjs → shared-BDIrEKWt.mjs} +1 -1
  179. package/dist/{smart-shield-C8mGSzyE.mjs → smart-shield-BXLH9OM0.mjs} +1 -1
  180. package/dist/{snippets-BmHMaKEZ.mjs → snippets-DZG6UWeH.mjs} +1 -1
  181. package/dist/{spawn-IM_tQldH.mjs → spawn-KZqyx6KK.mjs} +1 -1
  182. package/dist/{spectrum-CrGKTMx-.mjs → spectrum-Be4ImAIY.mjs} +1 -1
  183. package/dist/{speed-yyPLwj5X.mjs → speed-CNWujfIC.mjs} +1 -1
  184. package/dist/{src-DFnlH5Tg.mjs → src-CW6py11z.mjs} +5 -5
  185. package/dist/{ssl-DZ6G7pP_.mjs → ssl-BIlS4Qs8.mjs} +1 -1
  186. package/dist/{stream-hoBmKs9X.mjs → stream-C5RvTAKF.mjs} +1 -1
  187. package/dist/{submit-Lfebq3yj.mjs → submit-Bpru4P79.mjs} +1 -1
  188. package/dist/{tags-CnHv__u_.mjs → tags-Rv7X1rU9.mjs} +1 -1
  189. package/dist/{telemetry-DbAo3nvk.mjs → telemetry-0npQCuKc.mjs} +1 -1
  190. package/dist/telemetry-B4_YhD82.mjs +2 -0
  191. package/dist/tenant-CjYf6OPN.mjs +10 -0
  192. package/dist/{tenant-custom-nameservers-CZL9_D8w.mjs → tenant-custom-nameservers-BbHaaEhv.mjs} +1 -1
  193. package/dist/{tunnels-DuO8F5_h.mjs → tunnels-CLWPaIIF.mjs} +1 -1
  194. package/dist/{turnstile-B-6k-bKa.mjs → turnstile-C5ezKSoz.mjs} +1 -1
  195. package/dist/update-check-CebyUyqG.mjs +2 -0
  196. package/dist/{update-check-g9Jcn6YJ.mjs → update-check-aOpHVlzB.mjs} +1 -1
  197. package/dist/update-check-worker.mjs +1 -1
  198. package/dist/{url-info-C6-jj9nl.mjs → url-info-Gcf8-MyB.mjs} +1 -1
  199. package/dist/{url-normalization-BRSTQe20.mjs → url-normalization-Dvg8mZRk.mjs} +1 -1
  200. package/dist/{url-scanner-DER5YAdW.mjs → url-scanner-BZCsgh0O.mjs} +1 -1
  201. package/dist/{user-foSeF-0m.mjs → user-BnkvXmjc.mjs} +1 -1
  202. package/dist/{values-DgBNckq9.mjs → values-yUGls__L.mjs} +1 -1
  203. package/dist/{vectorize-9AZMN3fN.mjs → vectorize-BiXngTuI.mjs} +3 -3
  204. package/dist/version-C3q1GMTe.mjs +2 -0
  205. package/dist/{waiting-rooms-CUc0Xqp0.mjs → waiting-rooms-BoLWF74U.mjs} +1 -1
  206. package/dist/{web-assets-D5LUB5UO.mjs → web-assets-CEJ9Zne1.mjs} +1 -1
  207. package/dist/{web3-BvOpojFR.mjs → web3-CIjm7EuJ.mjs} +1 -1
  208. package/dist/workers-DdtWb7Ws.mjs +38 -0
  209. package/dist/{workers-builds-BFqiT0GR.mjs → workers-builds-DT4tA-KT.mjs} +1 -1
  210. package/dist/workers-for-platforms-CaCr8ApU.mjs +42 -0
  211. package/dist/{workers-vpc-9xBzFjiF.mjs → workers-vpc-DRtjG39D.mjs} +1 -1
  212. package/dist/{workflows-BS0EGixd.mjs → workflows-DRme6yrC.mjs} +2 -2
  213. package/dist/{wrangler-migration-BDkh1_IV.mjs → wrangler-migration-BDnS1puc.mjs} +1 -1
  214. package/dist/{zaraz-DBccJ-ZM.mjs → zaraz-DmjDEnUJ.mjs} +1 -1
  215. package/dist/{zero-trust-DGagti-V.mjs → zero-trust-BRAHExxa.mjs} +427 -441
  216. package/dist/{zone-B4OniptR.mjs → zone-CclLvb-g.mjs} +1 -1
  217. package/dist/{zones-DYuGVoTH.mjs → zones-C6tc2OOV.mjs} +1 -1
  218. package/package.json +5 -4
  219. package/dist/abuse-reports-L4L7sC0F.mjs +0 -26
  220. package/dist/account-J7N4Ukse.mjs +0 -12
  221. package/dist/build-BmLpTw4w.mjs +0 -2
  222. package/dist/d1-Cbqx2kAz.mjs +0 -45
  223. package/dist/discover-DgHRf-qo.mjs +0 -2
  224. package/dist/durable-objects-CRhSGkpc.mjs +0 -8
  225. package/dist/error-sanitization-Cu-8OKRA.mjs +0 -2
  226. package/dist/flagship-IRVq23te.mjs +0 -28
  227. package/dist/generate-qMU-2MgC.mjs +0 -2
  228. package/dist/local-qOpZjDed.mjs +0 -2
  229. package/dist/logs-CBU44LT8.mjs +0 -48
  230. package/dist/pages-iil93G96.mjs +0 -60
  231. package/dist/r2-data-catalog-CI-oHtKe.mjs +0 -44
  232. package/dist/run-BQGVl3vg.mjs +0 -2
  233. package/dist/security-center-D1LSkhL_.mjs +0 -30
  234. package/dist/telemetry-C3hmM9Q9.mjs +0 -2
  235. package/dist/tenant-7CL844dh.mjs +0 -12
  236. package/dist/update-check-BDMPumcv.mjs +0 -2
  237. package/dist/version-DLvRzH-I.mjs +0 -2
  238. package/dist/workers-Cko7OnFE.mjs +0 -40
  239. package/dist/workers-for-platforms-EVE01qsM.mjs +0 -25
  240. /package/dist/{alerts-DqZgVSCT.mjs → alerts-DY_7Nknx.mjs} +0 -0
  241. /package/dist/{autorag-Cq9k9Ye6.mjs → autorag-K396-M2S.mjs} +0 -0
  242. /package/dist/{cloudflared-91JvyShh.mjs → cloudflared-Ciq4L97v.mjs} +0 -0
  243. /package/dist/{command-C72KLHMc.mjs → command-D1Z5uf_S.mjs} +0 -0
  244. /package/dist/{discover-VRFBjse7.mjs → discover-B_3A4a_t.mjs} +0 -0
  245. /package/dist/{generate-iV6OVNin.mjs → generate-QUDsysBJ.mjs} +0 -0
  246. /package/dist/{rate-limit-analytics-Bw9qmxMx.mjs → rate-limit-analytics-YsGha5pH.mjs} +0 -0
  247. /package/dist/{rate-limits-CDm_xzKt.mjs → rate-limits-kH13NRdf.mjs} +0 -0
  248. /package/dist/{ready-BXGqY1Wi.mjs → ready-DYun4Fpn.mjs} +0 -0
  249. /package/dist/{recent-submissions-AhGZD3a3.mjs → recent-submissions-18NaOGOo.mjs} +0 -0
  250. /package/dist/{refute-D_w5Gw20.mjs → refute-BhMiJcE1.mjs} +0 -0
  251. /package/dist/{registry-DBMUTYqf.mjs → registry-CSv7HR1J.mjs} +0 -0
  252. /package/dist/{scan-logo-BZzFam-Q.mjs → scan-logo-7y0pqFMk.mjs} +0 -0
  253. /package/dist/{scan-page-BPA8nSPM.mjs → scan-page-B6jnK3QI.mjs} +0 -0
  254. /package/dist/{schema-CueLBLXC.mjs → schema-JVvksQ1J.mjs} +0 -0
  255. /package/dist/{search-De0UlXYN.mjs → search-Rn3Eefv8.mjs} +0 -0
  256. /package/dist/{signed-url-ziDz9frX.mjs → signed-url-Dzwy9Xiw.mjs} +0 -0
  257. /package/dist/{submission-info-83D2DCCG.mjs → submission-info-SNhkDRRZ.mjs} +0 -0
  258. /package/dist/{tools-BJbI_f35.mjs → tools-CFEubTr4.mjs} +0 -0
  259. /package/dist/{total-queries-Dhol31Kn.mjs → total-queries-B20xslrH.mjs} +0 -0
  260. /package/dist/{tracked-domains-DoOPs6Vd.mjs → tracked-domains-BCvIOZOK.mjs} +0 -0
  261. /package/dist/{verify-CxpGEnJb.mjs → verify-DOeBG4PL.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-BIWQFmZ0.mjs";import{n as t,t as n}from"./local-B3OyWKkW.mjs";import{a as r,t as i}from"./context-BsGrhAqB.mjs";import{a,o,r as s}from"./auth-BYFcxn1F.mjs";import{t as c}from"./output-CvQFJkvi.mjs";import{t as l}from"./dry-run-Bq0JAsbX.mjs";import{t as u}from"./progress-5nsUpQL6.mjs";import{n as d,t as f}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as p,t as m}from"./body-parser-hh2avzkz.mjs";import{n as h,t as g}from"./input-validation-Dk52b0me.mjs";import{a as _,i as v,n as y}from"./prompt-Ba_bys2F.mjs";import{t as b}from"./cli-types-DoVT5q_M.mjs";import{n as x}from"./raw-fetch-AX_Gz3c3.mjs";import{_ as S,c as C,d as w,f as T,g as ee,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F}from"./schema-flags-C4KmiKur.mjs";const I=`ai-model-schema`;async function L(e,t,n,r){let i=ee(I,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:k(e)}}let o=E(a,`input`);return o?(S(I,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const R="Run `cf ai models list` to see the models you can run.",z=[`model-name`,`modelName`];let B;function V(e){return B=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${R}`)}async function H(n){n.local&&console.log(`${t}\n`),B?.showHelp(`log`);let r=n[`model-name`];if(!r||n.local)return;let i=Date.now()+M,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let c=await L(r,a,()=>s(n),i);console.log(c.ok?`\n${j(C(c.schema),`Input flags for ${r}`)}`:`\n${e.muted(`Could not load the input flags for ${r}: ${c.reason}.`)}`)}var U=d({command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:V,handler:async e=>{if(e.help){await H(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${R}`);let o=e.dryRun?await r()??`<account-id>`:await i(),d=n.split(`/`).map(encodeURIComponent).join(`/`),f;if(e.body!==void 0){if(O(e,z).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);f=p(e.body)}else{let t=await L(n,o,()=>s(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let r=C(t.schema),i=O(e,[...z,...A(r)]);if(i.length>0)throw Error(`${i.map(e=>`Unknown flag --${e}`).join(`
2
+ import{r as e}from"./theme-BIWQFmZ0.mjs";import{n as t,t as n}from"./local-Cyk8fPvL.mjs";import{a as r,t as i}from"./context-CE7QFX-z.mjs";import{a,o,r as s}from"./auth-gOCL6Pm0.mjs";import{t as c}from"./output-CvQFJkvi.mjs";import{t as l}from"./dry-run-Bq0JAsbX.mjs";import{t as u}from"./progress-CRjK46r1.mjs";import{n as d,t as f}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as p,t as m}from"./body-parser-hh2avzkz.mjs";import{n as h,t as g}from"./input-validation-Dk52b0me.mjs";import{a as _,i as v,n as y}from"./prompt-C_90YsVE.mjs";import{t as b}from"./cli-types-DoVT5q_M.mjs";import{n as x}from"./raw-fetch-C8SdmQBp.mjs";import{_ as S,c as C,d as w,f as T,g as ee,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F}from"./schema-flags-nL7pHvaE.mjs";const I=`ai-model-schema`;async function L(e,t,n,r){let i=ee(I,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:k(e)}}let o=E(a,`input`);return o?(S(I,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const R="Run `cf ai models list` to see the models you can run.",z=[`model-name`,`modelName`];let B;function V(e){return B=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${R}`)}async function H(n){n.local&&console.log(`${t}\n`),B?.showHelp(`log`);let r=n[`model-name`];if(!r||n.local)return;let i=Date.now()+M,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let c=await L(r,a,()=>s(n),i);console.log(c.ok?`\n${j(C(c.schema),`Input flags for ${r}`)}`:`\n${e.muted(`Could not load the input flags for ${r}: ${c.reason}.`)}`)}var U=d({command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:V,handler:async e=>{if(e.help){await H(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${R}`);let o=e.dryRun?await r()??`<account-id>`:await i(),d;if(e.body!==void 0){if(O(e,z).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);d=p(e.body)}else{let t=await L(n,o,()=>s(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let r=C(t.schema),i=O(e,[...z,...A(r)]);if(i.length>0)throw Error(`${i.map(e=>`Unknown flag --${e}`).join(`
3
3
  `)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);let a=new Set;for(;;){let t=D(r,e).find(e=>!a.has(e.name)&&(e.choices!==void 0||e.type===`string`));if(!t)break;a.add(t.name),t.choices?e[t.name]=await v(t.name,P(t),t.choices,t.choiceLabels):e[t.name]=await _(t.name,P(t))}let c=N(t.schema),l=F(r,e,{reserved:z}),u=l.errors.length===0?c?w(t.schema,l.body):T(t.schema,l.body):l.errors;if(u.length>0)throw Error(`${u.join(`
4
- `)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);f=l.body}if(e.dryRun){l({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${o}/ai/run/${d}`,pathParams:{"model-name":n},bodyKind:`json`,body:f});return}let m=await s(e);e.accountId=o;let h=await u(`Running`,async()=>a(m,`POST`,`/accounts/${o}/ai/run/${d}`,{body:f,preserveNonJsonBytes:!0}));if(Buffer.isBuffer(h)){x(h);return}c(h,{successLabel:`Ran`})}},{command:`ai run`,recordArgs:!1});function W(e){return e.usage(`$0 ai authors list
4
+ `)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);d=l.body}if(e.dryRun){let e={model:n,input:d};l({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${o}/ai/run`,pathParams:{},bodyKind:`json`,body:e});return}let f=await s(e);e.accountId=o;let m=await u(`Running`,async()=>a(f,`POST`,`/accounts/${o}/ai/run`,{body:{model:n,input:d},preserveNonJsonBytes:!0}));if(Buffer.isBuffer(m)){x(m);return}c(m,{successLabel:`Ran`})}},{command:`ai run`,recordArgs:!1});function W(e){return e.usage(`$0 ai authors list
5
5
 
6
6
  Searches Workers AI models by author or organization name.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`Author Search`,builder:W,handler:async e=>f({command:`ai authors list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await i();e.accountId=a,c(await u(`Loading`,async()=>t.ai.authors.list({account_id:a})),{successLabel:`Loaded`})})},K={command:`authors`,describe:`Operations for authors`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.usage(`$0 ai finetunes assets create <finetune-id>
7
7
 
@@ -18,14 +18,12 @@ Lists all fine-tuning jobs created by the account, including status and metrics.
18
18
 
19
19
  Lists publicly available fine-tuned models that can be used with Workers AI.`).option(`limit`,{type:`number`,description:`Pagination Limit.`}).option(`offset`,{type:`number`,description:`Pagination Offset.`}).option(`order-by`,{type:`string`,description:`Order By Column Name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`List Public Finetunes`,builder:oe,handler:async e=>f({command:`ai finetunes public list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={limit:e.limit,offset:e.offset,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await i();e.accountId=o,c(await u(`Loading`,async()=>a.ai.finetunes.public.list({account_id:o,...t})),{successLabel:`Loaded`})})},ce={command:`public`,describe:`Operations for finetunes.public`,builder:e=>e.command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`finetunes`,describe:`Operations for finetunes`,builder:e=>e.command(Q).command(re).command(ae).command(X).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.usage(`$0 ai get-model-schema
20
20
 
21
- Retrieves the input and output JSON schema definition for a Workers AI model.`).option(`model`,{type:`string`,description:`Model Name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get-model-schema`,describe:`Get Model Schema`,builder:ue,handler:async e=>f({command:`ai get-model-schema`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={model:e.model};if(e.dryRun){l({command:`cf ai get-model-schema`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await i();e.accountId=o,c(await u(`Loading`,async()=>a.ai.getModelSchema({account_id:o,...t})),{successLabel:`Loaded`})})};function fe(e){return e.usage(`$0 ai listMarkdownSupportedFormats
21
+ Retrieves the input and output JSON Schema definitions for an AI model. Use these definitions to determine the model-specific request fields and response format.`).option(`model`,{type:`string`,description:`AI model identifier, including its namespace and model name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get-model-schema`,describe:`Get an AI model's input and output schemas`,builder:ue,handler:async e=>f({command:`ai get-model-schema`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={model:e.model};if(e.dryRun){l({command:`cf ai get-model-schema`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await i();e.accountId=o,c(await u(`Loading`,async()=>a.ai.getModelSchema({account_id:o,...t})),{successLabel:`Loaded`})})};function fe(e){return e.usage(`$0 ai listMarkdownSupportedFormats
22
22
 
23
- Lists all file formats supported for conversion to Markdown.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`listMarkdownSupportedFormats`,describe:`Get all converted formats supported`,builder:fe,handler:async e=>f({command:`ai listMarkdownSupportedFormats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai listMarkdownSupportedFormats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await i();e.accountId=a,c(await u(`Loading`,async()=>t.ai.listMarkdownSupportedFormats({account_id:a})),{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 ai models list
23
+ Lists the file extensions and MIME types accepted by Workers AI's Markdown conversion endpoint. Use this list to check whether a file can be converted before uploading it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`listMarkdownSupportedFormats`,describe:`List supported Markdown conversion formats`,builder:fe,handler:async e=>f({command:`ai listMarkdownSupportedFormats`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai listMarkdownSupportedFormats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await i();e.accountId=a,c(await u(`Loading`,async()=>t.ai.listMarkdownSupportedFormats({account_id:a})),{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 ai models list
24
24
 
25
- Searches Workers AI models by name or description.`).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Model Search`,builder:b($),handler:async e=>f({command:`ai models list`,classification:{safeFlags:[`hide-experimental`,`include-deprecated`,`format`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){l({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await i();e.accountId=o,c(await u(`Loading`,async()=>a.ai.models.list({account_id:o,...t})),{successLabel:`Loaded`})})},he={command:`models`,describe:`Operations for models`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.usage(`$0 ai run-model <model-name>
25
+ Searches Workers AI models by name or description.`).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Model Search`,builder:b($),handler:async e=>f({command:`ai models list`,classification:{safeFlags:[`hide-experimental`,`include-deprecated`,`format`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){l({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await i();e.accountId=o,c(await u(`Loading`,async()=>a.ai.models.list({account_id:o,...t})),{successLabel:`Loaded`})})},he={command:`models`,describe:`Operations for models`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.usage(`$0 ai tasks list
26
26
 
27
- This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases. Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).`).positional(`model-name`,{type:`string`,description:`Model name`,demandOption:!0}).option(`text`,{type:`string`,description:`The text that you want to classify`}).option(`guidance`,{type:`number`,description:`Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt`}).option(`height`,{type:`number`,description:`The height of the generated image in pixels`}).option(`image`,{type:`string`,array:!0,description:`For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values`}).option(`image-b64`,{type:`string`,description:`For use with img2img tasks. A base64-encoded string of the input image`}).option(`mask`,{type:`string`,array:!0,description:`An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values`}).option(`negative-prompt`,{type:`string`,description:`Text describing elements to avoid in the generated image`}).option(`num-steps`,{type:`number`,description:`The number of diffusion steps; higher values can improve quality but take longer`}).option(`prompt`,{type:`string`,description:`A text description of the image you want to generate`}).option(`seed`,{type:`number`,description:`Random seed for reproducibility of the image generation`}).option(`strength`,{type:`number`,description:`A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image`}).option(`width`,{type:`number`,description:`The width of the generated image in pixels`}).option(`lang`,{type:`string`,description:`The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified`}).option(`source-lang`,{type:`string`,description:`The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified`}).option(`target-lang`,{type:`string`,description:`The language code to translate the text into (e.g., 'es' for Spanish)`}).option(`input-text`,{type:`string`,description:`The text that you want the model to summarize`}).option(`max-length`,{type:`number`,description:`The maximum length of the generated summary in tokens`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`text`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`guidance`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`height`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`image`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`,`prompt`]).conflicts(`image-b64`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`mask`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`negative-prompt`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`num-steps`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`prompt`,[`text`,`source-lang`,`target-lang`,`input-text`,`max-length`,`image`]).conflicts(`seed`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`strength`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`width`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`lang`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`seed`,`strength`,`width`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`source-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`target-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).implies(`target-lang`,[`text`]).conflicts(`input-text`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`]).conflicts(`max-length`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`])}const _e={command:`run-model <model-name>`,describe:`Execute AI model`,builder:ge,handler:async e=>f({command:`ai run-model`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai run-model`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/run/${e[`model-name`]==null?`<model-name>`:encodeURIComponent(String(e[`model-name`]))}`,pathParams:{"model-name":String(e[`model-name`]??``)},bodyKind:`json`,body:e.body===void 0?m({text:h(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:h(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:h(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:h(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:h(e.lang,`lang`,`text`),source_lang:h(e[`source-lang`],`source-lang`,`text`),target_lang:h(e[`target-lang`],`target-lang`,`text`),input_text:h(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]}):p(e.body)});return}let t=await s(e),a=e.local?n:await i();if(e.accountId=a,e.body){let n=p(e.body);c(await u(`Creating`,async()=>t.ai.runModel({body:n,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`});return}let o=m({text:h(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:h(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:h(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:h(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:h(e.lang,`lang`,`text`),source_lang:h(e[`source-lang`],`source-lang`,`text`),target_lang:h(e[`target-lang`],`target-lang`,`text`),input_text:h(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]});c(await u(`Creating`,async()=>t.ai.runModel({body:o,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`})})};function ve(e){return e.usage(`$0 ai tasks list
27
+ Searches Workers AI models by task type (e.g., text-generation, embeddings).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Task Search`,builder:ge,handler:async e=>f({command:`ai tasks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await i();e.accountId=a,c(await u(`Loading`,async()=>t.ai.tasks.list({account_id:a})),{successLabel:`Loaded`})})},ve={command:`tasks`,describe:`Operations for tasks`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.usage(`$0 ai to-markdown
28
28
 
29
- Searches Workers AI models by task type (e.g., text-generation, embeddings).`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`Task Search`,builder:ve,handler:async e=>f({command:`ai tasks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await i();e.accountId=a,c(await u(`Loading`,async()=>t.ai.tasks.list({account_id:a})),{successLabel:`Loaded`})})},be={command:`tasks`,describe:`Operations for tasks`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.usage(`$0 ai to-markdown
30
-
31
- Converts uploaded files into Markdown format using Workers AI.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:`The files`})}const Se={command:`to-markdown`,describe:`Convert Files into Markdown`,builder:xe,handler:async e=>f({command:`ai to-markdown`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai to-markdown`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await s(e),o=e.local?n:await i();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?h(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Ce={command:`ai`,describe:`ai`,builder:e=>e.command(de).command(pe).command(U).command(_e).command(Se).command(K).command(le).command(he).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ce as default};
29
+ Converts files uploaded as multipart form data into Markdown using Workers AI. Returns a conversion result for each file. Use the supported-formats endpoint to check accepted file types.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:`Files to convert, supplied as multipart file uploads.`})}const be={command:`to-markdown`,describe:`Convert uploaded files to Markdown`,builder:ye,handler:async e=>f({command:`ai to-markdown`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){l({command:`cf ai to-markdown`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await s(e),o=e.local?n:await i();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=g(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?h(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=h(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},xe={command:`ai`,describe:`ai`,builder:e=>e.command(de).command(pe).command(U).command(be).command(K).command(le).command(he).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{xe as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./context-BsGrhAqB.mjs";import{a as t,r as n}from"./auth-BYFcxn1F.mjs";import{t as r}from"./output-CvQFJkvi.mjs";import{t as i}from"./dry-run-Bq0JAsbX.mjs";import{t as a}from"./progress-5nsUpQL6.mjs";import{t as o}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as s}from"./body-parser-hh2avzkz.mjs";function c(e){return e.usage(`$0 ai-audit robots bulk-get
2
+ import{i as e}from"./context-CE7QFX-z.mjs";import{a as t,r as n}from"./auth-gOCL6Pm0.mjs";import{t as r}from"./output-CvQFJkvi.mjs";import{t as i}from"./dry-run-Bq0JAsbX.mjs";import{t as a}from"./progress-CRjK46r1.mjs";import{t as o}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as s}from"./body-parser-hh2avzkz.mjs";function c(e){return e.usage(`$0 ai-audit robots bulk-get
3
3
 
4
4
  Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const l={command:`bulk-get`,describe:`Bulk get robots.txt rules`,builder:c,handler:async c=>o({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await n(c);if(c.zoneId=await e({zone:c.zone},o,{quiet:c.quiet}),c.body){let e=s(c.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let s=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:s}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(o,`POST`,`/zones/${c.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function u(e){return e.usage(`$0 ai-audit robots get
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{a as r,r as i}from"./auth-BYFcxn1F.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-5nsUpQL6.mjs";import{t as c}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,n as h}from"./prompt-Ba_bys2F.mjs";import{t as g}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{a as r,r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,n as h}from"./prompt-C_90YsVE.mjs";import{t as g}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
3
3
 
4
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`]}).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 te={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:ee,handler:async r=>c({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-gateway/gateways/${r[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(r[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(r[`gateway-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({domain:p(r.domain,`domain`,`text`),minTLS:p(r[`min-tls`],`min-tls`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.aiGateway.customDomains.create({...e,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`});return}r.domain===void 0&&(r.domain=await m(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),r[`zone-id`]===void 0&&(r[`zone-id`]=await m(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let d=f({domain:p(r.domain,`domain`,`text`),minTLS:p(r[`min-tls`],`min-tls`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`)});a(await s(`Creating`,async()=>c.aiGateway.customDomains.create({...d,account_id:l,gateway_id:r[`gateway-id`]})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{a as r,r as i}from"./auth-BYFcxn1F.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-5nsUpQL6.mjs";import{t as c}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f,t as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-Ba_bys2F.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";import{n as ee,t as te}from"./raw-fetch-AX_Gz3c3.mjs";function v(e){return e.usage(`$0 ai-search chat-completions <id>
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{a as r,r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f,t as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-C_90YsVE.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";import{n as ee,t as te}from"./raw-fetch-C8SdmQBp.mjs";function v(e){return e.usage(`$0 ai-search chat-completions <id>
3
3
 
4
4
  Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`name`,{type:`string`,description:`Namespace to use for this operation.`,demandOption:!0}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`The ai_search_options.reranking.match_threshold field`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents are candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term, ranked by BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`The ai_search_options.retrieval.match_threshold field`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`The ai_search_options.retrieval.max_num_results field`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream 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 y={command:`chat-completions <id>`,describe:`Chat Completions`,builder:v,handler:async r=>c({command:`ai-search chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/ai-search/namespaces/${r.name==null?`<name>`:encodeURIComponent(String(r.name))}/instances/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/chat/completions`,pathParams:{id:String(r.id??``),name:String(r.name??``)},bodyKind:`json`,body:r.body===void 0?d({ai_search_options:{cache:{cache_threshold:f(r[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:r[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:r[`ai-search-options-query-rewrite-enabled`],model:f(r[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(r[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:r[`ai-search-options-reranking-enabled`],match_threshold:r[`ai-search-options-reranking-match-threshold`],model:f(r[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:r[`ai-search-options-retrieval-context-expansion`],fusion_method:f(r[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(r[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:r[`ai-search-options-retrieval-match-threshold`],max_num_results:r[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(r[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:r[`ai-search-options-retrieval-return-on-failure`]}},messages:u(r.messages,`messages`),model:f(r.model,`model`,`text`),stream:r.stream}):l(r.body)});return}let c=await i(r),p=r.local?e:await n();if(r.accountId=p,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.aiSearch.chatCompletions({...e,account_id:p,name:r.name,id:r.id})),{successLabel:`Created`});return}if(r.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let m=d({ai_search_options:{cache:{cache_threshold:f(r[`ai-search-options-cache-cache-threshold`],`ai-search-options-cache-cache-threshold`,`text`),enabled:r[`ai-search-options-cache-enabled`]},query_rewrite:{enabled:r[`ai-search-options-query-rewrite-enabled`],model:f(r[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(r[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:r[`ai-search-options-reranking-enabled`],match_threshold:r[`ai-search-options-reranking-match-threshold`],model:f(r[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{context_expansion:r[`ai-search-options-retrieval-context-expansion`],fusion_method:f(r[`ai-search-options-retrieval-fusion-method`],`ai-search-options-retrieval-fusion-method`,`text`),keyword_match_mode:f(r[`ai-search-options-retrieval-keyword-match-mode`],`ai-search-options-retrieval-keyword-match-mode`,`text`),match_threshold:r[`ai-search-options-retrieval-match-threshold`],max_num_results:r[`ai-search-options-retrieval-max-num-results`],retrieval_type:f(r[`ai-search-options-retrieval-retrieval-type`],`ai-search-options-retrieval-retrieval-type`,`text`),return_on_failure:r[`ai-search-options-retrieval-return-on-failure`]}},messages:u(r.messages,`messages`),model:f(r.model,`model`,`text`),stream:r.stream});a(await s(`Creating`,async()=>c.aiSearch.chatCompletions({...m,account_id:p,name:r.name,id:r.id})),{successLabel:`Created`})})};function b(e){return e.usage(`$0 ai-search create <name> <id>
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./context-BsGrhAqB.mjs";import{r as t}from"./auth-BYFcxn1F.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-5nsUpQL6.mjs";import{t as a}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as o,r as s,t as c}from"./body-parser-hh2avzkz.mjs";import{n as l}from"./prompt-Ba_bys2F.mjs";function u(e){return e.usage(`$0 ai-security custom-topics get
2
+ import{i as e}from"./context-CE7QFX-z.mjs";import{r as t}from"./auth-gOCL6Pm0.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-CRjK46r1.mjs";import{t as a}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as o,r as s,t as c}from"./body-parser-hh2avzkz.mjs";import{n as l}from"./prompt-C_90YsVE.mjs";function u(e){return e.usage(`$0 ai-security custom-topics get
3
3
 
4
4
  Get the custom topic categories defined for the zone. While AI Security for Apps is enabled, it scores every incoming prompt against these topics and writes the scores to the \`cf.llm.prompt.custom_topic_categories\` field, keyed by topic label. Topics can be configured while the detection is disabled, but no prompt is scored until you enable it.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Get the AI Security for Apps custom topics of a zone.`,builder:u,handler:async o=>a({command:`ai-security custom-topics get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf ai-security custom-topics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/ai-security/custom-topics`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.aiSecurity.customTopics.get({zone_id:s})),{successLabel:`Loaded`})})};function f(e){return e.usage("$0 ai-security custom-topics update\n\nUpdate the custom topic list of the zone, overwriting it entirely with the topics in the request, so include every topic you want to keep. Changes can take up to a minute to propagate. Each entry has a `label`, used to reference the topic in rule expressions and analytics, and a `topic` description, which the classifier scores prompts against while AI Security for Apps is enabled. The following rules apply: - A zone can hold at most 20 topics. - `label` must be 2–20 characters, using only lowercase letters (a–z), digits (0–9), and hyphens. - `topic` must be 2–50 printable ASCII characters. - Labels must be unique within the zone, and so must topic descriptions.").option(`topics`,{type:`string`,description:`Custom topic categories for AI Security for Apps content detection. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`update`,describe:`Update the AI Security for Apps custom topics of a zone.`,builder:f,handler:async u=>a({command:`ai-security custom-topics update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},u,async()=>{if(u.dryRun){r({command:`cf ai-security custom-topics update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/ai-security/custom-topics`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({topics:s(u.topics,`topics`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,!await l({force:!!u.force,message:`This operation overwrites the AI Security for Apps custom topics for a zone.`})){process.stderr.write(`Aborted.
5
5
  `);return}if(u.body){let e=o(u.body);n(await i(`Deleting`,async()=>a.aiSecurity.customTopics.update({body:e,zone_id:d})),{successLabel:`Deleted`});return}let f=c({topics:s(u.topics,`topics`)});n(await i(`Deleting`,async()=>a.aiSecurity.customTopics.update({body:f,zone_id:d})),{successLabel:`Deleted`})})},m={command:`custom-topics`,describe:`Organization-specific topic categories used by AI Security for Apps content detection`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.usage(`$0 ai-security get
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,i as f,n as p}from"./prompt-Ba_bys2F.mjs";import{n as m,t as h}from"./raw-fetch-AX_Gz3c3.mjs";function ee(e){return e.usage(`$0 alerting available-alerts list
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,i as f,n as p}from"./prompt-C_90YsVE.mjs";import{n as m,t as h}from"./raw-fetch-C8SdmQBp.mjs";function ee(e){return e.usage(`$0 alerting available-alerts list
3
3
 
4
4
  Gets a list of all alert types for which an account is eligible.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`Get Alert Types`,builder:ee,handler:async c=>s({command:`alerting available-alerts list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf alerting available-alerts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/alerting/v3/available_alerts`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.alerting.availableAlerts.list({account_id:l})),{successLabel:`Loaded`})})},_={command:`available-alerts`,describe:`Operations for available-alerts`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.usage(`$0 alerting destinations eligible get
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,i as n,t as r}from"./context-BsGrhAqB.mjs";import{a as i,r as a}from"./auth-BYFcxn1F.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-5nsUpQL6.mjs";import{t as l}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-hh2avzkz.mjs";import{n as m,t as h}from"./input-validation-Dk52b0me.mjs";import{a as g}from"./prompt-Ba_bys2F.mjs";function _(e){return e.usage(`$0 analytics latency colos get
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,i as n,t as r}from"./context-CE7QFX-z.mjs";import{a as i,r as a}from"./auth-gOCL6Pm0.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-CRjK46r1.mjs";import{t as l}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-hh2avzkz.mjs";import{n as m,t as h}from"./input-validation-Dk52b0me.mjs";import{a as g}from"./prompt-C_90YsVE.mjs";function _(e){return e.usage(`$0 analytics latency colos get
3
3
 
4
4
  Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Argo Analytics for a zone at different PoPs`,builder:_,handler:async e=>l({command:`analytics latency colos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,o(await c(`Loading`,async()=>t.analytics.latency.colos.get({zone_id:r})),{successLabel:`Loaded`})})},y={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 analytics latency get
5
5
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{a as r,r as i}from"./auth-BYFcxn1F.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-5nsUpQL6.mjs";import{t as c}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as l,t as u}from"./input-validation-Dk52b0me.mjs";function d(e){return e.usage(`$0 analytics_engine sql query
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{a as r,r as i}from"./auth-gOCL6Pm0.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-CRjK46r1.mjs";import{t as c}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as l,t as u}from"./input-validation-Dk52b0me.mjs";function d(e){return e.usage(`$0 analytics_engine sql query
3
3
 
4
4
  Executes a SQL query against Workers Analytics Engine data. Pass the SQL query in the request body as plain text. The response uses newline-delimited JSON (NDJSON) by default, or a single JSON object when the query includes a FORMAT JSON clause. Prefer this method for longer queries that may exceed URL length limits.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const f={command:`query`,describe:`Execute an Analytics Engine SQL query via request body`,builder:d,handler:async d=>c({command:`analytics_engine sql query`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf analytics_engine sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/analytics_engine/sql`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await n();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Loading`,async()=>r(c,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Loading`,async()=>r(c,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}a(await s(`Loading`,async()=>c.analyticsEngine.sql.query({account_id:f})),{successLabel:`Loaded`})})},p={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`analytics_engine`,describe:`analytics_engine`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,i as n,t as r}from"./context-BsGrhAqB.mjs";import{a as i,r as a}from"./auth-BYFcxn1F.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-5nsUpQL6.mjs";import{t as l}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-Ba_bys2F.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 api-security schema-validation schemas create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,i as n,t as r}from"./context-CE7QFX-z.mjs";import{a as i,r as a}from"./auth-gOCL6Pm0.mjs";import{t as o}from"./output-CvQFJkvi.mjs";import{t as s}from"./dry-run-Bq0JAsbX.mjs";import{t as c}from"./progress-CRjK46r1.mjs";import{t as l}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g}from"./prompt-C_90YsVE.mjs";import{t as _}from"./cli-types-DoVT5q_M.mjs";function ee(e){return e.usage(`$0 api-security schema-validation schemas create
3
3
 
4
4
  Uploads an OpenAPI schema that defines expected request formats for API operations.`).option(`kind`,{type:`string`,description:`The kind of the schema`,choices:[`openapi_v3`]}).option(`name`,{type:`string`,description:`A human-readable name for the schema`}).option(`source`,{type:`string`,description:`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`}).option(`validation-enabled`,{type:`boolean`,description:`An indicator if this schema is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Upload a schema`,builder:ee,handler:async e=>l({command:`api-security schema-validation schemas create`,classification:{safeFlags:[`kind`,`validation-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf api-security schema-validation schemas create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/schema_validation/schemas`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({kind:p(e.kind,`kind`,`text`),name:p(e.name,`name`,`text`),source:p(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]}):u(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=u(e.body);o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...n,zone_id:r})),{successLabel:`Created`});return}if(e.kind===void 0&&(e.kind=await h(`kind`,`The kind of the schema`,[`openapi_v3`])),e.name===void 0&&(e.name=await m(`name`,`A human-readable name for the schema`)),e.source===void 0&&(e.source=await m(`source`,`The raw schema, e.g., the OpenAPI schema, either as JSON or YAML`)),e[`validation-enabled`]===void 0)throw Error(`--validation-enabled is required (or pass --body with this field set).`);let i=f({kind:p(e.kind,`kind`,`text`),name:p(e.name,`name`,`text`),source:p(e.source,`source`,`text`),validation_enabled:e[`validation-enabled`]});o(await c(`Creating`,async()=>t.apiSecurity.schemaValidation.schemas.create({...i,zone_id:r})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 api-security schema-validation schemas delete <schema-id>
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./context-BsGrhAqB.mjs";import{r as t}from"./auth-BYFcxn1F.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-5nsUpQL6.mjs";import{t as a}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as o,t as s}from"./body-parser-hh2avzkz.mjs";import{n as c}from"./input-validation-Dk52b0me.mjs";import{i as l}from"./prompt-Ba_bys2F.mjs";function u(e){return e.usage(`$0 argo smart-routing edit
2
+ import{i as e}from"./context-CE7QFX-z.mjs";import{r as t}from"./auth-gOCL6Pm0.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-CRjK46r1.mjs";import{t as a}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as o,t as s}from"./body-parser-hh2avzkz.mjs";import{n as c}from"./input-validation-Dk52b0me.mjs";import{i as l}from"./prompt-C_90YsVE.mjs";function u(e){return e.usage(`$0 argo smart-routing edit
3
3
 
4
4
  Configures the value of the Argo Smart Routing enablement setting.`).option(`value`,{type:`string`,description:`Specifies the enablement value of Argo Smart Routing.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configures the enablement of Argo Smart Routing.`})}const d={command:`edit`,describe:`Patch Argo Smart Routing setting`,builder:u,handler:async u=>a({command:`argo smart-routing edit`,classification:{safeFlags:[`value`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf argo smart-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/argo/smart_routing`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({value:c(u.value,`value`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.argo.smartRouting.edit({...e,zone_id:d})),{successLabel:`Updated`});return}u.value===void 0&&(u.value=await l(`value`,`Specifies the enablement value of Argo Smart Routing.`,[`on`,`off`]));let f=s({value:c(u.value,`value`,`text`)});n(await i(`Updating`,async()=>a.argo.smartRouting.edit({...f,zone_id:d})),{successLabel:`Updated`})})};function f(e){return e.usage(`$0 argo smart-routing get
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,n as f}from"./prompt-Ba_bys2F.mjs";import{t as p}from"./cli-types-DoVT5q_M.mjs";import{n as m,t as h}from"./raw-fetch-AX_Gz3c3.mjs";function ee(e){return e.usage(`$0 artifacts namespaces create
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d,n as f}from"./prompt-C_90YsVE.mjs";import{t as p}from"./cli-types-DoVT5q_M.mjs";import{n as m,t as h}from"./raw-fetch-C8SdmQBp.mjs";function ee(e){return e.usage(`$0 artifacts namespaces create
3
3
 
4
4
  Creates an empty Artifacts namespace for an account.`).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`unrestricted`,`us`,`eu`,`fedramp`],default:`unrestricted`}).option(`namespace`,{type:`string`,description:`The namespace 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 g={command:`create`,describe:`Create a namespace`,builder:ee,handler:async f=>s({command:`artifacts namespaces create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf artifacts namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/artifacts/namespaces`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({jurisdiction:u(f.jurisdiction,`jurisdiction`,`text`),namespace:u(f.namespace,`namespace`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.artifacts.namespaces.create({...e,account_id:p})),{successLabel:`Created`});return}f.namespace===void 0&&(f.namespace=await d(`namespace`,`The namespace field`));let m=l({jurisdiction:u(f.jurisdiction,`jurisdiction`,`text`),namespace:u(f.namespace,`namespace`,`text`)});i(await o(`Creating`,async()=>s.artifacts.namespaces.create({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 artifacts namespaces delete <namespace>
5
5
 
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{t as c}from"./cli-types-DoVT5q_M.mjs";function l(e){return e.usage(`$0 audit-logs list
2
+ import{t as e}from"./local-Cyk8fPvL.mjs";import{a as t,t as n}from"./context-CE7QFX-z.mjs";import{r}from"./auth-gOCL6Pm0.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-CRjK46r1.mjs";import{t as s}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{t as c}from"./cli-types-DoVT5q_M.mjs";function l(e){return e.usage(`$0 audit-logs list
3
3
 
4
4
  Gets a list of audit logs for an account. Can be filtered by who made the change, on which zone, and the timeframe of the change.`).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`export`,{type:`boolean`,description:`Indicates that this request is an export of logs in CSV format.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-ip`,{type:`string`,description:`Filters by the IP address of the request that made the change by specific IP address or valid CIDR Range.`}).option(`actor-email`,{type:`string`,description:`Filters by the email address of the actor that made the change.`}).option(`since`,{type:`string`,description:"Limits the returned results to logs newer than the specified date. A `full-date` that conforms to RFC3339."}).option(`before`,{type:`string`,description:"Limits the returned results to logs older than the specified date. A `full-date` that conforms to RFC3339."}).option(`zone-name`,{type:`string`,description:`Filters by the name of the zone associated to the change.`}).option(`direction`,{type:`string`,description:`Changes the direction of the chronological sorting.`,choices:[`desc`,`asc`]}).option(`per-page`,{type:`number`,description:`Sets the number of results to return per page.`}).option(`page`,{type:`number`,description:`Defines which page of results to return.`}).option(`hide-user-logs`,{type:`boolean`,description:`Indicates whether or not to hide user level audit logs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Get account audit logs`,builder:c(l),handler:async c=>s({command:`audit-logs list`,classification:{safeFlags:[`export`,`direction`,`hide-user-logs`,`dry-run`]}},c,async()=>{let s={id:c.id,export:c.export,"action.type":c[`action-type`],"actor.ip":c[`actor-ip`],"actor.email":c[`actor-email`],since:c.since,before:c.before,"zone.name":c[`zone-name`],direction:c.direction,per_page:c[`per-page`],page:c.page,hide_user_logs:c[`hide-user-logs`]};if(c.dryRun){a({command:`cf audit-logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/audit_logs`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.auditLogs.list({account_id:u,...s})),{successLabel:`Loaded`})})},d={command:`audit-logs`,describe:`audit-logs`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{r as e}from"./theme-BIWQFmZ0.mjs";import{a as t,n,r}from"./banner-ClclgnBn.mjs";import"./ui-BQxRjahW.mjs";import{c as i,d as a,i as o,p as s,r as c,t as l,u}from"./oauth-DJW_HyaL.mjs";import{i as d,n as f}from"./auth-BYFcxn1F.mjs";import{t as p}from"./output-CvQFJkvi.mjs";import{n as m}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{a as h,c as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./login-k3QLVysD.mjs";const C={command:`logout`,describe:`Log out and remove stored credentials`,handler:async a=>{_(a,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let l=c();l!==`default`&&console.log(t(`This directory has profile "${l}" active. \`cf auth logout\` removes the default profile's token, not "${l}".\nTo delete "${l}", run \`cf auth delete ${l}\`.`)),s(`default`);let d=i(),f=!!process.env.CLOUDFLARE_API_TOKEN;if(!d){f?(console.log(r(`No cf OAuth credentials found, but CLOUDFLARE_API_TOKEN environment variable is set.`)),console.log(r(`Unset it with: unset CLOUDFLARE_API_TOKEN`))):(console.log(r(`You are not currently logged in.`)),console.log(n(`Run ${e.code(`cf auth login`)} to authenticate.`)));return}console.log(r(`Logging out...`)),await u(`default`),console.log(`${e.info(`Removed:`)} OAuth tokens from ${e.muted(o())}`),f&&(console.log(``),console.log(t(`CLOUDFLARE_API_TOKEN environment variable is still set.`)),console.log(r(`You will remain authenticated via the env var. Unset it with: unset CLOUDFLARE_API_TOKEN`)))}},w={command:`whoami`,describe:`Show current user and authentication status`,builder:e=>e,handler:async e=>{let t=process.env.CLOUDFLARE_API_TOKEN,n=a(),r;r=t?`CLOUDFLARE_API_TOKEN environment variable`:n?.oauth_token?`OAuth token from ${o()}`:`none`;let i;try{i=await d()}catch{p({authenticated:!1,error:`Not logged in`});return}let s=f({apiToken:i}),c,u=[],[m,h]=await Promise.allSettled([s.user.get(),l()]);if(m.status===`fulfilled`){let e=m.value;e&&`email`in e&&typeof e.email==`string`&&(c=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,m.reason);h.status===`fulfilled`?u=h.value:process.env.DEBUG&&console.error(`Account lookup error:`,h.reason);let g=m.status===`fulfilled`||h.status===`fulfilled`,_={authenticated:!0,authSource:r,tokenValid:g,...c&&{email:c},accounts:u};n?.oauth_token&&(_.scopes=n.scopes,_.expiresAt=n.expiration_time),p(_)}},T={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(m(S,{command:`auth login`,classification:v})).command(E(C,`auth logout`)).command(E(w,`auth whoami`)).command(E(h,`auth create`,[`browser`,`device`])).command(E(x,`auth delete`)).command(E(b,`auth activate`)).command(E(y,`auth deactivate`)).command(E(g,`auth list`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e,t,n=[],r){return m(e,{command:t,classification:{safeFlags:n,shortFlagAliases:r}})}export{T as default};
2
+ import{r as e}from"./theme-BIWQFmZ0.mjs";import{a as t,n,r}from"./banner-ClclgnBn.mjs";import"./ui-BQxRjahW.mjs";import{c as i,d as a,i as o,p as s,r as c,t as l,u}from"./oauth-CNSirGUu.mjs";import{i as d,n as f}from"./auth-gOCL6Pm0.mjs";import{t as p}from"./output-CvQFJkvi.mjs";import{n as m}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{a as h,c as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./login-CyU_ZTNI.mjs";const C={command:`logout`,describe:`Log out and remove stored credentials`,handler:async a=>{_(a,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let l=c();l!==`default`&&console.log(t(`This directory has profile "${l}" active. \`cf auth logout\` removes the default profile's token, not "${l}".\nTo delete "${l}", run \`cf auth delete ${l}\`.`)),s(`default`);let d=i(),f=!!process.env.CLOUDFLARE_API_TOKEN;if(!d){f?(console.log(r(`No cf OAuth credentials found, but CLOUDFLARE_API_TOKEN environment variable is set.`)),console.log(r(`Unset it with: unset CLOUDFLARE_API_TOKEN`))):(console.log(r(`You are not currently logged in.`)),console.log(n(`Run ${e.code(`cf auth login`)} to authenticate.`)));return}console.log(r(`Logging out...`)),await u(`default`),console.log(`${e.info(`Removed:`)} OAuth tokens from ${e.muted(o())}`),f&&(console.log(``),console.log(t(`CLOUDFLARE_API_TOKEN environment variable is still set.`)),console.log(r(`You will remain authenticated via the env var. Unset it with: unset CLOUDFLARE_API_TOKEN`)))}},w={command:`whoami`,describe:`Show current user and authentication status`,builder:e=>e,handler:async e=>{let t=process.env.CLOUDFLARE_API_TOKEN,n=a(),r;r=t?`CLOUDFLARE_API_TOKEN environment variable`:n?.oauth_token?`OAuth token from ${o()}`:`none`;let i;try{i=await d()}catch{p({authenticated:!1,error:`Not logged in`});return}let s=f({apiToken:i}),c,u=[],[m,h]=await Promise.allSettled([s.user.get(),l()]);if(m.status===`fulfilled`){let e=m.value;e&&`email`in e&&typeof e.email==`string`&&(c=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,m.reason);h.status===`fulfilled`?u=h.value:process.env.DEBUG&&console.error(`Account lookup error:`,h.reason);let g=m.status===`fulfilled`||h.status===`fulfilled`,_={authenticated:!0,authSource:r,tokenValid:g,...c&&{email:c},accounts:u};n?.oauth_token&&(_.scopes=n.scopes,_.expiresAt=n.expiration_time),p(_)}},T={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(m(S,{command:`auth login`,classification:v})).command(E(C,`auth logout`)).command(E(w,`auth whoami`)).command(E(h,`auth create`,[`browser`,`device`])).command(E(x,`auth delete`)).command(E(b,`auth activate`)).command(E(y,`auth deactivate`)).command(E(g,`auth list`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e,t,n=[],r){return m(e,{command:t,classification:{safeFlags:n,shortFlagAliases:r}})}export{T as default};
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{n as e,r as t,t as n}from"./sdk-Bx29ZKK3.mjs";import{G as r}from"./dist-DfMipWKR.mjs";import{o as i}from"./chunk-RV27PEH3-Cws_30ln.mjs";import{a,n as o}from"./context-BsGrhAqB.mjs";import{s}from"./oauth-DJW_HyaL.mjs";import{n as c}from"./request-headers-sc4CaZX0.mjs";const l=3e4,u=e.Default;function d(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function f(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function p(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function m(e,t,n){if(!(n==null||n===``)){if(Array.isArray(n)){for(let r of n)m(e,t,r);return}e.append(t,String(n))}}function h(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))m(t,n,r);return t.toString()}function g(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=h(n??{});return a&&(i.search=a),i.toString()}const _=new WeakMap;async function v(e,n,r,i={}){let a=g(r,_.get(e)??u,i.query),o={...i.headers},s;i.body!==void 0&&(d(i.body)||typeof i.body==`string`&&f(o)?s=i.body:(o[`Content-Type`]??=`application/json`,s=JSON.stringify(i.body)));let c;try{c=await e.fetch(a,{method:n,headers:o,body:s,signal:i.signal},{timeoutInSeconds:i.timeout?i.timeout/1e3:void 0,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e instanceof Error&&e.name===`AbortError`?Error(`Request timed out after ${i.timeout??3e4}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!c.ok)throw new t({statusCode:c.status,body:await p(c),rawResponse:{status:c.status,statusText:c.statusText,url:c.url||a,headers:c.headers,redirected:c.redirected,type:c.type}});if(c.status===204)return null;let l=c.headers.get(`content-type`)??``;if(!l.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await c.arrayBuffer());let m=await c.text();if(m===``)return null;if(!l.includes(`application/json`))return m;let h=JSON.parse(m);if(h.success===!1)throw new t({message:`API error: ${h.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`}`,statusCode:c.status,body:h});return`result`in h?h.result:h}function y(e){let t=e.baseURL??u,r=new n({baseUrl:t,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??3e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch});return _.set(r,t),r}async function b(){let e=i({allowGlobalAuthKey:!1});if(e&&`apiToken`in e)return e.apiToken;let t=await s();if(t)return t;throw Error(`No authentication token found.
2
+ import{n as e,r as t,t as n}from"./sdk-Bmz7t_CD.mjs";import{G as r}from"./dist-DfMipWKR.mjs";import{o as i}from"./chunk-RV27PEH3-Cws_30ln.mjs";import{a,n as o}from"./context-CE7QFX-z.mjs";import{s}from"./oauth-CNSirGUu.mjs";import{n as c}from"./request-headers-jr2VznA9.mjs";const l=3e4,u=e.Default;function d(e){return e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof ReadableStream||e instanceof URLSearchParams}function f(e){return Object.keys(e).some(e=>e.toLowerCase()===`content-type`)}async function p(e){let t=e.headers.get(`content-type`)??``;try{return t.includes(`application/json`)?await e.json():await e.text()}catch{return null}}function m(e,t,n){if(!(n==null||n===``)){if(Array.isArray(n)){for(let r of n)m(e,t,r);return}e.append(t,String(n))}}function h(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))m(t,n,r);return t.toString()}function g(e,t,n){let r=new URL(t.endsWith(`/`)?t:`${t}/`),i=new URL(e.startsWith(`/`)?e.slice(1):e,r);if(i.origin!==r.origin)throw Error(`Refusing to send an authenticated request to ${i.origin} (expected ${r.origin})`);let a=h(n??{});return a&&(i.search=a),i.toString()}const _=new WeakMap;async function v(e,n,r,i={}){let a=g(r,_.get(e)??u,i.query),o={...i.headers},s;i.body!==void 0&&(d(i.body)||typeof i.body==`string`&&f(o)?s=i.body:(o[`Content-Type`]??=`application/json`,s=JSON.stringify(i.body)));let c;try{c=await e.fetch(a,{method:n,headers:o,body:s,signal:i.signal},{timeoutInSeconds:i.timeout?i.timeout/1e3:void 0,abortSignal:i.signal})}catch(e){throw i.signal?.aborted?Error(`Request aborted`):e instanceof Error&&e.name===`AbortError`?Error(`Request timed out after ${i.timeout??3e4}ms`):e instanceof Error?Error(`Request failed: ${e.message}`):e}if(!c.ok)throw new t({statusCode:c.status,body:await p(c),rawResponse:{status:c.status,statusText:c.statusText,url:c.url||a,headers:c.headers,redirected:c.redirected,type:c.type}});if(c.status===204)return null;let l=c.headers.get(`content-type`)??``;if(!l.includes(`application/json`)&&i.preserveNonJsonBytes)return Buffer.from(await c.arrayBuffer());let m=await c.text();if(m===``)return null;if(!l.includes(`application/json`))return m;let h=JSON.parse(m);if(h.success===!1)throw new t({message:`API error: ${h.errors?.map(e=>e.message).filter(Boolean).join(`, `)||`unknown error`}`,statusCode:c.status,body:h});return`result`in h?h.result:h}function y(e){let t=e.baseURL??u,r=new n({baseUrl:t,auth:async()=>({headers:{Authorization:`Bearer ${e.apiToken}`}}),headers:e.defaultHeaders,timeoutInSeconds:(e.timeout??3e4)/1e3,maxRetries:0,fetch:e.fetch??globalThis.fetch});return _.set(r,t),r}async function b(){let e=i({allowGlobalAuthKey:!1});if(e&&`apiToken`in e)return e.apiToken;let t=await s();if(t)return t;throw Error(`No authentication token found.
3
3
 
4
4
  Please set one of the following:
5
5
  1. Set the CLOUDFLARE_API_TOKEN environment variable
6
6
  2. Run 'cf auth login' to authenticate via OAuth
7
7
 
8
- For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function x(e){let t=await a();if(t)return t;try{let t=await b(),n=r({compliance_region:await o()}),i=e-Date.now();if(i<=0)return;let a=y({apiToken:t,baseURL:n,defaultHeaders:c()}),s={timeoutInSeconds:i/1e3,maxRetries:0},[l,u]=await Promise.allSettled([a.accounts.list({per_page:50},s),a.user.memberships.list({per_page:50},s)]);if(l.status===`rejected`)return;let d=l.value;if((d.result_info?.total_count??d.result.length)>d.result.length)return;let f=d.result;if(u.status===`fulfilled`){let e=u.value.result??[];if((u.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));f=f.filter(e=>t.has(e.id))}return f.length===1?f[0]?.id:void 0}catch{return}}async function S(e){let t=r({compliance_region:await o()});if(e.local){let{createLocalFetch:n}=await import(`./local-qOpZjDed.mjs`);return y({apiToken:`cf-local-mode-no-auth`,baseURL:t,defaultHeaders:c(),fetch:n({persistTo:e.persistTo,apiBaseUrl:t})})}return y({apiToken:await b(),baseURL:t,defaultHeaders:c()})}export{v as a,b as i,y as n,x as o,S as r,l as t};
8
+ For API tokens, visit: https://dash.cloudflare.com/profile/api-tokens`)}async function x(e){let t=await a();if(t)return t;try{let t=await b(),n=r({compliance_region:await o()}),i=e-Date.now();if(i<=0)return;let a=y({apiToken:t,baseURL:n,defaultHeaders:c()}),s={timeoutInSeconds:i/1e3,maxRetries:0},[l,u]=await Promise.allSettled([a.accounts.list({per_page:50},s),a.user.memberships.list({per_page:50},s)]);if(l.status===`rejected`)return;let d=l.value;if((d.result_info?.total_count??d.result.length)>d.result.length)return;let f=d.result;if(u.status===`fulfilled`){let e=u.value.result??[];if((u.value.result_info?.total_count??e.length)>e.length)return;let t=new Set(e.map(e=>e.account?.id).filter(e=>e!==void 0));f=f.filter(e=>t.has(e.id))}return f.length===1?f[0]?.id:void 0}catch{return}}async function S(e){let t=r({compliance_region:await o()});if(e.local){let{createLocalFetch:n}=await import(`./local-BWhuu9TH.mjs`);return y({apiToken:`cf-local-mode-no-auth`,baseURL:t,defaultHeaders:c(),fetch:n({persistTo:e.persistTo,apiBaseUrl:t})})}return y({apiToken:await b(),baseURL:t,defaultHeaders:c()})}export{v as a,b as i,y as n,x as o,S as r,l as t};