@distilled.cloud/cloudflare 0.0.0 → 0.2.3

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 (560) hide show
  1. package/README.md +41 -7
  2. package/lib/auth.d.ts +13 -0
  3. package/lib/auth.d.ts.map +1 -0
  4. package/lib/auth.js +12 -0
  5. package/lib/auth.js.map +1 -0
  6. package/lib/category.d.ts +2 -0
  7. package/lib/category.d.ts.map +1 -0
  8. package/lib/category.js +2 -0
  9. package/lib/category.js.map +1 -0
  10. package/lib/client/api.d.ts +14 -0
  11. package/lib/client/api.d.ts.map +1 -0
  12. package/lib/client/api.js +245 -0
  13. package/lib/client/api.js.map +1 -0
  14. package/lib/client/index.d.ts +8 -0
  15. package/lib/client/index.d.ts.map +1 -0
  16. package/lib/client/index.js +8 -0
  17. package/lib/client/index.js.map +1 -0
  18. package/lib/credentials.d.ts +14 -0
  19. package/lib/credentials.d.ts.map +1 -0
  20. package/lib/credentials.js +17 -0
  21. package/lib/credentials.js.map +1 -0
  22. package/lib/errors.d.ts +37 -0
  23. package/lib/errors.d.ts.map +1 -0
  24. package/lib/errors.js +31 -0
  25. package/lib/errors.js.map +1 -0
  26. package/lib/index.d.ts +10 -0
  27. package/lib/index.d.ts.map +1 -0
  28. package/lib/index.js +10 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/retry.d.ts +14 -0
  31. package/lib/retry.d.ts.map +1 -0
  32. package/lib/retry.js +14 -0
  33. package/lib/retry.js.map +1 -0
  34. package/lib/schemas.d.ts +29 -0
  35. package/lib/schemas.d.ts.map +1 -0
  36. package/lib/schemas.js +34 -0
  37. package/lib/schemas.js.map +1 -0
  38. package/lib/services/abuse-reports.d.ts +224 -0
  39. package/lib/services/abuse-reports.d.ts.map +1 -0
  40. package/lib/services/abuse-reports.js +353 -0
  41. package/lib/services/abuse-reports.js.map +1 -0
  42. package/lib/services/accounts.d.ts +682 -0
  43. package/lib/services/accounts.d.ts.map +1 -0
  44. package/lib/services/accounts.js +805 -0
  45. package/lib/services/accounts.js.map +1 -0
  46. package/lib/services/acm.d.ts +73 -0
  47. package/lib/services/acm.d.ts.map +1 -0
  48. package/lib/services/acm.js +76 -0
  49. package/lib/services/acm.js.map +1 -0
  50. package/lib/services/addressing.d.ts +1208 -0
  51. package/lib/services/addressing.d.ts.map +1 -0
  52. package/lib/services/addressing.js +1776 -0
  53. package/lib/services/addressing.js.map +1 -0
  54. package/lib/services/ai-gateway.d.ts +956 -0
  55. package/lib/services/ai-gateway.d.ts.map +1 -0
  56. package/lib/services/ai-gateway.js +1706 -0
  57. package/lib/services/ai-gateway.js.map +1 -0
  58. package/lib/services/ai.d.ts +243 -0
  59. package/lib/services/ai.d.ts.map +1 -0
  60. package/lib/services/ai.js +299 -0
  61. package/lib/services/ai.js.map +1 -0
  62. package/lib/services/aisearch.d.ts +915 -0
  63. package/lib/services/aisearch.d.ts.map +1 -0
  64. package/lib/services/aisearch.js +2425 -0
  65. package/lib/services/aisearch.js.map +1 -0
  66. package/lib/services/alerting.d.ts +718 -0
  67. package/lib/services/alerting.d.ts.map +1 -0
  68. package/lib/services/alerting.js +1388 -0
  69. package/lib/services/alerting.js.map +1 -0
  70. package/lib/services/api-gateway.d.ts +830 -0
  71. package/lib/services/api-gateway.d.ts.map +1 -0
  72. package/lib/services/api-gateway.js +1548 -0
  73. package/lib/services/api-gateway.js.map +1 -0
  74. package/lib/services/argo.d.ts +101 -0
  75. package/lib/services/argo.d.ts.map +1 -0
  76. package/lib/services/argo.js +105 -0
  77. package/lib/services/argo.js.map +1 -0
  78. package/lib/services/audit-logs.d.ts +46 -0
  79. package/lib/services/audit-logs.d.ts.map +1 -0
  80. package/lib/services/audit-logs.js +37 -0
  81. package/lib/services/audit-logs.js.map +1 -0
  82. package/lib/services/billing.d.ts +62 -0
  83. package/lib/services/billing.d.ts.map +1 -0
  84. package/lib/services/billing.js +100 -0
  85. package/lib/services/billing.js.map +1 -0
  86. package/lib/services/bot-management.d.ts +124 -0
  87. package/lib/services/bot-management.d.ts.map +1 -0
  88. package/lib/services/bot-management.js +262 -0
  89. package/lib/services/bot-management.js.map +1 -0
  90. package/lib/services/botnet-feed.d.ts +65 -0
  91. package/lib/services/botnet-feed.d.ts.map +1 -0
  92. package/lib/services/botnet-feed.js +84 -0
  93. package/lib/services/botnet-feed.js.map +1 -0
  94. package/lib/services/brand-protection.d.ts +188 -0
  95. package/lib/services/brand-protection.d.ts.map +1 -0
  96. package/lib/services/brand-protection.js +214 -0
  97. package/lib/services/brand-protection.js.map +1 -0
  98. package/lib/services/browser-rendering.d.ts +857 -0
  99. package/lib/services/browser-rendering.d.ts.map +1 -0
  100. package/lib/services/browser-rendering.js +1141 -0
  101. package/lib/services/browser-rendering.js.map +1 -0
  102. package/lib/services/cache.d.ts +287 -0
  103. package/lib/services/cache.d.ts.map +1 -0
  104. package/lib/services/cache.js +330 -0
  105. package/lib/services/cache.js.map +1 -0
  106. package/lib/services/calls.d.ts +202 -0
  107. package/lib/services/calls.d.ts.map +1 -0
  108. package/lib/services/calls.js +175 -0
  109. package/lib/services/calls.js.map +1 -0
  110. package/lib/services/certificate-authorities.d.ts +40 -0
  111. package/lib/services/certificate-authorities.d.ts.map +1 -0
  112. package/lib/services/certificate-authorities.js +49 -0
  113. package/lib/services/certificate-authorities.js.map +1 -0
  114. package/lib/services/client-certificates.d.ts +254 -0
  115. package/lib/services/client-certificates.d.ts.map +1 -0
  116. package/lib/services/client-certificates.js +350 -0
  117. package/lib/services/client-certificates.js.map +1 -0
  118. package/lib/services/cloud-connector.d.ts +59 -0
  119. package/lib/services/cloud-connector.d.ts.map +1 -0
  120. package/lib/services/cloud-connector.js +84 -0
  121. package/lib/services/cloud-connector.js.map +1 -0
  122. package/lib/services/cloudforce-one.d.ts +1318 -0
  123. package/lib/services/cloudforce-one.d.ts.map +1 -0
  124. package/lib/services/cloudforce-one.js +1684 -0
  125. package/lib/services/cloudforce-one.js.map +1 -0
  126. package/lib/services/connectivity.d.ts +248 -0
  127. package/lib/services/connectivity.d.ts.map +1 -0
  128. package/lib/services/connectivity.js +377 -0
  129. package/lib/services/connectivity.js.map +1 -0
  130. package/lib/services/content-scanning.d.ts +131 -0
  131. package/lib/services/content-scanning.d.ts.map +1 -0
  132. package/lib/services/content-scanning.js +156 -0
  133. package/lib/services/content-scanning.js.map +1 -0
  134. package/lib/services/custom-certificates.d.ts +211 -0
  135. package/lib/services/custom-certificates.d.ts.map +1 -0
  136. package/lib/services/custom-certificates.js +309 -0
  137. package/lib/services/custom-certificates.js.map +1 -0
  138. package/lib/services/custom-hostnames.d.ts +525 -0
  139. package/lib/services/custom-hostnames.d.ts.map +1 -0
  140. package/lib/services/custom-hostnames.js +1164 -0
  141. package/lib/services/custom-hostnames.js.map +1 -0
  142. package/lib/services/custom-nameservers.d.ts +67 -0
  143. package/lib/services/custom-nameservers.d.ts.map +1 -0
  144. package/lib/services/custom-nameservers.js +80 -0
  145. package/lib/services/custom-nameservers.js.map +1 -0
  146. package/lib/services/custom-pages.d.ts +74 -0
  147. package/lib/services/custom-pages.d.ts.map +1 -0
  148. package/lib/services/custom-pages.js +125 -0
  149. package/lib/services/custom-pages.js.map +1 -0
  150. package/lib/services/d1.d.ts +326 -0
  151. package/lib/services/d1.d.ts.map +1 -0
  152. package/lib/services/d1.js +448 -0
  153. package/lib/services/d1.js.map +1 -0
  154. package/lib/services/dcv-delegation.d.ts +24 -0
  155. package/lib/services/dcv-delegation.d.ts.map +1 -0
  156. package/lib/services/dcv-delegation.js +24 -0
  157. package/lib/services/dcv-delegation.js.map +1 -0
  158. package/lib/services/diagnostics.d.ts +175 -0
  159. package/lib/services/diagnostics.d.ts.map +1 -0
  160. package/lib/services/diagnostics.js +273 -0
  161. package/lib/services/diagnostics.js.map +1 -0
  162. package/lib/services/dns-firewall.d.ts +288 -0
  163. package/lib/services/dns-firewall.d.ts.map +1 -0
  164. package/lib/services/dns-firewall.js +373 -0
  165. package/lib/services/dns-firewall.js.map +1 -0
  166. package/lib/services/dns.d.ts +2946 -0
  167. package/lib/services/dns.d.ts.map +1 -0
  168. package/lib/services/dns.js +4511 -0
  169. package/lib/services/dns.js.map +1 -0
  170. package/lib/services/durable-objects.d.ts +61 -0
  171. package/lib/services/durable-objects.d.ts.map +1 -0
  172. package/lib/services/durable-objects.js +66 -0
  173. package/lib/services/durable-objects.js.map +1 -0
  174. package/lib/services/email-routing.d.ts +542 -0
  175. package/lib/services/email-routing.d.ts.map +1 -0
  176. package/lib/services/email-routing.js +662 -0
  177. package/lib/services/email-routing.js.map +1 -0
  178. package/lib/services/email-security.d.ts +1131 -0
  179. package/lib/services/email-security.d.ts.map +1 -0
  180. package/lib/services/email-security.js +2065 -0
  181. package/lib/services/email-security.js.map +1 -0
  182. package/lib/services/filters.d.ts +157 -0
  183. package/lib/services/filters.d.ts.map +1 -0
  184. package/lib/services/filters.js +135 -0
  185. package/lib/services/filters.js.map +1 -0
  186. package/lib/services/firewall.d.ts +1080 -0
  187. package/lib/services/firewall.d.ts.map +1 -0
  188. package/lib/services/firewall.js +1881 -0
  189. package/lib/services/firewall.js.map +1 -0
  190. package/lib/services/healthchecks.d.ts +464 -0
  191. package/lib/services/healthchecks.d.ts.map +1 -0
  192. package/lib/services/healthchecks.js +838 -0
  193. package/lib/services/healthchecks.js.map +1 -0
  194. package/lib/services/hostnames.d.ts +74 -0
  195. package/lib/services/hostnames.d.ts.map +1 -0
  196. package/lib/services/hostnames.js +100 -0
  197. package/lib/services/hostnames.js.map +1 -0
  198. package/lib/services/hyperdrive.d.ts +203 -0
  199. package/lib/services/hyperdrive.d.ts.map +1 -0
  200. package/lib/services/hyperdrive.js +299 -0
  201. package/lib/services/hyperdrive.js.map +1 -0
  202. package/lib/services/iam.d.ts +554 -0
  203. package/lib/services/iam.d.ts.map +1 -0
  204. package/lib/services/iam.js +743 -0
  205. package/lib/services/iam.js.map +1 -0
  206. package/lib/services/images.d.ts +403 -0
  207. package/lib/services/images.d.ts.map +1 -0
  208. package/lib/services/images.js +417 -0
  209. package/lib/services/images.js.map +1 -0
  210. package/lib/services/intel.d.ts +768 -0
  211. package/lib/services/intel.d.ts.map +1 -0
  212. package/lib/services/intel.js +1179 -0
  213. package/lib/services/intel.js.map +1 -0
  214. package/lib/services/ips.d.ts +28 -0
  215. package/lib/services/ips.d.ts.map +1 -0
  216. package/lib/services/ips.js +39 -0
  217. package/lib/services/ips.js.map +1 -0
  218. package/lib/services/keyless-certificates.d.ts +177 -0
  219. package/lib/services/keyless-certificates.d.ts.map +1 -0
  220. package/lib/services/keyless-certificates.js +216 -0
  221. package/lib/services/keyless-certificates.js.map +1 -0
  222. package/lib/services/kv.d.ts +339 -0
  223. package/lib/services/kv.d.ts.map +1 -0
  224. package/lib/services/kv.js +402 -0
  225. package/lib/services/kv.js.map +1 -0
  226. package/lib/services/leaked-credential-checks.d.ts +119 -0
  227. package/lib/services/leaked-credential-checks.d.ts.map +1 -0
  228. package/lib/services/leaked-credential-checks.js +130 -0
  229. package/lib/services/leaked-credential-checks.js.map +1 -0
  230. package/lib/services/load-balancers.d.ts +1767 -0
  231. package/lib/services/load-balancers.d.ts.map +1 -0
  232. package/lib/services/load-balancers.js +3068 -0
  233. package/lib/services/load-balancers.js.map +1 -0
  234. package/lib/services/logpush.d.ts +401 -0
  235. package/lib/services/logpush.d.ts.map +1 -0
  236. package/lib/services/logpush.js +724 -0
  237. package/lib/services/logpush.js.map +1 -0
  238. package/lib/services/logs.d.ts +125 -0
  239. package/lib/services/logs.d.ts.map +1 -0
  240. package/lib/services/logs.js +145 -0
  241. package/lib/services/logs.js.map +1 -0
  242. package/lib/services/magic-cloud-networking.d.ts +1599 -0
  243. package/lib/services/magic-cloud-networking.d.ts.map +1 -0
  244. package/lib/services/magic-cloud-networking.js +5205 -0
  245. package/lib/services/magic-cloud-networking.js.map +1 -0
  246. package/lib/services/magic-network-monitoring.d.ts +379 -0
  247. package/lib/services/magic-network-monitoring.d.ts.map +1 -0
  248. package/lib/services/magic-network-monitoring.js +535 -0
  249. package/lib/services/magic-network-monitoring.js.map +1 -0
  250. package/lib/services/magic-transit.d.ts +3650 -0
  251. package/lib/services/magic-transit.d.ts.map +1 -0
  252. package/lib/services/magic-transit.js +6120 -0
  253. package/lib/services/magic-transit.js.map +1 -0
  254. package/lib/services/managed-transforms.d.ts +79 -0
  255. package/lib/services/managed-transforms.d.ts.map +1 -0
  256. package/lib/services/managed-transforms.js +107 -0
  257. package/lib/services/managed-transforms.js.map +1 -0
  258. package/lib/services/memberships.d.ts +172 -0
  259. package/lib/services/memberships.d.ts.map +1 -0
  260. package/lib/services/memberships.js +282 -0
  261. package/lib/services/memberships.js.map +1 -0
  262. package/lib/services/mtls-certificates.d.ts +140 -0
  263. package/lib/services/mtls-certificates.d.ts.map +1 -0
  264. package/lib/services/mtls-certificates.js +173 -0
  265. package/lib/services/mtls-certificates.js.map +1 -0
  266. package/lib/services/network-interconnects.d.ts +410 -0
  267. package/lib/services/network-interconnects.d.ts.map +1 -0
  268. package/lib/services/network-interconnects.js +583 -0
  269. package/lib/services/network-interconnects.js.map +1 -0
  270. package/lib/services/organizations.d.ts +201 -0
  271. package/lib/services/organizations.d.ts.map +1 -0
  272. package/lib/services/organizations.js +355 -0
  273. package/lib/services/organizations.js.map +1 -0
  274. package/lib/services/origin-ca-certificates.d.ts +99 -0
  275. package/lib/services/origin-ca-certificates.d.ts.map +1 -0
  276. package/lib/services/origin-ca-certificates.js +156 -0
  277. package/lib/services/origin-ca-certificates.js.map +1 -0
  278. package/lib/services/origin-post-quantum-encryption.d.ts +50 -0
  279. package/lib/services/origin-post-quantum-encryption.d.ts.map +1 -0
  280. package/lib/services/origin-post-quantum-encryption.js +60 -0
  281. package/lib/services/origin-post-quantum-encryption.js.map +1 -0
  282. package/lib/services/origin-tls-client-auth.d.ts +273 -0
  283. package/lib/services/origin-tls-client-auth.d.ts.map +1 -0
  284. package/lib/services/origin-tls-client-auth.js +401 -0
  285. package/lib/services/origin-tls-client-auth.js.map +1 -0
  286. package/lib/services/page-rules.d.ts +773 -0
  287. package/lib/services/page-rules.d.ts.map +1 -0
  288. package/lib/services/page-rules.js +1365 -0
  289. package/lib/services/page-rules.js.map +1 -0
  290. package/lib/services/page-shield.d.ts +426 -0
  291. package/lib/services/page-shield.d.ts.map +1 -0
  292. package/lib/services/page-shield.js +484 -0
  293. package/lib/services/page-shield.js.map +1 -0
  294. package/lib/services/pages.d.ts +1654 -0
  295. package/lib/services/pages.d.ts.map +1 -0
  296. package/lib/services/pages.js +2954 -0
  297. package/lib/services/pages.js.map +1 -0
  298. package/lib/services/pipelines.d.ts +1461 -0
  299. package/lib/services/pipelines.d.ts.map +1 -0
  300. package/lib/services/pipelines.js +2912 -0
  301. package/lib/services/pipelines.js.map +1 -0
  302. package/lib/services/queues.d.ts +807 -0
  303. package/lib/services/queues.d.ts.map +1 -0
  304. package/lib/services/queues.js +1194 -0
  305. package/lib/services/queues.js.map +1 -0
  306. package/lib/services/r2-data-catalog.d.ts +341 -0
  307. package/lib/services/r2-data-catalog.d.ts.map +1 -0
  308. package/lib/services/r2-data-catalog.js +499 -0
  309. package/lib/services/r2-data-catalog.js.map +1 -0
  310. package/lib/services/r2.d.ts +1041 -0
  311. package/lib/services/r2.d.ts.map +1 -0
  312. package/lib/services/r2.js +1384 -0
  313. package/lib/services/r2.js.map +1 -0
  314. package/lib/services/radar.d.ts +9276 -0
  315. package/lib/services/radar.d.ts.map +1 -0
  316. package/lib/services/radar.js +20491 -0
  317. package/lib/services/radar.js.map +1 -0
  318. package/lib/services/rate-limits.d.ts +315 -0
  319. package/lib/services/rate-limits.d.ts.map +1 -0
  320. package/lib/services/rate-limits.js +521 -0
  321. package/lib/services/rate-limits.js.map +1 -0
  322. package/lib/services/realtime-kit.d.ts +2728 -0
  323. package/lib/services/realtime-kit.d.ts.map +1 -0
  324. package/lib/services/realtime-kit.js +5401 -0
  325. package/lib/services/realtime-kit.js.map +1 -0
  326. package/lib/services/registrar.d.ts +81 -0
  327. package/lib/services/registrar.d.ts.map +1 -0
  328. package/lib/services/registrar.js +154 -0
  329. package/lib/services/registrar.js.map +1 -0
  330. package/lib/services/request-tracers.d.ts +61 -0
  331. package/lib/services/request-tracers.d.ts.map +1 -0
  332. package/lib/services/request-tracers.js +82 -0
  333. package/lib/services/request-tracers.js.map +1 -0
  334. package/lib/services/resource-sharing.d.ts +540 -0
  335. package/lib/services/resource-sharing.d.ts.map +1 -0
  336. package/lib/services/resource-sharing.js +846 -0
  337. package/lib/services/resource-sharing.js.map +1 -0
  338. package/lib/services/rules.d.ts +297 -0
  339. package/lib/services/rules.d.ts.map +1 -0
  340. package/lib/services/rules.js +396 -0
  341. package/lib/services/rules.js.map +1 -0
  342. package/lib/services/rulesets.d.ts +3300 -0
  343. package/lib/services/rulesets.d.ts.map +1 -0
  344. package/lib/services/rulesets.js +7852 -0
  345. package/lib/services/rulesets.js.map +1 -0
  346. package/lib/services/rum.d.ts +289 -0
  347. package/lib/services/rum.d.ts.map +1 -0
  348. package/lib/services/rum.js +409 -0
  349. package/lib/services/rum.js.map +1 -0
  350. package/lib/services/schema-validation.d.ts +240 -0
  351. package/lib/services/schema-validation.d.ts.map +1 -0
  352. package/lib/services/schema-validation.js +306 -0
  353. package/lib/services/schema-validation.js.map +1 -0
  354. package/lib/services/secrets-store.d.ts +321 -0
  355. package/lib/services/secrets-store.d.ts.map +1 -0
  356. package/lib/services/secrets-store.js +385 -0
  357. package/lib/services/secrets-store.js.map +1 -0
  358. package/lib/services/security-center.d.ts +102 -0
  359. package/lib/services/security-center.d.ts.map +1 -0
  360. package/lib/services/security-center.js +170 -0
  361. package/lib/services/security-center.js.map +1 -0
  362. package/lib/services/security-txt.d.ts +105 -0
  363. package/lib/services/security-txt.d.ts.map +1 -0
  364. package/lib/services/security-txt.js +136 -0
  365. package/lib/services/security-txt.js.map +1 -0
  366. package/lib/services/snippets.d.ts +138 -0
  367. package/lib/services/snippets.d.ts.map +1 -0
  368. package/lib/services/snippets.js +178 -0
  369. package/lib/services/snippets.js.map +1 -0
  370. package/lib/services/spectrum.d.ts +316 -0
  371. package/lib/services/spectrum.d.ts.map +1 -0
  372. package/lib/services/spectrum.js +510 -0
  373. package/lib/services/spectrum.js.map +1 -0
  374. package/lib/services/speed.d.ts +227 -0
  375. package/lib/services/speed.d.ts.map +1 -0
  376. package/lib/services/speed.js +444 -0
  377. package/lib/services/speed.js.map +1 -0
  378. package/lib/services/ssl.d.ts +370 -0
  379. package/lib/services/ssl.d.ts.map +1 -0
  380. package/lib/services/ssl.js +732 -0
  381. package/lib/services/ssl.js.map +1 -0
  382. package/lib/services/stream.d.ts +1014 -0
  383. package/lib/services/stream.d.ts.map +1 -0
  384. package/lib/services/stream.js +1049 -0
  385. package/lib/services/stream.js.map +1 -0
  386. package/lib/services/token-validation.d.ts +547 -0
  387. package/lib/services/token-validation.d.ts.map +1 -0
  388. package/lib/services/token-validation.js +768 -0
  389. package/lib/services/token-validation.js.map +1 -0
  390. package/lib/services/turnstile.d.ts +248 -0
  391. package/lib/services/turnstile.d.ts.map +1 -0
  392. package/lib/services/turnstile.js +308 -0
  393. package/lib/services/turnstile.js.map +1 -0
  394. package/lib/services/url-normalization.d.ts +53 -0
  395. package/lib/services/url-normalization.d.ts.map +1 -0
  396. package/lib/services/url-normalization.js +52 -0
  397. package/lib/services/url-normalization.js.map +1 -0
  398. package/lib/services/url-scanner.d.ts +612 -0
  399. package/lib/services/url-scanner.d.ts.map +1 -0
  400. package/lib/services/url-scanner.js +915 -0
  401. package/lib/services/url-scanner.js.map +1 -0
  402. package/lib/services/user.d.ts +441 -0
  403. package/lib/services/user.d.ts.map +1 -0
  404. package/lib/services/user.js +567 -0
  405. package/lib/services/user.js.map +1 -0
  406. package/lib/services/vectorize.d.ts +282 -0
  407. package/lib/services/vectorize.d.ts.map +1 -0
  408. package/lib/services/vectorize.js +340 -0
  409. package/lib/services/vectorize.js.map +1 -0
  410. package/lib/services/waiting-rooms.d.ts +1009 -0
  411. package/lib/services/waiting-rooms.d.ts.map +1 -0
  412. package/lib/services/waiting-rooms.js +1757 -0
  413. package/lib/services/waiting-rooms.js.map +1 -0
  414. package/lib/services/web3.d.ts +274 -0
  415. package/lib/services/web3.d.ts.map +1 -0
  416. package/lib/services/web3.js +362 -0
  417. package/lib/services/web3.js.map +1 -0
  418. package/lib/services/workers-for-platforms.d.ts +1224 -0
  419. package/lib/services/workers-for-platforms.d.ts.map +1 -0
  420. package/lib/services/workers-for-platforms.js +2078 -0
  421. package/lib/services/workers-for-platforms.js.map +1 -0
  422. package/lib/services/workers.d.ts +3498 -0
  423. package/lib/services/workers.d.ts.map +1 -0
  424. package/lib/services/workers.js +5967 -0
  425. package/lib/services/workers.js.map +1 -0
  426. package/lib/services/workflows.d.ts +359 -0
  427. package/lib/services/workflows.d.ts.map +1 -0
  428. package/lib/services/workflows.js +516 -0
  429. package/lib/services/workflows.js.map +1 -0
  430. package/lib/services/zaraz.d.ts +300 -0
  431. package/lib/services/zaraz.d.ts.map +1 -0
  432. package/lib/services/zaraz.js +298 -0
  433. package/lib/services/zaraz.js.map +1 -0
  434. package/lib/services/zero-trust.d.ts +15449 -0
  435. package/lib/services/zero-trust.d.ts.map +1 -0
  436. package/lib/services/zero-trust.js +29194 -0
  437. package/lib/services/zero-trust.js.map +1 -0
  438. package/lib/services/zones.d.ts +1278 -0
  439. package/lib/services/zones.d.ts.map +1 -0
  440. package/lib/services/zones.js +2416 -0
  441. package/lib/services/zones.js.map +1 -0
  442. package/lib/traits.d.ts +28 -0
  443. package/lib/traits.d.ts.map +1 -0
  444. package/lib/traits.js +26 -0
  445. package/lib/traits.js.map +1 -0
  446. package/package.json +68 -5
  447. package/src/auth.ts +14 -0
  448. package/src/category.ts +1 -0
  449. package/src/client/api.ts +329 -0
  450. package/src/client/index.ts +7 -0
  451. package/src/credentials.ts +30 -0
  452. package/src/errors.ts +57 -0
  453. package/src/index.ts +9 -0
  454. package/src/retry.ts +35 -0
  455. package/src/schemas.ts +51 -0
  456. package/src/services/abuse-reports.ts +747 -0
  457. package/src/services/accounts.ts +1947 -0
  458. package/src/services/acm.ts +170 -0
  459. package/src/services/addressing.ts +3947 -0
  460. package/src/services/ai-gateway.ts +3335 -0
  461. package/src/services/ai.ts +727 -0
  462. package/src/services/aisearch.ts +4750 -0
  463. package/src/services/alerting.ts +2947 -0
  464. package/src/services/api-gateway.ts +3391 -0
  465. package/src/services/argo.ts +254 -0
  466. package/src/services/audit-logs.ts +90 -0
  467. package/src/services/billing.ts +172 -0
  468. package/src/services/bot-management.ts +541 -0
  469. package/src/services/botnet-feed.ts +193 -0
  470. package/src/services/brand-protection.ts +553 -0
  471. package/src/services/browser-rendering.ts +2707 -0
  472. package/src/services/cache.ts +827 -0
  473. package/src/services/calls.ts +483 -0
  474. package/src/services/certificate-authorities.ts +110 -0
  475. package/src/services/client-certificates.ts +718 -0
  476. package/src/services/cloud-connector.ts +181 -0
  477. package/src/services/cloudforce-one.ts +3876 -0
  478. package/src/services/connectivity.ts +629 -0
  479. package/src/services/content-scanning.ts +385 -0
  480. package/src/services/custom-certificates.ts +611 -0
  481. package/src/services/custom-hostnames.ts +2453 -0
  482. package/src/services/custom-nameservers.ts +182 -0
  483. package/src/services/custom-pages.ts +264 -0
  484. package/src/services/d1.ts +1034 -0
  485. package/src/services/dcv-delegation.ts +52 -0
  486. package/src/services/diagnostics.ts +603 -0
  487. package/src/services/dns-firewall.ts +823 -0
  488. package/src/services/dns.ts +8897 -0
  489. package/src/services/durable-objects.ts +148 -0
  490. package/src/services/email-routing.ts +1602 -0
  491. package/src/services/email-security.ts +4283 -0
  492. package/src/services/filters.ts +370 -0
  493. package/src/services/firewall.ts +3896 -0
  494. package/src/services/healthchecks.ts +1750 -0
  495. package/src/services/hostnames.ts +218 -0
  496. package/src/services/hyperdrive.ts +592 -0
  497. package/src/services/iam.ts +1668 -0
  498. package/src/services/images.ts +1086 -0
  499. package/src/services/intel.ts +2768 -0
  500. package/src/services/ips.ts +88 -0
  501. package/src/services/keyless-certificates.ts +462 -0
  502. package/src/services/kv.ts +1011 -0
  503. package/src/services/leaked-credential-checks.ts +325 -0
  504. package/src/services/load-balancers.ts +6438 -0
  505. package/src/services/logpush.ts +1667 -0
  506. package/src/services/logs.ts +375 -0
  507. package/src/services/magic-cloud-networking.ts +10020 -0
  508. package/src/services/magic-network-monitoring.ts +1156 -0
  509. package/src/services/magic-transit.ts +13050 -0
  510. package/src/services/managed-transforms.ts +237 -0
  511. package/src/services/memberships.ts +615 -0
  512. package/src/services/mtls-certificates.ts +374 -0
  513. package/src/services/network-interconnects.ts +1253 -0
  514. package/src/services/organizations.ts +674 -0
  515. package/src/services/origin-ca-certificates.ts +303 -0
  516. package/src/services/origin-post-quantum-encryption.ts +128 -0
  517. package/src/services/origin-tls-client-auth.ts +878 -0
  518. package/src/services/page-rules.ts +2612 -0
  519. package/src/services/page-shield.ts +1195 -0
  520. package/src/services/pages.ts +5709 -0
  521. package/src/services/pipelines.ts +6000 -0
  522. package/src/services/queues.ts +2629 -0
  523. package/src/services/r2-data-catalog.ts +1119 -0
  524. package/src/services/r2.ts +3348 -0
  525. package/src/services/radar.ts +42152 -0
  526. package/src/services/rate-limits.ts +1150 -0
  527. package/src/services/realtime-kit.ts +11079 -0
  528. package/src/services/registrar.ts +295 -0
  529. package/src/services/request-tracers.ts +158 -0
  530. package/src/services/resource-sharing.ts +1832 -0
  531. package/src/services/rules.ts +837 -0
  532. package/src/services/rulesets.ts +15144 -0
  533. package/src/services/rum.ts +901 -0
  534. package/src/services/schema-validation.ts +733 -0
  535. package/src/services/secrets-store.ts +860 -0
  536. package/src/services/security-center.ts +397 -0
  537. package/src/services/security-txt.ts +315 -0
  538. package/src/services/snippets.ts +420 -0
  539. package/src/services/spectrum.ts +1103 -0
  540. package/src/services/speed.ts +1056 -0
  541. package/src/services/ssl.ts +1587 -0
  542. package/src/services/stream.ts +2756 -0
  543. package/src/services/token-validation.ts +1585 -0
  544. package/src/services/turnstile.ts +643 -0
  545. package/src/services/url-normalization.ts +129 -0
  546. package/src/services/url-scanner.ts +1851 -0
  547. package/src/services/user.ts +1384 -0
  548. package/src/services/vectorize.ts +816 -0
  549. package/src/services/waiting-rooms.ts +3807 -0
  550. package/src/services/web3.ts +834 -0
  551. package/src/services/workers-for-platforms.ts +3859 -0
  552. package/src/services/workers.ts +11637 -0
  553. package/src/services/workflows.ts +1124 -0
  554. package/src/services/zaraz.ts +797 -0
  555. package/src/services/zero-trust.ts +58929 -0
  556. package/src/services/zones.ts +4875 -0
  557. package/src/traits.ts +47 -0
  558. package/bun.lock +0 -26
  559. package/index.ts +0 -1
  560. package/tsconfig.json +0 -29
@@ -0,0 +1,4750 @@
1
+ /**
2
+ * Cloudflare AISEARCH API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service aisearch
6
+ */
7
+
8
+ import * as Schema from "effect/Schema";
9
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
+ import * as API from "../client/api.ts";
11
+ import * as T from "../traits";
12
+ import type { Credentials } from "../credentials";
13
+ import { type DefaultErrors } from "../errors";
14
+
15
+ // =============================================================================
16
+ // Errors
17
+ // =============================================================================
18
+
19
+ export class InvalidRoute extends Schema.TaggedErrorClass<InvalidRoute>()(
20
+ "InvalidRoute",
21
+ { code: Schema.Number, message: Schema.String },
22
+ ) {}
23
+ T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
24
+
25
+ export class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
26
+ code: Schema.Number,
27
+ message: Schema.String,
28
+ }) {}
29
+ T.applyErrorMatchers(NotFound, [{ code: 7002 }]);
30
+
31
+ export class SyncInCooldown extends Schema.TaggedErrorClass<SyncInCooldown>()(
32
+ "SyncInCooldown",
33
+ { code: Schema.Number, message: Schema.String },
34
+ ) {}
35
+ T.applyErrorMatchers(SyncInCooldown, [{ code: 7020 }]);
36
+
37
+ export class UnableToConnect extends Schema.TaggedErrorClass<UnableToConnect>()(
38
+ "UnableToConnect",
39
+ { code: Schema.Number, message: Schema.String },
40
+ ) {}
41
+ T.applyErrorMatchers(UnableToConnect, [{ code: 7017 }]);
42
+
43
+ export class ValidationError extends Schema.TaggedErrorClass<ValidationError>()(
44
+ "ValidationError",
45
+ { code: Schema.Number, message: Schema.String },
46
+ ) {}
47
+ T.applyErrorMatchers(ValidationError, [{ code: 7001 }]);
48
+
49
+ // =============================================================================
50
+ // Instance
51
+ // =============================================================================
52
+
53
+ export interface ListInstancesRequest {
54
+ /** Path param: */
55
+ accountId: string;
56
+ /** Query param: Search by id */
57
+ search?: string;
58
+ }
59
+
60
+ export const ListInstancesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
61
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
62
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
63
+ }).pipe(
64
+ T.Http({ method: "GET", path: "/accounts/{account_id}/ai-search/instances" }),
65
+ ) as unknown as Schema.Schema<ListInstancesRequest>;
66
+
67
+ export type ListInstancesResponse = {
68
+ id: string;
69
+ accountId?: string | null;
70
+ accountTag?: string | null;
71
+ createdAt: string;
72
+ internalId?: string | null;
73
+ modifiedAt: string;
74
+ source: string;
75
+ tokenId: string;
76
+ type: "r2" | "web-crawler";
77
+ vectorizeName: string;
78
+ aiGatewayId?: string | null;
79
+ aiSearchModel?:
80
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
81
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
82
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
83
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
84
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
85
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
86
+ | "@cf/moonshotai/kimi-k2-instruct"
87
+ | "anthropic/claude-3-7-sonnet"
88
+ | "anthropic/claude-sonnet-4"
89
+ | "anthropic/claude-opus-4"
90
+ | "anthropic/claude-3-5-haiku"
91
+ | "cerebras/qwen-3-235b-a22b-instruct"
92
+ | "cerebras/qwen-3-235b-a22b-thinking"
93
+ | "cerebras/llama-3.3-70b"
94
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
95
+ | "cerebras/llama-4-scout-17b-16e-instruct"
96
+ | "cerebras/gpt-oss-120b"
97
+ | "google-ai-studio/gemini-2.5-flash"
98
+ | "google-ai-studio/gemini-2.5-pro"
99
+ | "grok/grok-4"
100
+ | "groq/llama-3.3-70b-versatile"
101
+ | "groq/llama-3.1-8b-instant"
102
+ | "openai/gpt-5"
103
+ | "openai/gpt-5-mini"
104
+ | "openai/gpt-5-nano"
105
+ | ""
106
+ | null;
107
+ cache?: boolean | null;
108
+ cacheThreshold?:
109
+ | "super_strict_match"
110
+ | "close_enough"
111
+ | "flexible_friend"
112
+ | "anything_goes"
113
+ | null;
114
+ chunk?: boolean | null;
115
+ chunkOverlap?: number | null;
116
+ chunkSize?: number | null;
117
+ createdBy?: string | null;
118
+ embeddingModel?:
119
+ | "@cf/baai/bge-m3"
120
+ | "@cf/baai/bge-large-en-v1.5"
121
+ | "@cf/google/embeddinggemma-300m"
122
+ | "@cf/qwen/qwen3-embedding-0.6b"
123
+ | "google-ai-studio/gemini-embedding-001"
124
+ | "openai/text-embedding-3-small"
125
+ | "openai/text-embedding-3-large"
126
+ | ""
127
+ | null;
128
+ enable?: boolean | null;
129
+ engineVersion?: number | null;
130
+ hybridSearchEnabled?: boolean | null;
131
+ lastActivity?: string | null;
132
+ maxNumResults?: number | null;
133
+ metadata?: {
134
+ createdFromAisearchWizard?: boolean | null;
135
+ workerDomain?: string | null;
136
+ } | null;
137
+ modifiedBy?: string | null;
138
+ paused?: boolean | null;
139
+ publicEndpointId?: string | null;
140
+ publicEndpointParams?: {
141
+ authorizedHosts?: string[] | null;
142
+ chatCompletionsEndpoint?: { disabled?: boolean | null } | null;
143
+ enabled?: boolean | null;
144
+ mcp?: { disabled?: boolean | null } | null;
145
+ rateLimit?: {
146
+ periodMs?: number | null;
147
+ requests?: number | null;
148
+ technique?: "fixed" | "sliding" | null;
149
+ } | null;
150
+ searchEndpoint?: { disabled?: boolean | null } | null;
151
+ } | null;
152
+ reranking?: boolean | null;
153
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "" | null;
154
+ rewriteModel?:
155
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
156
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
157
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
158
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
159
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
160
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
161
+ | "@cf/moonshotai/kimi-k2-instruct"
162
+ | "anthropic/claude-3-7-sonnet"
163
+ | "anthropic/claude-sonnet-4"
164
+ | "anthropic/claude-opus-4"
165
+ | "anthropic/claude-3-5-haiku"
166
+ | "cerebras/qwen-3-235b-a22b-instruct"
167
+ | "cerebras/qwen-3-235b-a22b-thinking"
168
+ | "cerebras/llama-3.3-70b"
169
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
170
+ | "cerebras/llama-4-scout-17b-16e-instruct"
171
+ | "cerebras/gpt-oss-120b"
172
+ | "google-ai-studio/gemini-2.5-flash"
173
+ | "google-ai-studio/gemini-2.5-pro"
174
+ | "grok/grok-4"
175
+ | "groq/llama-3.3-70b-versatile"
176
+ | "groq/llama-3.1-8b-instant"
177
+ | "openai/gpt-5"
178
+ | "openai/gpt-5-mini"
179
+ | "openai/gpt-5-nano"
180
+ | ""
181
+ | null;
182
+ rewriteQuery?: boolean | null;
183
+ scoreThreshold?: number | null;
184
+ sourceParams?: {
185
+ excludeItems?: string[] | null;
186
+ includeItems?: string[] | null;
187
+ prefix?: string | null;
188
+ r2Jurisdiction?: string | null;
189
+ webCrawler?: {
190
+ parseOptions?: {
191
+ includeHeaders?: Record<string, unknown> | null;
192
+ includeImages?: boolean | null;
193
+ useBrowserRendering?: boolean | null;
194
+ } | null;
195
+ parseType?: "sitemap" | "feed-rss" | null;
196
+ storeOptions?: {
197
+ storageId: string;
198
+ r2Jurisdiction?: string | null;
199
+ storageType?: "r2" | null;
200
+ } | null;
201
+ } | null;
202
+ } | null;
203
+ status?: string | null;
204
+ summarization?: boolean | null;
205
+ summarizationModel?:
206
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
207
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
208
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
209
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
210
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
211
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
212
+ | "@cf/moonshotai/kimi-k2-instruct"
213
+ | "anthropic/claude-3-7-sonnet"
214
+ | "anthropic/claude-sonnet-4"
215
+ | "anthropic/claude-opus-4"
216
+ | "anthropic/claude-3-5-haiku"
217
+ | "cerebras/qwen-3-235b-a22b-instruct"
218
+ | "cerebras/qwen-3-235b-a22b-thinking"
219
+ | "cerebras/llama-3.3-70b"
220
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
221
+ | "cerebras/llama-4-scout-17b-16e-instruct"
222
+ | "cerebras/gpt-oss-120b"
223
+ | "google-ai-studio/gemini-2.5-flash"
224
+ | "google-ai-studio/gemini-2.5-pro"
225
+ | "grok/grok-4"
226
+ | "groq/llama-3.3-70b-versatile"
227
+ | "groq/llama-3.1-8b-instant"
228
+ | "openai/gpt-5"
229
+ | "openai/gpt-5-mini"
230
+ | "openai/gpt-5-nano"
231
+ | ""
232
+ | null;
233
+ systemPromptAiSearch?: string | null;
234
+ systemPromptIndexSummarization?: string | null;
235
+ systemPromptRewriteQuery?: string | null;
236
+ vectorizeActiveNamespace?: string | null;
237
+ }[];
238
+
239
+ export const ListInstancesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
240
+ Schema.Struct({
241
+ id: Schema.String,
242
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
243
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
244
+ createdAt: Schema.String,
245
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
246
+ modifiedAt: Schema.String,
247
+ source: Schema.String,
248
+ tokenId: Schema.String,
249
+ type: Schema.Literals(["r2", "web-crawler"]),
250
+ vectorizeName: Schema.String,
251
+ aiGatewayId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
252
+ aiSearchModel: Schema.optional(
253
+ Schema.Union([
254
+ Schema.Literals([
255
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
256
+ "@cf/meta/llama-3.1-8b-instruct-fast",
257
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
258
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
259
+ "@cf/qwen/qwen3-30b-a3b-fp8",
260
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
261
+ "@cf/moonshotai/kimi-k2-instruct",
262
+ "anthropic/claude-3-7-sonnet",
263
+ "anthropic/claude-sonnet-4",
264
+ "anthropic/claude-opus-4",
265
+ "anthropic/claude-3-5-haiku",
266
+ "cerebras/qwen-3-235b-a22b-instruct",
267
+ "cerebras/qwen-3-235b-a22b-thinking",
268
+ "cerebras/llama-3.3-70b",
269
+ "cerebras/llama-4-maverick-17b-128e-instruct",
270
+ "cerebras/llama-4-scout-17b-16e-instruct",
271
+ "cerebras/gpt-oss-120b",
272
+ "google-ai-studio/gemini-2.5-flash",
273
+ "google-ai-studio/gemini-2.5-pro",
274
+ "grok/grok-4",
275
+ "groq/llama-3.3-70b-versatile",
276
+ "groq/llama-3.1-8b-instant",
277
+ "openai/gpt-5",
278
+ "openai/gpt-5-mini",
279
+ "openai/gpt-5-nano",
280
+ "",
281
+ ]),
282
+ Schema.Null,
283
+ ]),
284
+ ),
285
+ cache: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
286
+ cacheThreshold: Schema.optional(
287
+ Schema.Union([
288
+ Schema.Literal("super_strict_match"),
289
+ Schema.Literal("close_enough"),
290
+ Schema.Literal("flexible_friend"),
291
+ Schema.Literal("anything_goes"),
292
+ Schema.Null,
293
+ ]),
294
+ ),
295
+ chunk: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
296
+ chunkOverlap: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
297
+ chunkSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
298
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
299
+ embeddingModel: Schema.optional(
300
+ Schema.Union([
301
+ Schema.Literals([
302
+ "@cf/baai/bge-m3",
303
+ "@cf/baai/bge-large-en-v1.5",
304
+ "@cf/google/embeddinggemma-300m",
305
+ "@cf/qwen/qwen3-embedding-0.6b",
306
+ "google-ai-studio/gemini-embedding-001",
307
+ "openai/text-embedding-3-small",
308
+ "openai/text-embedding-3-large",
309
+ "",
310
+ ]),
311
+ Schema.Null,
312
+ ]),
313
+ ),
314
+ enable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
315
+ engineVersion: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
316
+ hybridSearchEnabled: Schema.optional(
317
+ Schema.Union([Schema.Boolean, Schema.Null]),
318
+ ),
319
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
320
+ maxNumResults: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
321
+ metadata: Schema.optional(
322
+ Schema.Union([
323
+ Schema.Struct({
324
+ createdFromAisearchWizard: Schema.optional(
325
+ Schema.Union([Schema.Boolean, Schema.Null]),
326
+ ),
327
+ workerDomain: Schema.optional(
328
+ Schema.Union([Schema.String, Schema.Null]),
329
+ ),
330
+ }).pipe(
331
+ Schema.encodeKeys({
332
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
333
+ workerDomain: "worker_domain",
334
+ }),
335
+ ),
336
+ Schema.Null,
337
+ ]),
338
+ ),
339
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
340
+ paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
341
+ publicEndpointId: Schema.optional(
342
+ Schema.Union([Schema.String, Schema.Null]),
343
+ ),
344
+ publicEndpointParams: Schema.optional(
345
+ Schema.Union([
346
+ Schema.Struct({
347
+ authorizedHosts: Schema.optional(
348
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
349
+ ),
350
+ chatCompletionsEndpoint: Schema.optional(
351
+ Schema.Union([
352
+ Schema.Struct({
353
+ disabled: Schema.optional(
354
+ Schema.Union([Schema.Boolean, Schema.Null]),
355
+ ),
356
+ }),
357
+ Schema.Null,
358
+ ]),
359
+ ),
360
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
361
+ mcp: Schema.optional(
362
+ Schema.Union([
363
+ Schema.Struct({
364
+ disabled: Schema.optional(
365
+ Schema.Union([Schema.Boolean, Schema.Null]),
366
+ ),
367
+ }),
368
+ Schema.Null,
369
+ ]),
370
+ ),
371
+ rateLimit: Schema.optional(
372
+ Schema.Union([
373
+ Schema.Struct({
374
+ periodMs: Schema.optional(
375
+ Schema.Union([Schema.Number, Schema.Null]),
376
+ ),
377
+ requests: Schema.optional(
378
+ Schema.Union([Schema.Number, Schema.Null]),
379
+ ),
380
+ technique: Schema.optional(
381
+ Schema.Union([
382
+ Schema.Literals(["fixed", "sliding"]),
383
+ Schema.Null,
384
+ ]),
385
+ ),
386
+ }).pipe(
387
+ Schema.encodeKeys({
388
+ periodMs: "period_ms",
389
+ requests: "requests",
390
+ technique: "technique",
391
+ }),
392
+ ),
393
+ Schema.Null,
394
+ ]),
395
+ ),
396
+ searchEndpoint: Schema.optional(
397
+ Schema.Union([
398
+ Schema.Struct({
399
+ disabled: Schema.optional(
400
+ Schema.Union([Schema.Boolean, Schema.Null]),
401
+ ),
402
+ }),
403
+ Schema.Null,
404
+ ]),
405
+ ),
406
+ }).pipe(
407
+ Schema.encodeKeys({
408
+ authorizedHosts: "authorized_hosts",
409
+ chatCompletionsEndpoint: "chat_completions_endpoint",
410
+ enabled: "enabled",
411
+ mcp: "mcp",
412
+ rateLimit: "rate_limit",
413
+ searchEndpoint: "search_endpoint",
414
+ }),
415
+ ),
416
+ Schema.Null,
417
+ ]),
418
+ ),
419
+ reranking: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
420
+ rerankingModel: Schema.optional(
421
+ Schema.Union([
422
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
423
+ Schema.Null,
424
+ ]),
425
+ ),
426
+ rewriteModel: Schema.optional(
427
+ Schema.Union([
428
+ Schema.Literals([
429
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
430
+ "@cf/meta/llama-3.1-8b-instruct-fast",
431
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
432
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
433
+ "@cf/qwen/qwen3-30b-a3b-fp8",
434
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
435
+ "@cf/moonshotai/kimi-k2-instruct",
436
+ "anthropic/claude-3-7-sonnet",
437
+ "anthropic/claude-sonnet-4",
438
+ "anthropic/claude-opus-4",
439
+ "anthropic/claude-3-5-haiku",
440
+ "cerebras/qwen-3-235b-a22b-instruct",
441
+ "cerebras/qwen-3-235b-a22b-thinking",
442
+ "cerebras/llama-3.3-70b",
443
+ "cerebras/llama-4-maverick-17b-128e-instruct",
444
+ "cerebras/llama-4-scout-17b-16e-instruct",
445
+ "cerebras/gpt-oss-120b",
446
+ "google-ai-studio/gemini-2.5-flash",
447
+ "google-ai-studio/gemini-2.5-pro",
448
+ "grok/grok-4",
449
+ "groq/llama-3.3-70b-versatile",
450
+ "groq/llama-3.1-8b-instant",
451
+ "openai/gpt-5",
452
+ "openai/gpt-5-mini",
453
+ "openai/gpt-5-nano",
454
+ "",
455
+ ]),
456
+ Schema.Null,
457
+ ]),
458
+ ),
459
+ rewriteQuery: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
460
+ scoreThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
461
+ sourceParams: Schema.optional(
462
+ Schema.Union([
463
+ Schema.Struct({
464
+ excludeItems: Schema.optional(
465
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
466
+ ),
467
+ includeItems: Schema.optional(
468
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
469
+ ),
470
+ prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
471
+ r2Jurisdiction: Schema.optional(
472
+ Schema.Union([Schema.String, Schema.Null]),
473
+ ),
474
+ webCrawler: Schema.optional(
475
+ Schema.Union([
476
+ Schema.Struct({
477
+ parseOptions: Schema.optional(
478
+ Schema.Union([
479
+ Schema.Struct({
480
+ includeHeaders: Schema.optional(
481
+ Schema.Union([Schema.Struct({}), Schema.Null]),
482
+ ),
483
+ includeImages: Schema.optional(
484
+ Schema.Union([Schema.Boolean, Schema.Null]),
485
+ ),
486
+ useBrowserRendering: Schema.optional(
487
+ Schema.Union([Schema.Boolean, Schema.Null]),
488
+ ),
489
+ }).pipe(
490
+ Schema.encodeKeys({
491
+ includeHeaders: "include_headers",
492
+ includeImages: "include_images",
493
+ useBrowserRendering: "use_browser_rendering",
494
+ }),
495
+ ),
496
+ Schema.Null,
497
+ ]),
498
+ ),
499
+ parseType: Schema.optional(
500
+ Schema.Union([
501
+ Schema.Literals(["sitemap", "feed-rss"]),
502
+ Schema.Null,
503
+ ]),
504
+ ),
505
+ storeOptions: Schema.optional(
506
+ Schema.Union([
507
+ Schema.Struct({
508
+ storageId: Schema.String,
509
+ r2Jurisdiction: Schema.optional(
510
+ Schema.Union([Schema.String, Schema.Null]),
511
+ ),
512
+ storageType: Schema.optional(
513
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
514
+ ),
515
+ }).pipe(
516
+ Schema.encodeKeys({
517
+ storageId: "storage_id",
518
+ r2Jurisdiction: "r2_jurisdiction",
519
+ storageType: "storage_type",
520
+ }),
521
+ ),
522
+ Schema.Null,
523
+ ]),
524
+ ),
525
+ }).pipe(
526
+ Schema.encodeKeys({
527
+ parseOptions: "parse_options",
528
+ parseType: "parse_type",
529
+ storeOptions: "store_options",
530
+ }),
531
+ ),
532
+ Schema.Null,
533
+ ]),
534
+ ),
535
+ }).pipe(
536
+ Schema.encodeKeys({
537
+ excludeItems: "exclude_items",
538
+ includeItems: "include_items",
539
+ prefix: "prefix",
540
+ r2Jurisdiction: "r2_jurisdiction",
541
+ webCrawler: "web_crawler",
542
+ }),
543
+ ),
544
+ Schema.Null,
545
+ ]),
546
+ ),
547
+ status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
548
+ summarization: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
549
+ summarizationModel: Schema.optional(
550
+ Schema.Union([
551
+ Schema.Literals([
552
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
553
+ "@cf/meta/llama-3.1-8b-instruct-fast",
554
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
555
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
556
+ "@cf/qwen/qwen3-30b-a3b-fp8",
557
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
558
+ "@cf/moonshotai/kimi-k2-instruct",
559
+ "anthropic/claude-3-7-sonnet",
560
+ "anthropic/claude-sonnet-4",
561
+ "anthropic/claude-opus-4",
562
+ "anthropic/claude-3-5-haiku",
563
+ "cerebras/qwen-3-235b-a22b-instruct",
564
+ "cerebras/qwen-3-235b-a22b-thinking",
565
+ "cerebras/llama-3.3-70b",
566
+ "cerebras/llama-4-maverick-17b-128e-instruct",
567
+ "cerebras/llama-4-scout-17b-16e-instruct",
568
+ "cerebras/gpt-oss-120b",
569
+ "google-ai-studio/gemini-2.5-flash",
570
+ "google-ai-studio/gemini-2.5-pro",
571
+ "grok/grok-4",
572
+ "groq/llama-3.3-70b-versatile",
573
+ "groq/llama-3.1-8b-instant",
574
+ "openai/gpt-5",
575
+ "openai/gpt-5-mini",
576
+ "openai/gpt-5-nano",
577
+ "",
578
+ ]),
579
+ Schema.Null,
580
+ ]),
581
+ ),
582
+ systemPromptAiSearch: Schema.optional(
583
+ Schema.Union([Schema.String, Schema.Null]),
584
+ ),
585
+ systemPromptIndexSummarization: Schema.optional(
586
+ Schema.Union([Schema.String, Schema.Null]),
587
+ ),
588
+ systemPromptRewriteQuery: Schema.optional(
589
+ Schema.Union([Schema.String, Schema.Null]),
590
+ ),
591
+ vectorizeActiveNamespace: Schema.optional(
592
+ Schema.Union([Schema.String, Schema.Null]),
593
+ ),
594
+ }).pipe(
595
+ Schema.encodeKeys({
596
+ id: "id",
597
+ accountId: "account_id",
598
+ accountTag: "account_tag",
599
+ createdAt: "created_at",
600
+ internalId: "internal_id",
601
+ modifiedAt: "modified_at",
602
+ source: "source",
603
+ tokenId: "token_id",
604
+ type: "type",
605
+ vectorizeName: "vectorize_name",
606
+ aiGatewayId: "ai_gateway_id",
607
+ aiSearchModel: "ai_search_model",
608
+ cache: "cache",
609
+ cacheThreshold: "cache_threshold",
610
+ chunk: "chunk",
611
+ chunkOverlap: "chunk_overlap",
612
+ chunkSize: "chunk_size",
613
+ createdBy: "created_by",
614
+ embeddingModel: "embedding_model",
615
+ enable: "enable",
616
+ engineVersion: "engine_version",
617
+ hybridSearchEnabled: "hybrid_search_enabled",
618
+ lastActivity: "last_activity",
619
+ maxNumResults: "max_num_results",
620
+ metadata: "metadata",
621
+ modifiedBy: "modified_by",
622
+ paused: "paused",
623
+ publicEndpointId: "public_endpoint_id",
624
+ publicEndpointParams: "public_endpoint_params",
625
+ reranking: "reranking",
626
+ rerankingModel: "reranking_model",
627
+ rewriteModel: "rewrite_model",
628
+ rewriteQuery: "rewrite_query",
629
+ scoreThreshold: "score_threshold",
630
+ sourceParams: "source_params",
631
+ status: "status",
632
+ summarization: "summarization",
633
+ summarizationModel: "summarization_model",
634
+ systemPromptAiSearch: "system_prompt_ai_search",
635
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
636
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
637
+ vectorizeActiveNamespace: "vectorize_active_namespace",
638
+ }),
639
+ ),
640
+ ) as unknown as Schema.Schema<ListInstancesResponse>;
641
+
642
+ export type ListInstancesError = DefaultErrors | InvalidRoute;
643
+
644
+ export const listInstances: API.OperationMethod<
645
+ ListInstancesRequest,
646
+ ListInstancesResponse,
647
+ ListInstancesError,
648
+ Credentials | HttpClient.HttpClient
649
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
650
+ input: ListInstancesRequest,
651
+ output: ListInstancesResponse,
652
+ errors: [InvalidRoute],
653
+ }));
654
+
655
+ export interface CreateInstanceRequest {
656
+ /** Path param: */
657
+ accountId: string;
658
+ /** Body param: Use your AI Search ID. */
659
+ id: string;
660
+ /** Body param: */
661
+ source: string;
662
+ /** Body param: */
663
+ tokenId: string;
664
+ /** Body param: */
665
+ type: "r2" | "web-crawler";
666
+ /** Body param: */
667
+ aiGatewayId?: string;
668
+ /** Body param: */
669
+ aiSearchModel?:
670
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
671
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
672
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
673
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
674
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
675
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
676
+ | "@cf/moonshotai/kimi-k2-instruct"
677
+ | "anthropic/claude-3-7-sonnet"
678
+ | "anthropic/claude-sonnet-4"
679
+ | "anthropic/claude-opus-4"
680
+ | "anthropic/claude-3-5-haiku"
681
+ | "cerebras/qwen-3-235b-a22b-instruct"
682
+ | "cerebras/qwen-3-235b-a22b-thinking"
683
+ | "cerebras/llama-3.3-70b"
684
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
685
+ | "cerebras/llama-4-scout-17b-16e-instruct"
686
+ | "cerebras/gpt-oss-120b"
687
+ | "google-ai-studio/gemini-2.5-flash"
688
+ | "google-ai-studio/gemini-2.5-pro"
689
+ | "grok/grok-4"
690
+ | "groq/llama-3.3-70b-versatile"
691
+ | "groq/llama-3.1-8b-instant"
692
+ | "openai/gpt-5"
693
+ | "openai/gpt-5-mini"
694
+ | "openai/gpt-5-nano"
695
+ | "";
696
+ /** Body param: */
697
+ chunk?: boolean;
698
+ /** Body param: */
699
+ chunkOverlap?: number;
700
+ /** Body param: */
701
+ chunkSize?: number;
702
+ /** Body param: */
703
+ embeddingModel?:
704
+ | "@cf/baai/bge-m3"
705
+ | "@cf/baai/bge-large-en-v1.5"
706
+ | "@cf/google/embeddinggemma-300m"
707
+ | "@cf/qwen/qwen3-embedding-0.6b"
708
+ | "google-ai-studio/gemini-embedding-001"
709
+ | "openai/text-embedding-3-small"
710
+ | "openai/text-embedding-3-large"
711
+ | "";
712
+ /** Body param: */
713
+ hybridSearchEnabled?: boolean;
714
+ /** Body param: */
715
+ maxNumResults?: number;
716
+ /** Body param: */
717
+ metadata?: { createdFromAisearchWizard?: boolean; workerDomain?: string };
718
+ /** Body param: */
719
+ publicEndpointParams?: {
720
+ authorizedHosts?: string[];
721
+ chatCompletionsEndpoint?: { disabled?: boolean };
722
+ enabled?: boolean;
723
+ mcp?: { disabled?: boolean };
724
+ rateLimit?: {
725
+ periodMs?: number;
726
+ requests?: number;
727
+ technique?: "fixed" | "sliding";
728
+ };
729
+ searchEndpoint?: { disabled?: boolean };
730
+ };
731
+ /** Body param: */
732
+ reranking?: boolean;
733
+ /** Body param: */
734
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "";
735
+ /** Body param: */
736
+ rewriteModel?:
737
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
738
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
739
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
740
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
741
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
742
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
743
+ | "@cf/moonshotai/kimi-k2-instruct"
744
+ | "anthropic/claude-3-7-sonnet"
745
+ | "anthropic/claude-sonnet-4"
746
+ | "anthropic/claude-opus-4"
747
+ | "anthropic/claude-3-5-haiku"
748
+ | "cerebras/qwen-3-235b-a22b-instruct"
749
+ | "cerebras/qwen-3-235b-a22b-thinking"
750
+ | "cerebras/llama-3.3-70b"
751
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
752
+ | "cerebras/llama-4-scout-17b-16e-instruct"
753
+ | "cerebras/gpt-oss-120b"
754
+ | "google-ai-studio/gemini-2.5-flash"
755
+ | "google-ai-studio/gemini-2.5-pro"
756
+ | "grok/grok-4"
757
+ | "groq/llama-3.3-70b-versatile"
758
+ | "groq/llama-3.1-8b-instant"
759
+ | "openai/gpt-5"
760
+ | "openai/gpt-5-mini"
761
+ | "openai/gpt-5-nano"
762
+ | "";
763
+ /** Body param: */
764
+ rewriteQuery?: boolean;
765
+ /** Body param: */
766
+ scoreThreshold?: number;
767
+ /** Body param: */
768
+ sourceParams?: {
769
+ excludeItems?: string[];
770
+ includeItems?: string[];
771
+ prefix?: string;
772
+ r2Jurisdiction?: string;
773
+ webCrawler?: {
774
+ parseOptions?: {
775
+ includeHeaders?: Record<string, unknown>;
776
+ includeImages?: boolean;
777
+ useBrowserRendering?: boolean;
778
+ };
779
+ parseType?: "sitemap" | "feed-rss";
780
+ storeOptions?: {
781
+ storageId: string;
782
+ r2Jurisdiction?: string;
783
+ storageType?: "r2";
784
+ };
785
+ };
786
+ };
787
+ }
788
+
789
+ export const CreateInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
790
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
791
+ id: Schema.String,
792
+ source: Schema.String,
793
+ tokenId: Schema.String,
794
+ type: Schema.Literals(["r2", "web-crawler"]),
795
+ aiGatewayId: Schema.optional(Schema.String),
796
+ aiSearchModel: Schema.optional(
797
+ Schema.Literals([
798
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
799
+ "@cf/meta/llama-3.1-8b-instruct-fast",
800
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
801
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
802
+ "@cf/qwen/qwen3-30b-a3b-fp8",
803
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
804
+ "@cf/moonshotai/kimi-k2-instruct",
805
+ "anthropic/claude-3-7-sonnet",
806
+ "anthropic/claude-sonnet-4",
807
+ "anthropic/claude-opus-4",
808
+ "anthropic/claude-3-5-haiku",
809
+ "cerebras/qwen-3-235b-a22b-instruct",
810
+ "cerebras/qwen-3-235b-a22b-thinking",
811
+ "cerebras/llama-3.3-70b",
812
+ "cerebras/llama-4-maverick-17b-128e-instruct",
813
+ "cerebras/llama-4-scout-17b-16e-instruct",
814
+ "cerebras/gpt-oss-120b",
815
+ "google-ai-studio/gemini-2.5-flash",
816
+ "google-ai-studio/gemini-2.5-pro",
817
+ "grok/grok-4",
818
+ "groq/llama-3.3-70b-versatile",
819
+ "groq/llama-3.1-8b-instant",
820
+ "openai/gpt-5",
821
+ "openai/gpt-5-mini",
822
+ "openai/gpt-5-nano",
823
+ "",
824
+ ]),
825
+ ),
826
+ chunk: Schema.optional(Schema.Boolean),
827
+ chunkOverlap: Schema.optional(Schema.Number),
828
+ chunkSize: Schema.optional(Schema.Number),
829
+ embeddingModel: Schema.optional(
830
+ Schema.Literals([
831
+ "@cf/baai/bge-m3",
832
+ "@cf/baai/bge-large-en-v1.5",
833
+ "@cf/google/embeddinggemma-300m",
834
+ "@cf/qwen/qwen3-embedding-0.6b",
835
+ "google-ai-studio/gemini-embedding-001",
836
+ "openai/text-embedding-3-small",
837
+ "openai/text-embedding-3-large",
838
+ "",
839
+ ]),
840
+ ),
841
+ hybridSearchEnabled: Schema.optional(Schema.Boolean),
842
+ maxNumResults: Schema.optional(Schema.Number),
843
+ metadata: Schema.optional(
844
+ Schema.Struct({
845
+ createdFromAisearchWizard: Schema.optional(Schema.Boolean),
846
+ workerDomain: Schema.optional(Schema.String),
847
+ }).pipe(
848
+ Schema.encodeKeys({
849
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
850
+ workerDomain: "worker_domain",
851
+ }),
852
+ ),
853
+ ),
854
+ publicEndpointParams: Schema.optional(
855
+ Schema.Struct({
856
+ authorizedHosts: Schema.optional(Schema.Array(Schema.String)),
857
+ chatCompletionsEndpoint: Schema.optional(
858
+ Schema.Struct({
859
+ disabled: Schema.optional(Schema.Boolean),
860
+ }),
861
+ ),
862
+ enabled: Schema.optional(Schema.Boolean),
863
+ mcp: Schema.optional(
864
+ Schema.Struct({
865
+ disabled: Schema.optional(Schema.Boolean),
866
+ }),
867
+ ),
868
+ rateLimit: Schema.optional(
869
+ Schema.Struct({
870
+ periodMs: Schema.optional(Schema.Number),
871
+ requests: Schema.optional(Schema.Number),
872
+ technique: Schema.optional(Schema.Literals(["fixed", "sliding"])),
873
+ }).pipe(
874
+ Schema.encodeKeys({
875
+ periodMs: "period_ms",
876
+ requests: "requests",
877
+ technique: "technique",
878
+ }),
879
+ ),
880
+ ),
881
+ searchEndpoint: Schema.optional(
882
+ Schema.Struct({
883
+ disabled: Schema.optional(Schema.Boolean),
884
+ }),
885
+ ),
886
+ }).pipe(
887
+ Schema.encodeKeys({
888
+ authorizedHosts: "authorized_hosts",
889
+ chatCompletionsEndpoint: "chat_completions_endpoint",
890
+ enabled: "enabled",
891
+ mcp: "mcp",
892
+ rateLimit: "rate_limit",
893
+ searchEndpoint: "search_endpoint",
894
+ }),
895
+ ),
896
+ ),
897
+ reranking: Schema.optional(Schema.Boolean),
898
+ rerankingModel: Schema.optional(
899
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
900
+ ),
901
+ rewriteModel: Schema.optional(
902
+ Schema.Literals([
903
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
904
+ "@cf/meta/llama-3.1-8b-instruct-fast",
905
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
906
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
907
+ "@cf/qwen/qwen3-30b-a3b-fp8",
908
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
909
+ "@cf/moonshotai/kimi-k2-instruct",
910
+ "anthropic/claude-3-7-sonnet",
911
+ "anthropic/claude-sonnet-4",
912
+ "anthropic/claude-opus-4",
913
+ "anthropic/claude-3-5-haiku",
914
+ "cerebras/qwen-3-235b-a22b-instruct",
915
+ "cerebras/qwen-3-235b-a22b-thinking",
916
+ "cerebras/llama-3.3-70b",
917
+ "cerebras/llama-4-maverick-17b-128e-instruct",
918
+ "cerebras/llama-4-scout-17b-16e-instruct",
919
+ "cerebras/gpt-oss-120b",
920
+ "google-ai-studio/gemini-2.5-flash",
921
+ "google-ai-studio/gemini-2.5-pro",
922
+ "grok/grok-4",
923
+ "groq/llama-3.3-70b-versatile",
924
+ "groq/llama-3.1-8b-instant",
925
+ "openai/gpt-5",
926
+ "openai/gpt-5-mini",
927
+ "openai/gpt-5-nano",
928
+ "",
929
+ ]),
930
+ ),
931
+ rewriteQuery: Schema.optional(Schema.Boolean),
932
+ scoreThreshold: Schema.optional(Schema.Number),
933
+ sourceParams: Schema.optional(
934
+ Schema.Struct({
935
+ excludeItems: Schema.optional(Schema.Array(Schema.String)),
936
+ includeItems: Schema.optional(Schema.Array(Schema.String)),
937
+ prefix: Schema.optional(Schema.String),
938
+ r2Jurisdiction: Schema.optional(Schema.String),
939
+ webCrawler: Schema.optional(
940
+ Schema.Struct({
941
+ parseOptions: Schema.optional(
942
+ Schema.Struct({
943
+ includeHeaders: Schema.optional(Schema.Struct({})),
944
+ includeImages: Schema.optional(Schema.Boolean),
945
+ useBrowserRendering: Schema.optional(Schema.Boolean),
946
+ }).pipe(
947
+ Schema.encodeKeys({
948
+ includeHeaders: "include_headers",
949
+ includeImages: "include_images",
950
+ useBrowserRendering: "use_browser_rendering",
951
+ }),
952
+ ),
953
+ ),
954
+ parseType: Schema.optional(Schema.Literals(["sitemap", "feed-rss"])),
955
+ storeOptions: Schema.optional(
956
+ Schema.Struct({
957
+ storageId: Schema.String,
958
+ r2Jurisdiction: Schema.optional(Schema.String),
959
+ storageType: Schema.optional(Schema.Literal("r2")),
960
+ }).pipe(
961
+ Schema.encodeKeys({
962
+ storageId: "storage_id",
963
+ r2Jurisdiction: "r2_jurisdiction",
964
+ storageType: "storage_type",
965
+ }),
966
+ ),
967
+ ),
968
+ }).pipe(
969
+ Schema.encodeKeys({
970
+ parseOptions: "parse_options",
971
+ parseType: "parse_type",
972
+ storeOptions: "store_options",
973
+ }),
974
+ ),
975
+ ),
976
+ }).pipe(
977
+ Schema.encodeKeys({
978
+ excludeItems: "exclude_items",
979
+ includeItems: "include_items",
980
+ prefix: "prefix",
981
+ r2Jurisdiction: "r2_jurisdiction",
982
+ webCrawler: "web_crawler",
983
+ }),
984
+ ),
985
+ ),
986
+ }).pipe(
987
+ Schema.encodeKeys({
988
+ id: "id",
989
+ source: "source",
990
+ tokenId: "token_id",
991
+ type: "type",
992
+ aiGatewayId: "ai_gateway_id",
993
+ aiSearchModel: "ai_search_model",
994
+ chunk: "chunk",
995
+ chunkOverlap: "chunk_overlap",
996
+ chunkSize: "chunk_size",
997
+ embeddingModel: "embedding_model",
998
+ hybridSearchEnabled: "hybrid_search_enabled",
999
+ maxNumResults: "max_num_results",
1000
+ metadata: "metadata",
1001
+ publicEndpointParams: "public_endpoint_params",
1002
+ reranking: "reranking",
1003
+ rerankingModel: "reranking_model",
1004
+ rewriteModel: "rewrite_model",
1005
+ rewriteQuery: "rewrite_query",
1006
+ scoreThreshold: "score_threshold",
1007
+ sourceParams: "source_params",
1008
+ }),
1009
+ T.Http({
1010
+ method: "POST",
1011
+ path: "/accounts/{account_id}/ai-search/instances",
1012
+ }),
1013
+ ) as unknown as Schema.Schema<CreateInstanceRequest>;
1014
+
1015
+ export interface CreateInstanceResponse {
1016
+ /** Use your AI Search ID. */
1017
+ id: string;
1018
+ accountId?: string | null;
1019
+ accountTag?: string | null;
1020
+ createdAt: string;
1021
+ internalId?: string | null;
1022
+ modifiedAt: string;
1023
+ source: string;
1024
+ tokenId: string;
1025
+ type: "r2" | "web-crawler";
1026
+ vectorizeName: string;
1027
+ aiGatewayId?: string | null;
1028
+ aiSearchModel?:
1029
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1030
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1031
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1032
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1033
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1034
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1035
+ | "@cf/moonshotai/kimi-k2-instruct"
1036
+ | "anthropic/claude-3-7-sonnet"
1037
+ | "anthropic/claude-sonnet-4"
1038
+ | "anthropic/claude-opus-4"
1039
+ | "anthropic/claude-3-5-haiku"
1040
+ | "cerebras/qwen-3-235b-a22b-instruct"
1041
+ | "cerebras/qwen-3-235b-a22b-thinking"
1042
+ | "cerebras/llama-3.3-70b"
1043
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1044
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1045
+ | "cerebras/gpt-oss-120b"
1046
+ | "google-ai-studio/gemini-2.5-flash"
1047
+ | "google-ai-studio/gemini-2.5-pro"
1048
+ | "grok/grok-4"
1049
+ | "groq/llama-3.3-70b-versatile"
1050
+ | "groq/llama-3.1-8b-instant"
1051
+ | "openai/gpt-5"
1052
+ | "openai/gpt-5-mini"
1053
+ | "openai/gpt-5-nano"
1054
+ | ""
1055
+ | null;
1056
+ cache?: boolean | null;
1057
+ cacheThreshold?:
1058
+ | "super_strict_match"
1059
+ | "close_enough"
1060
+ | "flexible_friend"
1061
+ | "anything_goes"
1062
+ | null;
1063
+ chunk?: boolean | null;
1064
+ chunkOverlap?: number | null;
1065
+ chunkSize?: number | null;
1066
+ createdBy?: string | null;
1067
+ embeddingModel?:
1068
+ | "@cf/baai/bge-m3"
1069
+ | "@cf/baai/bge-large-en-v1.5"
1070
+ | "@cf/google/embeddinggemma-300m"
1071
+ | "@cf/qwen/qwen3-embedding-0.6b"
1072
+ | "google-ai-studio/gemini-embedding-001"
1073
+ | "openai/text-embedding-3-small"
1074
+ | "openai/text-embedding-3-large"
1075
+ | ""
1076
+ | null;
1077
+ enable?: boolean | null;
1078
+ engineVersion?: number | null;
1079
+ hybridSearchEnabled?: boolean | null;
1080
+ lastActivity?: string | null;
1081
+ maxNumResults?: number | null;
1082
+ metadata?: {
1083
+ createdFromAisearchWizard?: boolean | null;
1084
+ workerDomain?: string | null;
1085
+ } | null;
1086
+ modifiedBy?: string | null;
1087
+ paused?: boolean | null;
1088
+ publicEndpointId?: string | null;
1089
+ publicEndpointParams?: {
1090
+ authorizedHosts?: string[] | null;
1091
+ chatCompletionsEndpoint?: { disabled?: boolean | null } | null;
1092
+ enabled?: boolean | null;
1093
+ mcp?: { disabled?: boolean | null } | null;
1094
+ rateLimit?: {
1095
+ periodMs?: number | null;
1096
+ requests?: number | null;
1097
+ technique?: "fixed" | "sliding" | null;
1098
+ } | null;
1099
+ searchEndpoint?: { disabled?: boolean | null } | null;
1100
+ } | null;
1101
+ reranking?: boolean | null;
1102
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "" | null;
1103
+ rewriteModel?:
1104
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1105
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1106
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1107
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1108
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1109
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1110
+ | "@cf/moonshotai/kimi-k2-instruct"
1111
+ | "anthropic/claude-3-7-sonnet"
1112
+ | "anthropic/claude-sonnet-4"
1113
+ | "anthropic/claude-opus-4"
1114
+ | "anthropic/claude-3-5-haiku"
1115
+ | "cerebras/qwen-3-235b-a22b-instruct"
1116
+ | "cerebras/qwen-3-235b-a22b-thinking"
1117
+ | "cerebras/llama-3.3-70b"
1118
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1119
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1120
+ | "cerebras/gpt-oss-120b"
1121
+ | "google-ai-studio/gemini-2.5-flash"
1122
+ | "google-ai-studio/gemini-2.5-pro"
1123
+ | "grok/grok-4"
1124
+ | "groq/llama-3.3-70b-versatile"
1125
+ | "groq/llama-3.1-8b-instant"
1126
+ | "openai/gpt-5"
1127
+ | "openai/gpt-5-mini"
1128
+ | "openai/gpt-5-nano"
1129
+ | ""
1130
+ | null;
1131
+ rewriteQuery?: boolean | null;
1132
+ scoreThreshold?: number | null;
1133
+ sourceParams?: {
1134
+ excludeItems?: string[] | null;
1135
+ includeItems?: string[] | null;
1136
+ prefix?: string | null;
1137
+ r2Jurisdiction?: string | null;
1138
+ webCrawler?: {
1139
+ parseOptions?: {
1140
+ includeHeaders?: Record<string, unknown> | null;
1141
+ includeImages?: boolean | null;
1142
+ useBrowserRendering?: boolean | null;
1143
+ } | null;
1144
+ parseType?: "sitemap" | "feed-rss" | null;
1145
+ storeOptions?: {
1146
+ storageId: string;
1147
+ r2Jurisdiction?: string | null;
1148
+ storageType?: "r2" | null;
1149
+ } | null;
1150
+ } | null;
1151
+ } | null;
1152
+ status?: string | null;
1153
+ summarization?: boolean | null;
1154
+ summarizationModel?:
1155
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1156
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1157
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1158
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1159
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1160
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1161
+ | "@cf/moonshotai/kimi-k2-instruct"
1162
+ | "anthropic/claude-3-7-sonnet"
1163
+ | "anthropic/claude-sonnet-4"
1164
+ | "anthropic/claude-opus-4"
1165
+ | "anthropic/claude-3-5-haiku"
1166
+ | "cerebras/qwen-3-235b-a22b-instruct"
1167
+ | "cerebras/qwen-3-235b-a22b-thinking"
1168
+ | "cerebras/llama-3.3-70b"
1169
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1170
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1171
+ | "cerebras/gpt-oss-120b"
1172
+ | "google-ai-studio/gemini-2.5-flash"
1173
+ | "google-ai-studio/gemini-2.5-pro"
1174
+ | "grok/grok-4"
1175
+ | "groq/llama-3.3-70b-versatile"
1176
+ | "groq/llama-3.1-8b-instant"
1177
+ | "openai/gpt-5"
1178
+ | "openai/gpt-5-mini"
1179
+ | "openai/gpt-5-nano"
1180
+ | ""
1181
+ | null;
1182
+ systemPromptAiSearch?: string | null;
1183
+ systemPromptIndexSummarization?: string | null;
1184
+ systemPromptRewriteQuery?: string | null;
1185
+ vectorizeActiveNamespace?: string | null;
1186
+ }
1187
+
1188
+ export const CreateInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
1189
+ {
1190
+ id: Schema.String,
1191
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1192
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1193
+ createdAt: Schema.String,
1194
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1195
+ modifiedAt: Schema.String,
1196
+ source: Schema.String,
1197
+ tokenId: Schema.String,
1198
+ type: Schema.Literals(["r2", "web-crawler"]),
1199
+ vectorizeName: Schema.String,
1200
+ aiGatewayId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1201
+ aiSearchModel: Schema.optional(
1202
+ Schema.Union([
1203
+ Schema.Literals([
1204
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1205
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1206
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1207
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1208
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1209
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1210
+ "@cf/moonshotai/kimi-k2-instruct",
1211
+ "anthropic/claude-3-7-sonnet",
1212
+ "anthropic/claude-sonnet-4",
1213
+ "anthropic/claude-opus-4",
1214
+ "anthropic/claude-3-5-haiku",
1215
+ "cerebras/qwen-3-235b-a22b-instruct",
1216
+ "cerebras/qwen-3-235b-a22b-thinking",
1217
+ "cerebras/llama-3.3-70b",
1218
+ "cerebras/llama-4-maverick-17b-128e-instruct",
1219
+ "cerebras/llama-4-scout-17b-16e-instruct",
1220
+ "cerebras/gpt-oss-120b",
1221
+ "google-ai-studio/gemini-2.5-flash",
1222
+ "google-ai-studio/gemini-2.5-pro",
1223
+ "grok/grok-4",
1224
+ "groq/llama-3.3-70b-versatile",
1225
+ "groq/llama-3.1-8b-instant",
1226
+ "openai/gpt-5",
1227
+ "openai/gpt-5-mini",
1228
+ "openai/gpt-5-nano",
1229
+ "",
1230
+ ]),
1231
+ Schema.Null,
1232
+ ]),
1233
+ ),
1234
+ cache: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1235
+ cacheThreshold: Schema.optional(
1236
+ Schema.Union([
1237
+ Schema.Literal("super_strict_match"),
1238
+ Schema.Literal("close_enough"),
1239
+ Schema.Literal("flexible_friend"),
1240
+ Schema.Literal("anything_goes"),
1241
+ Schema.Null,
1242
+ ]),
1243
+ ),
1244
+ chunk: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1245
+ chunkOverlap: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1246
+ chunkSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1247
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1248
+ embeddingModel: Schema.optional(
1249
+ Schema.Union([
1250
+ Schema.Literals([
1251
+ "@cf/baai/bge-m3",
1252
+ "@cf/baai/bge-large-en-v1.5",
1253
+ "@cf/google/embeddinggemma-300m",
1254
+ "@cf/qwen/qwen3-embedding-0.6b",
1255
+ "google-ai-studio/gemini-embedding-001",
1256
+ "openai/text-embedding-3-small",
1257
+ "openai/text-embedding-3-large",
1258
+ "",
1259
+ ]),
1260
+ Schema.Null,
1261
+ ]),
1262
+ ),
1263
+ enable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1264
+ engineVersion: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1265
+ hybridSearchEnabled: Schema.optional(
1266
+ Schema.Union([Schema.Boolean, Schema.Null]),
1267
+ ),
1268
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1269
+ maxNumResults: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1270
+ metadata: Schema.optional(
1271
+ Schema.Union([
1272
+ Schema.Struct({
1273
+ createdFromAisearchWizard: Schema.optional(
1274
+ Schema.Union([Schema.Boolean, Schema.Null]),
1275
+ ),
1276
+ workerDomain: Schema.optional(
1277
+ Schema.Union([Schema.String, Schema.Null]),
1278
+ ),
1279
+ }).pipe(
1280
+ Schema.encodeKeys({
1281
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
1282
+ workerDomain: "worker_domain",
1283
+ }),
1284
+ ),
1285
+ Schema.Null,
1286
+ ]),
1287
+ ),
1288
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1289
+ paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1290
+ publicEndpointId: Schema.optional(
1291
+ Schema.Union([Schema.String, Schema.Null]),
1292
+ ),
1293
+ publicEndpointParams: Schema.optional(
1294
+ Schema.Union([
1295
+ Schema.Struct({
1296
+ authorizedHosts: Schema.optional(
1297
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1298
+ ),
1299
+ chatCompletionsEndpoint: Schema.optional(
1300
+ Schema.Union([
1301
+ Schema.Struct({
1302
+ disabled: Schema.optional(
1303
+ Schema.Union([Schema.Boolean, Schema.Null]),
1304
+ ),
1305
+ }),
1306
+ Schema.Null,
1307
+ ]),
1308
+ ),
1309
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1310
+ mcp: Schema.optional(
1311
+ Schema.Union([
1312
+ Schema.Struct({
1313
+ disabled: Schema.optional(
1314
+ Schema.Union([Schema.Boolean, Schema.Null]),
1315
+ ),
1316
+ }),
1317
+ Schema.Null,
1318
+ ]),
1319
+ ),
1320
+ rateLimit: Schema.optional(
1321
+ Schema.Union([
1322
+ Schema.Struct({
1323
+ periodMs: Schema.optional(
1324
+ Schema.Union([Schema.Number, Schema.Null]),
1325
+ ),
1326
+ requests: Schema.optional(
1327
+ Schema.Union([Schema.Number, Schema.Null]),
1328
+ ),
1329
+ technique: Schema.optional(
1330
+ Schema.Union([
1331
+ Schema.Literals(["fixed", "sliding"]),
1332
+ Schema.Null,
1333
+ ]),
1334
+ ),
1335
+ }).pipe(
1336
+ Schema.encodeKeys({
1337
+ periodMs: "period_ms",
1338
+ requests: "requests",
1339
+ technique: "technique",
1340
+ }),
1341
+ ),
1342
+ Schema.Null,
1343
+ ]),
1344
+ ),
1345
+ searchEndpoint: Schema.optional(
1346
+ Schema.Union([
1347
+ Schema.Struct({
1348
+ disabled: Schema.optional(
1349
+ Schema.Union([Schema.Boolean, Schema.Null]),
1350
+ ),
1351
+ }),
1352
+ Schema.Null,
1353
+ ]),
1354
+ ),
1355
+ }).pipe(
1356
+ Schema.encodeKeys({
1357
+ authorizedHosts: "authorized_hosts",
1358
+ chatCompletionsEndpoint: "chat_completions_endpoint",
1359
+ enabled: "enabled",
1360
+ mcp: "mcp",
1361
+ rateLimit: "rate_limit",
1362
+ searchEndpoint: "search_endpoint",
1363
+ }),
1364
+ ),
1365
+ Schema.Null,
1366
+ ]),
1367
+ ),
1368
+ reranking: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1369
+ rerankingModel: Schema.optional(
1370
+ Schema.Union([
1371
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
1372
+ Schema.Null,
1373
+ ]),
1374
+ ),
1375
+ rewriteModel: Schema.optional(
1376
+ Schema.Union([
1377
+ Schema.Literals([
1378
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1379
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1380
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1381
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1382
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1383
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1384
+ "@cf/moonshotai/kimi-k2-instruct",
1385
+ "anthropic/claude-3-7-sonnet",
1386
+ "anthropic/claude-sonnet-4",
1387
+ "anthropic/claude-opus-4",
1388
+ "anthropic/claude-3-5-haiku",
1389
+ "cerebras/qwen-3-235b-a22b-instruct",
1390
+ "cerebras/qwen-3-235b-a22b-thinking",
1391
+ "cerebras/llama-3.3-70b",
1392
+ "cerebras/llama-4-maverick-17b-128e-instruct",
1393
+ "cerebras/llama-4-scout-17b-16e-instruct",
1394
+ "cerebras/gpt-oss-120b",
1395
+ "google-ai-studio/gemini-2.5-flash",
1396
+ "google-ai-studio/gemini-2.5-pro",
1397
+ "grok/grok-4",
1398
+ "groq/llama-3.3-70b-versatile",
1399
+ "groq/llama-3.1-8b-instant",
1400
+ "openai/gpt-5",
1401
+ "openai/gpt-5-mini",
1402
+ "openai/gpt-5-nano",
1403
+ "",
1404
+ ]),
1405
+ Schema.Null,
1406
+ ]),
1407
+ ),
1408
+ rewriteQuery: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1409
+ scoreThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1410
+ sourceParams: Schema.optional(
1411
+ Schema.Union([
1412
+ Schema.Struct({
1413
+ excludeItems: Schema.optional(
1414
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1415
+ ),
1416
+ includeItems: Schema.optional(
1417
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1418
+ ),
1419
+ prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1420
+ r2Jurisdiction: Schema.optional(
1421
+ Schema.Union([Schema.String, Schema.Null]),
1422
+ ),
1423
+ webCrawler: Schema.optional(
1424
+ Schema.Union([
1425
+ Schema.Struct({
1426
+ parseOptions: Schema.optional(
1427
+ Schema.Union([
1428
+ Schema.Struct({
1429
+ includeHeaders: Schema.optional(
1430
+ Schema.Union([Schema.Struct({}), Schema.Null]),
1431
+ ),
1432
+ includeImages: Schema.optional(
1433
+ Schema.Union([Schema.Boolean, Schema.Null]),
1434
+ ),
1435
+ useBrowserRendering: Schema.optional(
1436
+ Schema.Union([Schema.Boolean, Schema.Null]),
1437
+ ),
1438
+ }).pipe(
1439
+ Schema.encodeKeys({
1440
+ includeHeaders: "include_headers",
1441
+ includeImages: "include_images",
1442
+ useBrowserRendering: "use_browser_rendering",
1443
+ }),
1444
+ ),
1445
+ Schema.Null,
1446
+ ]),
1447
+ ),
1448
+ parseType: Schema.optional(
1449
+ Schema.Union([
1450
+ Schema.Literals(["sitemap", "feed-rss"]),
1451
+ Schema.Null,
1452
+ ]),
1453
+ ),
1454
+ storeOptions: Schema.optional(
1455
+ Schema.Union([
1456
+ Schema.Struct({
1457
+ storageId: Schema.String,
1458
+ r2Jurisdiction: Schema.optional(
1459
+ Schema.Union([Schema.String, Schema.Null]),
1460
+ ),
1461
+ storageType: Schema.optional(
1462
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
1463
+ ),
1464
+ }).pipe(
1465
+ Schema.encodeKeys({
1466
+ storageId: "storage_id",
1467
+ r2Jurisdiction: "r2_jurisdiction",
1468
+ storageType: "storage_type",
1469
+ }),
1470
+ ),
1471
+ Schema.Null,
1472
+ ]),
1473
+ ),
1474
+ }).pipe(
1475
+ Schema.encodeKeys({
1476
+ parseOptions: "parse_options",
1477
+ parseType: "parse_type",
1478
+ storeOptions: "store_options",
1479
+ }),
1480
+ ),
1481
+ Schema.Null,
1482
+ ]),
1483
+ ),
1484
+ }).pipe(
1485
+ Schema.encodeKeys({
1486
+ excludeItems: "exclude_items",
1487
+ includeItems: "include_items",
1488
+ prefix: "prefix",
1489
+ r2Jurisdiction: "r2_jurisdiction",
1490
+ webCrawler: "web_crawler",
1491
+ }),
1492
+ ),
1493
+ Schema.Null,
1494
+ ]),
1495
+ ),
1496
+ status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1497
+ summarization: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1498
+ summarizationModel: Schema.optional(
1499
+ Schema.Union([
1500
+ Schema.Literals([
1501
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1502
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1503
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1504
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1505
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1506
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1507
+ "@cf/moonshotai/kimi-k2-instruct",
1508
+ "anthropic/claude-3-7-sonnet",
1509
+ "anthropic/claude-sonnet-4",
1510
+ "anthropic/claude-opus-4",
1511
+ "anthropic/claude-3-5-haiku",
1512
+ "cerebras/qwen-3-235b-a22b-instruct",
1513
+ "cerebras/qwen-3-235b-a22b-thinking",
1514
+ "cerebras/llama-3.3-70b",
1515
+ "cerebras/llama-4-maverick-17b-128e-instruct",
1516
+ "cerebras/llama-4-scout-17b-16e-instruct",
1517
+ "cerebras/gpt-oss-120b",
1518
+ "google-ai-studio/gemini-2.5-flash",
1519
+ "google-ai-studio/gemini-2.5-pro",
1520
+ "grok/grok-4",
1521
+ "groq/llama-3.3-70b-versatile",
1522
+ "groq/llama-3.1-8b-instant",
1523
+ "openai/gpt-5",
1524
+ "openai/gpt-5-mini",
1525
+ "openai/gpt-5-nano",
1526
+ "",
1527
+ ]),
1528
+ Schema.Null,
1529
+ ]),
1530
+ ),
1531
+ systemPromptAiSearch: Schema.optional(
1532
+ Schema.Union([Schema.String, Schema.Null]),
1533
+ ),
1534
+ systemPromptIndexSummarization: Schema.optional(
1535
+ Schema.Union([Schema.String, Schema.Null]),
1536
+ ),
1537
+ systemPromptRewriteQuery: Schema.optional(
1538
+ Schema.Union([Schema.String, Schema.Null]),
1539
+ ),
1540
+ vectorizeActiveNamespace: Schema.optional(
1541
+ Schema.Union([Schema.String, Schema.Null]),
1542
+ ),
1543
+ },
1544
+ ).pipe(
1545
+ Schema.encodeKeys({
1546
+ id: "id",
1547
+ accountId: "account_id",
1548
+ accountTag: "account_tag",
1549
+ createdAt: "created_at",
1550
+ internalId: "internal_id",
1551
+ modifiedAt: "modified_at",
1552
+ source: "source",
1553
+ tokenId: "token_id",
1554
+ type: "type",
1555
+ vectorizeName: "vectorize_name",
1556
+ aiGatewayId: "ai_gateway_id",
1557
+ aiSearchModel: "ai_search_model",
1558
+ cache: "cache",
1559
+ cacheThreshold: "cache_threshold",
1560
+ chunk: "chunk",
1561
+ chunkOverlap: "chunk_overlap",
1562
+ chunkSize: "chunk_size",
1563
+ createdBy: "created_by",
1564
+ embeddingModel: "embedding_model",
1565
+ enable: "enable",
1566
+ engineVersion: "engine_version",
1567
+ hybridSearchEnabled: "hybrid_search_enabled",
1568
+ lastActivity: "last_activity",
1569
+ maxNumResults: "max_num_results",
1570
+ metadata: "metadata",
1571
+ modifiedBy: "modified_by",
1572
+ paused: "paused",
1573
+ publicEndpointId: "public_endpoint_id",
1574
+ publicEndpointParams: "public_endpoint_params",
1575
+ reranking: "reranking",
1576
+ rerankingModel: "reranking_model",
1577
+ rewriteModel: "rewrite_model",
1578
+ rewriteQuery: "rewrite_query",
1579
+ scoreThreshold: "score_threshold",
1580
+ sourceParams: "source_params",
1581
+ status: "status",
1582
+ summarization: "summarization",
1583
+ summarizationModel: "summarization_model",
1584
+ systemPromptAiSearch: "system_prompt_ai_search",
1585
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
1586
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
1587
+ vectorizeActiveNamespace: "vectorize_active_namespace",
1588
+ }),
1589
+ ) as unknown as Schema.Schema<CreateInstanceResponse>;
1590
+
1591
+ export type CreateInstanceError =
1592
+ | DefaultErrors
1593
+ | ValidationError
1594
+ | NotFound
1595
+ | InvalidRoute;
1596
+
1597
+ export const createInstance: API.OperationMethod<
1598
+ CreateInstanceRequest,
1599
+ CreateInstanceResponse,
1600
+ CreateInstanceError,
1601
+ Credentials | HttpClient.HttpClient
1602
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1603
+ input: CreateInstanceRequest,
1604
+ output: CreateInstanceResponse,
1605
+ errors: [ValidationError, NotFound, InvalidRoute],
1606
+ }));
1607
+
1608
+ export interface UpdateInstanceRequest {
1609
+ id: string;
1610
+ /** Path param: */
1611
+ accountId: string;
1612
+ /** Body param: */
1613
+ aiGatewayId?: string;
1614
+ /** Body param: */
1615
+ aiSearchModel?:
1616
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1617
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1618
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1619
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1620
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1621
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1622
+ | "@cf/moonshotai/kimi-k2-instruct"
1623
+ | "anthropic/claude-3-7-sonnet"
1624
+ | "anthropic/claude-sonnet-4"
1625
+ | "anthropic/claude-opus-4"
1626
+ | "anthropic/claude-3-5-haiku"
1627
+ | "cerebras/qwen-3-235b-a22b-instruct"
1628
+ | "cerebras/qwen-3-235b-a22b-thinking"
1629
+ | "cerebras/llama-3.3-70b"
1630
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1631
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1632
+ | "cerebras/gpt-oss-120b"
1633
+ | "google-ai-studio/gemini-2.5-flash"
1634
+ | "google-ai-studio/gemini-2.5-pro"
1635
+ | "grok/grok-4"
1636
+ | "groq/llama-3.3-70b-versatile"
1637
+ | "groq/llama-3.1-8b-instant"
1638
+ | "openai/gpt-5"
1639
+ | "openai/gpt-5-mini"
1640
+ | "openai/gpt-5-nano"
1641
+ | "";
1642
+ /** Body param: */
1643
+ cache?: boolean;
1644
+ /** Body param: */
1645
+ cacheThreshold?:
1646
+ | "super_strict_match"
1647
+ | "close_enough"
1648
+ | "flexible_friend"
1649
+ | "anything_goes";
1650
+ /** Body param: */
1651
+ chunk?: boolean;
1652
+ /** Body param: */
1653
+ chunkOverlap?: number;
1654
+ /** Body param: */
1655
+ chunkSize?: number;
1656
+ /** Body param: */
1657
+ embeddingModel?:
1658
+ | "@cf/baai/bge-m3"
1659
+ | "@cf/baai/bge-large-en-v1.5"
1660
+ | "@cf/google/embeddinggemma-300m"
1661
+ | "@cf/qwen/qwen3-embedding-0.6b"
1662
+ | "google-ai-studio/gemini-embedding-001"
1663
+ | "openai/text-embedding-3-small"
1664
+ | "openai/text-embedding-3-large"
1665
+ | "";
1666
+ /** Body param: */
1667
+ hybridSearchEnabled?: boolean;
1668
+ /** Body param: */
1669
+ maxNumResults?: number;
1670
+ /** Body param: */
1671
+ metadata?: { createdFromAisearchWizard?: boolean; workerDomain?: string };
1672
+ /** Body param: */
1673
+ paused?: boolean;
1674
+ /** Body param: */
1675
+ publicEndpointParams?: {
1676
+ authorizedHosts?: string[];
1677
+ chatCompletionsEndpoint?: { disabled?: boolean };
1678
+ enabled?: boolean;
1679
+ mcp?: { disabled?: boolean };
1680
+ rateLimit?: {
1681
+ periodMs?: number;
1682
+ requests?: number;
1683
+ technique?: "fixed" | "sliding";
1684
+ };
1685
+ searchEndpoint?: { disabled?: boolean };
1686
+ };
1687
+ /** Body param: */
1688
+ reranking?: boolean;
1689
+ /** Body param: */
1690
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "";
1691
+ /** Body param: */
1692
+ rewriteModel?:
1693
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1694
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1695
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1696
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1697
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1698
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1699
+ | "@cf/moonshotai/kimi-k2-instruct"
1700
+ | "anthropic/claude-3-7-sonnet"
1701
+ | "anthropic/claude-sonnet-4"
1702
+ | "anthropic/claude-opus-4"
1703
+ | "anthropic/claude-3-5-haiku"
1704
+ | "cerebras/qwen-3-235b-a22b-instruct"
1705
+ | "cerebras/qwen-3-235b-a22b-thinking"
1706
+ | "cerebras/llama-3.3-70b"
1707
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1708
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1709
+ | "cerebras/gpt-oss-120b"
1710
+ | "google-ai-studio/gemini-2.5-flash"
1711
+ | "google-ai-studio/gemini-2.5-pro"
1712
+ | "grok/grok-4"
1713
+ | "groq/llama-3.3-70b-versatile"
1714
+ | "groq/llama-3.1-8b-instant"
1715
+ | "openai/gpt-5"
1716
+ | "openai/gpt-5-mini"
1717
+ | "openai/gpt-5-nano"
1718
+ | "";
1719
+ /** Body param: */
1720
+ rewriteQuery?: boolean;
1721
+ /** Body param: */
1722
+ scoreThreshold?: number;
1723
+ /** Body param: */
1724
+ sourceParams?: {
1725
+ excludeItems?: string[];
1726
+ includeItems?: string[];
1727
+ prefix?: string;
1728
+ r2Jurisdiction?: string;
1729
+ webCrawler?: {
1730
+ parseOptions?: {
1731
+ includeHeaders?: Record<string, unknown>;
1732
+ includeImages?: boolean;
1733
+ useBrowserRendering?: boolean;
1734
+ };
1735
+ parseType?: "sitemap" | "feed-rss";
1736
+ storeOptions?: {
1737
+ storageId: string;
1738
+ r2Jurisdiction?: string;
1739
+ storageType?: "r2";
1740
+ };
1741
+ };
1742
+ };
1743
+ /** Body param: */
1744
+ summarization?: boolean;
1745
+ /** Body param: */
1746
+ summarizationModel?:
1747
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
1748
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
1749
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
1750
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
1751
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
1752
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
1753
+ | "@cf/moonshotai/kimi-k2-instruct"
1754
+ | "anthropic/claude-3-7-sonnet"
1755
+ | "anthropic/claude-sonnet-4"
1756
+ | "anthropic/claude-opus-4"
1757
+ | "anthropic/claude-3-5-haiku"
1758
+ | "cerebras/qwen-3-235b-a22b-instruct"
1759
+ | "cerebras/qwen-3-235b-a22b-thinking"
1760
+ | "cerebras/llama-3.3-70b"
1761
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
1762
+ | "cerebras/llama-4-scout-17b-16e-instruct"
1763
+ | "cerebras/gpt-oss-120b"
1764
+ | "google-ai-studio/gemini-2.5-flash"
1765
+ | "google-ai-studio/gemini-2.5-pro"
1766
+ | "grok/grok-4"
1767
+ | "groq/llama-3.3-70b-versatile"
1768
+ | "groq/llama-3.1-8b-instant"
1769
+ | "openai/gpt-5"
1770
+ | "openai/gpt-5-mini"
1771
+ | "openai/gpt-5-nano"
1772
+ | "";
1773
+ /** Body param: */
1774
+ systemPromptAiSearch?: string;
1775
+ /** Body param: */
1776
+ systemPromptIndexSummarization?: string;
1777
+ /** Body param: */
1778
+ systemPromptRewriteQuery?: string;
1779
+ /** Body param: */
1780
+ tokenId?: string;
1781
+ }
1782
+
1783
+ export const UpdateInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1784
+ id: Schema.String.pipe(T.HttpPath("id")),
1785
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1786
+ aiGatewayId: Schema.optional(Schema.String),
1787
+ aiSearchModel: Schema.optional(
1788
+ Schema.Literals([
1789
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1790
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1791
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1792
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1793
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1794
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1795
+ "@cf/moonshotai/kimi-k2-instruct",
1796
+ "anthropic/claude-3-7-sonnet",
1797
+ "anthropic/claude-sonnet-4",
1798
+ "anthropic/claude-opus-4",
1799
+ "anthropic/claude-3-5-haiku",
1800
+ "cerebras/qwen-3-235b-a22b-instruct",
1801
+ "cerebras/qwen-3-235b-a22b-thinking",
1802
+ "cerebras/llama-3.3-70b",
1803
+ "cerebras/llama-4-maverick-17b-128e-instruct",
1804
+ "cerebras/llama-4-scout-17b-16e-instruct",
1805
+ "cerebras/gpt-oss-120b",
1806
+ "google-ai-studio/gemini-2.5-flash",
1807
+ "google-ai-studio/gemini-2.5-pro",
1808
+ "grok/grok-4",
1809
+ "groq/llama-3.3-70b-versatile",
1810
+ "groq/llama-3.1-8b-instant",
1811
+ "openai/gpt-5",
1812
+ "openai/gpt-5-mini",
1813
+ "openai/gpt-5-nano",
1814
+ "",
1815
+ ]),
1816
+ ),
1817
+ cache: Schema.optional(Schema.Boolean),
1818
+ cacheThreshold: Schema.optional(
1819
+ Schema.Literals([
1820
+ "super_strict_match",
1821
+ "close_enough",
1822
+ "flexible_friend",
1823
+ "anything_goes",
1824
+ ]),
1825
+ ),
1826
+ chunk: Schema.optional(Schema.Boolean),
1827
+ chunkOverlap: Schema.optional(Schema.Number),
1828
+ chunkSize: Schema.optional(Schema.Number),
1829
+ embeddingModel: Schema.optional(
1830
+ Schema.Literals([
1831
+ "@cf/baai/bge-m3",
1832
+ "@cf/baai/bge-large-en-v1.5",
1833
+ "@cf/google/embeddinggemma-300m",
1834
+ "@cf/qwen/qwen3-embedding-0.6b",
1835
+ "google-ai-studio/gemini-embedding-001",
1836
+ "openai/text-embedding-3-small",
1837
+ "openai/text-embedding-3-large",
1838
+ "",
1839
+ ]),
1840
+ ),
1841
+ hybridSearchEnabled: Schema.optional(Schema.Boolean),
1842
+ maxNumResults: Schema.optional(Schema.Number),
1843
+ metadata: Schema.optional(
1844
+ Schema.Struct({
1845
+ createdFromAisearchWizard: Schema.optional(Schema.Boolean),
1846
+ workerDomain: Schema.optional(Schema.String),
1847
+ }).pipe(
1848
+ Schema.encodeKeys({
1849
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
1850
+ workerDomain: "worker_domain",
1851
+ }),
1852
+ ),
1853
+ ),
1854
+ paused: Schema.optional(Schema.Boolean),
1855
+ publicEndpointParams: Schema.optional(
1856
+ Schema.Struct({
1857
+ authorizedHosts: Schema.optional(Schema.Array(Schema.String)),
1858
+ chatCompletionsEndpoint: Schema.optional(
1859
+ Schema.Struct({
1860
+ disabled: Schema.optional(Schema.Boolean),
1861
+ }),
1862
+ ),
1863
+ enabled: Schema.optional(Schema.Boolean),
1864
+ mcp: Schema.optional(
1865
+ Schema.Struct({
1866
+ disabled: Schema.optional(Schema.Boolean),
1867
+ }),
1868
+ ),
1869
+ rateLimit: Schema.optional(
1870
+ Schema.Struct({
1871
+ periodMs: Schema.optional(Schema.Number),
1872
+ requests: Schema.optional(Schema.Number),
1873
+ technique: Schema.optional(Schema.Literals(["fixed", "sliding"])),
1874
+ }).pipe(
1875
+ Schema.encodeKeys({
1876
+ periodMs: "period_ms",
1877
+ requests: "requests",
1878
+ technique: "technique",
1879
+ }),
1880
+ ),
1881
+ ),
1882
+ searchEndpoint: Schema.optional(
1883
+ Schema.Struct({
1884
+ disabled: Schema.optional(Schema.Boolean),
1885
+ }),
1886
+ ),
1887
+ }).pipe(
1888
+ Schema.encodeKeys({
1889
+ authorizedHosts: "authorized_hosts",
1890
+ chatCompletionsEndpoint: "chat_completions_endpoint",
1891
+ enabled: "enabled",
1892
+ mcp: "mcp",
1893
+ rateLimit: "rate_limit",
1894
+ searchEndpoint: "search_endpoint",
1895
+ }),
1896
+ ),
1897
+ ),
1898
+ reranking: Schema.optional(Schema.Boolean),
1899
+ rerankingModel: Schema.optional(
1900
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
1901
+ ),
1902
+ rewriteModel: Schema.optional(
1903
+ Schema.Literals([
1904
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1905
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1906
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1907
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1908
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1909
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1910
+ "@cf/moonshotai/kimi-k2-instruct",
1911
+ "anthropic/claude-3-7-sonnet",
1912
+ "anthropic/claude-sonnet-4",
1913
+ "anthropic/claude-opus-4",
1914
+ "anthropic/claude-3-5-haiku",
1915
+ "cerebras/qwen-3-235b-a22b-instruct",
1916
+ "cerebras/qwen-3-235b-a22b-thinking",
1917
+ "cerebras/llama-3.3-70b",
1918
+ "cerebras/llama-4-maverick-17b-128e-instruct",
1919
+ "cerebras/llama-4-scout-17b-16e-instruct",
1920
+ "cerebras/gpt-oss-120b",
1921
+ "google-ai-studio/gemini-2.5-flash",
1922
+ "google-ai-studio/gemini-2.5-pro",
1923
+ "grok/grok-4",
1924
+ "groq/llama-3.3-70b-versatile",
1925
+ "groq/llama-3.1-8b-instant",
1926
+ "openai/gpt-5",
1927
+ "openai/gpt-5-mini",
1928
+ "openai/gpt-5-nano",
1929
+ "",
1930
+ ]),
1931
+ ),
1932
+ rewriteQuery: Schema.optional(Schema.Boolean),
1933
+ scoreThreshold: Schema.optional(Schema.Number),
1934
+ sourceParams: Schema.optional(
1935
+ Schema.Struct({
1936
+ excludeItems: Schema.optional(Schema.Array(Schema.String)),
1937
+ includeItems: Schema.optional(Schema.Array(Schema.String)),
1938
+ prefix: Schema.optional(Schema.String),
1939
+ r2Jurisdiction: Schema.optional(Schema.String),
1940
+ webCrawler: Schema.optional(
1941
+ Schema.Struct({
1942
+ parseOptions: Schema.optional(
1943
+ Schema.Struct({
1944
+ includeHeaders: Schema.optional(Schema.Struct({})),
1945
+ includeImages: Schema.optional(Schema.Boolean),
1946
+ useBrowserRendering: Schema.optional(Schema.Boolean),
1947
+ }).pipe(
1948
+ Schema.encodeKeys({
1949
+ includeHeaders: "include_headers",
1950
+ includeImages: "include_images",
1951
+ useBrowserRendering: "use_browser_rendering",
1952
+ }),
1953
+ ),
1954
+ ),
1955
+ parseType: Schema.optional(Schema.Literals(["sitemap", "feed-rss"])),
1956
+ storeOptions: Schema.optional(
1957
+ Schema.Struct({
1958
+ storageId: Schema.String,
1959
+ r2Jurisdiction: Schema.optional(Schema.String),
1960
+ storageType: Schema.optional(Schema.Literal("r2")),
1961
+ }).pipe(
1962
+ Schema.encodeKeys({
1963
+ storageId: "storage_id",
1964
+ r2Jurisdiction: "r2_jurisdiction",
1965
+ storageType: "storage_type",
1966
+ }),
1967
+ ),
1968
+ ),
1969
+ }).pipe(
1970
+ Schema.encodeKeys({
1971
+ parseOptions: "parse_options",
1972
+ parseType: "parse_type",
1973
+ storeOptions: "store_options",
1974
+ }),
1975
+ ),
1976
+ ),
1977
+ }).pipe(
1978
+ Schema.encodeKeys({
1979
+ excludeItems: "exclude_items",
1980
+ includeItems: "include_items",
1981
+ prefix: "prefix",
1982
+ r2Jurisdiction: "r2_jurisdiction",
1983
+ webCrawler: "web_crawler",
1984
+ }),
1985
+ ),
1986
+ ),
1987
+ summarization: Schema.optional(Schema.Boolean),
1988
+ summarizationModel: Schema.optional(
1989
+ Schema.Literals([
1990
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
1991
+ "@cf/meta/llama-3.1-8b-instruct-fast",
1992
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
1993
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
1994
+ "@cf/qwen/qwen3-30b-a3b-fp8",
1995
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
1996
+ "@cf/moonshotai/kimi-k2-instruct",
1997
+ "anthropic/claude-3-7-sonnet",
1998
+ "anthropic/claude-sonnet-4",
1999
+ "anthropic/claude-opus-4",
2000
+ "anthropic/claude-3-5-haiku",
2001
+ "cerebras/qwen-3-235b-a22b-instruct",
2002
+ "cerebras/qwen-3-235b-a22b-thinking",
2003
+ "cerebras/llama-3.3-70b",
2004
+ "cerebras/llama-4-maverick-17b-128e-instruct",
2005
+ "cerebras/llama-4-scout-17b-16e-instruct",
2006
+ "cerebras/gpt-oss-120b",
2007
+ "google-ai-studio/gemini-2.5-flash",
2008
+ "google-ai-studio/gemini-2.5-pro",
2009
+ "grok/grok-4",
2010
+ "groq/llama-3.3-70b-versatile",
2011
+ "groq/llama-3.1-8b-instant",
2012
+ "openai/gpt-5",
2013
+ "openai/gpt-5-mini",
2014
+ "openai/gpt-5-nano",
2015
+ "",
2016
+ ]),
2017
+ ),
2018
+ systemPromptAiSearch: Schema.optional(Schema.String),
2019
+ systemPromptIndexSummarization: Schema.optional(Schema.String),
2020
+ systemPromptRewriteQuery: Schema.optional(Schema.String),
2021
+ tokenId: Schema.optional(Schema.String),
2022
+ }).pipe(
2023
+ Schema.encodeKeys({
2024
+ aiGatewayId: "ai_gateway_id",
2025
+ aiSearchModel: "ai_search_model",
2026
+ cache: "cache",
2027
+ cacheThreshold: "cache_threshold",
2028
+ chunk: "chunk",
2029
+ chunkOverlap: "chunk_overlap",
2030
+ chunkSize: "chunk_size",
2031
+ embeddingModel: "embedding_model",
2032
+ hybridSearchEnabled: "hybrid_search_enabled",
2033
+ maxNumResults: "max_num_results",
2034
+ metadata: "metadata",
2035
+ paused: "paused",
2036
+ publicEndpointParams: "public_endpoint_params",
2037
+ reranking: "reranking",
2038
+ rerankingModel: "reranking_model",
2039
+ rewriteModel: "rewrite_model",
2040
+ rewriteQuery: "rewrite_query",
2041
+ scoreThreshold: "score_threshold",
2042
+ sourceParams: "source_params",
2043
+ summarization: "summarization",
2044
+ summarizationModel: "summarization_model",
2045
+ systemPromptAiSearch: "system_prompt_ai_search",
2046
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
2047
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
2048
+ tokenId: "token_id",
2049
+ }),
2050
+ T.Http({
2051
+ method: "PUT",
2052
+ path: "/accounts/{account_id}/ai-search/instances/{id}",
2053
+ }),
2054
+ ) as unknown as Schema.Schema<UpdateInstanceRequest>;
2055
+
2056
+ export interface UpdateInstanceResponse {
2057
+ /** Use your AI Search ID. */
2058
+ id: string;
2059
+ accountId?: string | null;
2060
+ accountTag?: string | null;
2061
+ createdAt: string;
2062
+ internalId?: string | null;
2063
+ modifiedAt: string;
2064
+ source: string;
2065
+ tokenId: string;
2066
+ type: "r2" | "web-crawler";
2067
+ vectorizeName: string;
2068
+ aiGatewayId?: string | null;
2069
+ aiSearchModel?:
2070
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2071
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2072
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2073
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2074
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2075
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2076
+ | "@cf/moonshotai/kimi-k2-instruct"
2077
+ | "anthropic/claude-3-7-sonnet"
2078
+ | "anthropic/claude-sonnet-4"
2079
+ | "anthropic/claude-opus-4"
2080
+ | "anthropic/claude-3-5-haiku"
2081
+ | "cerebras/qwen-3-235b-a22b-instruct"
2082
+ | "cerebras/qwen-3-235b-a22b-thinking"
2083
+ | "cerebras/llama-3.3-70b"
2084
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2085
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2086
+ | "cerebras/gpt-oss-120b"
2087
+ | "google-ai-studio/gemini-2.5-flash"
2088
+ | "google-ai-studio/gemini-2.5-pro"
2089
+ | "grok/grok-4"
2090
+ | "groq/llama-3.3-70b-versatile"
2091
+ | "groq/llama-3.1-8b-instant"
2092
+ | "openai/gpt-5"
2093
+ | "openai/gpt-5-mini"
2094
+ | "openai/gpt-5-nano"
2095
+ | ""
2096
+ | null;
2097
+ cache?: boolean | null;
2098
+ cacheThreshold?:
2099
+ | "super_strict_match"
2100
+ | "close_enough"
2101
+ | "flexible_friend"
2102
+ | "anything_goes"
2103
+ | null;
2104
+ chunk?: boolean | null;
2105
+ chunkOverlap?: number | null;
2106
+ chunkSize?: number | null;
2107
+ createdBy?: string | null;
2108
+ embeddingModel?:
2109
+ | "@cf/baai/bge-m3"
2110
+ | "@cf/baai/bge-large-en-v1.5"
2111
+ | "@cf/google/embeddinggemma-300m"
2112
+ | "@cf/qwen/qwen3-embedding-0.6b"
2113
+ | "google-ai-studio/gemini-embedding-001"
2114
+ | "openai/text-embedding-3-small"
2115
+ | "openai/text-embedding-3-large"
2116
+ | ""
2117
+ | null;
2118
+ enable?: boolean | null;
2119
+ engineVersion?: number | null;
2120
+ hybridSearchEnabled?: boolean | null;
2121
+ lastActivity?: string | null;
2122
+ maxNumResults?: number | null;
2123
+ metadata?: {
2124
+ createdFromAisearchWizard?: boolean | null;
2125
+ workerDomain?: string | null;
2126
+ } | null;
2127
+ modifiedBy?: string | null;
2128
+ paused?: boolean | null;
2129
+ publicEndpointId?: string | null;
2130
+ publicEndpointParams?: {
2131
+ authorizedHosts?: string[] | null;
2132
+ chatCompletionsEndpoint?: { disabled?: boolean | null } | null;
2133
+ enabled?: boolean | null;
2134
+ mcp?: { disabled?: boolean | null } | null;
2135
+ rateLimit?: {
2136
+ periodMs?: number | null;
2137
+ requests?: number | null;
2138
+ technique?: "fixed" | "sliding" | null;
2139
+ } | null;
2140
+ searchEndpoint?: { disabled?: boolean | null } | null;
2141
+ } | null;
2142
+ reranking?: boolean | null;
2143
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "" | null;
2144
+ rewriteModel?:
2145
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2146
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2147
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2148
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2149
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2150
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2151
+ | "@cf/moonshotai/kimi-k2-instruct"
2152
+ | "anthropic/claude-3-7-sonnet"
2153
+ | "anthropic/claude-sonnet-4"
2154
+ | "anthropic/claude-opus-4"
2155
+ | "anthropic/claude-3-5-haiku"
2156
+ | "cerebras/qwen-3-235b-a22b-instruct"
2157
+ | "cerebras/qwen-3-235b-a22b-thinking"
2158
+ | "cerebras/llama-3.3-70b"
2159
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2160
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2161
+ | "cerebras/gpt-oss-120b"
2162
+ | "google-ai-studio/gemini-2.5-flash"
2163
+ | "google-ai-studio/gemini-2.5-pro"
2164
+ | "grok/grok-4"
2165
+ | "groq/llama-3.3-70b-versatile"
2166
+ | "groq/llama-3.1-8b-instant"
2167
+ | "openai/gpt-5"
2168
+ | "openai/gpt-5-mini"
2169
+ | "openai/gpt-5-nano"
2170
+ | ""
2171
+ | null;
2172
+ rewriteQuery?: boolean | null;
2173
+ scoreThreshold?: number | null;
2174
+ sourceParams?: {
2175
+ excludeItems?: string[] | null;
2176
+ includeItems?: string[] | null;
2177
+ prefix?: string | null;
2178
+ r2Jurisdiction?: string | null;
2179
+ webCrawler?: {
2180
+ parseOptions?: {
2181
+ includeHeaders?: Record<string, unknown> | null;
2182
+ includeImages?: boolean | null;
2183
+ useBrowserRendering?: boolean | null;
2184
+ } | null;
2185
+ parseType?: "sitemap" | "feed-rss" | null;
2186
+ storeOptions?: {
2187
+ storageId: string;
2188
+ r2Jurisdiction?: string | null;
2189
+ storageType?: "r2" | null;
2190
+ } | null;
2191
+ } | null;
2192
+ } | null;
2193
+ status?: string | null;
2194
+ summarization?: boolean | null;
2195
+ summarizationModel?:
2196
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2197
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2198
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2199
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2200
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2201
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2202
+ | "@cf/moonshotai/kimi-k2-instruct"
2203
+ | "anthropic/claude-3-7-sonnet"
2204
+ | "anthropic/claude-sonnet-4"
2205
+ | "anthropic/claude-opus-4"
2206
+ | "anthropic/claude-3-5-haiku"
2207
+ | "cerebras/qwen-3-235b-a22b-instruct"
2208
+ | "cerebras/qwen-3-235b-a22b-thinking"
2209
+ | "cerebras/llama-3.3-70b"
2210
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2211
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2212
+ | "cerebras/gpt-oss-120b"
2213
+ | "google-ai-studio/gemini-2.5-flash"
2214
+ | "google-ai-studio/gemini-2.5-pro"
2215
+ | "grok/grok-4"
2216
+ | "groq/llama-3.3-70b-versatile"
2217
+ | "groq/llama-3.1-8b-instant"
2218
+ | "openai/gpt-5"
2219
+ | "openai/gpt-5-mini"
2220
+ | "openai/gpt-5-nano"
2221
+ | ""
2222
+ | null;
2223
+ systemPromptAiSearch?: string | null;
2224
+ systemPromptIndexSummarization?: string | null;
2225
+ systemPromptRewriteQuery?: string | null;
2226
+ vectorizeActiveNamespace?: string | null;
2227
+ }
2228
+
2229
+ export const UpdateInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
2230
+ {
2231
+ id: Schema.String,
2232
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2233
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2234
+ createdAt: Schema.String,
2235
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2236
+ modifiedAt: Schema.String,
2237
+ source: Schema.String,
2238
+ tokenId: Schema.String,
2239
+ type: Schema.Literals(["r2", "web-crawler"]),
2240
+ vectorizeName: Schema.String,
2241
+ aiGatewayId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2242
+ aiSearchModel: Schema.optional(
2243
+ Schema.Union([
2244
+ Schema.Literals([
2245
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
2246
+ "@cf/meta/llama-3.1-8b-instruct-fast",
2247
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
2248
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
2249
+ "@cf/qwen/qwen3-30b-a3b-fp8",
2250
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
2251
+ "@cf/moonshotai/kimi-k2-instruct",
2252
+ "anthropic/claude-3-7-sonnet",
2253
+ "anthropic/claude-sonnet-4",
2254
+ "anthropic/claude-opus-4",
2255
+ "anthropic/claude-3-5-haiku",
2256
+ "cerebras/qwen-3-235b-a22b-instruct",
2257
+ "cerebras/qwen-3-235b-a22b-thinking",
2258
+ "cerebras/llama-3.3-70b",
2259
+ "cerebras/llama-4-maverick-17b-128e-instruct",
2260
+ "cerebras/llama-4-scout-17b-16e-instruct",
2261
+ "cerebras/gpt-oss-120b",
2262
+ "google-ai-studio/gemini-2.5-flash",
2263
+ "google-ai-studio/gemini-2.5-pro",
2264
+ "grok/grok-4",
2265
+ "groq/llama-3.3-70b-versatile",
2266
+ "groq/llama-3.1-8b-instant",
2267
+ "openai/gpt-5",
2268
+ "openai/gpt-5-mini",
2269
+ "openai/gpt-5-nano",
2270
+ "",
2271
+ ]),
2272
+ Schema.Null,
2273
+ ]),
2274
+ ),
2275
+ cache: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2276
+ cacheThreshold: Schema.optional(
2277
+ Schema.Union([
2278
+ Schema.Literal("super_strict_match"),
2279
+ Schema.Literal("close_enough"),
2280
+ Schema.Literal("flexible_friend"),
2281
+ Schema.Literal("anything_goes"),
2282
+ Schema.Null,
2283
+ ]),
2284
+ ),
2285
+ chunk: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2286
+ chunkOverlap: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2287
+ chunkSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2288
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2289
+ embeddingModel: Schema.optional(
2290
+ Schema.Union([
2291
+ Schema.Literals([
2292
+ "@cf/baai/bge-m3",
2293
+ "@cf/baai/bge-large-en-v1.5",
2294
+ "@cf/google/embeddinggemma-300m",
2295
+ "@cf/qwen/qwen3-embedding-0.6b",
2296
+ "google-ai-studio/gemini-embedding-001",
2297
+ "openai/text-embedding-3-small",
2298
+ "openai/text-embedding-3-large",
2299
+ "",
2300
+ ]),
2301
+ Schema.Null,
2302
+ ]),
2303
+ ),
2304
+ enable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2305
+ engineVersion: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2306
+ hybridSearchEnabled: Schema.optional(
2307
+ Schema.Union([Schema.Boolean, Schema.Null]),
2308
+ ),
2309
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2310
+ maxNumResults: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2311
+ metadata: Schema.optional(
2312
+ Schema.Union([
2313
+ Schema.Struct({
2314
+ createdFromAisearchWizard: Schema.optional(
2315
+ Schema.Union([Schema.Boolean, Schema.Null]),
2316
+ ),
2317
+ workerDomain: Schema.optional(
2318
+ Schema.Union([Schema.String, Schema.Null]),
2319
+ ),
2320
+ }).pipe(
2321
+ Schema.encodeKeys({
2322
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
2323
+ workerDomain: "worker_domain",
2324
+ }),
2325
+ ),
2326
+ Schema.Null,
2327
+ ]),
2328
+ ),
2329
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2330
+ paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2331
+ publicEndpointId: Schema.optional(
2332
+ Schema.Union([Schema.String, Schema.Null]),
2333
+ ),
2334
+ publicEndpointParams: Schema.optional(
2335
+ Schema.Union([
2336
+ Schema.Struct({
2337
+ authorizedHosts: Schema.optional(
2338
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2339
+ ),
2340
+ chatCompletionsEndpoint: Schema.optional(
2341
+ Schema.Union([
2342
+ Schema.Struct({
2343
+ disabled: Schema.optional(
2344
+ Schema.Union([Schema.Boolean, Schema.Null]),
2345
+ ),
2346
+ }),
2347
+ Schema.Null,
2348
+ ]),
2349
+ ),
2350
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2351
+ mcp: Schema.optional(
2352
+ Schema.Union([
2353
+ Schema.Struct({
2354
+ disabled: Schema.optional(
2355
+ Schema.Union([Schema.Boolean, Schema.Null]),
2356
+ ),
2357
+ }),
2358
+ Schema.Null,
2359
+ ]),
2360
+ ),
2361
+ rateLimit: Schema.optional(
2362
+ Schema.Union([
2363
+ Schema.Struct({
2364
+ periodMs: Schema.optional(
2365
+ Schema.Union([Schema.Number, Schema.Null]),
2366
+ ),
2367
+ requests: Schema.optional(
2368
+ Schema.Union([Schema.Number, Schema.Null]),
2369
+ ),
2370
+ technique: Schema.optional(
2371
+ Schema.Union([
2372
+ Schema.Literals(["fixed", "sliding"]),
2373
+ Schema.Null,
2374
+ ]),
2375
+ ),
2376
+ }).pipe(
2377
+ Schema.encodeKeys({
2378
+ periodMs: "period_ms",
2379
+ requests: "requests",
2380
+ technique: "technique",
2381
+ }),
2382
+ ),
2383
+ Schema.Null,
2384
+ ]),
2385
+ ),
2386
+ searchEndpoint: Schema.optional(
2387
+ Schema.Union([
2388
+ Schema.Struct({
2389
+ disabled: Schema.optional(
2390
+ Schema.Union([Schema.Boolean, Schema.Null]),
2391
+ ),
2392
+ }),
2393
+ Schema.Null,
2394
+ ]),
2395
+ ),
2396
+ }).pipe(
2397
+ Schema.encodeKeys({
2398
+ authorizedHosts: "authorized_hosts",
2399
+ chatCompletionsEndpoint: "chat_completions_endpoint",
2400
+ enabled: "enabled",
2401
+ mcp: "mcp",
2402
+ rateLimit: "rate_limit",
2403
+ searchEndpoint: "search_endpoint",
2404
+ }),
2405
+ ),
2406
+ Schema.Null,
2407
+ ]),
2408
+ ),
2409
+ reranking: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2410
+ rerankingModel: Schema.optional(
2411
+ Schema.Union([
2412
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
2413
+ Schema.Null,
2414
+ ]),
2415
+ ),
2416
+ rewriteModel: Schema.optional(
2417
+ Schema.Union([
2418
+ Schema.Literals([
2419
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
2420
+ "@cf/meta/llama-3.1-8b-instruct-fast",
2421
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
2422
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
2423
+ "@cf/qwen/qwen3-30b-a3b-fp8",
2424
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
2425
+ "@cf/moonshotai/kimi-k2-instruct",
2426
+ "anthropic/claude-3-7-sonnet",
2427
+ "anthropic/claude-sonnet-4",
2428
+ "anthropic/claude-opus-4",
2429
+ "anthropic/claude-3-5-haiku",
2430
+ "cerebras/qwen-3-235b-a22b-instruct",
2431
+ "cerebras/qwen-3-235b-a22b-thinking",
2432
+ "cerebras/llama-3.3-70b",
2433
+ "cerebras/llama-4-maverick-17b-128e-instruct",
2434
+ "cerebras/llama-4-scout-17b-16e-instruct",
2435
+ "cerebras/gpt-oss-120b",
2436
+ "google-ai-studio/gemini-2.5-flash",
2437
+ "google-ai-studio/gemini-2.5-pro",
2438
+ "grok/grok-4",
2439
+ "groq/llama-3.3-70b-versatile",
2440
+ "groq/llama-3.1-8b-instant",
2441
+ "openai/gpt-5",
2442
+ "openai/gpt-5-mini",
2443
+ "openai/gpt-5-nano",
2444
+ "",
2445
+ ]),
2446
+ Schema.Null,
2447
+ ]),
2448
+ ),
2449
+ rewriteQuery: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2450
+ scoreThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2451
+ sourceParams: Schema.optional(
2452
+ Schema.Union([
2453
+ Schema.Struct({
2454
+ excludeItems: Schema.optional(
2455
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2456
+ ),
2457
+ includeItems: Schema.optional(
2458
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2459
+ ),
2460
+ prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2461
+ r2Jurisdiction: Schema.optional(
2462
+ Schema.Union([Schema.String, Schema.Null]),
2463
+ ),
2464
+ webCrawler: Schema.optional(
2465
+ Schema.Union([
2466
+ Schema.Struct({
2467
+ parseOptions: Schema.optional(
2468
+ Schema.Union([
2469
+ Schema.Struct({
2470
+ includeHeaders: Schema.optional(
2471
+ Schema.Union([Schema.Struct({}), Schema.Null]),
2472
+ ),
2473
+ includeImages: Schema.optional(
2474
+ Schema.Union([Schema.Boolean, Schema.Null]),
2475
+ ),
2476
+ useBrowserRendering: Schema.optional(
2477
+ Schema.Union([Schema.Boolean, Schema.Null]),
2478
+ ),
2479
+ }).pipe(
2480
+ Schema.encodeKeys({
2481
+ includeHeaders: "include_headers",
2482
+ includeImages: "include_images",
2483
+ useBrowserRendering: "use_browser_rendering",
2484
+ }),
2485
+ ),
2486
+ Schema.Null,
2487
+ ]),
2488
+ ),
2489
+ parseType: Schema.optional(
2490
+ Schema.Union([
2491
+ Schema.Literals(["sitemap", "feed-rss"]),
2492
+ Schema.Null,
2493
+ ]),
2494
+ ),
2495
+ storeOptions: Schema.optional(
2496
+ Schema.Union([
2497
+ Schema.Struct({
2498
+ storageId: Schema.String,
2499
+ r2Jurisdiction: Schema.optional(
2500
+ Schema.Union([Schema.String, Schema.Null]),
2501
+ ),
2502
+ storageType: Schema.optional(
2503
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
2504
+ ),
2505
+ }).pipe(
2506
+ Schema.encodeKeys({
2507
+ storageId: "storage_id",
2508
+ r2Jurisdiction: "r2_jurisdiction",
2509
+ storageType: "storage_type",
2510
+ }),
2511
+ ),
2512
+ Schema.Null,
2513
+ ]),
2514
+ ),
2515
+ }).pipe(
2516
+ Schema.encodeKeys({
2517
+ parseOptions: "parse_options",
2518
+ parseType: "parse_type",
2519
+ storeOptions: "store_options",
2520
+ }),
2521
+ ),
2522
+ Schema.Null,
2523
+ ]),
2524
+ ),
2525
+ }).pipe(
2526
+ Schema.encodeKeys({
2527
+ excludeItems: "exclude_items",
2528
+ includeItems: "include_items",
2529
+ prefix: "prefix",
2530
+ r2Jurisdiction: "r2_jurisdiction",
2531
+ webCrawler: "web_crawler",
2532
+ }),
2533
+ ),
2534
+ Schema.Null,
2535
+ ]),
2536
+ ),
2537
+ status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2538
+ summarization: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2539
+ summarizationModel: Schema.optional(
2540
+ Schema.Union([
2541
+ Schema.Literals([
2542
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
2543
+ "@cf/meta/llama-3.1-8b-instruct-fast",
2544
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
2545
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
2546
+ "@cf/qwen/qwen3-30b-a3b-fp8",
2547
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
2548
+ "@cf/moonshotai/kimi-k2-instruct",
2549
+ "anthropic/claude-3-7-sonnet",
2550
+ "anthropic/claude-sonnet-4",
2551
+ "anthropic/claude-opus-4",
2552
+ "anthropic/claude-3-5-haiku",
2553
+ "cerebras/qwen-3-235b-a22b-instruct",
2554
+ "cerebras/qwen-3-235b-a22b-thinking",
2555
+ "cerebras/llama-3.3-70b",
2556
+ "cerebras/llama-4-maverick-17b-128e-instruct",
2557
+ "cerebras/llama-4-scout-17b-16e-instruct",
2558
+ "cerebras/gpt-oss-120b",
2559
+ "google-ai-studio/gemini-2.5-flash",
2560
+ "google-ai-studio/gemini-2.5-pro",
2561
+ "grok/grok-4",
2562
+ "groq/llama-3.3-70b-versatile",
2563
+ "groq/llama-3.1-8b-instant",
2564
+ "openai/gpt-5",
2565
+ "openai/gpt-5-mini",
2566
+ "openai/gpt-5-nano",
2567
+ "",
2568
+ ]),
2569
+ Schema.Null,
2570
+ ]),
2571
+ ),
2572
+ systemPromptAiSearch: Schema.optional(
2573
+ Schema.Union([Schema.String, Schema.Null]),
2574
+ ),
2575
+ systemPromptIndexSummarization: Schema.optional(
2576
+ Schema.Union([Schema.String, Schema.Null]),
2577
+ ),
2578
+ systemPromptRewriteQuery: Schema.optional(
2579
+ Schema.Union([Schema.String, Schema.Null]),
2580
+ ),
2581
+ vectorizeActiveNamespace: Schema.optional(
2582
+ Schema.Union([Schema.String, Schema.Null]),
2583
+ ),
2584
+ },
2585
+ ).pipe(
2586
+ Schema.encodeKeys({
2587
+ id: "id",
2588
+ accountId: "account_id",
2589
+ accountTag: "account_tag",
2590
+ createdAt: "created_at",
2591
+ internalId: "internal_id",
2592
+ modifiedAt: "modified_at",
2593
+ source: "source",
2594
+ tokenId: "token_id",
2595
+ type: "type",
2596
+ vectorizeName: "vectorize_name",
2597
+ aiGatewayId: "ai_gateway_id",
2598
+ aiSearchModel: "ai_search_model",
2599
+ cache: "cache",
2600
+ cacheThreshold: "cache_threshold",
2601
+ chunk: "chunk",
2602
+ chunkOverlap: "chunk_overlap",
2603
+ chunkSize: "chunk_size",
2604
+ createdBy: "created_by",
2605
+ embeddingModel: "embedding_model",
2606
+ enable: "enable",
2607
+ engineVersion: "engine_version",
2608
+ hybridSearchEnabled: "hybrid_search_enabled",
2609
+ lastActivity: "last_activity",
2610
+ maxNumResults: "max_num_results",
2611
+ metadata: "metadata",
2612
+ modifiedBy: "modified_by",
2613
+ paused: "paused",
2614
+ publicEndpointId: "public_endpoint_id",
2615
+ publicEndpointParams: "public_endpoint_params",
2616
+ reranking: "reranking",
2617
+ rerankingModel: "reranking_model",
2618
+ rewriteModel: "rewrite_model",
2619
+ rewriteQuery: "rewrite_query",
2620
+ scoreThreshold: "score_threshold",
2621
+ sourceParams: "source_params",
2622
+ status: "status",
2623
+ summarization: "summarization",
2624
+ summarizationModel: "summarization_model",
2625
+ systemPromptAiSearch: "system_prompt_ai_search",
2626
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
2627
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
2628
+ vectorizeActiveNamespace: "vectorize_active_namespace",
2629
+ }),
2630
+ ) as unknown as Schema.Schema<UpdateInstanceResponse>;
2631
+
2632
+ export type UpdateInstanceError =
2633
+ | DefaultErrors
2634
+ | ValidationError
2635
+ | NotFound
2636
+ | InvalidRoute;
2637
+
2638
+ export const updateInstance: API.OperationMethod<
2639
+ UpdateInstanceRequest,
2640
+ UpdateInstanceResponse,
2641
+ UpdateInstanceError,
2642
+ Credentials | HttpClient.HttpClient
2643
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2644
+ input: UpdateInstanceRequest,
2645
+ output: UpdateInstanceResponse,
2646
+ errors: [ValidationError, NotFound, InvalidRoute],
2647
+ }));
2648
+
2649
+ export interface DeleteInstanceRequest {
2650
+ id: string;
2651
+ accountId: string;
2652
+ }
2653
+
2654
+ export const DeleteInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2655
+ id: Schema.String.pipe(T.HttpPath("id")),
2656
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2657
+ }).pipe(
2658
+ T.Http({
2659
+ method: "DELETE",
2660
+ path: "/accounts/{account_id}/ai-search/instances/{id}",
2661
+ }),
2662
+ ) as unknown as Schema.Schema<DeleteInstanceRequest>;
2663
+
2664
+ export interface DeleteInstanceResponse {
2665
+ /** Use your AI Search ID. */
2666
+ id: string;
2667
+ accountId?: string | null;
2668
+ accountTag?: string | null;
2669
+ createdAt: string;
2670
+ internalId?: string | null;
2671
+ modifiedAt: string;
2672
+ source: string;
2673
+ tokenId: string;
2674
+ type: "r2" | "web-crawler";
2675
+ vectorizeName: string;
2676
+ aiGatewayId?: string | null;
2677
+ aiSearchModel?:
2678
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2679
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2680
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2681
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2682
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2683
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2684
+ | "@cf/moonshotai/kimi-k2-instruct"
2685
+ | "anthropic/claude-3-7-sonnet"
2686
+ | "anthropic/claude-sonnet-4"
2687
+ | "anthropic/claude-opus-4"
2688
+ | "anthropic/claude-3-5-haiku"
2689
+ | "cerebras/qwen-3-235b-a22b-instruct"
2690
+ | "cerebras/qwen-3-235b-a22b-thinking"
2691
+ | "cerebras/llama-3.3-70b"
2692
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2693
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2694
+ | "cerebras/gpt-oss-120b"
2695
+ | "google-ai-studio/gemini-2.5-flash"
2696
+ | "google-ai-studio/gemini-2.5-pro"
2697
+ | "grok/grok-4"
2698
+ | "groq/llama-3.3-70b-versatile"
2699
+ | "groq/llama-3.1-8b-instant"
2700
+ | "openai/gpt-5"
2701
+ | "openai/gpt-5-mini"
2702
+ | "openai/gpt-5-nano"
2703
+ | ""
2704
+ | null;
2705
+ cache?: boolean | null;
2706
+ cacheThreshold?:
2707
+ | "super_strict_match"
2708
+ | "close_enough"
2709
+ | "flexible_friend"
2710
+ | "anything_goes"
2711
+ | null;
2712
+ chunk?: boolean | null;
2713
+ chunkOverlap?: number | null;
2714
+ chunkSize?: number | null;
2715
+ createdBy?: string | null;
2716
+ embeddingModel?:
2717
+ | "@cf/baai/bge-m3"
2718
+ | "@cf/baai/bge-large-en-v1.5"
2719
+ | "@cf/google/embeddinggemma-300m"
2720
+ | "@cf/qwen/qwen3-embedding-0.6b"
2721
+ | "google-ai-studio/gemini-embedding-001"
2722
+ | "openai/text-embedding-3-small"
2723
+ | "openai/text-embedding-3-large"
2724
+ | ""
2725
+ | null;
2726
+ enable?: boolean | null;
2727
+ engineVersion?: number | null;
2728
+ hybridSearchEnabled?: boolean | null;
2729
+ lastActivity?: string | null;
2730
+ maxNumResults?: number | null;
2731
+ metadata?: {
2732
+ createdFromAisearchWizard?: boolean | null;
2733
+ workerDomain?: string | null;
2734
+ } | null;
2735
+ modifiedBy?: string | null;
2736
+ paused?: boolean | null;
2737
+ publicEndpointId?: string | null;
2738
+ publicEndpointParams?: {
2739
+ authorizedHosts?: string[] | null;
2740
+ chatCompletionsEndpoint?: { disabled?: boolean | null } | null;
2741
+ enabled?: boolean | null;
2742
+ mcp?: { disabled?: boolean | null } | null;
2743
+ rateLimit?: {
2744
+ periodMs?: number | null;
2745
+ requests?: number | null;
2746
+ technique?: "fixed" | "sliding" | null;
2747
+ } | null;
2748
+ searchEndpoint?: { disabled?: boolean | null } | null;
2749
+ } | null;
2750
+ reranking?: boolean | null;
2751
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "" | null;
2752
+ rewriteModel?:
2753
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2754
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2755
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2756
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2757
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2758
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2759
+ | "@cf/moonshotai/kimi-k2-instruct"
2760
+ | "anthropic/claude-3-7-sonnet"
2761
+ | "anthropic/claude-sonnet-4"
2762
+ | "anthropic/claude-opus-4"
2763
+ | "anthropic/claude-3-5-haiku"
2764
+ | "cerebras/qwen-3-235b-a22b-instruct"
2765
+ | "cerebras/qwen-3-235b-a22b-thinking"
2766
+ | "cerebras/llama-3.3-70b"
2767
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2768
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2769
+ | "cerebras/gpt-oss-120b"
2770
+ | "google-ai-studio/gemini-2.5-flash"
2771
+ | "google-ai-studio/gemini-2.5-pro"
2772
+ | "grok/grok-4"
2773
+ | "groq/llama-3.3-70b-versatile"
2774
+ | "groq/llama-3.1-8b-instant"
2775
+ | "openai/gpt-5"
2776
+ | "openai/gpt-5-mini"
2777
+ | "openai/gpt-5-nano"
2778
+ | ""
2779
+ | null;
2780
+ rewriteQuery?: boolean | null;
2781
+ scoreThreshold?: number | null;
2782
+ sourceParams?: {
2783
+ excludeItems?: string[] | null;
2784
+ includeItems?: string[] | null;
2785
+ prefix?: string | null;
2786
+ r2Jurisdiction?: string | null;
2787
+ webCrawler?: {
2788
+ parseOptions?: {
2789
+ includeHeaders?: Record<string, unknown> | null;
2790
+ includeImages?: boolean | null;
2791
+ useBrowserRendering?: boolean | null;
2792
+ } | null;
2793
+ parseType?: "sitemap" | "feed-rss" | null;
2794
+ storeOptions?: {
2795
+ storageId: string;
2796
+ r2Jurisdiction?: string | null;
2797
+ storageType?: "r2" | null;
2798
+ } | null;
2799
+ } | null;
2800
+ } | null;
2801
+ status?: string | null;
2802
+ summarization?: boolean | null;
2803
+ summarizationModel?:
2804
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
2805
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
2806
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
2807
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
2808
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
2809
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
2810
+ | "@cf/moonshotai/kimi-k2-instruct"
2811
+ | "anthropic/claude-3-7-sonnet"
2812
+ | "anthropic/claude-sonnet-4"
2813
+ | "anthropic/claude-opus-4"
2814
+ | "anthropic/claude-3-5-haiku"
2815
+ | "cerebras/qwen-3-235b-a22b-instruct"
2816
+ | "cerebras/qwen-3-235b-a22b-thinking"
2817
+ | "cerebras/llama-3.3-70b"
2818
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
2819
+ | "cerebras/llama-4-scout-17b-16e-instruct"
2820
+ | "cerebras/gpt-oss-120b"
2821
+ | "google-ai-studio/gemini-2.5-flash"
2822
+ | "google-ai-studio/gemini-2.5-pro"
2823
+ | "grok/grok-4"
2824
+ | "groq/llama-3.3-70b-versatile"
2825
+ | "groq/llama-3.1-8b-instant"
2826
+ | "openai/gpt-5"
2827
+ | "openai/gpt-5-mini"
2828
+ | "openai/gpt-5-nano"
2829
+ | ""
2830
+ | null;
2831
+ systemPromptAiSearch?: string | null;
2832
+ systemPromptIndexSummarization?: string | null;
2833
+ systemPromptRewriteQuery?: string | null;
2834
+ vectorizeActiveNamespace?: string | null;
2835
+ }
2836
+
2837
+ export const DeleteInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
2838
+ {
2839
+ id: Schema.String,
2840
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2841
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2842
+ createdAt: Schema.String,
2843
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2844
+ modifiedAt: Schema.String,
2845
+ source: Schema.String,
2846
+ tokenId: Schema.String,
2847
+ type: Schema.Literals(["r2", "web-crawler"]),
2848
+ vectorizeName: Schema.String,
2849
+ aiGatewayId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2850
+ aiSearchModel: Schema.optional(
2851
+ Schema.Union([
2852
+ Schema.Literals([
2853
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
2854
+ "@cf/meta/llama-3.1-8b-instruct-fast",
2855
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
2856
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
2857
+ "@cf/qwen/qwen3-30b-a3b-fp8",
2858
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
2859
+ "@cf/moonshotai/kimi-k2-instruct",
2860
+ "anthropic/claude-3-7-sonnet",
2861
+ "anthropic/claude-sonnet-4",
2862
+ "anthropic/claude-opus-4",
2863
+ "anthropic/claude-3-5-haiku",
2864
+ "cerebras/qwen-3-235b-a22b-instruct",
2865
+ "cerebras/qwen-3-235b-a22b-thinking",
2866
+ "cerebras/llama-3.3-70b",
2867
+ "cerebras/llama-4-maverick-17b-128e-instruct",
2868
+ "cerebras/llama-4-scout-17b-16e-instruct",
2869
+ "cerebras/gpt-oss-120b",
2870
+ "google-ai-studio/gemini-2.5-flash",
2871
+ "google-ai-studio/gemini-2.5-pro",
2872
+ "grok/grok-4",
2873
+ "groq/llama-3.3-70b-versatile",
2874
+ "groq/llama-3.1-8b-instant",
2875
+ "openai/gpt-5",
2876
+ "openai/gpt-5-mini",
2877
+ "openai/gpt-5-nano",
2878
+ "",
2879
+ ]),
2880
+ Schema.Null,
2881
+ ]),
2882
+ ),
2883
+ cache: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2884
+ cacheThreshold: Schema.optional(
2885
+ Schema.Union([
2886
+ Schema.Literal("super_strict_match"),
2887
+ Schema.Literal("close_enough"),
2888
+ Schema.Literal("flexible_friend"),
2889
+ Schema.Literal("anything_goes"),
2890
+ Schema.Null,
2891
+ ]),
2892
+ ),
2893
+ chunk: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2894
+ chunkOverlap: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2895
+ chunkSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2896
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2897
+ embeddingModel: Schema.optional(
2898
+ Schema.Union([
2899
+ Schema.Literals([
2900
+ "@cf/baai/bge-m3",
2901
+ "@cf/baai/bge-large-en-v1.5",
2902
+ "@cf/google/embeddinggemma-300m",
2903
+ "@cf/qwen/qwen3-embedding-0.6b",
2904
+ "google-ai-studio/gemini-embedding-001",
2905
+ "openai/text-embedding-3-small",
2906
+ "openai/text-embedding-3-large",
2907
+ "",
2908
+ ]),
2909
+ Schema.Null,
2910
+ ]),
2911
+ ),
2912
+ enable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2913
+ engineVersion: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2914
+ hybridSearchEnabled: Schema.optional(
2915
+ Schema.Union([Schema.Boolean, Schema.Null]),
2916
+ ),
2917
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2918
+ maxNumResults: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2919
+ metadata: Schema.optional(
2920
+ Schema.Union([
2921
+ Schema.Struct({
2922
+ createdFromAisearchWizard: Schema.optional(
2923
+ Schema.Union([Schema.Boolean, Schema.Null]),
2924
+ ),
2925
+ workerDomain: Schema.optional(
2926
+ Schema.Union([Schema.String, Schema.Null]),
2927
+ ),
2928
+ }).pipe(
2929
+ Schema.encodeKeys({
2930
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
2931
+ workerDomain: "worker_domain",
2932
+ }),
2933
+ ),
2934
+ Schema.Null,
2935
+ ]),
2936
+ ),
2937
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2938
+ paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2939
+ publicEndpointId: Schema.optional(
2940
+ Schema.Union([Schema.String, Schema.Null]),
2941
+ ),
2942
+ publicEndpointParams: Schema.optional(
2943
+ Schema.Union([
2944
+ Schema.Struct({
2945
+ authorizedHosts: Schema.optional(
2946
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2947
+ ),
2948
+ chatCompletionsEndpoint: Schema.optional(
2949
+ Schema.Union([
2950
+ Schema.Struct({
2951
+ disabled: Schema.optional(
2952
+ Schema.Union([Schema.Boolean, Schema.Null]),
2953
+ ),
2954
+ }),
2955
+ Schema.Null,
2956
+ ]),
2957
+ ),
2958
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2959
+ mcp: Schema.optional(
2960
+ Schema.Union([
2961
+ Schema.Struct({
2962
+ disabled: Schema.optional(
2963
+ Schema.Union([Schema.Boolean, Schema.Null]),
2964
+ ),
2965
+ }),
2966
+ Schema.Null,
2967
+ ]),
2968
+ ),
2969
+ rateLimit: Schema.optional(
2970
+ Schema.Union([
2971
+ Schema.Struct({
2972
+ periodMs: Schema.optional(
2973
+ Schema.Union([Schema.Number, Schema.Null]),
2974
+ ),
2975
+ requests: Schema.optional(
2976
+ Schema.Union([Schema.Number, Schema.Null]),
2977
+ ),
2978
+ technique: Schema.optional(
2979
+ Schema.Union([
2980
+ Schema.Literals(["fixed", "sliding"]),
2981
+ Schema.Null,
2982
+ ]),
2983
+ ),
2984
+ }).pipe(
2985
+ Schema.encodeKeys({
2986
+ periodMs: "period_ms",
2987
+ requests: "requests",
2988
+ technique: "technique",
2989
+ }),
2990
+ ),
2991
+ Schema.Null,
2992
+ ]),
2993
+ ),
2994
+ searchEndpoint: Schema.optional(
2995
+ Schema.Union([
2996
+ Schema.Struct({
2997
+ disabled: Schema.optional(
2998
+ Schema.Union([Schema.Boolean, Schema.Null]),
2999
+ ),
3000
+ }),
3001
+ Schema.Null,
3002
+ ]),
3003
+ ),
3004
+ }).pipe(
3005
+ Schema.encodeKeys({
3006
+ authorizedHosts: "authorized_hosts",
3007
+ chatCompletionsEndpoint: "chat_completions_endpoint",
3008
+ enabled: "enabled",
3009
+ mcp: "mcp",
3010
+ rateLimit: "rate_limit",
3011
+ searchEndpoint: "search_endpoint",
3012
+ }),
3013
+ ),
3014
+ Schema.Null,
3015
+ ]),
3016
+ ),
3017
+ reranking: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3018
+ rerankingModel: Schema.optional(
3019
+ Schema.Union([
3020
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
3021
+ Schema.Null,
3022
+ ]),
3023
+ ),
3024
+ rewriteModel: Schema.optional(
3025
+ Schema.Union([
3026
+ Schema.Literals([
3027
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
3028
+ "@cf/meta/llama-3.1-8b-instruct-fast",
3029
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
3030
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
3031
+ "@cf/qwen/qwen3-30b-a3b-fp8",
3032
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
3033
+ "@cf/moonshotai/kimi-k2-instruct",
3034
+ "anthropic/claude-3-7-sonnet",
3035
+ "anthropic/claude-sonnet-4",
3036
+ "anthropic/claude-opus-4",
3037
+ "anthropic/claude-3-5-haiku",
3038
+ "cerebras/qwen-3-235b-a22b-instruct",
3039
+ "cerebras/qwen-3-235b-a22b-thinking",
3040
+ "cerebras/llama-3.3-70b",
3041
+ "cerebras/llama-4-maverick-17b-128e-instruct",
3042
+ "cerebras/llama-4-scout-17b-16e-instruct",
3043
+ "cerebras/gpt-oss-120b",
3044
+ "google-ai-studio/gemini-2.5-flash",
3045
+ "google-ai-studio/gemini-2.5-pro",
3046
+ "grok/grok-4",
3047
+ "groq/llama-3.3-70b-versatile",
3048
+ "groq/llama-3.1-8b-instant",
3049
+ "openai/gpt-5",
3050
+ "openai/gpt-5-mini",
3051
+ "openai/gpt-5-nano",
3052
+ "",
3053
+ ]),
3054
+ Schema.Null,
3055
+ ]),
3056
+ ),
3057
+ rewriteQuery: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3058
+ scoreThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3059
+ sourceParams: Schema.optional(
3060
+ Schema.Union([
3061
+ Schema.Struct({
3062
+ excludeItems: Schema.optional(
3063
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3064
+ ),
3065
+ includeItems: Schema.optional(
3066
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3067
+ ),
3068
+ prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3069
+ r2Jurisdiction: Schema.optional(
3070
+ Schema.Union([Schema.String, Schema.Null]),
3071
+ ),
3072
+ webCrawler: Schema.optional(
3073
+ Schema.Union([
3074
+ Schema.Struct({
3075
+ parseOptions: Schema.optional(
3076
+ Schema.Union([
3077
+ Schema.Struct({
3078
+ includeHeaders: Schema.optional(
3079
+ Schema.Union([Schema.Struct({}), Schema.Null]),
3080
+ ),
3081
+ includeImages: Schema.optional(
3082
+ Schema.Union([Schema.Boolean, Schema.Null]),
3083
+ ),
3084
+ useBrowserRendering: Schema.optional(
3085
+ Schema.Union([Schema.Boolean, Schema.Null]),
3086
+ ),
3087
+ }).pipe(
3088
+ Schema.encodeKeys({
3089
+ includeHeaders: "include_headers",
3090
+ includeImages: "include_images",
3091
+ useBrowserRendering: "use_browser_rendering",
3092
+ }),
3093
+ ),
3094
+ Schema.Null,
3095
+ ]),
3096
+ ),
3097
+ parseType: Schema.optional(
3098
+ Schema.Union([
3099
+ Schema.Literals(["sitemap", "feed-rss"]),
3100
+ Schema.Null,
3101
+ ]),
3102
+ ),
3103
+ storeOptions: Schema.optional(
3104
+ Schema.Union([
3105
+ Schema.Struct({
3106
+ storageId: Schema.String,
3107
+ r2Jurisdiction: Schema.optional(
3108
+ Schema.Union([Schema.String, Schema.Null]),
3109
+ ),
3110
+ storageType: Schema.optional(
3111
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3112
+ ),
3113
+ }).pipe(
3114
+ Schema.encodeKeys({
3115
+ storageId: "storage_id",
3116
+ r2Jurisdiction: "r2_jurisdiction",
3117
+ storageType: "storage_type",
3118
+ }),
3119
+ ),
3120
+ Schema.Null,
3121
+ ]),
3122
+ ),
3123
+ }).pipe(
3124
+ Schema.encodeKeys({
3125
+ parseOptions: "parse_options",
3126
+ parseType: "parse_type",
3127
+ storeOptions: "store_options",
3128
+ }),
3129
+ ),
3130
+ Schema.Null,
3131
+ ]),
3132
+ ),
3133
+ }).pipe(
3134
+ Schema.encodeKeys({
3135
+ excludeItems: "exclude_items",
3136
+ includeItems: "include_items",
3137
+ prefix: "prefix",
3138
+ r2Jurisdiction: "r2_jurisdiction",
3139
+ webCrawler: "web_crawler",
3140
+ }),
3141
+ ),
3142
+ Schema.Null,
3143
+ ]),
3144
+ ),
3145
+ status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3146
+ summarization: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3147
+ summarizationModel: Schema.optional(
3148
+ Schema.Union([
3149
+ Schema.Literals([
3150
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
3151
+ "@cf/meta/llama-3.1-8b-instruct-fast",
3152
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
3153
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
3154
+ "@cf/qwen/qwen3-30b-a3b-fp8",
3155
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
3156
+ "@cf/moonshotai/kimi-k2-instruct",
3157
+ "anthropic/claude-3-7-sonnet",
3158
+ "anthropic/claude-sonnet-4",
3159
+ "anthropic/claude-opus-4",
3160
+ "anthropic/claude-3-5-haiku",
3161
+ "cerebras/qwen-3-235b-a22b-instruct",
3162
+ "cerebras/qwen-3-235b-a22b-thinking",
3163
+ "cerebras/llama-3.3-70b",
3164
+ "cerebras/llama-4-maverick-17b-128e-instruct",
3165
+ "cerebras/llama-4-scout-17b-16e-instruct",
3166
+ "cerebras/gpt-oss-120b",
3167
+ "google-ai-studio/gemini-2.5-flash",
3168
+ "google-ai-studio/gemini-2.5-pro",
3169
+ "grok/grok-4",
3170
+ "groq/llama-3.3-70b-versatile",
3171
+ "groq/llama-3.1-8b-instant",
3172
+ "openai/gpt-5",
3173
+ "openai/gpt-5-mini",
3174
+ "openai/gpt-5-nano",
3175
+ "",
3176
+ ]),
3177
+ Schema.Null,
3178
+ ]),
3179
+ ),
3180
+ systemPromptAiSearch: Schema.optional(
3181
+ Schema.Union([Schema.String, Schema.Null]),
3182
+ ),
3183
+ systemPromptIndexSummarization: Schema.optional(
3184
+ Schema.Union([Schema.String, Schema.Null]),
3185
+ ),
3186
+ systemPromptRewriteQuery: Schema.optional(
3187
+ Schema.Union([Schema.String, Schema.Null]),
3188
+ ),
3189
+ vectorizeActiveNamespace: Schema.optional(
3190
+ Schema.Union([Schema.String, Schema.Null]),
3191
+ ),
3192
+ },
3193
+ ).pipe(
3194
+ Schema.encodeKeys({
3195
+ id: "id",
3196
+ accountId: "account_id",
3197
+ accountTag: "account_tag",
3198
+ createdAt: "created_at",
3199
+ internalId: "internal_id",
3200
+ modifiedAt: "modified_at",
3201
+ source: "source",
3202
+ tokenId: "token_id",
3203
+ type: "type",
3204
+ vectorizeName: "vectorize_name",
3205
+ aiGatewayId: "ai_gateway_id",
3206
+ aiSearchModel: "ai_search_model",
3207
+ cache: "cache",
3208
+ cacheThreshold: "cache_threshold",
3209
+ chunk: "chunk",
3210
+ chunkOverlap: "chunk_overlap",
3211
+ chunkSize: "chunk_size",
3212
+ createdBy: "created_by",
3213
+ embeddingModel: "embedding_model",
3214
+ enable: "enable",
3215
+ engineVersion: "engine_version",
3216
+ hybridSearchEnabled: "hybrid_search_enabled",
3217
+ lastActivity: "last_activity",
3218
+ maxNumResults: "max_num_results",
3219
+ metadata: "metadata",
3220
+ modifiedBy: "modified_by",
3221
+ paused: "paused",
3222
+ publicEndpointId: "public_endpoint_id",
3223
+ publicEndpointParams: "public_endpoint_params",
3224
+ reranking: "reranking",
3225
+ rerankingModel: "reranking_model",
3226
+ rewriteModel: "rewrite_model",
3227
+ rewriteQuery: "rewrite_query",
3228
+ scoreThreshold: "score_threshold",
3229
+ sourceParams: "source_params",
3230
+ status: "status",
3231
+ summarization: "summarization",
3232
+ summarizationModel: "summarization_model",
3233
+ systemPromptAiSearch: "system_prompt_ai_search",
3234
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
3235
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
3236
+ vectorizeActiveNamespace: "vectorize_active_namespace",
3237
+ }),
3238
+ ) as unknown as Schema.Schema<DeleteInstanceResponse>;
3239
+
3240
+ export type DeleteInstanceError =
3241
+ | DefaultErrors
3242
+ | ValidationError
3243
+ | NotFound
3244
+ | InvalidRoute;
3245
+
3246
+ export const deleteInstance: API.OperationMethod<
3247
+ DeleteInstanceRequest,
3248
+ DeleteInstanceResponse,
3249
+ DeleteInstanceError,
3250
+ Credentials | HttpClient.HttpClient
3251
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3252
+ input: DeleteInstanceRequest,
3253
+ output: DeleteInstanceResponse,
3254
+ errors: [ValidationError, NotFound, InvalidRoute],
3255
+ }));
3256
+
3257
+ export interface ReadInstanceRequest {
3258
+ id: string;
3259
+ accountId: string;
3260
+ }
3261
+
3262
+ export const ReadInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3263
+ id: Schema.String.pipe(T.HttpPath("id")),
3264
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3265
+ }).pipe(
3266
+ T.Http({
3267
+ method: "GET",
3268
+ path: "/accounts/{account_id}/ai-search/instances/{id}",
3269
+ }),
3270
+ ) as unknown as Schema.Schema<ReadInstanceRequest>;
3271
+
3272
+ export interface ReadInstanceResponse {
3273
+ /** Use your AI Search ID. */
3274
+ id: string;
3275
+ accountId?: string | null;
3276
+ accountTag?: string | null;
3277
+ createdAt: string;
3278
+ internalId?: string | null;
3279
+ modifiedAt: string;
3280
+ source: string;
3281
+ tokenId: string;
3282
+ type: "r2" | "web-crawler";
3283
+ vectorizeName: string;
3284
+ aiGatewayId?: string | null;
3285
+ aiSearchModel?:
3286
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
3287
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
3288
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
3289
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
3290
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
3291
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
3292
+ | "@cf/moonshotai/kimi-k2-instruct"
3293
+ | "anthropic/claude-3-7-sonnet"
3294
+ | "anthropic/claude-sonnet-4"
3295
+ | "anthropic/claude-opus-4"
3296
+ | "anthropic/claude-3-5-haiku"
3297
+ | "cerebras/qwen-3-235b-a22b-instruct"
3298
+ | "cerebras/qwen-3-235b-a22b-thinking"
3299
+ | "cerebras/llama-3.3-70b"
3300
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
3301
+ | "cerebras/llama-4-scout-17b-16e-instruct"
3302
+ | "cerebras/gpt-oss-120b"
3303
+ | "google-ai-studio/gemini-2.5-flash"
3304
+ | "google-ai-studio/gemini-2.5-pro"
3305
+ | "grok/grok-4"
3306
+ | "groq/llama-3.3-70b-versatile"
3307
+ | "groq/llama-3.1-8b-instant"
3308
+ | "openai/gpt-5"
3309
+ | "openai/gpt-5-mini"
3310
+ | "openai/gpt-5-nano"
3311
+ | ""
3312
+ | null;
3313
+ cache?: boolean | null;
3314
+ cacheThreshold?:
3315
+ | "super_strict_match"
3316
+ | "close_enough"
3317
+ | "flexible_friend"
3318
+ | "anything_goes"
3319
+ | null;
3320
+ chunk?: boolean | null;
3321
+ chunkOverlap?: number | null;
3322
+ chunkSize?: number | null;
3323
+ createdBy?: string | null;
3324
+ embeddingModel?:
3325
+ | "@cf/baai/bge-m3"
3326
+ | "@cf/baai/bge-large-en-v1.5"
3327
+ | "@cf/google/embeddinggemma-300m"
3328
+ | "@cf/qwen/qwen3-embedding-0.6b"
3329
+ | "google-ai-studio/gemini-embedding-001"
3330
+ | "openai/text-embedding-3-small"
3331
+ | "openai/text-embedding-3-large"
3332
+ | ""
3333
+ | null;
3334
+ enable?: boolean | null;
3335
+ engineVersion?: number | null;
3336
+ hybridSearchEnabled?: boolean | null;
3337
+ lastActivity?: string | null;
3338
+ maxNumResults?: number | null;
3339
+ metadata?: {
3340
+ createdFromAisearchWizard?: boolean | null;
3341
+ workerDomain?: string | null;
3342
+ } | null;
3343
+ modifiedBy?: string | null;
3344
+ paused?: boolean | null;
3345
+ publicEndpointId?: string | null;
3346
+ publicEndpointParams?: {
3347
+ authorizedHosts?: string[] | null;
3348
+ chatCompletionsEndpoint?: { disabled?: boolean | null } | null;
3349
+ enabled?: boolean | null;
3350
+ mcp?: { disabled?: boolean | null } | null;
3351
+ rateLimit?: {
3352
+ periodMs?: number | null;
3353
+ requests?: number | null;
3354
+ technique?: "fixed" | "sliding" | null;
3355
+ } | null;
3356
+ searchEndpoint?: { disabled?: boolean | null } | null;
3357
+ } | null;
3358
+ reranking?: boolean | null;
3359
+ rerankingModel?: "@cf/baai/bge-reranker-base" | "" | null;
3360
+ rewriteModel?:
3361
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
3362
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
3363
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
3364
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
3365
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
3366
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
3367
+ | "@cf/moonshotai/kimi-k2-instruct"
3368
+ | "anthropic/claude-3-7-sonnet"
3369
+ | "anthropic/claude-sonnet-4"
3370
+ | "anthropic/claude-opus-4"
3371
+ | "anthropic/claude-3-5-haiku"
3372
+ | "cerebras/qwen-3-235b-a22b-instruct"
3373
+ | "cerebras/qwen-3-235b-a22b-thinking"
3374
+ | "cerebras/llama-3.3-70b"
3375
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
3376
+ | "cerebras/llama-4-scout-17b-16e-instruct"
3377
+ | "cerebras/gpt-oss-120b"
3378
+ | "google-ai-studio/gemini-2.5-flash"
3379
+ | "google-ai-studio/gemini-2.5-pro"
3380
+ | "grok/grok-4"
3381
+ | "groq/llama-3.3-70b-versatile"
3382
+ | "groq/llama-3.1-8b-instant"
3383
+ | "openai/gpt-5"
3384
+ | "openai/gpt-5-mini"
3385
+ | "openai/gpt-5-nano"
3386
+ | ""
3387
+ | null;
3388
+ rewriteQuery?: boolean | null;
3389
+ scoreThreshold?: number | null;
3390
+ sourceParams?: {
3391
+ excludeItems?: string[] | null;
3392
+ includeItems?: string[] | null;
3393
+ prefix?: string | null;
3394
+ r2Jurisdiction?: string | null;
3395
+ webCrawler?: {
3396
+ parseOptions?: {
3397
+ includeHeaders?: Record<string, unknown> | null;
3398
+ includeImages?: boolean | null;
3399
+ useBrowserRendering?: boolean | null;
3400
+ } | null;
3401
+ parseType?: "sitemap" | "feed-rss" | null;
3402
+ storeOptions?: {
3403
+ storageId: string;
3404
+ r2Jurisdiction?: string | null;
3405
+ storageType?: "r2" | null;
3406
+ } | null;
3407
+ } | null;
3408
+ } | null;
3409
+ status?: string | null;
3410
+ summarization?: boolean | null;
3411
+ summarizationModel?:
3412
+ | "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
3413
+ | "@cf/meta/llama-3.1-8b-instruct-fast"
3414
+ | "@cf/meta/llama-3.1-8b-instruct-fp8"
3415
+ | "@cf/meta/llama-4-scout-17b-16e-instruct"
3416
+ | "@cf/qwen/qwen3-30b-a3b-fp8"
3417
+ | "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
3418
+ | "@cf/moonshotai/kimi-k2-instruct"
3419
+ | "anthropic/claude-3-7-sonnet"
3420
+ | "anthropic/claude-sonnet-4"
3421
+ | "anthropic/claude-opus-4"
3422
+ | "anthropic/claude-3-5-haiku"
3423
+ | "cerebras/qwen-3-235b-a22b-instruct"
3424
+ | "cerebras/qwen-3-235b-a22b-thinking"
3425
+ | "cerebras/llama-3.3-70b"
3426
+ | "cerebras/llama-4-maverick-17b-128e-instruct"
3427
+ | "cerebras/llama-4-scout-17b-16e-instruct"
3428
+ | "cerebras/gpt-oss-120b"
3429
+ | "google-ai-studio/gemini-2.5-flash"
3430
+ | "google-ai-studio/gemini-2.5-pro"
3431
+ | "grok/grok-4"
3432
+ | "groq/llama-3.3-70b-versatile"
3433
+ | "groq/llama-3.1-8b-instant"
3434
+ | "openai/gpt-5"
3435
+ | "openai/gpt-5-mini"
3436
+ | "openai/gpt-5-nano"
3437
+ | ""
3438
+ | null;
3439
+ systemPromptAiSearch?: string | null;
3440
+ systemPromptIndexSummarization?: string | null;
3441
+ systemPromptRewriteQuery?: string | null;
3442
+ vectorizeActiveNamespace?: string | null;
3443
+ }
3444
+
3445
+ export const ReadInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3446
+ id: Schema.String,
3447
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3448
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3449
+ createdAt: Schema.String,
3450
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3451
+ modifiedAt: Schema.String,
3452
+ source: Schema.String,
3453
+ tokenId: Schema.String,
3454
+ type: Schema.Literals(["r2", "web-crawler"]),
3455
+ vectorizeName: Schema.String,
3456
+ aiGatewayId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3457
+ aiSearchModel: Schema.optional(
3458
+ Schema.Union([
3459
+ Schema.Literals([
3460
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
3461
+ "@cf/meta/llama-3.1-8b-instruct-fast",
3462
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
3463
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
3464
+ "@cf/qwen/qwen3-30b-a3b-fp8",
3465
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
3466
+ "@cf/moonshotai/kimi-k2-instruct",
3467
+ "anthropic/claude-3-7-sonnet",
3468
+ "anthropic/claude-sonnet-4",
3469
+ "anthropic/claude-opus-4",
3470
+ "anthropic/claude-3-5-haiku",
3471
+ "cerebras/qwen-3-235b-a22b-instruct",
3472
+ "cerebras/qwen-3-235b-a22b-thinking",
3473
+ "cerebras/llama-3.3-70b",
3474
+ "cerebras/llama-4-maverick-17b-128e-instruct",
3475
+ "cerebras/llama-4-scout-17b-16e-instruct",
3476
+ "cerebras/gpt-oss-120b",
3477
+ "google-ai-studio/gemini-2.5-flash",
3478
+ "google-ai-studio/gemini-2.5-pro",
3479
+ "grok/grok-4",
3480
+ "groq/llama-3.3-70b-versatile",
3481
+ "groq/llama-3.1-8b-instant",
3482
+ "openai/gpt-5",
3483
+ "openai/gpt-5-mini",
3484
+ "openai/gpt-5-nano",
3485
+ "",
3486
+ ]),
3487
+ Schema.Null,
3488
+ ]),
3489
+ ),
3490
+ cache: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3491
+ cacheThreshold: Schema.optional(
3492
+ Schema.Union([
3493
+ Schema.Literal("super_strict_match"),
3494
+ Schema.Literal("close_enough"),
3495
+ Schema.Literal("flexible_friend"),
3496
+ Schema.Literal("anything_goes"),
3497
+ Schema.Null,
3498
+ ]),
3499
+ ),
3500
+ chunk: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3501
+ chunkOverlap: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3502
+ chunkSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3503
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3504
+ embeddingModel: Schema.optional(
3505
+ Schema.Union([
3506
+ Schema.Literals([
3507
+ "@cf/baai/bge-m3",
3508
+ "@cf/baai/bge-large-en-v1.5",
3509
+ "@cf/google/embeddinggemma-300m",
3510
+ "@cf/qwen/qwen3-embedding-0.6b",
3511
+ "google-ai-studio/gemini-embedding-001",
3512
+ "openai/text-embedding-3-small",
3513
+ "openai/text-embedding-3-large",
3514
+ "",
3515
+ ]),
3516
+ Schema.Null,
3517
+ ]),
3518
+ ),
3519
+ enable: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3520
+ engineVersion: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3521
+ hybridSearchEnabled: Schema.optional(
3522
+ Schema.Union([Schema.Boolean, Schema.Null]),
3523
+ ),
3524
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3525
+ maxNumResults: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3526
+ metadata: Schema.optional(
3527
+ Schema.Union([
3528
+ Schema.Struct({
3529
+ createdFromAisearchWizard: Schema.optional(
3530
+ Schema.Union([Schema.Boolean, Schema.Null]),
3531
+ ),
3532
+ workerDomain: Schema.optional(
3533
+ Schema.Union([Schema.String, Schema.Null]),
3534
+ ),
3535
+ }).pipe(
3536
+ Schema.encodeKeys({
3537
+ createdFromAisearchWizard: "created_from_aisearch_wizard",
3538
+ workerDomain: "worker_domain",
3539
+ }),
3540
+ ),
3541
+ Schema.Null,
3542
+ ]),
3543
+ ),
3544
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3545
+ paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3546
+ publicEndpointId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3547
+ publicEndpointParams: Schema.optional(
3548
+ Schema.Union([
3549
+ Schema.Struct({
3550
+ authorizedHosts: Schema.optional(
3551
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3552
+ ),
3553
+ chatCompletionsEndpoint: Schema.optional(
3554
+ Schema.Union([
3555
+ Schema.Struct({
3556
+ disabled: Schema.optional(
3557
+ Schema.Union([Schema.Boolean, Schema.Null]),
3558
+ ),
3559
+ }),
3560
+ Schema.Null,
3561
+ ]),
3562
+ ),
3563
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3564
+ mcp: Schema.optional(
3565
+ Schema.Union([
3566
+ Schema.Struct({
3567
+ disabled: Schema.optional(
3568
+ Schema.Union([Schema.Boolean, Schema.Null]),
3569
+ ),
3570
+ }),
3571
+ Schema.Null,
3572
+ ]),
3573
+ ),
3574
+ rateLimit: Schema.optional(
3575
+ Schema.Union([
3576
+ Schema.Struct({
3577
+ periodMs: Schema.optional(
3578
+ Schema.Union([Schema.Number, Schema.Null]),
3579
+ ),
3580
+ requests: Schema.optional(
3581
+ Schema.Union([Schema.Number, Schema.Null]),
3582
+ ),
3583
+ technique: Schema.optional(
3584
+ Schema.Union([
3585
+ Schema.Literals(["fixed", "sliding"]),
3586
+ Schema.Null,
3587
+ ]),
3588
+ ),
3589
+ }).pipe(
3590
+ Schema.encodeKeys({
3591
+ periodMs: "period_ms",
3592
+ requests: "requests",
3593
+ technique: "technique",
3594
+ }),
3595
+ ),
3596
+ Schema.Null,
3597
+ ]),
3598
+ ),
3599
+ searchEndpoint: Schema.optional(
3600
+ Schema.Union([
3601
+ Schema.Struct({
3602
+ disabled: Schema.optional(
3603
+ Schema.Union([Schema.Boolean, Schema.Null]),
3604
+ ),
3605
+ }),
3606
+ Schema.Null,
3607
+ ]),
3608
+ ),
3609
+ }).pipe(
3610
+ Schema.encodeKeys({
3611
+ authorizedHosts: "authorized_hosts",
3612
+ chatCompletionsEndpoint: "chat_completions_endpoint",
3613
+ enabled: "enabled",
3614
+ mcp: "mcp",
3615
+ rateLimit: "rate_limit",
3616
+ searchEndpoint: "search_endpoint",
3617
+ }),
3618
+ ),
3619
+ Schema.Null,
3620
+ ]),
3621
+ ),
3622
+ reranking: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3623
+ rerankingModel: Schema.optional(
3624
+ Schema.Union([
3625
+ Schema.Literals(["@cf/baai/bge-reranker-base", ""]),
3626
+ Schema.Null,
3627
+ ]),
3628
+ ),
3629
+ rewriteModel: Schema.optional(
3630
+ Schema.Union([
3631
+ Schema.Literals([
3632
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
3633
+ "@cf/meta/llama-3.1-8b-instruct-fast",
3634
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
3635
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
3636
+ "@cf/qwen/qwen3-30b-a3b-fp8",
3637
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
3638
+ "@cf/moonshotai/kimi-k2-instruct",
3639
+ "anthropic/claude-3-7-sonnet",
3640
+ "anthropic/claude-sonnet-4",
3641
+ "anthropic/claude-opus-4",
3642
+ "anthropic/claude-3-5-haiku",
3643
+ "cerebras/qwen-3-235b-a22b-instruct",
3644
+ "cerebras/qwen-3-235b-a22b-thinking",
3645
+ "cerebras/llama-3.3-70b",
3646
+ "cerebras/llama-4-maverick-17b-128e-instruct",
3647
+ "cerebras/llama-4-scout-17b-16e-instruct",
3648
+ "cerebras/gpt-oss-120b",
3649
+ "google-ai-studio/gemini-2.5-flash",
3650
+ "google-ai-studio/gemini-2.5-pro",
3651
+ "grok/grok-4",
3652
+ "groq/llama-3.3-70b-versatile",
3653
+ "groq/llama-3.1-8b-instant",
3654
+ "openai/gpt-5",
3655
+ "openai/gpt-5-mini",
3656
+ "openai/gpt-5-nano",
3657
+ "",
3658
+ ]),
3659
+ Schema.Null,
3660
+ ]),
3661
+ ),
3662
+ rewriteQuery: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3663
+ scoreThreshold: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3664
+ sourceParams: Schema.optional(
3665
+ Schema.Union([
3666
+ Schema.Struct({
3667
+ excludeItems: Schema.optional(
3668
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3669
+ ),
3670
+ includeItems: Schema.optional(
3671
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3672
+ ),
3673
+ prefix: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3674
+ r2Jurisdiction: Schema.optional(
3675
+ Schema.Union([Schema.String, Schema.Null]),
3676
+ ),
3677
+ webCrawler: Schema.optional(
3678
+ Schema.Union([
3679
+ Schema.Struct({
3680
+ parseOptions: Schema.optional(
3681
+ Schema.Union([
3682
+ Schema.Struct({
3683
+ includeHeaders: Schema.optional(
3684
+ Schema.Union([Schema.Struct({}), Schema.Null]),
3685
+ ),
3686
+ includeImages: Schema.optional(
3687
+ Schema.Union([Schema.Boolean, Schema.Null]),
3688
+ ),
3689
+ useBrowserRendering: Schema.optional(
3690
+ Schema.Union([Schema.Boolean, Schema.Null]),
3691
+ ),
3692
+ }).pipe(
3693
+ Schema.encodeKeys({
3694
+ includeHeaders: "include_headers",
3695
+ includeImages: "include_images",
3696
+ useBrowserRendering: "use_browser_rendering",
3697
+ }),
3698
+ ),
3699
+ Schema.Null,
3700
+ ]),
3701
+ ),
3702
+ parseType: Schema.optional(
3703
+ Schema.Union([
3704
+ Schema.Literals(["sitemap", "feed-rss"]),
3705
+ Schema.Null,
3706
+ ]),
3707
+ ),
3708
+ storeOptions: Schema.optional(
3709
+ Schema.Union([
3710
+ Schema.Struct({
3711
+ storageId: Schema.String,
3712
+ r2Jurisdiction: Schema.optional(
3713
+ Schema.Union([Schema.String, Schema.Null]),
3714
+ ),
3715
+ storageType: Schema.optional(
3716
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3717
+ ),
3718
+ }).pipe(
3719
+ Schema.encodeKeys({
3720
+ storageId: "storage_id",
3721
+ r2Jurisdiction: "r2_jurisdiction",
3722
+ storageType: "storage_type",
3723
+ }),
3724
+ ),
3725
+ Schema.Null,
3726
+ ]),
3727
+ ),
3728
+ }).pipe(
3729
+ Schema.encodeKeys({
3730
+ parseOptions: "parse_options",
3731
+ parseType: "parse_type",
3732
+ storeOptions: "store_options",
3733
+ }),
3734
+ ),
3735
+ Schema.Null,
3736
+ ]),
3737
+ ),
3738
+ }).pipe(
3739
+ Schema.encodeKeys({
3740
+ excludeItems: "exclude_items",
3741
+ includeItems: "include_items",
3742
+ prefix: "prefix",
3743
+ r2Jurisdiction: "r2_jurisdiction",
3744
+ webCrawler: "web_crawler",
3745
+ }),
3746
+ ),
3747
+ Schema.Null,
3748
+ ]),
3749
+ ),
3750
+ status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3751
+ summarization: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3752
+ summarizationModel: Schema.optional(
3753
+ Schema.Union([
3754
+ Schema.Literals([
3755
+ "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
3756
+ "@cf/meta/llama-3.1-8b-instruct-fast",
3757
+ "@cf/meta/llama-3.1-8b-instruct-fp8",
3758
+ "@cf/meta/llama-4-scout-17b-16e-instruct",
3759
+ "@cf/qwen/qwen3-30b-a3b-fp8",
3760
+ "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",
3761
+ "@cf/moonshotai/kimi-k2-instruct",
3762
+ "anthropic/claude-3-7-sonnet",
3763
+ "anthropic/claude-sonnet-4",
3764
+ "anthropic/claude-opus-4",
3765
+ "anthropic/claude-3-5-haiku",
3766
+ "cerebras/qwen-3-235b-a22b-instruct",
3767
+ "cerebras/qwen-3-235b-a22b-thinking",
3768
+ "cerebras/llama-3.3-70b",
3769
+ "cerebras/llama-4-maverick-17b-128e-instruct",
3770
+ "cerebras/llama-4-scout-17b-16e-instruct",
3771
+ "cerebras/gpt-oss-120b",
3772
+ "google-ai-studio/gemini-2.5-flash",
3773
+ "google-ai-studio/gemini-2.5-pro",
3774
+ "grok/grok-4",
3775
+ "groq/llama-3.3-70b-versatile",
3776
+ "groq/llama-3.1-8b-instant",
3777
+ "openai/gpt-5",
3778
+ "openai/gpt-5-mini",
3779
+ "openai/gpt-5-nano",
3780
+ "",
3781
+ ]),
3782
+ Schema.Null,
3783
+ ]),
3784
+ ),
3785
+ systemPromptAiSearch: Schema.optional(
3786
+ Schema.Union([Schema.String, Schema.Null]),
3787
+ ),
3788
+ systemPromptIndexSummarization: Schema.optional(
3789
+ Schema.Union([Schema.String, Schema.Null]),
3790
+ ),
3791
+ systemPromptRewriteQuery: Schema.optional(
3792
+ Schema.Union([Schema.String, Schema.Null]),
3793
+ ),
3794
+ vectorizeActiveNamespace: Schema.optional(
3795
+ Schema.Union([Schema.String, Schema.Null]),
3796
+ ),
3797
+ }).pipe(
3798
+ Schema.encodeKeys({
3799
+ id: "id",
3800
+ accountId: "account_id",
3801
+ accountTag: "account_tag",
3802
+ createdAt: "created_at",
3803
+ internalId: "internal_id",
3804
+ modifiedAt: "modified_at",
3805
+ source: "source",
3806
+ tokenId: "token_id",
3807
+ type: "type",
3808
+ vectorizeName: "vectorize_name",
3809
+ aiGatewayId: "ai_gateway_id",
3810
+ aiSearchModel: "ai_search_model",
3811
+ cache: "cache",
3812
+ cacheThreshold: "cache_threshold",
3813
+ chunk: "chunk",
3814
+ chunkOverlap: "chunk_overlap",
3815
+ chunkSize: "chunk_size",
3816
+ createdBy: "created_by",
3817
+ embeddingModel: "embedding_model",
3818
+ enable: "enable",
3819
+ engineVersion: "engine_version",
3820
+ hybridSearchEnabled: "hybrid_search_enabled",
3821
+ lastActivity: "last_activity",
3822
+ maxNumResults: "max_num_results",
3823
+ metadata: "metadata",
3824
+ modifiedBy: "modified_by",
3825
+ paused: "paused",
3826
+ publicEndpointId: "public_endpoint_id",
3827
+ publicEndpointParams: "public_endpoint_params",
3828
+ reranking: "reranking",
3829
+ rerankingModel: "reranking_model",
3830
+ rewriteModel: "rewrite_model",
3831
+ rewriteQuery: "rewrite_query",
3832
+ scoreThreshold: "score_threshold",
3833
+ sourceParams: "source_params",
3834
+ status: "status",
3835
+ summarization: "summarization",
3836
+ summarizationModel: "summarization_model",
3837
+ systemPromptAiSearch: "system_prompt_ai_search",
3838
+ systemPromptIndexSummarization: "system_prompt_index_summarization",
3839
+ systemPromptRewriteQuery: "system_prompt_rewrite_query",
3840
+ vectorizeActiveNamespace: "vectorize_active_namespace",
3841
+ }),
3842
+ ) as unknown as Schema.Schema<ReadInstanceResponse>;
3843
+
3844
+ export type ReadInstanceError =
3845
+ | DefaultErrors
3846
+ | ValidationError
3847
+ | NotFound
3848
+ | InvalidRoute;
3849
+
3850
+ export const readInstance: API.OperationMethod<
3851
+ ReadInstanceRequest,
3852
+ ReadInstanceResponse,
3853
+ ReadInstanceError,
3854
+ Credentials | HttpClient.HttpClient
3855
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3856
+ input: ReadInstanceRequest,
3857
+ output: ReadInstanceResponse,
3858
+ errors: [ValidationError, NotFound, InvalidRoute],
3859
+ }));
3860
+
3861
+ export interface StatsInstanceRequest {
3862
+ id: string;
3863
+ accountId: string;
3864
+ }
3865
+
3866
+ export const StatsInstanceRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3867
+ id: Schema.String.pipe(T.HttpPath("id")),
3868
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3869
+ }).pipe(
3870
+ T.Http({
3871
+ method: "GET",
3872
+ path: "/accounts/{account_id}/ai-search/instances/{id}/stats",
3873
+ }),
3874
+ ) as unknown as Schema.Schema<StatsInstanceRequest>;
3875
+
3876
+ export interface StatsInstanceResponse {
3877
+ completed?: number | null;
3878
+ error?: number | null;
3879
+ fileEmbedErrors?: Record<string, unknown> | null;
3880
+ indexSourceErrors?: Record<string, unknown> | null;
3881
+ lastActivity?: string | null;
3882
+ queued?: number | null;
3883
+ running?: number | null;
3884
+ skipped?: number | null;
3885
+ }
3886
+
3887
+ export const StatsInstanceResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3888
+ completed: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3889
+ error: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3890
+ fileEmbedErrors: Schema.optional(
3891
+ Schema.Union([Schema.Struct({}), Schema.Null]),
3892
+ ),
3893
+ indexSourceErrors: Schema.optional(
3894
+ Schema.Union([Schema.Struct({}), Schema.Null]),
3895
+ ),
3896
+ lastActivity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3897
+ queued: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3898
+ running: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3899
+ skipped: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3900
+ }).pipe(
3901
+ Schema.encodeKeys({
3902
+ completed: "completed",
3903
+ error: "error",
3904
+ fileEmbedErrors: "file_embed_errors",
3905
+ indexSourceErrors: "index_source_errors",
3906
+ lastActivity: "last_activity",
3907
+ queued: "queued",
3908
+ running: "running",
3909
+ skipped: "skipped",
3910
+ }),
3911
+ ) as unknown as Schema.Schema<StatsInstanceResponse>;
3912
+
3913
+ export type StatsInstanceError =
3914
+ | DefaultErrors
3915
+ | ValidationError
3916
+ | NotFound
3917
+ | InvalidRoute;
3918
+
3919
+ export const statsInstance: API.OperationMethod<
3920
+ StatsInstanceRequest,
3921
+ StatsInstanceResponse,
3922
+ StatsInstanceError,
3923
+ Credentials | HttpClient.HttpClient
3924
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3925
+ input: StatsInstanceRequest,
3926
+ output: StatsInstanceResponse,
3927
+ errors: [ValidationError, NotFound, InvalidRoute],
3928
+ }));
3929
+
3930
+ // =============================================================================
3931
+ // InstanceItem
3932
+ // =============================================================================
3933
+
3934
+ export interface GetInstanceItemRequest {
3935
+ id: string;
3936
+ itemId: string;
3937
+ accountId: string;
3938
+ }
3939
+
3940
+ export const GetInstanceItemRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
3941
+ {
3942
+ id: Schema.String.pipe(T.HttpPath("id")),
3943
+ itemId: Schema.String.pipe(T.HttpPath("itemId")),
3944
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3945
+ },
3946
+ ).pipe(
3947
+ T.Http({
3948
+ method: "GET",
3949
+ path: "/accounts/{account_id}/ai-search/instances/{id}/items/{itemId}",
3950
+ }),
3951
+ ) as unknown as Schema.Schema<GetInstanceItemRequest>;
3952
+
3953
+ export interface GetInstanceItemResponse {
3954
+ id: string;
3955
+ key: string;
3956
+ status: "queued" | "running" | "completed" | "error" | "skipped";
3957
+ error?: string | null;
3958
+ lastSeenAt?: string | null;
3959
+ nextAction?: string | null;
3960
+ }
3961
+
3962
+ export const GetInstanceItemResponse =
3963
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3964
+ id: Schema.String,
3965
+ key: Schema.String,
3966
+ status: Schema.Literals([
3967
+ "queued",
3968
+ "running",
3969
+ "completed",
3970
+ "error",
3971
+ "skipped",
3972
+ ]),
3973
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3974
+ lastSeenAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3975
+ nextAction: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3976
+ }).pipe(
3977
+ Schema.encodeKeys({
3978
+ id: "id",
3979
+ key: "key",
3980
+ status: "status",
3981
+ error: "error",
3982
+ lastSeenAt: "last_seen_at",
3983
+ nextAction: "next_action",
3984
+ }),
3985
+ ) as unknown as Schema.Schema<GetInstanceItemResponse>;
3986
+
3987
+ export type GetInstanceItemError =
3988
+ | DefaultErrors
3989
+ | ValidationError
3990
+ | NotFound
3991
+ | InvalidRoute;
3992
+
3993
+ export const getInstanceItem: API.OperationMethod<
3994
+ GetInstanceItemRequest,
3995
+ GetInstanceItemResponse,
3996
+ GetInstanceItemError,
3997
+ Credentials | HttpClient.HttpClient
3998
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3999
+ input: GetInstanceItemRequest,
4000
+ output: GetInstanceItemResponse,
4001
+ errors: [ValidationError, NotFound, InvalidRoute],
4002
+ }));
4003
+
4004
+ export interface ListInstanceItemsRequest {
4005
+ id: string;
4006
+ /** Path param: */
4007
+ accountId: string;
4008
+ /** Query param: */
4009
+ search?: string;
4010
+ /** Query param: */
4011
+ status?: "queued" | "running" | "completed" | "error" | "skipped";
4012
+ }
4013
+
4014
+ export const ListInstanceItemsRequest =
4015
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4016
+ id: Schema.String.pipe(T.HttpPath("id")),
4017
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4018
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
4019
+ status: Schema.optional(
4020
+ Schema.Literals(["queued", "running", "completed", "error", "skipped"]),
4021
+ ).pipe(T.HttpQuery("status")),
4022
+ }).pipe(
4023
+ T.Http({
4024
+ method: "GET",
4025
+ path: "/accounts/{account_id}/ai-search/instances/{id}/items",
4026
+ }),
4027
+ ) as unknown as Schema.Schema<ListInstanceItemsRequest>;
4028
+
4029
+ export type ListInstanceItemsResponse = {
4030
+ id: string;
4031
+ key: string;
4032
+ status: "queued" | "running" | "completed" | "error" | "skipped";
4033
+ error?: string | null;
4034
+ lastSeenAt?: string | null;
4035
+ nextAction?: string | null;
4036
+ }[];
4037
+
4038
+ export const ListInstanceItemsResponse =
4039
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
4040
+ Schema.Struct({
4041
+ id: Schema.String,
4042
+ key: Schema.String,
4043
+ status: Schema.Literals([
4044
+ "queued",
4045
+ "running",
4046
+ "completed",
4047
+ "error",
4048
+ "skipped",
4049
+ ]),
4050
+ error: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4051
+ lastSeenAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4052
+ nextAction: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4053
+ }).pipe(
4054
+ Schema.encodeKeys({
4055
+ id: "id",
4056
+ key: "key",
4057
+ status: "status",
4058
+ error: "error",
4059
+ lastSeenAt: "last_seen_at",
4060
+ nextAction: "next_action",
4061
+ }),
4062
+ ),
4063
+ ) as unknown as Schema.Schema<ListInstanceItemsResponse>;
4064
+
4065
+ export type ListInstanceItemsError = DefaultErrors;
4066
+
4067
+ export const listInstanceItems: API.OperationMethod<
4068
+ ListInstanceItemsRequest,
4069
+ ListInstanceItemsResponse,
4070
+ ListInstanceItemsError,
4071
+ Credentials | HttpClient.HttpClient
4072
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4073
+ input: ListInstanceItemsRequest,
4074
+ output: ListInstanceItemsResponse,
4075
+ errors: [],
4076
+ }));
4077
+
4078
+ // =============================================================================
4079
+ // InstanceJob
4080
+ // =============================================================================
4081
+
4082
+ export interface GetInstanceJobRequest {
4083
+ id: string;
4084
+ jobId: string;
4085
+ accountId: string;
4086
+ }
4087
+
4088
+ export const GetInstanceJobRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4089
+ id: Schema.String.pipe(T.HttpPath("id")),
4090
+ jobId: Schema.String.pipe(T.HttpPath("jobId")),
4091
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4092
+ }).pipe(
4093
+ T.Http({
4094
+ method: "GET",
4095
+ path: "/accounts/{account_id}/ai-search/instances/{id}/jobs/{jobId}",
4096
+ }),
4097
+ ) as unknown as Schema.Schema<GetInstanceJobRequest>;
4098
+
4099
+ export interface GetInstanceJobResponse {
4100
+ id: string;
4101
+ source: "user" | "schedule";
4102
+ endReason?: string | null;
4103
+ endedAt?: string | null;
4104
+ lastSeenAt?: string | null;
4105
+ startedAt?: string | null;
4106
+ }
4107
+
4108
+ export const GetInstanceJobResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
4109
+ {
4110
+ id: Schema.String,
4111
+ source: Schema.Literals(["user", "schedule"]),
4112
+ endReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4113
+ endedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4114
+ lastSeenAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4115
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4116
+ },
4117
+ ).pipe(
4118
+ Schema.encodeKeys({
4119
+ id: "id",
4120
+ source: "source",
4121
+ endReason: "end_reason",
4122
+ endedAt: "ended_at",
4123
+ lastSeenAt: "last_seen_at",
4124
+ startedAt: "started_at",
4125
+ }),
4126
+ ) as unknown as Schema.Schema<GetInstanceJobResponse>;
4127
+
4128
+ export type GetInstanceJobError =
4129
+ | DefaultErrors
4130
+ | ValidationError
4131
+ | NotFound
4132
+ | InvalidRoute;
4133
+
4134
+ export const getInstanceJob: API.OperationMethod<
4135
+ GetInstanceJobRequest,
4136
+ GetInstanceJobResponse,
4137
+ GetInstanceJobError,
4138
+ Credentials | HttpClient.HttpClient
4139
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4140
+ input: GetInstanceJobRequest,
4141
+ output: GetInstanceJobResponse,
4142
+ errors: [ValidationError, NotFound, InvalidRoute],
4143
+ }));
4144
+
4145
+ export interface ListInstanceJobsRequest {
4146
+ id: string;
4147
+ /** Path param: */
4148
+ accountId: string;
4149
+ }
4150
+
4151
+ export const ListInstanceJobsRequest =
4152
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4153
+ id: Schema.String.pipe(T.HttpPath("id")),
4154
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4155
+ }).pipe(
4156
+ T.Http({
4157
+ method: "GET",
4158
+ path: "/accounts/{account_id}/ai-search/instances/{id}/jobs",
4159
+ }),
4160
+ ) as unknown as Schema.Schema<ListInstanceJobsRequest>;
4161
+
4162
+ export type ListInstanceJobsResponse = {
4163
+ id: string;
4164
+ source: "user" | "schedule";
4165
+ endReason?: string | null;
4166
+ endedAt?: string | null;
4167
+ lastSeenAt?: string | null;
4168
+ startedAt?: string | null;
4169
+ }[];
4170
+
4171
+ export const ListInstanceJobsResponse =
4172
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
4173
+ Schema.Struct({
4174
+ id: Schema.String,
4175
+ source: Schema.Literals(["user", "schedule"]),
4176
+ endReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4177
+ endedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4178
+ lastSeenAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4179
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4180
+ }).pipe(
4181
+ Schema.encodeKeys({
4182
+ id: "id",
4183
+ source: "source",
4184
+ endReason: "end_reason",
4185
+ endedAt: "ended_at",
4186
+ lastSeenAt: "last_seen_at",
4187
+ startedAt: "started_at",
4188
+ }),
4189
+ ),
4190
+ ) as unknown as Schema.Schema<ListInstanceJobsResponse>;
4191
+
4192
+ export type ListInstanceJobsError = DefaultErrors;
4193
+
4194
+ export const listInstanceJobs: API.OperationMethod<
4195
+ ListInstanceJobsRequest,
4196
+ ListInstanceJobsResponse,
4197
+ ListInstanceJobsError,
4198
+ Credentials | HttpClient.HttpClient
4199
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4200
+ input: ListInstanceJobsRequest,
4201
+ output: ListInstanceJobsResponse,
4202
+ errors: [],
4203
+ }));
4204
+
4205
+ export interface CreateInstanceJobRequest {
4206
+ id: string;
4207
+ accountId: string;
4208
+ }
4209
+
4210
+ export const CreateInstanceJobRequest =
4211
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4212
+ id: Schema.String.pipe(T.HttpPath("id")),
4213
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4214
+ }).pipe(
4215
+ T.Http({
4216
+ method: "POST",
4217
+ path: "/accounts/{account_id}/ai-search/instances/{id}/jobs",
4218
+ }),
4219
+ ) as unknown as Schema.Schema<CreateInstanceJobRequest>;
4220
+
4221
+ export interface CreateInstanceJobResponse {
4222
+ id: string;
4223
+ source: "user" | "schedule";
4224
+ endReason?: string | null;
4225
+ endedAt?: string | null;
4226
+ lastSeenAt?: string | null;
4227
+ startedAt?: string | null;
4228
+ }
4229
+
4230
+ export const CreateInstanceJobResponse =
4231
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4232
+ id: Schema.String,
4233
+ source: Schema.Literals(["user", "schedule"]),
4234
+ endReason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4235
+ endedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4236
+ lastSeenAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4237
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4238
+ }).pipe(
4239
+ Schema.encodeKeys({
4240
+ id: "id",
4241
+ source: "source",
4242
+ endReason: "end_reason",
4243
+ endedAt: "ended_at",
4244
+ lastSeenAt: "last_seen_at",
4245
+ startedAt: "started_at",
4246
+ }),
4247
+ ) as unknown as Schema.Schema<CreateInstanceJobResponse>;
4248
+
4249
+ export type CreateInstanceJobError =
4250
+ | DefaultErrors
4251
+ | ValidationError
4252
+ | NotFound
4253
+ | InvalidRoute
4254
+ | UnableToConnect
4255
+ | SyncInCooldown;
4256
+
4257
+ export const createInstanceJob: API.OperationMethod<
4258
+ CreateInstanceJobRequest,
4259
+ CreateInstanceJobResponse,
4260
+ CreateInstanceJobError,
4261
+ Credentials | HttpClient.HttpClient
4262
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4263
+ input: CreateInstanceJobRequest,
4264
+ output: CreateInstanceJobResponse,
4265
+ errors: [
4266
+ ValidationError,
4267
+ NotFound,
4268
+ InvalidRoute,
4269
+ UnableToConnect,
4270
+ SyncInCooldown,
4271
+ ],
4272
+ }));
4273
+
4274
+ export interface LogsInstanceJobRequest {
4275
+ id: string;
4276
+ jobId: string;
4277
+ /** Path param: */
4278
+ accountId: string;
4279
+ /** Query param: */
4280
+ page?: number;
4281
+ /** Query param: */
4282
+ perPage?: number;
4283
+ }
4284
+
4285
+ export const LogsInstanceJobRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
4286
+ {
4287
+ id: Schema.String.pipe(T.HttpPath("id")),
4288
+ jobId: Schema.String.pipe(T.HttpPath("jobId")),
4289
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4290
+ page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
4291
+ perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
4292
+ },
4293
+ ).pipe(
4294
+ T.Http({
4295
+ method: "GET",
4296
+ path: "/accounts/{account_id}/ai-search/instances/{id}/jobs/{jobId}/logs",
4297
+ }),
4298
+ ) as unknown as Schema.Schema<LogsInstanceJobRequest>;
4299
+
4300
+ export type LogsInstanceJobResponse = {
4301
+ id: number;
4302
+ createdAt: number;
4303
+ message: string;
4304
+ messageType: number;
4305
+ }[];
4306
+
4307
+ export const LogsInstanceJobResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
4308
+ Schema.Struct({
4309
+ id: Schema.Number,
4310
+ createdAt: Schema.Number,
4311
+ message: Schema.String,
4312
+ messageType: Schema.Number,
4313
+ }).pipe(
4314
+ Schema.encodeKeys({
4315
+ id: "id",
4316
+ createdAt: "created_at",
4317
+ message: "message",
4318
+ messageType: "message_type",
4319
+ }),
4320
+ ),
4321
+ ) as unknown as Schema.Schema<LogsInstanceJobResponse>;
4322
+
4323
+ export type LogsInstanceJobError =
4324
+ | DefaultErrors
4325
+ | ValidationError
4326
+ | NotFound
4327
+ | InvalidRoute;
4328
+
4329
+ export const logsInstanceJob: API.OperationMethod<
4330
+ LogsInstanceJobRequest,
4331
+ LogsInstanceJobResponse,
4332
+ LogsInstanceJobError,
4333
+ Credentials | HttpClient.HttpClient
4334
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4335
+ input: LogsInstanceJobRequest,
4336
+ output: LogsInstanceJobResponse,
4337
+ errors: [ValidationError, NotFound, InvalidRoute],
4338
+ }));
4339
+
4340
+ // =============================================================================
4341
+ // Token
4342
+ // =============================================================================
4343
+
4344
+ export interface ListTokensRequest {
4345
+ /** Path param: */
4346
+ accountId: string;
4347
+ }
4348
+
4349
+ export const ListTokensRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4350
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4351
+ }).pipe(
4352
+ T.Http({ method: "GET", path: "/accounts/{account_id}/ai-search/tokens" }),
4353
+ ) as unknown as Schema.Schema<ListTokensRequest>;
4354
+
4355
+ export type ListTokensResponse = {
4356
+ id: string;
4357
+ accountId?: string | null;
4358
+ accountTag?: string | null;
4359
+ cfApiId: string;
4360
+ cfApiKey?: string | null;
4361
+ createdAt: string;
4362
+ modifiedAt: string;
4363
+ name: string;
4364
+ createdBy?: string | null;
4365
+ enabled?: boolean | null;
4366
+ legacy?: boolean | null;
4367
+ modifiedBy?: string | null;
4368
+ syncedAt?: string | null;
4369
+ }[];
4370
+
4371
+ export const ListTokensResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
4372
+ Schema.Struct({
4373
+ id: Schema.String,
4374
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4375
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4376
+ cfApiId: Schema.String,
4377
+ cfApiKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4378
+ createdAt: Schema.String,
4379
+ modifiedAt: Schema.String,
4380
+ name: Schema.String,
4381
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4382
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4383
+ legacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4384
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4385
+ syncedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4386
+ }).pipe(
4387
+ Schema.encodeKeys({
4388
+ id: "id",
4389
+ accountId: "account_id",
4390
+ accountTag: "account_tag",
4391
+ cfApiId: "cf_api_id",
4392
+ cfApiKey: "cf_api_key",
4393
+ createdAt: "created_at",
4394
+ modifiedAt: "modified_at",
4395
+ name: "name",
4396
+ createdBy: "created_by",
4397
+ enabled: "enabled",
4398
+ legacy: "legacy",
4399
+ modifiedBy: "modified_by",
4400
+ syncedAt: "synced_at",
4401
+ }),
4402
+ ),
4403
+ ) as unknown as Schema.Schema<ListTokensResponse>;
4404
+
4405
+ export type ListTokensError = DefaultErrors | InvalidRoute;
4406
+
4407
+ export const listTokens: API.OperationMethod<
4408
+ ListTokensRequest,
4409
+ ListTokensResponse,
4410
+ ListTokensError,
4411
+ Credentials | HttpClient.HttpClient
4412
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4413
+ input: ListTokensRequest,
4414
+ output: ListTokensResponse,
4415
+ errors: [InvalidRoute],
4416
+ }));
4417
+
4418
+ export interface CreateTokenRequest {
4419
+ /** Path param: */
4420
+ accountId: string;
4421
+ /** Body param: */
4422
+ cfApiId: string;
4423
+ /** Body param: */
4424
+ cfApiKey: string;
4425
+ /** Body param: */
4426
+ name: string;
4427
+ /** Body param: */
4428
+ legacy?: boolean;
4429
+ }
4430
+
4431
+ export const CreateTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4432
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4433
+ cfApiId: Schema.String,
4434
+ cfApiKey: Schema.String,
4435
+ name: Schema.String,
4436
+ legacy: Schema.optional(Schema.Boolean),
4437
+ }).pipe(
4438
+ Schema.encodeKeys({
4439
+ cfApiId: "cf_api_id",
4440
+ cfApiKey: "cf_api_key",
4441
+ name: "name",
4442
+ legacy: "legacy",
4443
+ }),
4444
+ T.Http({ method: "POST", path: "/accounts/{account_id}/ai-search/tokens" }),
4445
+ ) as unknown as Schema.Schema<CreateTokenRequest>;
4446
+
4447
+ export interface CreateTokenResponse {
4448
+ id: string;
4449
+ accountId?: string | null;
4450
+ accountTag?: string | null;
4451
+ cfApiId: string;
4452
+ cfApiKey?: string | null;
4453
+ createdAt: string;
4454
+ modifiedAt: string;
4455
+ name: string;
4456
+ createdBy?: string | null;
4457
+ enabled?: boolean | null;
4458
+ legacy?: boolean | null;
4459
+ modifiedBy?: string | null;
4460
+ syncedAt?: string | null;
4461
+ }
4462
+
4463
+ export const CreateTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4464
+ id: Schema.String,
4465
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4466
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4467
+ cfApiId: Schema.String,
4468
+ cfApiKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4469
+ createdAt: Schema.String,
4470
+ modifiedAt: Schema.String,
4471
+ name: Schema.String,
4472
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4473
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4474
+ legacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4475
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4476
+ syncedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4477
+ }).pipe(
4478
+ Schema.encodeKeys({
4479
+ id: "id",
4480
+ accountId: "account_id",
4481
+ accountTag: "account_tag",
4482
+ cfApiId: "cf_api_id",
4483
+ cfApiKey: "cf_api_key",
4484
+ createdAt: "created_at",
4485
+ modifiedAt: "modified_at",
4486
+ name: "name",
4487
+ createdBy: "created_by",
4488
+ enabled: "enabled",
4489
+ legacy: "legacy",
4490
+ modifiedBy: "modified_by",
4491
+ syncedAt: "synced_at",
4492
+ }),
4493
+ ) as unknown as Schema.Schema<CreateTokenResponse>;
4494
+
4495
+ export type CreateTokenError =
4496
+ | DefaultErrors
4497
+ | ValidationError
4498
+ | NotFound
4499
+ | InvalidRoute;
4500
+
4501
+ export const createToken: API.OperationMethod<
4502
+ CreateTokenRequest,
4503
+ CreateTokenResponse,
4504
+ CreateTokenError,
4505
+ Credentials | HttpClient.HttpClient
4506
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4507
+ input: CreateTokenRequest,
4508
+ output: CreateTokenResponse,
4509
+ errors: [ValidationError, NotFound, InvalidRoute],
4510
+ }));
4511
+
4512
+ export interface UpdateTokenRequest {
4513
+ id: string;
4514
+ accountId: string;
4515
+ }
4516
+
4517
+ export const UpdateTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4518
+ id: Schema.String.pipe(T.HttpPath("id")),
4519
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4520
+ }).pipe(
4521
+ T.Http({
4522
+ method: "DELETE",
4523
+ path: "/accounts/{account_id}/ai-search/tokens/{id}",
4524
+ }),
4525
+ ) as unknown as Schema.Schema<UpdateTokenRequest>;
4526
+
4527
+ export interface UpdateTokenResponse {
4528
+ id: string;
4529
+ accountId: string;
4530
+ accountTag: string;
4531
+ cfApiId: string;
4532
+ cfApiKey: string;
4533
+ createdAt: string;
4534
+ modifiedAt: string;
4535
+ name: string;
4536
+ createdBy?: string | null;
4537
+ enabled?: boolean | null;
4538
+ legacy?: boolean | null;
4539
+ modifiedBy?: string | null;
4540
+ syncedAt?: string | null;
4541
+ }
4542
+
4543
+ export const UpdateTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4544
+ id: Schema.String,
4545
+ accountId: Schema.String,
4546
+ accountTag: Schema.String,
4547
+ cfApiId: Schema.String,
4548
+ cfApiKey: Schema.String,
4549
+ createdAt: Schema.String,
4550
+ modifiedAt: Schema.String,
4551
+ name: Schema.String,
4552
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4553
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4554
+ legacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4555
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4556
+ syncedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4557
+ }).pipe(
4558
+ Schema.encodeKeys({
4559
+ id: "id",
4560
+ accountId: "account_id",
4561
+ accountTag: "account_tag",
4562
+ cfApiId: "cf_api_id",
4563
+ cfApiKey: "cf_api_key",
4564
+ createdAt: "created_at",
4565
+ modifiedAt: "modified_at",
4566
+ name: "name",
4567
+ createdBy: "created_by",
4568
+ enabled: "enabled",
4569
+ legacy: "legacy",
4570
+ modifiedBy: "modified_by",
4571
+ syncedAt: "synced_at",
4572
+ }),
4573
+ ) as unknown as Schema.Schema<UpdateTokenResponse>;
4574
+
4575
+ export type UpdateTokenError =
4576
+ | DefaultErrors
4577
+ | ValidationError
4578
+ | NotFound
4579
+ | InvalidRoute;
4580
+
4581
+ export const updateToken: API.OperationMethod<
4582
+ UpdateTokenRequest,
4583
+ UpdateTokenResponse,
4584
+ UpdateTokenError,
4585
+ Credentials | HttpClient.HttpClient
4586
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4587
+ input: UpdateTokenRequest,
4588
+ output: UpdateTokenResponse,
4589
+ errors: [ValidationError, NotFound, InvalidRoute],
4590
+ }));
4591
+
4592
+ export interface DeleteTokenRequest {
4593
+ id: string;
4594
+ accountId: string;
4595
+ }
4596
+
4597
+ export const DeleteTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4598
+ id: Schema.String.pipe(T.HttpPath("id")),
4599
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4600
+ }).pipe(
4601
+ T.Http({
4602
+ method: "DELETE",
4603
+ path: "/accounts/{account_id}/ai-search/tokens/{id}",
4604
+ }),
4605
+ ) as unknown as Schema.Schema<DeleteTokenRequest>;
4606
+
4607
+ export interface DeleteTokenResponse {
4608
+ id: string;
4609
+ accountId?: string | null;
4610
+ accountTag?: string | null;
4611
+ cfApiId: string;
4612
+ cfApiKey?: string | null;
4613
+ createdAt: string;
4614
+ modifiedAt: string;
4615
+ name: string;
4616
+ createdBy?: string | null;
4617
+ enabled?: boolean | null;
4618
+ legacy?: boolean | null;
4619
+ modifiedBy?: string | null;
4620
+ syncedAt?: string | null;
4621
+ }
4622
+
4623
+ export const DeleteTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4624
+ id: Schema.String,
4625
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4626
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4627
+ cfApiId: Schema.String,
4628
+ cfApiKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4629
+ createdAt: Schema.String,
4630
+ modifiedAt: Schema.String,
4631
+ name: Schema.String,
4632
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4633
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4634
+ legacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4635
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4636
+ syncedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4637
+ }).pipe(
4638
+ Schema.encodeKeys({
4639
+ id: "id",
4640
+ accountId: "account_id",
4641
+ accountTag: "account_tag",
4642
+ cfApiId: "cf_api_id",
4643
+ cfApiKey: "cf_api_key",
4644
+ createdAt: "created_at",
4645
+ modifiedAt: "modified_at",
4646
+ name: "name",
4647
+ createdBy: "created_by",
4648
+ enabled: "enabled",
4649
+ legacy: "legacy",
4650
+ modifiedBy: "modified_by",
4651
+ syncedAt: "synced_at",
4652
+ }),
4653
+ ) as unknown as Schema.Schema<DeleteTokenResponse>;
4654
+
4655
+ export type DeleteTokenError =
4656
+ | DefaultErrors
4657
+ | ValidationError
4658
+ | NotFound
4659
+ | InvalidRoute;
4660
+
4661
+ export const deleteToken: API.OperationMethod<
4662
+ DeleteTokenRequest,
4663
+ DeleteTokenResponse,
4664
+ DeleteTokenError,
4665
+ Credentials | HttpClient.HttpClient
4666
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4667
+ input: DeleteTokenRequest,
4668
+ output: DeleteTokenResponse,
4669
+ errors: [ValidationError, NotFound, InvalidRoute],
4670
+ }));
4671
+
4672
+ export interface ReadTokenRequest {
4673
+ id: string;
4674
+ accountId: string;
4675
+ }
4676
+
4677
+ export const ReadTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4678
+ id: Schema.String.pipe(T.HttpPath("id")),
4679
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
4680
+ }).pipe(
4681
+ T.Http({
4682
+ method: "DELETE",
4683
+ path: "/accounts/{account_id}/ai-search/tokens/{id}",
4684
+ }),
4685
+ ) as unknown as Schema.Schema<ReadTokenRequest>;
4686
+
4687
+ export interface ReadTokenResponse {
4688
+ id: string;
4689
+ accountId?: string | null;
4690
+ accountTag?: string | null;
4691
+ cfApiId: string;
4692
+ cfApiKey?: string | null;
4693
+ createdAt: string;
4694
+ modifiedAt: string;
4695
+ name: string;
4696
+ createdBy?: string | null;
4697
+ enabled?: boolean | null;
4698
+ legacy?: boolean | null;
4699
+ modifiedBy?: string | null;
4700
+ syncedAt?: string | null;
4701
+ }
4702
+
4703
+ export const ReadTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
4704
+ id: Schema.String,
4705
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4706
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4707
+ cfApiId: Schema.String,
4708
+ cfApiKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4709
+ createdAt: Schema.String,
4710
+ modifiedAt: Schema.String,
4711
+ name: Schema.String,
4712
+ createdBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4713
+ enabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4714
+ legacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
4715
+ modifiedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4716
+ syncedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
4717
+ }).pipe(
4718
+ Schema.encodeKeys({
4719
+ id: "id",
4720
+ accountId: "account_id",
4721
+ accountTag: "account_tag",
4722
+ cfApiId: "cf_api_id",
4723
+ cfApiKey: "cf_api_key",
4724
+ createdAt: "created_at",
4725
+ modifiedAt: "modified_at",
4726
+ name: "name",
4727
+ createdBy: "created_by",
4728
+ enabled: "enabled",
4729
+ legacy: "legacy",
4730
+ modifiedBy: "modified_by",
4731
+ syncedAt: "synced_at",
4732
+ }),
4733
+ ) as unknown as Schema.Schema<ReadTokenResponse>;
4734
+
4735
+ export type ReadTokenError =
4736
+ | DefaultErrors
4737
+ | ValidationError
4738
+ | NotFound
4739
+ | InvalidRoute;
4740
+
4741
+ export const readToken: API.OperationMethod<
4742
+ ReadTokenRequest,
4743
+ ReadTokenResponse,
4744
+ ReadTokenError,
4745
+ Credentials | HttpClient.HttpClient
4746
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
4747
+ input: ReadTokenRequest,
4748
+ output: ReadTokenResponse,
4749
+ errors: [ValidationError, NotFound, InvalidRoute],
4750
+ }));