@distilled.cloud/cloudflare 0.0.0-john

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 (562) hide show
  1. package/README.md +59 -0
  2. package/lib/auth.d.ts +14 -0
  3. package/lib/auth.d.ts.map +1 -0
  4. package/lib/auth.js +13 -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 +12 -0
  11. package/lib/client/api.d.ts.map +1 -0
  12. package/lib/client/api.js +292 -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 +68 -0
  19. package/lib/credentials.d.ts.map +1 -0
  20. package/lib/credentials.js +136 -0
  21. package/lib/credentials.js.map +1 -0
  22. package/lib/errors.d.ts +48 -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/sensitive.d.ts +5 -0
  39. package/lib/sensitive.d.ts.map +1 -0
  40. package/lib/sensitive.js +5 -0
  41. package/lib/sensitive.js.map +1 -0
  42. package/lib/services/abuse-reports.d.ts +296 -0
  43. package/lib/services/abuse-reports.d.ts.map +1 -0
  44. package/lib/services/abuse-reports.js +414 -0
  45. package/lib/services/abuse-reports.js.map +1 -0
  46. package/lib/services/accounts.d.ts +766 -0
  47. package/lib/services/accounts.d.ts.map +1 -0
  48. package/lib/services/accounts.js +860 -0
  49. package/lib/services/accounts.js.map +1 -0
  50. package/lib/services/acm.d.ts +73 -0
  51. package/lib/services/acm.d.ts.map +1 -0
  52. package/lib/services/acm.js +80 -0
  53. package/lib/services/acm.js.map +1 -0
  54. package/lib/services/addressing.d.ts +1321 -0
  55. package/lib/services/addressing.d.ts.map +1 -0
  56. package/lib/services/addressing.js +1863 -0
  57. package/lib/services/addressing.js.map +1 -0
  58. package/lib/services/ai-gateway.d.ts +1137 -0
  59. package/lib/services/ai-gateway.d.ts.map +1 -0
  60. package/lib/services/ai-gateway.js +1830 -0
  61. package/lib/services/ai-gateway.js.map +1 -0
  62. package/lib/services/ai.d.ts +297 -0
  63. package/lib/services/ai.d.ts.map +1 -0
  64. package/lib/services/ai.js +352 -0
  65. package/lib/services/ai.js.map +1 -0
  66. package/lib/services/aisearch.d.ts +1069 -0
  67. package/lib/services/aisearch.d.ts.map +1 -0
  68. package/lib/services/aisearch.js +2542 -0
  69. package/lib/services/aisearch.js.map +1 -0
  70. package/lib/services/alerting.d.ts +855 -0
  71. package/lib/services/alerting.d.ts.map +1 -0
  72. package/lib/services/alerting.js +1445 -0
  73. package/lib/services/alerting.js.map +1 -0
  74. package/lib/services/api-gateway.d.ts +1088 -0
  75. package/lib/services/api-gateway.d.ts.map +1 -0
  76. package/lib/services/api-gateway.js +1655 -0
  77. package/lib/services/api-gateway.js.map +1 -0
  78. package/lib/services/argo.d.ts +101 -0
  79. package/lib/services/argo.d.ts.map +1 -0
  80. package/lib/services/argo.js +113 -0
  81. package/lib/services/argo.js.map +1 -0
  82. package/lib/services/audit-logs.d.ts +46 -0
  83. package/lib/services/audit-logs.d.ts.map +1 -0
  84. package/lib/services/audit-logs.js +37 -0
  85. package/lib/services/audit-logs.js.map +1 -0
  86. package/lib/services/billing.d.ts +62 -0
  87. package/lib/services/billing.d.ts.map +1 -0
  88. package/lib/services/billing.js +102 -0
  89. package/lib/services/billing.js.map +1 -0
  90. package/lib/services/bot-management.d.ts +124 -0
  91. package/lib/services/bot-management.d.ts.map +1 -0
  92. package/lib/services/bot-management.js +262 -0
  93. package/lib/services/bot-management.js.map +1 -0
  94. package/lib/services/botnet-feed.d.ts +65 -0
  95. package/lib/services/botnet-feed.d.ts.map +1 -0
  96. package/lib/services/botnet-feed.js +88 -0
  97. package/lib/services/botnet-feed.js.map +1 -0
  98. package/lib/services/brand-protection.d.ts +194 -0
  99. package/lib/services/brand-protection.d.ts.map +1 -0
  100. package/lib/services/brand-protection.js +221 -0
  101. package/lib/services/brand-protection.js.map +1 -0
  102. package/lib/services/browser-rendering.d.ts +857 -0
  103. package/lib/services/browser-rendering.d.ts.map +1 -0
  104. package/lib/services/browser-rendering.js +1142 -0
  105. package/lib/services/browser-rendering.js.map +1 -0
  106. package/lib/services/cache.d.ts +287 -0
  107. package/lib/services/cache.d.ts.map +1 -0
  108. package/lib/services/cache.js +354 -0
  109. package/lib/services/cache.js.map +1 -0
  110. package/lib/services/calls.d.ts +223 -0
  111. package/lib/services/calls.d.ts.map +1 -0
  112. package/lib/services/calls.js +188 -0
  113. package/lib/services/calls.js.map +1 -0
  114. package/lib/services/certificate-authorities.d.ts +40 -0
  115. package/lib/services/certificate-authorities.d.ts.map +1 -0
  116. package/lib/services/certificate-authorities.js +49 -0
  117. package/lib/services/certificate-authorities.js.map +1 -0
  118. package/lib/services/client-certificates.d.ts +288 -0
  119. package/lib/services/client-certificates.d.ts.map +1 -0
  120. package/lib/services/client-certificates.js +379 -0
  121. package/lib/services/client-certificates.js.map +1 -0
  122. package/lib/services/cloud-connector.d.ts +88 -0
  123. package/lib/services/cloud-connector.d.ts.map +1 -0
  124. package/lib/services/cloud-connector.js +97 -0
  125. package/lib/services/cloud-connector.js.map +1 -0
  126. package/lib/services/cloudforce-one.d.ts +1387 -0
  127. package/lib/services/cloudforce-one.d.ts.map +1 -0
  128. package/lib/services/cloudforce-one.js +1741 -0
  129. package/lib/services/cloudforce-one.js.map +1 -0
  130. package/lib/services/connectivity.d.ts +291 -0
  131. package/lib/services/connectivity.d.ts.map +1 -0
  132. package/lib/services/connectivity.js +404 -0
  133. package/lib/services/connectivity.js.map +1 -0
  134. package/lib/services/content-scanning.d.ts +156 -0
  135. package/lib/services/content-scanning.d.ts.map +1 -0
  136. package/lib/services/content-scanning.js +175 -0
  137. package/lib/services/content-scanning.js.map +1 -0
  138. package/lib/services/custom-certificates.d.ts +240 -0
  139. package/lib/services/custom-certificates.d.ts.map +1 -0
  140. package/lib/services/custom-certificates.js +336 -0
  141. package/lib/services/custom-certificates.js.map +1 -0
  142. package/lib/services/custom-hostnames.d.ts +590 -0
  143. package/lib/services/custom-hostnames.d.ts.map +1 -0
  144. package/lib/services/custom-hostnames.js +1204 -0
  145. package/lib/services/custom-hostnames.js.map +1 -0
  146. package/lib/services/custom-nameservers.d.ts +87 -0
  147. package/lib/services/custom-nameservers.d.ts.map +1 -0
  148. package/lib/services/custom-nameservers.js +95 -0
  149. package/lib/services/custom-nameservers.js.map +1 -0
  150. package/lib/services/custom-pages.d.ts +89 -0
  151. package/lib/services/custom-pages.d.ts.map +1 -0
  152. package/lib/services/custom-pages.js +140 -0
  153. package/lib/services/custom-pages.js.map +1 -0
  154. package/lib/services/d1.d.ts +392 -0
  155. package/lib/services/d1.d.ts.map +1 -0
  156. package/lib/services/d1.js +487 -0
  157. package/lib/services/d1.js.map +1 -0
  158. package/lib/services/dcv-delegation.d.ts +24 -0
  159. package/lib/services/dcv-delegation.d.ts.map +1 -0
  160. package/lib/services/dcv-delegation.js +24 -0
  161. package/lib/services/dcv-delegation.js.map +1 -0
  162. package/lib/services/diagnostics.d.ts +208 -0
  163. package/lib/services/diagnostics.d.ts.map +1 -0
  164. package/lib/services/diagnostics.js +288 -0
  165. package/lib/services/diagnostics.js.map +1 -0
  166. package/lib/services/dns-firewall.d.ts +317 -0
  167. package/lib/services/dns-firewall.d.ts.map +1 -0
  168. package/lib/services/dns-firewall.js +400 -0
  169. package/lib/services/dns-firewall.js.map +1 -0
  170. package/lib/services/dns.d.ts +3065 -0
  171. package/lib/services/dns.d.ts.map +1 -0
  172. package/lib/services/dns.js +4627 -0
  173. package/lib/services/dns.js.map +1 -0
  174. package/lib/services/durable-objects.d.ts +92 -0
  175. package/lib/services/durable-objects.d.ts.map +1 -0
  176. package/lib/services/durable-objects.js +103 -0
  177. package/lib/services/durable-objects.js.map +1 -0
  178. package/lib/services/email-routing.d.ts +598 -0
  179. package/lib/services/email-routing.d.ts.map +1 -0
  180. package/lib/services/email-routing.js +715 -0
  181. package/lib/services/email-routing.js.map +1 -0
  182. package/lib/services/email-security.d.ts +1389 -0
  183. package/lib/services/email-security.d.ts.map +1 -0
  184. package/lib/services/email-security.js +2261 -0
  185. package/lib/services/email-security.js.map +1 -0
  186. package/lib/services/filters.d.ts +197 -0
  187. package/lib/services/filters.d.ts.map +1 -0
  188. package/lib/services/filters.js +168 -0
  189. package/lib/services/filters.js.map +1 -0
  190. package/lib/services/firewall.d.ts +1352 -0
  191. package/lib/services/firewall.d.ts.map +1 -0
  192. package/lib/services/firewall.js +2084 -0
  193. package/lib/services/firewall.js.map +1 -0
  194. package/lib/services/healthchecks.d.ts +507 -0
  195. package/lib/services/healthchecks.d.ts.map +1 -0
  196. package/lib/services/healthchecks.js +867 -0
  197. package/lib/services/healthchecks.js.map +1 -0
  198. package/lib/services/hostnames.d.ts +86 -0
  199. package/lib/services/hostnames.d.ts.map +1 -0
  200. package/lib/services/hostnames.js +111 -0
  201. package/lib/services/hostnames.js.map +1 -0
  202. package/lib/services/hyperdrive.d.ts +203 -0
  203. package/lib/services/hyperdrive.d.ts.map +1 -0
  204. package/lib/services/hyperdrive.js +300 -0
  205. package/lib/services/hyperdrive.js.map +1 -0
  206. package/lib/services/iam.d.ts +657 -0
  207. package/lib/services/iam.d.ts.map +1 -0
  208. package/lib/services/iam.js +843 -0
  209. package/lib/services/iam.js.map +1 -0
  210. package/lib/services/images.d.ts +427 -0
  211. package/lib/services/images.d.ts.map +1 -0
  212. package/lib/services/images.js +444 -0
  213. package/lib/services/images.js.map +1 -0
  214. package/lib/services/intel.d.ts +865 -0
  215. package/lib/services/intel.d.ts.map +1 -0
  216. package/lib/services/intel.js +1266 -0
  217. package/lib/services/intel.js.map +1 -0
  218. package/lib/services/ips.d.ts +28 -0
  219. package/lib/services/ips.d.ts.map +1 -0
  220. package/lib/services/ips.js +39 -0
  221. package/lib/services/ips.js.map +1 -0
  222. package/lib/services/keyless-certificates.d.ts +197 -0
  223. package/lib/services/keyless-certificates.d.ts.map +1 -0
  224. package/lib/services/keyless-certificates.js +229 -0
  225. package/lib/services/keyless-certificates.js.map +1 -0
  226. package/lib/services/kv.d.ts +369 -0
  227. package/lib/services/kv.d.ts.map +1 -0
  228. package/lib/services/kv.js +453 -0
  229. package/lib/services/kv.js.map +1 -0
  230. package/lib/services/leaked-credential-checks.d.ts +129 -0
  231. package/lib/services/leaked-credential-checks.d.ts.map +1 -0
  232. package/lib/services/leaked-credential-checks.js +138 -0
  233. package/lib/services/leaked-credential-checks.js.map +1 -0
  234. package/lib/services/load-balancers.d.ts +1973 -0
  235. package/lib/services/load-balancers.d.ts.map +1 -0
  236. package/lib/services/load-balancers.js +3181 -0
  237. package/lib/services/load-balancers.js.map +1 -0
  238. package/lib/services/logpush.d.ts +401 -0
  239. package/lib/services/logpush.d.ts.map +1 -0
  240. package/lib/services/logpush.js +732 -0
  241. package/lib/services/logpush.js.map +1 -0
  242. package/lib/services/logs.d.ts +125 -0
  243. package/lib/services/logs.d.ts.map +1 -0
  244. package/lib/services/logs.js +149 -0
  245. package/lib/services/logs.js.map +1 -0
  246. package/lib/services/magic-cloud-networking.d.ts +1892 -0
  247. package/lib/services/magic-cloud-networking.d.ts.map +1 -0
  248. package/lib/services/magic-cloud-networking.js +5291 -0
  249. package/lib/services/magic-cloud-networking.js.map +1 -0
  250. package/lib/services/magic-network-monitoring.d.ts +379 -0
  251. package/lib/services/magic-network-monitoring.d.ts.map +1 -0
  252. package/lib/services/magic-network-monitoring.js +557 -0
  253. package/lib/services/magic-network-monitoring.js.map +1 -0
  254. package/lib/services/magic-transit.d.ts +3886 -0
  255. package/lib/services/magic-transit.d.ts.map +1 -0
  256. package/lib/services/magic-transit.js +6284 -0
  257. package/lib/services/magic-transit.js.map +1 -0
  258. package/lib/services/managed-transforms.d.ts +79 -0
  259. package/lib/services/managed-transforms.d.ts.map +1 -0
  260. package/lib/services/managed-transforms.js +111 -0
  261. package/lib/services/managed-transforms.js.map +1 -0
  262. package/lib/services/memberships.d.ts +204 -0
  263. package/lib/services/memberships.d.ts.map +1 -0
  264. package/lib/services/memberships.js +308 -0
  265. package/lib/services/memberships.js.map +1 -0
  266. package/lib/services/mtls-certificates.d.ts +164 -0
  267. package/lib/services/mtls-certificates.d.ts.map +1 -0
  268. package/lib/services/mtls-certificates.js +192 -0
  269. package/lib/services/mtls-certificates.js.map +1 -0
  270. package/lib/services/network-interconnects.d.ts +410 -0
  271. package/lib/services/network-interconnects.d.ts.map +1 -0
  272. package/lib/services/network-interconnects.js +583 -0
  273. package/lib/services/network-interconnects.js.map +1 -0
  274. package/lib/services/organizations.d.ts +232 -0
  275. package/lib/services/organizations.d.ts.map +1 -0
  276. package/lib/services/organizations.js +370 -0
  277. package/lib/services/organizations.js.map +1 -0
  278. package/lib/services/origin-ca-certificates.d.ts +119 -0
  279. package/lib/services/origin-ca-certificates.d.ts.map +1 -0
  280. package/lib/services/origin-ca-certificates.js +183 -0
  281. package/lib/services/origin-ca-certificates.js.map +1 -0
  282. package/lib/services/origin-post-quantum-encryption.d.ts +50 -0
  283. package/lib/services/origin-post-quantum-encryption.d.ts.map +1 -0
  284. package/lib/services/origin-post-quantum-encryption.js +64 -0
  285. package/lib/services/origin-post-quantum-encryption.js.map +1 -0
  286. package/lib/services/origin-tls-client-auth.d.ts +308 -0
  287. package/lib/services/origin-tls-client-auth.d.ts.map +1 -0
  288. package/lib/services/origin-tls-client-auth.js +435 -0
  289. package/lib/services/origin-tls-client-auth.js.map +1 -0
  290. package/lib/services/page-rules.d.ts +773 -0
  291. package/lib/services/page-rules.d.ts.map +1 -0
  292. package/lib/services/page-rules.js +1373 -0
  293. package/lib/services/page-rules.js.map +1 -0
  294. package/lib/services/page-shield.d.ts +505 -0
  295. package/lib/services/page-shield.d.ts.map +1 -0
  296. package/lib/services/page-shield.js +520 -0
  297. package/lib/services/page-shield.js.map +1 -0
  298. package/lib/services/pages.d.ts +1949 -0
  299. package/lib/services/pages.d.ts.map +1 -0
  300. package/lib/services/pages.js +3030 -0
  301. package/lib/services/pages.js.map +1 -0
  302. package/lib/services/pipelines.d.ts +1716 -0
  303. package/lib/services/pipelines.d.ts.map +1 -0
  304. package/lib/services/pipelines.js +2991 -0
  305. package/lib/services/pipelines.js.map +1 -0
  306. package/lib/services/queues.d.ts +904 -0
  307. package/lib/services/queues.d.ts.map +1 -0
  308. package/lib/services/queues.js +1250 -0
  309. package/lib/services/queues.js.map +1 -0
  310. package/lib/services/r2-data-catalog.d.ts +341 -0
  311. package/lib/services/r2-data-catalog.d.ts.map +1 -0
  312. package/lib/services/r2-data-catalog.js +513 -0
  313. package/lib/services/r2-data-catalog.js.map +1 -0
  314. package/lib/services/r2.d.ts +1087 -0
  315. package/lib/services/r2.d.ts.map +1 -0
  316. package/lib/services/r2.js +1404 -0
  317. package/lib/services/r2.js.map +1 -0
  318. package/lib/services/radar.d.ts +9365 -0
  319. package/lib/services/radar.d.ts.map +1 -0
  320. package/lib/services/radar.js +20552 -0
  321. package/lib/services/radar.js.map +1 -0
  322. package/lib/services/rate-limits.d.ts +360 -0
  323. package/lib/services/rate-limits.d.ts.map +1 -0
  324. package/lib/services/rate-limits.js +545 -0
  325. package/lib/services/rate-limits.js.map +1 -0
  326. package/lib/services/realtime-kit.d.ts +2728 -0
  327. package/lib/services/realtime-kit.d.ts.map +1 -0
  328. package/lib/services/realtime-kit.js +5402 -0
  329. package/lib/services/realtime-kit.js.map +1 -0
  330. package/lib/services/registrar.d.ts +121 -0
  331. package/lib/services/registrar.d.ts.map +1 -0
  332. package/lib/services/registrar.js +167 -0
  333. package/lib/services/registrar.js.map +1 -0
  334. package/lib/services/request-tracers.d.ts +61 -0
  335. package/lib/services/request-tracers.d.ts.map +1 -0
  336. package/lib/services/request-tracers.js +85 -0
  337. package/lib/services/request-tracers.js.map +1 -0
  338. package/lib/services/resource-sharing.d.ts +622 -0
  339. package/lib/services/resource-sharing.d.ts.map +1 -0
  340. package/lib/services/resource-sharing.js +929 -0
  341. package/lib/services/resource-sharing.js.map +1 -0
  342. package/lib/services/rules.d.ts +346 -0
  343. package/lib/services/rules.d.ts.map +1 -0
  344. package/lib/services/rules.js +431 -0
  345. package/lib/services/rules.js.map +1 -0
  346. package/lib/services/rulesets.d.ts +3345 -0
  347. package/lib/services/rulesets.d.ts.map +1 -0
  348. package/lib/services/rulesets.js +7904 -0
  349. package/lib/services/rulesets.js.map +1 -0
  350. package/lib/services/rum.d.ts +314 -0
  351. package/lib/services/rum.d.ts.map +1 -0
  352. package/lib/services/rum.js +442 -0
  353. package/lib/services/rum.js.map +1 -0
  354. package/lib/services/schema-validation.d.ts +273 -0
  355. package/lib/services/schema-validation.d.ts.map +1 -0
  356. package/lib/services/schema-validation.js +365 -0
  357. package/lib/services/schema-validation.js.map +1 -0
  358. package/lib/services/secrets-store.d.ts +393 -0
  359. package/lib/services/secrets-store.d.ts.map +1 -0
  360. package/lib/services/secrets-store.js +452 -0
  361. package/lib/services/secrets-store.js.map +1 -0
  362. package/lib/services/security-center.d.ts +136 -0
  363. package/lib/services/security-center.d.ts.map +1 -0
  364. package/lib/services/security-center.js +196 -0
  365. package/lib/services/security-center.js.map +1 -0
  366. package/lib/services/security-txt.d.ts +105 -0
  367. package/lib/services/security-txt.d.ts.map +1 -0
  368. package/lib/services/security-txt.js +136 -0
  369. package/lib/services/security-txt.js.map +1 -0
  370. package/lib/services/snippets.d.ts +190 -0
  371. package/lib/services/snippets.d.ts.map +1 -0
  372. package/lib/services/snippets.js +221 -0
  373. package/lib/services/snippets.js.map +1 -0
  374. package/lib/services/spectrum.d.ts +350 -0
  375. package/lib/services/spectrum.d.ts.map +1 -0
  376. package/lib/services/spectrum.js +535 -0
  377. package/lib/services/spectrum.js.map +1 -0
  378. package/lib/services/speed.d.ts +257 -0
  379. package/lib/services/speed.d.ts.map +1 -0
  380. package/lib/services/speed.js +471 -0
  381. package/lib/services/speed.js.map +1 -0
  382. package/lib/services/ssl.d.ts +412 -0
  383. package/lib/services/ssl.d.ts.map +1 -0
  384. package/lib/services/ssl.js +755 -0
  385. package/lib/services/ssl.js.map +1 -0
  386. package/lib/services/stream.d.ts +1110 -0
  387. package/lib/services/stream.d.ts.map +1 -0
  388. package/lib/services/stream.js +1085 -0
  389. package/lib/services/stream.js.map +1 -0
  390. package/lib/services/token-validation.d.ts +662 -0
  391. package/lib/services/token-validation.d.ts.map +1 -0
  392. package/lib/services/token-validation.js +834 -0
  393. package/lib/services/token-validation.js.map +1 -0
  394. package/lib/services/turnstile.d.ts +272 -0
  395. package/lib/services/turnstile.d.ts.map +1 -0
  396. package/lib/services/turnstile.js +339 -0
  397. package/lib/services/turnstile.js.map +1 -0
  398. package/lib/services/url-normalization.d.ts +53 -0
  399. package/lib/services/url-normalization.d.ts.map +1 -0
  400. package/lib/services/url-normalization.js +52 -0
  401. package/lib/services/url-normalization.js.map +1 -0
  402. package/lib/services/url-scanner.d.ts +612 -0
  403. package/lib/services/url-scanner.d.ts.map +1 -0
  404. package/lib/services/url-scanner.js +915 -0
  405. package/lib/services/url-scanner.js.map +1 -0
  406. package/lib/services/user.d.ts +507 -0
  407. package/lib/services/user.d.ts.map +1 -0
  408. package/lib/services/user.js +634 -0
  409. package/lib/services/user.js.map +1 -0
  410. package/lib/services/vectorize.d.ts +297 -0
  411. package/lib/services/vectorize.d.ts.map +1 -0
  412. package/lib/services/vectorize.js +351 -0
  413. package/lib/services/vectorize.js.map +1 -0
  414. package/lib/services/waiting-rooms.d.ts +1149 -0
  415. package/lib/services/waiting-rooms.d.ts.map +1 -0
  416. package/lib/services/waiting-rooms.js +1859 -0
  417. package/lib/services/waiting-rooms.js.map +1 -0
  418. package/lib/services/web3.d.ts +289 -0
  419. package/lib/services/web3.d.ts.map +1 -0
  420. package/lib/services/web3.js +381 -0
  421. package/lib/services/web3.js.map +1 -0
  422. package/lib/services/workers-for-platforms.d.ts +1394 -0
  423. package/lib/services/workers-for-platforms.d.ts.map +1 -0
  424. package/lib/services/workers-for-platforms.js +2121 -0
  425. package/lib/services/workers-for-platforms.js.map +1 -0
  426. package/lib/services/workers.d.ts +3827 -0
  427. package/lib/services/workers.d.ts.map +1 -0
  428. package/lib/services/workers.js +6105 -0
  429. package/lib/services/workers.js.map +1 -0
  430. package/lib/services/workflows.d.ts +442 -0
  431. package/lib/services/workflows.d.ts.map +1 -0
  432. package/lib/services/workflows.js +599 -0
  433. package/lib/services/workflows.js.map +1 -0
  434. package/lib/services/zaraz.d.ts +312 -0
  435. package/lib/services/zaraz.d.ts.map +1 -0
  436. package/lib/services/zaraz.js +305 -0
  437. package/lib/services/zaraz.js.map +1 -0
  438. package/lib/services/zero-trust.d.ts +18235 -0
  439. package/lib/services/zero-trust.d.ts.map +1 -0
  440. package/lib/services/zero-trust.js +30268 -0
  441. package/lib/services/zero-trust.js.map +1 -0
  442. package/lib/services/zones.d.ts +1382 -0
  443. package/lib/services/zones.d.ts.map +1 -0
  444. package/lib/services/zones.js +2477 -0
  445. package/lib/services/zones.js.map +1 -0
  446. package/lib/traits.d.ts +28 -0
  447. package/lib/traits.d.ts.map +1 -0
  448. package/lib/traits.js +26 -0
  449. package/lib/traits.js.map +1 -0
  450. package/package.json +82 -0
  451. package/src/auth.ts +15 -0
  452. package/src/category.ts +1 -0
  453. package/src/client/api.ts +421 -0
  454. package/src/client/index.ts +7 -0
  455. package/src/credentials.ts +271 -0
  456. package/src/errors.ts +73 -0
  457. package/src/index.ts +9 -0
  458. package/src/retry.ts +35 -0
  459. package/src/schemas.ts +51 -0
  460. package/src/sensitive.ts +4 -0
  461. package/src/services/abuse-reports.ts +955 -0
  462. package/src/services/accounts.ts +2152 -0
  463. package/src/services/acm.ts +178 -0
  464. package/src/services/addressing.ts +4262 -0
  465. package/src/services/ai-gateway.ts +3773 -0
  466. package/src/services/ai.ts +901 -0
  467. package/src/services/aisearch.ts +5215 -0
  468. package/src/services/alerting.ts +3303 -0
  469. package/src/services/api-gateway.ts +3890 -0
  470. package/src/services/argo.ts +270 -0
  471. package/src/services/audit-logs.ts +90 -0
  472. package/src/services/billing.ts +176 -0
  473. package/src/services/bot-management.ts +545 -0
  474. package/src/services/botnet-feed.ts +205 -0
  475. package/src/services/brand-protection.ts +575 -0
  476. package/src/services/browser-rendering.ts +2720 -0
  477. package/src/services/cache.ts +877 -0
  478. package/src/services/calls.ts +548 -0
  479. package/src/services/certificate-authorities.ts +114 -0
  480. package/src/services/client-certificates.ts +815 -0
  481. package/src/services/cloud-connector.ts +248 -0
  482. package/src/services/cloudforce-one.ts +4104 -0
  483. package/src/services/connectivity.ts +706 -0
  484. package/src/services/content-scanning.ts +458 -0
  485. package/src/services/custom-certificates.ts +690 -0
  486. package/src/services/custom-hostnames.ts +2641 -0
  487. package/src/services/custom-nameservers.ts +235 -0
  488. package/src/services/custom-pages.ts +311 -0
  489. package/src/services/d1.ts +1208 -0
  490. package/src/services/dcv-delegation.ts +54 -0
  491. package/src/services/diagnostics.ts +677 -0
  492. package/src/services/dns-firewall.ts +904 -0
  493. package/src/services/dns.ts +9277 -0
  494. package/src/services/durable-objects.ts +237 -0
  495. package/src/services/email-routing.ts +1796 -0
  496. package/src/services/email-security.ts +5052 -0
  497. package/src/services/filters.ts +488 -0
  498. package/src/services/firewall.ts +4728 -0
  499. package/src/services/healthchecks.ts +1866 -0
  500. package/src/services/hostnames.ts +254 -0
  501. package/src/services/hyperdrive.ts +595 -0
  502. package/src/services/iam.ts +1969 -0
  503. package/src/services/images.ts +1180 -0
  504. package/src/services/intel.ts +3072 -0
  505. package/src/services/ips.ts +88 -0
  506. package/src/services/keyless-certificates.ts +509 -0
  507. package/src/services/kv.ts +1129 -0
  508. package/src/services/leaked-credential-checks.ts +364 -0
  509. package/src/services/load-balancers.ts +6993 -0
  510. package/src/services/logpush.ts +1695 -0
  511. package/src/services/logs.ts +389 -0
  512. package/src/services/magic-cloud-networking.ts +10747 -0
  513. package/src/services/magic-network-monitoring.ts +1200 -0
  514. package/src/services/magic-transit.ts +13673 -0
  515. package/src/services/managed-transforms.ts +245 -0
  516. package/src/services/memberships.ts +698 -0
  517. package/src/services/mtls-certificates.ts +444 -0
  518. package/src/services/network-interconnects.ts +1253 -0
  519. package/src/services/organizations.ts +738 -0
  520. package/src/services/origin-ca-certificates.ts +369 -0
  521. package/src/services/origin-post-quantum-encryption.ts +136 -0
  522. package/src/services/origin-tls-client-auth.ts +1002 -0
  523. package/src/services/page-rules.ts +2632 -0
  524. package/src/services/page-shield.ts +1371 -0
  525. package/src/services/pages.ts +6167 -0
  526. package/src/services/pipelines.ts +6455 -0
  527. package/src/services/queues.ts +2827 -0
  528. package/src/services/r2-data-catalog.ts +1151 -0
  529. package/src/services/r2.ts +3529 -0
  530. package/src/services/radar.ts +42836 -0
  531. package/src/services/rate-limits.ts +1252 -0
  532. package/src/services/realtime-kit.ts +11080 -0
  533. package/src/services/registrar.ts +390 -0
  534. package/src/services/request-tracers.ts +161 -0
  535. package/src/services/resource-sharing.ts +2082 -0
  536. package/src/services/rules.ts +953 -0
  537. package/src/services/rulesets.ts +15361 -0
  538. package/src/services/rum.ts +994 -0
  539. package/src/services/schema-validation.ts +869 -0
  540. package/src/services/secrets-store.ts +1050 -0
  541. package/src/services/security-center.ts +495 -0
  542. package/src/services/security-txt.ts +317 -0
  543. package/src/services/snippets.ts +562 -0
  544. package/src/services/spectrum.ts +1190 -0
  545. package/src/services/speed.ts +1154 -0
  546. package/src/services/ssl.ts +1714 -0
  547. package/src/services/stream.ts +3008 -0
  548. package/src/services/token-validation.ts +1825 -0
  549. package/src/services/turnstile.ts +725 -0
  550. package/src/services/url-normalization.ts +133 -0
  551. package/src/services/url-scanner.ts +1851 -0
  552. package/src/services/user.ts +1587 -0
  553. package/src/services/vectorize.ts +875 -0
  554. package/src/services/waiting-rooms.ts +4216 -0
  555. package/src/services/web3.ts +899 -0
  556. package/src/services/workers-for-platforms.ts +4134 -0
  557. package/src/services/workers.ts +12298 -0
  558. package/src/services/workflows.ts +1372 -0
  559. package/src/services/zaraz.ts +833 -0
  560. package/src/services/zero-trust.ts +64685 -0
  561. package/src/services/zones.ts +5106 -0
  562. package/src/traits.ts +47 -0
@@ -0,0 +1,3773 @@
1
+ /**
2
+ * Cloudflare AI-GATEWAY API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service ai-gateway
6
+ */
7
+
8
+ import * as stream from "effect/Stream";
9
+ import * as Schema from "effect/Schema";
10
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
11
+ import * as API from "../client/api.ts";
12
+ import * as T from "../traits.ts";
13
+ import type { Credentials } from "../credentials.ts";
14
+ import { type DefaultErrors } from "../errors.ts";
15
+
16
+ // =============================================================================
17
+ // Errors
18
+ // =============================================================================
19
+
20
+ export class GatewayAlreadyExists extends Schema.TaggedErrorClass<GatewayAlreadyExists>()(
21
+ "GatewayAlreadyExists",
22
+ { code: Schema.Number, message: Schema.String },
23
+ ) {}
24
+ T.applyErrorMatchers(GatewayAlreadyExists, [{ code: 7001 }, { status: 504 }]);
25
+
26
+ export class GatewayNotFound extends Schema.TaggedErrorClass<GatewayNotFound>()(
27
+ "GatewayNotFound",
28
+ { code: Schema.Number, message: Schema.String },
29
+ ) {}
30
+ T.applyErrorMatchers(GatewayNotFound, [{ code: 7002 }]);
31
+
32
+ // =============================================================================
33
+ // AiGateway
34
+ // =============================================================================
35
+
36
+ export interface GetAiGatewayRequest {
37
+ id: string;
38
+ accountId: string;
39
+ }
40
+
41
+ export const GetAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
42
+ id: Schema.String.pipe(T.HttpPath("id")),
43
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
44
+ }).pipe(
45
+ T.Http({
46
+ method: "GET",
47
+ path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
48
+ }),
49
+ ) as unknown as Schema.Schema<GetAiGatewayRequest>;
50
+
51
+ export interface GetAiGatewayResponse {
52
+ /** gateway id */
53
+ id: string;
54
+ accountId?: string | null;
55
+ accountTag?: string | null;
56
+ cacheInvalidateOnUpdate: boolean;
57
+ cacheTtl: number | null;
58
+ collectLogs: boolean;
59
+ createdAt: string;
60
+ internalId?: string | null;
61
+ modifiedAt: string;
62
+ rateLimitingInterval: number | null;
63
+ rateLimitingLimit: number | null;
64
+ rateLimitingTechnique: "fixed" | "sliding";
65
+ authentication?: boolean | null;
66
+ dlp?:
67
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
68
+ | {
69
+ enabled: boolean;
70
+ policies: {
71
+ id: string;
72
+ action: "FLAG" | "BLOCK";
73
+ check: ("REQUEST" | "RESPONSE")[];
74
+ enabled: boolean;
75
+ profiles: string[];
76
+ }[];
77
+ }
78
+ | null;
79
+ isDefault?: boolean | null;
80
+ logManagement?: number | null;
81
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
82
+ logpush?: boolean | null;
83
+ logpushPublicKey?: string | null;
84
+ otel?:
85
+ | { authorization: string; headers: Record<string, unknown>; url: string }[]
86
+ | null;
87
+ storeId?: string | null;
88
+ stripe?: { authorization: string; usageEvents: { payload: string }[] } | null;
89
+ zdr?: boolean | null;
90
+ }
91
+
92
+ export const GetAiGatewayResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
93
+ id: Schema.String,
94
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
95
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
96
+ cacheInvalidateOnUpdate: Schema.Boolean,
97
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
98
+ collectLogs: Schema.Boolean,
99
+ createdAt: Schema.String,
100
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
101
+ modifiedAt: Schema.String,
102
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
103
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
104
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
105
+ authentication: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
106
+ dlp: Schema.optional(
107
+ Schema.Union([
108
+ Schema.Union([
109
+ Schema.Struct({
110
+ action: Schema.Literals(["BLOCK", "FLAG"]),
111
+ enabled: Schema.Boolean,
112
+ profiles: Schema.Array(Schema.String),
113
+ }),
114
+ Schema.Struct({
115
+ enabled: Schema.Boolean,
116
+ policies: Schema.Array(
117
+ Schema.Struct({
118
+ id: Schema.String,
119
+ action: Schema.Literals(["FLAG", "BLOCK"]),
120
+ check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
121
+ enabled: Schema.Boolean,
122
+ profiles: Schema.Array(Schema.String),
123
+ }),
124
+ ),
125
+ }),
126
+ ]),
127
+ Schema.Null,
128
+ ]),
129
+ ),
130
+ isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
131
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
132
+ logManagementStrategy: Schema.optional(
133
+ Schema.Union([
134
+ Schema.Literal("STOP_INSERTING"),
135
+ Schema.Literal("DELETE_OLDEST"),
136
+ Schema.Null,
137
+ ]),
138
+ ),
139
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
140
+ logpushPublicKey: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
141
+ otel: Schema.optional(
142
+ Schema.Union([
143
+ Schema.Array(
144
+ Schema.Struct({
145
+ authorization: Schema.String,
146
+ headers: Schema.Struct({}),
147
+ url: Schema.String,
148
+ }),
149
+ ),
150
+ Schema.Null,
151
+ ]),
152
+ ),
153
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
154
+ stripe: Schema.optional(
155
+ Schema.Union([
156
+ Schema.Struct({
157
+ authorization: Schema.String,
158
+ usageEvents: Schema.Array(
159
+ Schema.Struct({
160
+ payload: Schema.String,
161
+ }),
162
+ ),
163
+ }).pipe(
164
+ Schema.encodeKeys({
165
+ authorization: "authorization",
166
+ usageEvents: "usage_events",
167
+ }),
168
+ ),
169
+ Schema.Null,
170
+ ]),
171
+ ),
172
+ zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
173
+ })
174
+ .pipe(
175
+ Schema.encodeKeys({
176
+ id: "id",
177
+ accountId: "account_id",
178
+ accountTag: "account_tag",
179
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
180
+ cacheTtl: "cache_ttl",
181
+ collectLogs: "collect_logs",
182
+ createdAt: "created_at",
183
+ internalId: "internal_id",
184
+ modifiedAt: "modified_at",
185
+ rateLimitingInterval: "rate_limiting_interval",
186
+ rateLimitingLimit: "rate_limiting_limit",
187
+ rateLimitingTechnique: "rate_limiting_technique",
188
+ authentication: "authentication",
189
+ dlp: "dlp",
190
+ isDefault: "is_default",
191
+ logManagement: "log_management",
192
+ logManagementStrategy: "log_management_strategy",
193
+ logpush: "logpush",
194
+ logpushPublicKey: "logpush_public_key",
195
+ otel: "otel",
196
+ storeId: "store_id",
197
+ stripe: "stripe",
198
+ zdr: "zdr",
199
+ }),
200
+ )
201
+ .pipe(
202
+ T.ResponsePath("result"),
203
+ ) as unknown as Schema.Schema<GetAiGatewayResponse>;
204
+
205
+ export type GetAiGatewayError = DefaultErrors | GatewayNotFound;
206
+
207
+ export const getAiGateway: API.OperationMethod<
208
+ GetAiGatewayRequest,
209
+ GetAiGatewayResponse,
210
+ GetAiGatewayError,
211
+ Credentials | HttpClient.HttpClient
212
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
213
+ input: GetAiGatewayRequest,
214
+ output: GetAiGatewayResponse,
215
+ errors: [GatewayNotFound],
216
+ }));
217
+
218
+ export interface ListAiGatewaysRequest {
219
+ /** Path param: */
220
+ accountId: string;
221
+ /** Query param: Search by id */
222
+ search?: string;
223
+ }
224
+
225
+ export const ListAiGatewaysRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
226
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
227
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
228
+ }).pipe(
229
+ T.Http({ method: "GET", path: "/accounts/{account_id}/ai-gateway/gateways" }),
230
+ ) as unknown as Schema.Schema<ListAiGatewaysRequest>;
231
+
232
+ export interface ListAiGatewaysResponse {
233
+ result: {
234
+ id: string;
235
+ accountId: string;
236
+ accountTag: string;
237
+ cacheInvalidateOnUpdate: boolean;
238
+ cacheTtl: number | null;
239
+ collectLogs: boolean;
240
+ createdAt: string;
241
+ internalId: string;
242
+ modifiedAt: string;
243
+ rateLimitingInterval: number | null;
244
+ rateLimitingLimit: number | null;
245
+ rateLimitingTechnique: "fixed" | "sliding";
246
+ authentication?: boolean | null;
247
+ dlp?:
248
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
249
+ | {
250
+ enabled: boolean;
251
+ policies: {
252
+ id: string;
253
+ action: "FLAG" | "BLOCK";
254
+ check: ("REQUEST" | "RESPONSE")[];
255
+ enabled: boolean;
256
+ profiles: string[];
257
+ }[];
258
+ }
259
+ | null;
260
+ isDefault?: boolean | null;
261
+ logManagement?: number | null;
262
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
263
+ logpush?: boolean | null;
264
+ logpushPublicKey?: string | null;
265
+ otel?:
266
+ | {
267
+ authorization: string;
268
+ headers: Record<string, unknown>;
269
+ url: string;
270
+ }[]
271
+ | null;
272
+ storeId?: string | null;
273
+ stripe?: {
274
+ authorization: string;
275
+ usageEvents: { payload: string }[];
276
+ } | null;
277
+ zdr?: boolean | null;
278
+ }[];
279
+ resultInfo: {
280
+ count?: number | null;
281
+ page?: number | null;
282
+ perPage?: number | null;
283
+ totalCount?: number | null;
284
+ };
285
+ }
286
+
287
+ export const ListAiGatewaysResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
288
+ {
289
+ result: Schema.Array(
290
+ Schema.Struct({
291
+ id: Schema.String,
292
+ accountId: Schema.String,
293
+ accountTag: Schema.String,
294
+ cacheInvalidateOnUpdate: Schema.Boolean,
295
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
296
+ collectLogs: Schema.Boolean,
297
+ createdAt: Schema.String,
298
+ internalId: Schema.String,
299
+ modifiedAt: Schema.String,
300
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
301
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
302
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
303
+ authentication: Schema.optional(
304
+ Schema.Union([Schema.Boolean, Schema.Null]),
305
+ ),
306
+ dlp: Schema.optional(
307
+ Schema.Union([
308
+ Schema.Union([
309
+ Schema.Struct({
310
+ action: Schema.Literals(["BLOCK", "FLAG"]),
311
+ enabled: Schema.Boolean,
312
+ profiles: Schema.Array(Schema.String),
313
+ }),
314
+ Schema.Struct({
315
+ enabled: Schema.Boolean,
316
+ policies: Schema.Array(
317
+ Schema.Struct({
318
+ id: Schema.String,
319
+ action: Schema.Literals(["FLAG", "BLOCK"]),
320
+ check: Schema.Array(
321
+ Schema.Literals(["REQUEST", "RESPONSE"]),
322
+ ),
323
+ enabled: Schema.Boolean,
324
+ profiles: Schema.Array(Schema.String),
325
+ }),
326
+ ),
327
+ }),
328
+ ]),
329
+ Schema.Null,
330
+ ]),
331
+ ),
332
+ isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
333
+ logManagement: Schema.optional(
334
+ Schema.Union([Schema.Number, Schema.Null]),
335
+ ),
336
+ logManagementStrategy: Schema.optional(
337
+ Schema.Union([
338
+ Schema.Literal("STOP_INSERTING"),
339
+ Schema.Literal("DELETE_OLDEST"),
340
+ Schema.Null,
341
+ ]),
342
+ ),
343
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
344
+ logpushPublicKey: Schema.optional(
345
+ Schema.Union([Schema.String, Schema.Null]),
346
+ ),
347
+ otel: Schema.optional(
348
+ Schema.Union([
349
+ Schema.Array(
350
+ Schema.Struct({
351
+ authorization: Schema.String,
352
+ headers: Schema.Struct({}),
353
+ url: Schema.String,
354
+ }),
355
+ ),
356
+ Schema.Null,
357
+ ]),
358
+ ),
359
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
360
+ stripe: Schema.optional(
361
+ Schema.Union([
362
+ Schema.Struct({
363
+ authorization: Schema.String,
364
+ usageEvents: Schema.Array(
365
+ Schema.Struct({
366
+ payload: Schema.String,
367
+ }),
368
+ ),
369
+ }).pipe(
370
+ Schema.encodeKeys({
371
+ authorization: "authorization",
372
+ usageEvents: "usage_events",
373
+ }),
374
+ ),
375
+ Schema.Null,
376
+ ]),
377
+ ),
378
+ zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
379
+ }).pipe(
380
+ Schema.encodeKeys({
381
+ id: "id",
382
+ accountId: "account_id",
383
+ accountTag: "account_tag",
384
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
385
+ cacheTtl: "cache_ttl",
386
+ collectLogs: "collect_logs",
387
+ createdAt: "created_at",
388
+ internalId: "internal_id",
389
+ modifiedAt: "modified_at",
390
+ rateLimitingInterval: "rate_limiting_interval",
391
+ rateLimitingLimit: "rate_limiting_limit",
392
+ rateLimitingTechnique: "rate_limiting_technique",
393
+ authentication: "authentication",
394
+ dlp: "dlp",
395
+ isDefault: "is_default",
396
+ logManagement: "log_management",
397
+ logManagementStrategy: "log_management_strategy",
398
+ logpush: "logpush",
399
+ logpushPublicKey: "logpush_public_key",
400
+ otel: "otel",
401
+ storeId: "store_id",
402
+ stripe: "stripe",
403
+ zdr: "zdr",
404
+ }),
405
+ ),
406
+ ),
407
+ resultInfo: Schema.Struct({
408
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
409
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
410
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
411
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
412
+ }).pipe(
413
+ Schema.encodeKeys({
414
+ count: "count",
415
+ page: "page",
416
+ perPage: "per_page",
417
+ totalCount: "total_count",
418
+ }),
419
+ ),
420
+ },
421
+ ).pipe(
422
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
423
+ ) as unknown as Schema.Schema<ListAiGatewaysResponse>;
424
+
425
+ export type ListAiGatewaysError = DefaultErrors;
426
+
427
+ export const listAiGateways: API.PaginatedOperationMethod<
428
+ ListAiGatewaysRequest,
429
+ ListAiGatewaysResponse,
430
+ ListAiGatewaysError,
431
+ Credentials | HttpClient.HttpClient
432
+ > & {
433
+ pages: (
434
+ input: ListAiGatewaysRequest,
435
+ ) => stream.Stream<
436
+ ListAiGatewaysResponse,
437
+ ListAiGatewaysError,
438
+ Credentials | HttpClient.HttpClient
439
+ >;
440
+ items: (input: ListAiGatewaysRequest) => stream.Stream<
441
+ {
442
+ id: string;
443
+ accountId: string;
444
+ accountTag: string;
445
+ cacheInvalidateOnUpdate: boolean;
446
+ cacheTtl: number | null;
447
+ collectLogs: boolean;
448
+ createdAt: string;
449
+ internalId: string;
450
+ modifiedAt: string;
451
+ rateLimitingInterval: number | null;
452
+ rateLimitingLimit: number | null;
453
+ rateLimitingTechnique: "fixed" | "sliding";
454
+ authentication?: boolean | null;
455
+ dlp?:
456
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
457
+ | {
458
+ enabled: boolean;
459
+ policies: {
460
+ id: string;
461
+ action: "FLAG" | "BLOCK";
462
+ check: ("REQUEST" | "RESPONSE")[];
463
+ enabled: boolean;
464
+ profiles: string[];
465
+ }[];
466
+ }
467
+ | null;
468
+ isDefault?: boolean | null;
469
+ logManagement?: number | null;
470
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
471
+ logpush?: boolean | null;
472
+ logpushPublicKey?: string | null;
473
+ otel?:
474
+ | {
475
+ authorization: string;
476
+ headers: Record<string, unknown>;
477
+ url: string;
478
+ }[]
479
+ | null;
480
+ storeId?: string | null;
481
+ stripe?: {
482
+ authorization: string;
483
+ usageEvents: { payload: string }[];
484
+ } | null;
485
+ zdr?: boolean | null;
486
+ },
487
+ ListAiGatewaysError,
488
+ Credentials | HttpClient.HttpClient
489
+ >;
490
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
491
+ input: ListAiGatewaysRequest,
492
+ output: ListAiGatewaysResponse,
493
+ errors: [],
494
+ pagination: {
495
+ mode: "page",
496
+ inputToken: "page",
497
+ outputToken: "resultInfo.page",
498
+ items: "result",
499
+ pageSize: "perPage",
500
+ } as const,
501
+ }));
502
+
503
+ export interface CreateAiGatewayRequest {
504
+ /** Path param: */
505
+ accountId: string;
506
+ /** Body param: gateway id */
507
+ id: string;
508
+ /** Body param: */
509
+ cacheInvalidateOnUpdate: boolean;
510
+ /** Body param: */
511
+ cacheTtl: number | null;
512
+ /** Body param: */
513
+ collectLogs: boolean;
514
+ /** Body param: */
515
+ rateLimitingInterval: number | null;
516
+ /** Body param: */
517
+ rateLimitingLimit: number | null;
518
+ /** Body param: */
519
+ rateLimitingTechnique: "fixed" | "sliding";
520
+ /** Body param: */
521
+ authentication?: boolean;
522
+ /** Body param: */
523
+ isDefault?: boolean;
524
+ /** Body param: */
525
+ logManagement?: number | null;
526
+ /** Body param: */
527
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
528
+ /** Body param: */
529
+ logpush?: boolean;
530
+ /** Body param: */
531
+ logpushPublicKey?: string | null;
532
+ /** Body param: */
533
+ zdr?: boolean;
534
+ }
535
+
536
+ export const CreateAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
537
+ {
538
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
539
+ id: Schema.String,
540
+ cacheInvalidateOnUpdate: Schema.Boolean,
541
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
542
+ collectLogs: Schema.Boolean,
543
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
544
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
545
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
546
+ authentication: Schema.optional(Schema.Boolean),
547
+ isDefault: Schema.optional(Schema.Boolean),
548
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
549
+ logManagementStrategy: Schema.optional(
550
+ Schema.Union([
551
+ Schema.Literal("STOP_INSERTING"),
552
+ Schema.Literal("DELETE_OLDEST"),
553
+ Schema.Null,
554
+ ]),
555
+ ),
556
+ logpush: Schema.optional(Schema.Boolean),
557
+ logpushPublicKey: Schema.optional(
558
+ Schema.Union([Schema.String, Schema.Null]),
559
+ ),
560
+ zdr: Schema.optional(Schema.Boolean),
561
+ },
562
+ ).pipe(
563
+ Schema.encodeKeys({
564
+ id: "id",
565
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
566
+ cacheTtl: "cache_ttl",
567
+ collectLogs: "collect_logs",
568
+ rateLimitingInterval: "rate_limiting_interval",
569
+ rateLimitingLimit: "rate_limiting_limit",
570
+ rateLimitingTechnique: "rate_limiting_technique",
571
+ authentication: "authentication",
572
+ isDefault: "is_default",
573
+ logManagement: "log_management",
574
+ logManagementStrategy: "log_management_strategy",
575
+ logpush: "logpush",
576
+ logpushPublicKey: "logpush_public_key",
577
+ zdr: "zdr",
578
+ }),
579
+ T.Http({
580
+ method: "POST",
581
+ path: "/accounts/{account_id}/ai-gateway/gateways",
582
+ }),
583
+ ) as unknown as Schema.Schema<CreateAiGatewayRequest>;
584
+
585
+ export interface CreateAiGatewayResponse {
586
+ /** gateway id */
587
+ id: string;
588
+ accountId?: string | null;
589
+ accountTag?: string | null;
590
+ cacheInvalidateOnUpdate: boolean;
591
+ cacheTtl: number | null;
592
+ collectLogs: boolean;
593
+ createdAt: string;
594
+ internalId?: string | null;
595
+ modifiedAt: string;
596
+ rateLimitingInterval: number | null;
597
+ rateLimitingLimit: number | null;
598
+ rateLimitingTechnique: "fixed" | "sliding";
599
+ authentication?: boolean | null;
600
+ dlp?:
601
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
602
+ | {
603
+ enabled: boolean;
604
+ policies: {
605
+ id: string;
606
+ action: "FLAG" | "BLOCK";
607
+ check: ("REQUEST" | "RESPONSE")[];
608
+ enabled: boolean;
609
+ profiles: string[];
610
+ }[];
611
+ }
612
+ | null;
613
+ isDefault?: boolean | null;
614
+ logManagement?: number | null;
615
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
616
+ logpush?: boolean | null;
617
+ logpushPublicKey?: string | null;
618
+ otel?:
619
+ | { authorization: string; headers: Record<string, unknown>; url: string }[]
620
+ | null;
621
+ storeId?: string | null;
622
+ stripe?: { authorization: string; usageEvents: { payload: string }[] } | null;
623
+ zdr?: boolean | null;
624
+ }
625
+
626
+ export const CreateAiGatewayResponse =
627
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
628
+ id: Schema.String,
629
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
630
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
631
+ cacheInvalidateOnUpdate: Schema.Boolean,
632
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
633
+ collectLogs: Schema.Boolean,
634
+ createdAt: Schema.String,
635
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
636
+ modifiedAt: Schema.String,
637
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
638
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
639
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
640
+ authentication: Schema.optional(
641
+ Schema.Union([Schema.Boolean, Schema.Null]),
642
+ ),
643
+ dlp: Schema.optional(
644
+ Schema.Union([
645
+ Schema.Union([
646
+ Schema.Struct({
647
+ action: Schema.Literals(["BLOCK", "FLAG"]),
648
+ enabled: Schema.Boolean,
649
+ profiles: Schema.Array(Schema.String),
650
+ }),
651
+ Schema.Struct({
652
+ enabled: Schema.Boolean,
653
+ policies: Schema.Array(
654
+ Schema.Struct({
655
+ id: Schema.String,
656
+ action: Schema.Literals(["FLAG", "BLOCK"]),
657
+ check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
658
+ enabled: Schema.Boolean,
659
+ profiles: Schema.Array(Schema.String),
660
+ }),
661
+ ),
662
+ }),
663
+ ]),
664
+ Schema.Null,
665
+ ]),
666
+ ),
667
+ isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
668
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
669
+ logManagementStrategy: Schema.optional(
670
+ Schema.Union([
671
+ Schema.Literal("STOP_INSERTING"),
672
+ Schema.Literal("DELETE_OLDEST"),
673
+ Schema.Null,
674
+ ]),
675
+ ),
676
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
677
+ logpushPublicKey: Schema.optional(
678
+ Schema.Union([Schema.String, Schema.Null]),
679
+ ),
680
+ otel: Schema.optional(
681
+ Schema.Union([
682
+ Schema.Array(
683
+ Schema.Struct({
684
+ authorization: Schema.String,
685
+ headers: Schema.Struct({}),
686
+ url: Schema.String,
687
+ }),
688
+ ),
689
+ Schema.Null,
690
+ ]),
691
+ ),
692
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
693
+ stripe: Schema.optional(
694
+ Schema.Union([
695
+ Schema.Struct({
696
+ authorization: Schema.String,
697
+ usageEvents: Schema.Array(
698
+ Schema.Struct({
699
+ payload: Schema.String,
700
+ }),
701
+ ),
702
+ }).pipe(
703
+ Schema.encodeKeys({
704
+ authorization: "authorization",
705
+ usageEvents: "usage_events",
706
+ }),
707
+ ),
708
+ Schema.Null,
709
+ ]),
710
+ ),
711
+ zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
712
+ })
713
+ .pipe(
714
+ Schema.encodeKeys({
715
+ id: "id",
716
+ accountId: "account_id",
717
+ accountTag: "account_tag",
718
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
719
+ cacheTtl: "cache_ttl",
720
+ collectLogs: "collect_logs",
721
+ createdAt: "created_at",
722
+ internalId: "internal_id",
723
+ modifiedAt: "modified_at",
724
+ rateLimitingInterval: "rate_limiting_interval",
725
+ rateLimitingLimit: "rate_limiting_limit",
726
+ rateLimitingTechnique: "rate_limiting_technique",
727
+ authentication: "authentication",
728
+ dlp: "dlp",
729
+ isDefault: "is_default",
730
+ logManagement: "log_management",
731
+ logManagementStrategy: "log_management_strategy",
732
+ logpush: "logpush",
733
+ logpushPublicKey: "logpush_public_key",
734
+ otel: "otel",
735
+ storeId: "store_id",
736
+ stripe: "stripe",
737
+ zdr: "zdr",
738
+ }),
739
+ )
740
+ .pipe(
741
+ T.ResponsePath("result"),
742
+ ) as unknown as Schema.Schema<CreateAiGatewayResponse>;
743
+
744
+ export type CreateAiGatewayError = DefaultErrors | GatewayAlreadyExists;
745
+
746
+ export const createAiGateway: API.OperationMethod<
747
+ CreateAiGatewayRequest,
748
+ CreateAiGatewayResponse,
749
+ CreateAiGatewayError,
750
+ Credentials | HttpClient.HttpClient
751
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
752
+ input: CreateAiGatewayRequest,
753
+ output: CreateAiGatewayResponse,
754
+ errors: [GatewayAlreadyExists],
755
+ }));
756
+
757
+ export interface UpdateAiGatewayRequest {
758
+ id: string;
759
+ /** Path param: */
760
+ accountId: string;
761
+ /** Body param: */
762
+ cacheInvalidateOnUpdate: boolean;
763
+ /** Body param: */
764
+ cacheTtl: number | null;
765
+ /** Body param: */
766
+ collectLogs: boolean;
767
+ /** Body param: */
768
+ rateLimitingInterval: number | null;
769
+ /** Body param: */
770
+ rateLimitingLimit: number | null;
771
+ /** Body param: */
772
+ rateLimitingTechnique: "fixed" | "sliding";
773
+ /** Body param: */
774
+ authentication?: boolean;
775
+ /** Body param: */
776
+ dlp?:
777
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
778
+ | {
779
+ enabled: boolean;
780
+ policies: {
781
+ id: string;
782
+ action: "FLAG" | "BLOCK";
783
+ check: ("REQUEST" | "RESPONSE")[];
784
+ enabled: boolean;
785
+ profiles: string[];
786
+ }[];
787
+ };
788
+ /** Body param: */
789
+ isDefault?: boolean;
790
+ /** Body param: */
791
+ logManagement?: number | null;
792
+ /** Body param: */
793
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
794
+ /** Body param: */
795
+ logpush?: boolean;
796
+ /** Body param: */
797
+ logpushPublicKey?: string | null;
798
+ /** Body param: */
799
+ otel?:
800
+ | { authorization: string; headers: Record<string, unknown>; url: string }[]
801
+ | null;
802
+ /** Body param: */
803
+ storeId?: string | null;
804
+ /** Body param: */
805
+ stripe?: { authorization: string; usageEvents: { payload: string }[] } | null;
806
+ /** Body param: */
807
+ zdr?: boolean;
808
+ }
809
+
810
+ export const UpdateAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
811
+ {
812
+ id: Schema.String.pipe(T.HttpPath("id")),
813
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
814
+ cacheInvalidateOnUpdate: Schema.Boolean,
815
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
816
+ collectLogs: Schema.Boolean,
817
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
818
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
819
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
820
+ authentication: Schema.optional(Schema.Boolean),
821
+ dlp: Schema.optional(
822
+ Schema.Union([
823
+ Schema.Struct({
824
+ action: Schema.Literals(["BLOCK", "FLAG"]),
825
+ enabled: Schema.Boolean,
826
+ profiles: Schema.Array(Schema.String),
827
+ }),
828
+ Schema.Struct({
829
+ enabled: Schema.Boolean,
830
+ policies: Schema.Array(
831
+ Schema.Struct({
832
+ id: Schema.String,
833
+ action: Schema.Literals(["FLAG", "BLOCK"]),
834
+ check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
835
+ enabled: Schema.Boolean,
836
+ profiles: Schema.Array(Schema.String),
837
+ }),
838
+ ),
839
+ }),
840
+ ]),
841
+ ),
842
+ isDefault: Schema.optional(Schema.Boolean),
843
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
844
+ logManagementStrategy: Schema.optional(
845
+ Schema.Union([
846
+ Schema.Literal("STOP_INSERTING"),
847
+ Schema.Literal("DELETE_OLDEST"),
848
+ Schema.Null,
849
+ ]),
850
+ ),
851
+ logpush: Schema.optional(Schema.Boolean),
852
+ logpushPublicKey: Schema.optional(
853
+ Schema.Union([Schema.String, Schema.Null]),
854
+ ),
855
+ otel: Schema.optional(
856
+ Schema.Union([
857
+ Schema.Array(
858
+ Schema.Struct({
859
+ authorization: Schema.String,
860
+ headers: Schema.Struct({}),
861
+ url: Schema.String,
862
+ }),
863
+ ),
864
+ Schema.Null,
865
+ ]),
866
+ ),
867
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
868
+ stripe: Schema.optional(
869
+ Schema.Union([
870
+ Schema.Struct({
871
+ authorization: Schema.String,
872
+ usageEvents: Schema.Array(
873
+ Schema.Struct({
874
+ payload: Schema.String,
875
+ }),
876
+ ),
877
+ }).pipe(
878
+ Schema.encodeKeys({
879
+ authorization: "authorization",
880
+ usageEvents: "usage_events",
881
+ }),
882
+ ),
883
+ Schema.Null,
884
+ ]),
885
+ ),
886
+ zdr: Schema.optional(Schema.Boolean),
887
+ },
888
+ ).pipe(
889
+ Schema.encodeKeys({
890
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
891
+ cacheTtl: "cache_ttl",
892
+ collectLogs: "collect_logs",
893
+ rateLimitingInterval: "rate_limiting_interval",
894
+ rateLimitingLimit: "rate_limiting_limit",
895
+ rateLimitingTechnique: "rate_limiting_technique",
896
+ authentication: "authentication",
897
+ dlp: "dlp",
898
+ isDefault: "is_default",
899
+ logManagement: "log_management",
900
+ logManagementStrategy: "log_management_strategy",
901
+ logpush: "logpush",
902
+ logpushPublicKey: "logpush_public_key",
903
+ otel: "otel",
904
+ storeId: "store_id",
905
+ stripe: "stripe",
906
+ zdr: "zdr",
907
+ }),
908
+ T.Http({
909
+ method: "PUT",
910
+ path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
911
+ }),
912
+ ) as unknown as Schema.Schema<UpdateAiGatewayRequest>;
913
+
914
+ export interface UpdateAiGatewayResponse {
915
+ /** gateway id */
916
+ id: string;
917
+ accountId?: string | null;
918
+ accountTag?: string | null;
919
+ cacheInvalidateOnUpdate: boolean;
920
+ cacheTtl: number | null;
921
+ collectLogs: boolean;
922
+ createdAt: string;
923
+ internalId?: string | null;
924
+ modifiedAt: string;
925
+ rateLimitingInterval: number | null;
926
+ rateLimitingLimit: number | null;
927
+ rateLimitingTechnique: "fixed" | "sliding";
928
+ authentication?: boolean | null;
929
+ dlp?:
930
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
931
+ | {
932
+ enabled: boolean;
933
+ policies: {
934
+ id: string;
935
+ action: "FLAG" | "BLOCK";
936
+ check: ("REQUEST" | "RESPONSE")[];
937
+ enabled: boolean;
938
+ profiles: string[];
939
+ }[];
940
+ }
941
+ | null;
942
+ isDefault?: boolean | null;
943
+ logManagement?: number | null;
944
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
945
+ logpush?: boolean | null;
946
+ logpushPublicKey?: string | null;
947
+ otel?:
948
+ | { authorization: string; headers: Record<string, unknown>; url: string }[]
949
+ | null;
950
+ storeId?: string | null;
951
+ stripe?: { authorization: string; usageEvents: { payload: string }[] } | null;
952
+ zdr?: boolean | null;
953
+ }
954
+
955
+ export const UpdateAiGatewayResponse =
956
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
957
+ id: Schema.String,
958
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
959
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
960
+ cacheInvalidateOnUpdate: Schema.Boolean,
961
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
962
+ collectLogs: Schema.Boolean,
963
+ createdAt: Schema.String,
964
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
965
+ modifiedAt: Schema.String,
966
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
967
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
968
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
969
+ authentication: Schema.optional(
970
+ Schema.Union([Schema.Boolean, Schema.Null]),
971
+ ),
972
+ dlp: Schema.optional(
973
+ Schema.Union([
974
+ Schema.Union([
975
+ Schema.Struct({
976
+ action: Schema.Literals(["BLOCK", "FLAG"]),
977
+ enabled: Schema.Boolean,
978
+ profiles: Schema.Array(Schema.String),
979
+ }),
980
+ Schema.Struct({
981
+ enabled: Schema.Boolean,
982
+ policies: Schema.Array(
983
+ Schema.Struct({
984
+ id: Schema.String,
985
+ action: Schema.Literals(["FLAG", "BLOCK"]),
986
+ check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
987
+ enabled: Schema.Boolean,
988
+ profiles: Schema.Array(Schema.String),
989
+ }),
990
+ ),
991
+ }),
992
+ ]),
993
+ Schema.Null,
994
+ ]),
995
+ ),
996
+ isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
997
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
998
+ logManagementStrategy: Schema.optional(
999
+ Schema.Union([
1000
+ Schema.Literal("STOP_INSERTING"),
1001
+ Schema.Literal("DELETE_OLDEST"),
1002
+ Schema.Null,
1003
+ ]),
1004
+ ),
1005
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1006
+ logpushPublicKey: Schema.optional(
1007
+ Schema.Union([Schema.String, Schema.Null]),
1008
+ ),
1009
+ otel: Schema.optional(
1010
+ Schema.Union([
1011
+ Schema.Array(
1012
+ Schema.Struct({
1013
+ authorization: Schema.String,
1014
+ headers: Schema.Struct({}),
1015
+ url: Schema.String,
1016
+ }),
1017
+ ),
1018
+ Schema.Null,
1019
+ ]),
1020
+ ),
1021
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1022
+ stripe: Schema.optional(
1023
+ Schema.Union([
1024
+ Schema.Struct({
1025
+ authorization: Schema.String,
1026
+ usageEvents: Schema.Array(
1027
+ Schema.Struct({
1028
+ payload: Schema.String,
1029
+ }),
1030
+ ),
1031
+ }).pipe(
1032
+ Schema.encodeKeys({
1033
+ authorization: "authorization",
1034
+ usageEvents: "usage_events",
1035
+ }),
1036
+ ),
1037
+ Schema.Null,
1038
+ ]),
1039
+ ),
1040
+ zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1041
+ })
1042
+ .pipe(
1043
+ Schema.encodeKeys({
1044
+ id: "id",
1045
+ accountId: "account_id",
1046
+ accountTag: "account_tag",
1047
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
1048
+ cacheTtl: "cache_ttl",
1049
+ collectLogs: "collect_logs",
1050
+ createdAt: "created_at",
1051
+ internalId: "internal_id",
1052
+ modifiedAt: "modified_at",
1053
+ rateLimitingInterval: "rate_limiting_interval",
1054
+ rateLimitingLimit: "rate_limiting_limit",
1055
+ rateLimitingTechnique: "rate_limiting_technique",
1056
+ authentication: "authentication",
1057
+ dlp: "dlp",
1058
+ isDefault: "is_default",
1059
+ logManagement: "log_management",
1060
+ logManagementStrategy: "log_management_strategy",
1061
+ logpush: "logpush",
1062
+ logpushPublicKey: "logpush_public_key",
1063
+ otel: "otel",
1064
+ storeId: "store_id",
1065
+ stripe: "stripe",
1066
+ zdr: "zdr",
1067
+ }),
1068
+ )
1069
+ .pipe(
1070
+ T.ResponsePath("result"),
1071
+ ) as unknown as Schema.Schema<UpdateAiGatewayResponse>;
1072
+
1073
+ export type UpdateAiGatewayError = DefaultErrors | GatewayNotFound;
1074
+
1075
+ export const updateAiGateway: API.OperationMethod<
1076
+ UpdateAiGatewayRequest,
1077
+ UpdateAiGatewayResponse,
1078
+ UpdateAiGatewayError,
1079
+ Credentials | HttpClient.HttpClient
1080
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1081
+ input: UpdateAiGatewayRequest,
1082
+ output: UpdateAiGatewayResponse,
1083
+ errors: [GatewayNotFound],
1084
+ }));
1085
+
1086
+ export interface DeleteAiGatewayRequest {
1087
+ id: string;
1088
+ accountId: string;
1089
+ }
1090
+
1091
+ export const DeleteAiGatewayRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
1092
+ {
1093
+ id: Schema.String.pipe(T.HttpPath("id")),
1094
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1095
+ },
1096
+ ).pipe(
1097
+ T.Http({
1098
+ method: "DELETE",
1099
+ path: "/accounts/{account_id}/ai-gateway/gateways/{id}",
1100
+ }),
1101
+ ) as unknown as Schema.Schema<DeleteAiGatewayRequest>;
1102
+
1103
+ export interface DeleteAiGatewayResponse {
1104
+ /** gateway id */
1105
+ id: string;
1106
+ accountId?: string | null;
1107
+ accountTag?: string | null;
1108
+ cacheInvalidateOnUpdate: boolean;
1109
+ cacheTtl: number | null;
1110
+ collectLogs: boolean;
1111
+ createdAt: string;
1112
+ internalId?: string | null;
1113
+ modifiedAt: string;
1114
+ rateLimitingInterval: number | null;
1115
+ rateLimitingLimit: number | null;
1116
+ rateLimitingTechnique: "fixed" | "sliding";
1117
+ authentication?: boolean | null;
1118
+ dlp?:
1119
+ | { action: "BLOCK" | "FLAG"; enabled: boolean; profiles: string[] }
1120
+ | {
1121
+ enabled: boolean;
1122
+ policies: {
1123
+ id: string;
1124
+ action: "FLAG" | "BLOCK";
1125
+ check: ("REQUEST" | "RESPONSE")[];
1126
+ enabled: boolean;
1127
+ profiles: string[];
1128
+ }[];
1129
+ }
1130
+ | null;
1131
+ isDefault?: boolean | null;
1132
+ logManagement?: number | null;
1133
+ logManagementStrategy?: "STOP_INSERTING" | "DELETE_OLDEST" | null;
1134
+ logpush?: boolean | null;
1135
+ logpushPublicKey?: string | null;
1136
+ otel?:
1137
+ | { authorization: string; headers: Record<string, unknown>; url: string }[]
1138
+ | null;
1139
+ storeId?: string | null;
1140
+ stripe?: { authorization: string; usageEvents: { payload: string }[] } | null;
1141
+ zdr?: boolean | null;
1142
+ }
1143
+
1144
+ export const DeleteAiGatewayResponse =
1145
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1146
+ id: Schema.String,
1147
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1148
+ accountTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1149
+ cacheInvalidateOnUpdate: Schema.Boolean,
1150
+ cacheTtl: Schema.Union([Schema.Number, Schema.Null]),
1151
+ collectLogs: Schema.Boolean,
1152
+ createdAt: Schema.String,
1153
+ internalId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1154
+ modifiedAt: Schema.String,
1155
+ rateLimitingInterval: Schema.Union([Schema.Number, Schema.Null]),
1156
+ rateLimitingLimit: Schema.Union([Schema.Number, Schema.Null]),
1157
+ rateLimitingTechnique: Schema.Literals(["fixed", "sliding"]),
1158
+ authentication: Schema.optional(
1159
+ Schema.Union([Schema.Boolean, Schema.Null]),
1160
+ ),
1161
+ dlp: Schema.optional(
1162
+ Schema.Union([
1163
+ Schema.Union([
1164
+ Schema.Struct({
1165
+ action: Schema.Literals(["BLOCK", "FLAG"]),
1166
+ enabled: Schema.Boolean,
1167
+ profiles: Schema.Array(Schema.String),
1168
+ }),
1169
+ Schema.Struct({
1170
+ enabled: Schema.Boolean,
1171
+ policies: Schema.Array(
1172
+ Schema.Struct({
1173
+ id: Schema.String,
1174
+ action: Schema.Literals(["FLAG", "BLOCK"]),
1175
+ check: Schema.Array(Schema.Literals(["REQUEST", "RESPONSE"])),
1176
+ enabled: Schema.Boolean,
1177
+ profiles: Schema.Array(Schema.String),
1178
+ }),
1179
+ ),
1180
+ }),
1181
+ ]),
1182
+ Schema.Null,
1183
+ ]),
1184
+ ),
1185
+ isDefault: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1186
+ logManagement: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1187
+ logManagementStrategy: Schema.optional(
1188
+ Schema.Union([
1189
+ Schema.Literal("STOP_INSERTING"),
1190
+ Schema.Literal("DELETE_OLDEST"),
1191
+ Schema.Null,
1192
+ ]),
1193
+ ),
1194
+ logpush: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1195
+ logpushPublicKey: Schema.optional(
1196
+ Schema.Union([Schema.String, Schema.Null]),
1197
+ ),
1198
+ otel: Schema.optional(
1199
+ Schema.Union([
1200
+ Schema.Array(
1201
+ Schema.Struct({
1202
+ authorization: Schema.String,
1203
+ headers: Schema.Struct({}),
1204
+ url: Schema.String,
1205
+ }),
1206
+ ),
1207
+ Schema.Null,
1208
+ ]),
1209
+ ),
1210
+ storeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1211
+ stripe: Schema.optional(
1212
+ Schema.Union([
1213
+ Schema.Struct({
1214
+ authorization: Schema.String,
1215
+ usageEvents: Schema.Array(
1216
+ Schema.Struct({
1217
+ payload: Schema.String,
1218
+ }),
1219
+ ),
1220
+ }).pipe(
1221
+ Schema.encodeKeys({
1222
+ authorization: "authorization",
1223
+ usageEvents: "usage_events",
1224
+ }),
1225
+ ),
1226
+ Schema.Null,
1227
+ ]),
1228
+ ),
1229
+ zdr: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1230
+ })
1231
+ .pipe(
1232
+ Schema.encodeKeys({
1233
+ id: "id",
1234
+ accountId: "account_id",
1235
+ accountTag: "account_tag",
1236
+ cacheInvalidateOnUpdate: "cache_invalidate_on_update",
1237
+ cacheTtl: "cache_ttl",
1238
+ collectLogs: "collect_logs",
1239
+ createdAt: "created_at",
1240
+ internalId: "internal_id",
1241
+ modifiedAt: "modified_at",
1242
+ rateLimitingInterval: "rate_limiting_interval",
1243
+ rateLimitingLimit: "rate_limiting_limit",
1244
+ rateLimitingTechnique: "rate_limiting_technique",
1245
+ authentication: "authentication",
1246
+ dlp: "dlp",
1247
+ isDefault: "is_default",
1248
+ logManagement: "log_management",
1249
+ logManagementStrategy: "log_management_strategy",
1250
+ logpush: "logpush",
1251
+ logpushPublicKey: "logpush_public_key",
1252
+ otel: "otel",
1253
+ storeId: "store_id",
1254
+ stripe: "stripe",
1255
+ zdr: "zdr",
1256
+ }),
1257
+ )
1258
+ .pipe(
1259
+ T.ResponsePath("result"),
1260
+ ) as unknown as Schema.Schema<DeleteAiGatewayResponse>;
1261
+
1262
+ export type DeleteAiGatewayError = DefaultErrors | GatewayNotFound;
1263
+
1264
+ export const deleteAiGateway: API.OperationMethod<
1265
+ DeleteAiGatewayRequest,
1266
+ DeleteAiGatewayResponse,
1267
+ DeleteAiGatewayError,
1268
+ Credentials | HttpClient.HttpClient
1269
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1270
+ input: DeleteAiGatewayRequest,
1271
+ output: DeleteAiGatewayResponse,
1272
+ errors: [GatewayNotFound],
1273
+ }));
1274
+
1275
+ // =============================================================================
1276
+ // Dataset
1277
+ // =============================================================================
1278
+
1279
+ export interface GetDatasetRequest {
1280
+ gatewayId: string;
1281
+ id: string;
1282
+ accountId: string;
1283
+ }
1284
+
1285
+ export const GetDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1286
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
1287
+ id: Schema.String.pipe(T.HttpPath("id")),
1288
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1289
+ }).pipe(
1290
+ T.Http({
1291
+ method: "GET",
1292
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
1293
+ }),
1294
+ ) as unknown as Schema.Schema<GetDatasetRequest>;
1295
+
1296
+ export interface GetDatasetResponse {
1297
+ id: string;
1298
+ accountId: string;
1299
+ accountTag: string;
1300
+ createdAt: string;
1301
+ enable: boolean;
1302
+ filters: {
1303
+ key:
1304
+ | "created_at"
1305
+ | "request_content_type"
1306
+ | "response_content_type"
1307
+ | "success"
1308
+ | "cached"
1309
+ | "provider"
1310
+ | "model"
1311
+ | "cost"
1312
+ | "tokens"
1313
+ | "tokens_in"
1314
+ | "tokens_out"
1315
+ | "duration"
1316
+ | "feedback";
1317
+ operator: "eq" | "contains" | "lt" | "gt";
1318
+ value: (string | number | boolean)[];
1319
+ }[];
1320
+ /** gateway id */
1321
+ gatewayId: string;
1322
+ modifiedAt: string;
1323
+ name: string;
1324
+ }
1325
+
1326
+ export const GetDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1327
+ id: Schema.String,
1328
+ accountId: Schema.String,
1329
+ accountTag: Schema.String,
1330
+ createdAt: Schema.String,
1331
+ enable: Schema.Boolean,
1332
+ filters: Schema.Array(
1333
+ Schema.Struct({
1334
+ key: Schema.Literals([
1335
+ "created_at",
1336
+ "request_content_type",
1337
+ "response_content_type",
1338
+ "success",
1339
+ "cached",
1340
+ "provider",
1341
+ "model",
1342
+ "cost",
1343
+ "tokens",
1344
+ "tokens_in",
1345
+ "tokens_out",
1346
+ "duration",
1347
+ "feedback",
1348
+ ]),
1349
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1350
+ value: Schema.Array(
1351
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1352
+ ),
1353
+ }),
1354
+ ),
1355
+ gatewayId: Schema.String,
1356
+ modifiedAt: Schema.String,
1357
+ name: Schema.String,
1358
+ })
1359
+ .pipe(
1360
+ Schema.encodeKeys({
1361
+ id: "id",
1362
+ accountId: "account_id",
1363
+ accountTag: "account_tag",
1364
+ createdAt: "created_at",
1365
+ enable: "enable",
1366
+ filters: "filters",
1367
+ gatewayId: "gateway_id",
1368
+ modifiedAt: "modified_at",
1369
+ name: "name",
1370
+ }),
1371
+ )
1372
+ .pipe(
1373
+ T.ResponsePath("result"),
1374
+ ) as unknown as Schema.Schema<GetDatasetResponse>;
1375
+
1376
+ export type GetDatasetError = DefaultErrors;
1377
+
1378
+ export const getDataset: API.OperationMethod<
1379
+ GetDatasetRequest,
1380
+ GetDatasetResponse,
1381
+ GetDatasetError,
1382
+ Credentials | HttpClient.HttpClient
1383
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1384
+ input: GetDatasetRequest,
1385
+ output: GetDatasetResponse,
1386
+ errors: [],
1387
+ }));
1388
+
1389
+ export interface ListDatasetsRequest {
1390
+ gatewayId: string;
1391
+ /** Path param: */
1392
+ accountId: string;
1393
+ /** Query param: */
1394
+ enable?: boolean;
1395
+ /** Query param: */
1396
+ name?: string;
1397
+ /** Query param: Search by id, name, filters */
1398
+ search?: string;
1399
+ }
1400
+
1401
+ export const ListDatasetsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1402
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
1403
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1404
+ enable: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("enable")),
1405
+ name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
1406
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
1407
+ }).pipe(
1408
+ T.Http({
1409
+ method: "GET",
1410
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets",
1411
+ }),
1412
+ ) as unknown as Schema.Schema<ListDatasetsRequest>;
1413
+
1414
+ export interface ListDatasetsResponse {
1415
+ result: {
1416
+ id: string;
1417
+ accountId: string;
1418
+ accountTag: string;
1419
+ createdAt: string;
1420
+ enable: boolean;
1421
+ filters: {
1422
+ key:
1423
+ | "created_at"
1424
+ | "request_content_type"
1425
+ | "response_content_type"
1426
+ | "success"
1427
+ | "cached"
1428
+ | "provider"
1429
+ | "model"
1430
+ | "cost"
1431
+ | "tokens"
1432
+ | "tokens_in"
1433
+ | "tokens_out"
1434
+ | "duration"
1435
+ | "feedback";
1436
+ operator: "eq" | "contains" | "lt" | "gt";
1437
+ value: (string | number | boolean)[];
1438
+ }[];
1439
+ gatewayId: string;
1440
+ modifiedAt: string;
1441
+ name: string;
1442
+ }[];
1443
+ resultInfo: {
1444
+ count?: number | null;
1445
+ page?: number | null;
1446
+ perPage?: number | null;
1447
+ totalCount?: number | null;
1448
+ };
1449
+ }
1450
+
1451
+ export const ListDatasetsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1452
+ result: Schema.Array(
1453
+ Schema.Struct({
1454
+ id: Schema.String,
1455
+ accountId: Schema.String,
1456
+ accountTag: Schema.String,
1457
+ createdAt: Schema.String,
1458
+ enable: Schema.Boolean,
1459
+ filters: Schema.Array(
1460
+ Schema.Struct({
1461
+ key: Schema.Literals([
1462
+ "created_at",
1463
+ "request_content_type",
1464
+ "response_content_type",
1465
+ "success",
1466
+ "cached",
1467
+ "provider",
1468
+ "model",
1469
+ "cost",
1470
+ "tokens",
1471
+ "tokens_in",
1472
+ "tokens_out",
1473
+ "duration",
1474
+ "feedback",
1475
+ ]),
1476
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1477
+ value: Schema.Array(
1478
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1479
+ ),
1480
+ }),
1481
+ ),
1482
+ gatewayId: Schema.String,
1483
+ modifiedAt: Schema.String,
1484
+ name: Schema.String,
1485
+ }).pipe(
1486
+ Schema.encodeKeys({
1487
+ id: "id",
1488
+ accountId: "account_id",
1489
+ accountTag: "account_tag",
1490
+ createdAt: "created_at",
1491
+ enable: "enable",
1492
+ filters: "filters",
1493
+ gatewayId: "gateway_id",
1494
+ modifiedAt: "modified_at",
1495
+ name: "name",
1496
+ }),
1497
+ ),
1498
+ ),
1499
+ resultInfo: Schema.Struct({
1500
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1501
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1502
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1503
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1504
+ }).pipe(
1505
+ Schema.encodeKeys({
1506
+ count: "count",
1507
+ page: "page",
1508
+ perPage: "per_page",
1509
+ totalCount: "total_count",
1510
+ }),
1511
+ ),
1512
+ }).pipe(
1513
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
1514
+ ) as unknown as Schema.Schema<ListDatasetsResponse>;
1515
+
1516
+ export type ListDatasetsError = DefaultErrors;
1517
+
1518
+ export const listDatasets: API.PaginatedOperationMethod<
1519
+ ListDatasetsRequest,
1520
+ ListDatasetsResponse,
1521
+ ListDatasetsError,
1522
+ Credentials | HttpClient.HttpClient
1523
+ > & {
1524
+ pages: (
1525
+ input: ListDatasetsRequest,
1526
+ ) => stream.Stream<
1527
+ ListDatasetsResponse,
1528
+ ListDatasetsError,
1529
+ Credentials | HttpClient.HttpClient
1530
+ >;
1531
+ items: (input: ListDatasetsRequest) => stream.Stream<
1532
+ {
1533
+ id: string;
1534
+ accountId: string;
1535
+ accountTag: string;
1536
+ createdAt: string;
1537
+ enable: boolean;
1538
+ filters: {
1539
+ key:
1540
+ | "created_at"
1541
+ | "request_content_type"
1542
+ | "response_content_type"
1543
+ | "success"
1544
+ | "cached"
1545
+ | "provider"
1546
+ | "model"
1547
+ | "cost"
1548
+ | "tokens"
1549
+ | "tokens_in"
1550
+ | "tokens_out"
1551
+ | "duration"
1552
+ | "feedback";
1553
+ operator: "eq" | "contains" | "lt" | "gt";
1554
+ value: (string | number | boolean)[];
1555
+ }[];
1556
+ gatewayId: string;
1557
+ modifiedAt: string;
1558
+ name: string;
1559
+ },
1560
+ ListDatasetsError,
1561
+ Credentials | HttpClient.HttpClient
1562
+ >;
1563
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
1564
+ input: ListDatasetsRequest,
1565
+ output: ListDatasetsResponse,
1566
+ errors: [],
1567
+ pagination: {
1568
+ mode: "page",
1569
+ inputToken: "page",
1570
+ outputToken: "resultInfo.page",
1571
+ items: "result",
1572
+ pageSize: "perPage",
1573
+ } as const,
1574
+ }));
1575
+
1576
+ export interface CreateDatasetRequest {
1577
+ gatewayId: string;
1578
+ /** Path param: */
1579
+ accountId: string;
1580
+ /** Body param: */
1581
+ enable: boolean;
1582
+ /** Body param: */
1583
+ filters: {
1584
+ key:
1585
+ | "created_at"
1586
+ | "request_content_type"
1587
+ | "response_content_type"
1588
+ | "success"
1589
+ | "cached"
1590
+ | "provider"
1591
+ | "model"
1592
+ | "cost"
1593
+ | "tokens"
1594
+ | "tokens_in"
1595
+ | "tokens_out"
1596
+ | "duration"
1597
+ | "feedback";
1598
+ operator: "eq" | "contains" | "lt" | "gt";
1599
+ value: (string | number | boolean)[];
1600
+ }[];
1601
+ /** Body param: */
1602
+ name: string;
1603
+ }
1604
+
1605
+ export const CreateDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1606
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
1607
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1608
+ enable: Schema.Boolean,
1609
+ filters: Schema.Array(
1610
+ Schema.Struct({
1611
+ key: Schema.Literals([
1612
+ "created_at",
1613
+ "request_content_type",
1614
+ "response_content_type",
1615
+ "success",
1616
+ "cached",
1617
+ "provider",
1618
+ "model",
1619
+ "cost",
1620
+ "tokens",
1621
+ "tokens_in",
1622
+ "tokens_out",
1623
+ "duration",
1624
+ "feedback",
1625
+ ]),
1626
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1627
+ value: Schema.Array(
1628
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1629
+ ),
1630
+ }),
1631
+ ),
1632
+ name: Schema.String,
1633
+ }).pipe(
1634
+ T.Http({
1635
+ method: "POST",
1636
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets",
1637
+ }),
1638
+ ) as unknown as Schema.Schema<CreateDatasetRequest>;
1639
+
1640
+ export interface CreateDatasetResponse {
1641
+ id: string;
1642
+ accountId: string;
1643
+ accountTag: string;
1644
+ createdAt: string;
1645
+ enable: boolean;
1646
+ filters: {
1647
+ key:
1648
+ | "created_at"
1649
+ | "request_content_type"
1650
+ | "response_content_type"
1651
+ | "success"
1652
+ | "cached"
1653
+ | "provider"
1654
+ | "model"
1655
+ | "cost"
1656
+ | "tokens"
1657
+ | "tokens_in"
1658
+ | "tokens_out"
1659
+ | "duration"
1660
+ | "feedback";
1661
+ operator: "eq" | "contains" | "lt" | "gt";
1662
+ value: (string | number | boolean)[];
1663
+ }[];
1664
+ /** gateway id */
1665
+ gatewayId: string;
1666
+ modifiedAt: string;
1667
+ name: string;
1668
+ }
1669
+
1670
+ export const CreateDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1671
+ id: Schema.String,
1672
+ accountId: Schema.String,
1673
+ accountTag: Schema.String,
1674
+ createdAt: Schema.String,
1675
+ enable: Schema.Boolean,
1676
+ filters: Schema.Array(
1677
+ Schema.Struct({
1678
+ key: Schema.Literals([
1679
+ "created_at",
1680
+ "request_content_type",
1681
+ "response_content_type",
1682
+ "success",
1683
+ "cached",
1684
+ "provider",
1685
+ "model",
1686
+ "cost",
1687
+ "tokens",
1688
+ "tokens_in",
1689
+ "tokens_out",
1690
+ "duration",
1691
+ "feedback",
1692
+ ]),
1693
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1694
+ value: Schema.Array(
1695
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1696
+ ),
1697
+ }),
1698
+ ),
1699
+ gatewayId: Schema.String,
1700
+ modifiedAt: Schema.String,
1701
+ name: Schema.String,
1702
+ })
1703
+ .pipe(
1704
+ Schema.encodeKeys({
1705
+ id: "id",
1706
+ accountId: "account_id",
1707
+ accountTag: "account_tag",
1708
+ createdAt: "created_at",
1709
+ enable: "enable",
1710
+ filters: "filters",
1711
+ gatewayId: "gateway_id",
1712
+ modifiedAt: "modified_at",
1713
+ name: "name",
1714
+ }),
1715
+ )
1716
+ .pipe(
1717
+ T.ResponsePath("result"),
1718
+ ) as unknown as Schema.Schema<CreateDatasetResponse>;
1719
+
1720
+ export type CreateDatasetError = DefaultErrors;
1721
+
1722
+ export const createDataset: API.OperationMethod<
1723
+ CreateDatasetRequest,
1724
+ CreateDatasetResponse,
1725
+ CreateDatasetError,
1726
+ Credentials | HttpClient.HttpClient
1727
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1728
+ input: CreateDatasetRequest,
1729
+ output: CreateDatasetResponse,
1730
+ errors: [],
1731
+ }));
1732
+
1733
+ export interface UpdateDatasetRequest {
1734
+ gatewayId: string;
1735
+ id: string;
1736
+ /** Path param: */
1737
+ accountId: string;
1738
+ /** Body param: */
1739
+ enable: boolean;
1740
+ /** Body param: */
1741
+ filters: {
1742
+ key:
1743
+ | "created_at"
1744
+ | "request_content_type"
1745
+ | "response_content_type"
1746
+ | "success"
1747
+ | "cached"
1748
+ | "provider"
1749
+ | "model"
1750
+ | "cost"
1751
+ | "tokens"
1752
+ | "tokens_in"
1753
+ | "tokens_out"
1754
+ | "duration"
1755
+ | "feedback";
1756
+ operator: "eq" | "contains" | "lt" | "gt";
1757
+ value: (string | number | boolean)[];
1758
+ }[];
1759
+ /** Body param: */
1760
+ name: string;
1761
+ }
1762
+
1763
+ export const UpdateDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1764
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
1765
+ id: Schema.String.pipe(T.HttpPath("id")),
1766
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1767
+ enable: Schema.Boolean,
1768
+ filters: Schema.Array(
1769
+ Schema.Struct({
1770
+ key: Schema.Literals([
1771
+ "created_at",
1772
+ "request_content_type",
1773
+ "response_content_type",
1774
+ "success",
1775
+ "cached",
1776
+ "provider",
1777
+ "model",
1778
+ "cost",
1779
+ "tokens",
1780
+ "tokens_in",
1781
+ "tokens_out",
1782
+ "duration",
1783
+ "feedback",
1784
+ ]),
1785
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1786
+ value: Schema.Array(
1787
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1788
+ ),
1789
+ }),
1790
+ ),
1791
+ name: Schema.String,
1792
+ }).pipe(
1793
+ T.Http({
1794
+ method: "PUT",
1795
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
1796
+ }),
1797
+ ) as unknown as Schema.Schema<UpdateDatasetRequest>;
1798
+
1799
+ export interface UpdateDatasetResponse {
1800
+ id: string;
1801
+ accountId: string;
1802
+ accountTag: string;
1803
+ createdAt: string;
1804
+ enable: boolean;
1805
+ filters: {
1806
+ key:
1807
+ | "created_at"
1808
+ | "request_content_type"
1809
+ | "response_content_type"
1810
+ | "success"
1811
+ | "cached"
1812
+ | "provider"
1813
+ | "model"
1814
+ | "cost"
1815
+ | "tokens"
1816
+ | "tokens_in"
1817
+ | "tokens_out"
1818
+ | "duration"
1819
+ | "feedback";
1820
+ operator: "eq" | "contains" | "lt" | "gt";
1821
+ value: (string | number | boolean)[];
1822
+ }[];
1823
+ /** gateway id */
1824
+ gatewayId: string;
1825
+ modifiedAt: string;
1826
+ name: string;
1827
+ }
1828
+
1829
+ export const UpdateDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1830
+ id: Schema.String,
1831
+ accountId: Schema.String,
1832
+ accountTag: Schema.String,
1833
+ createdAt: Schema.String,
1834
+ enable: Schema.Boolean,
1835
+ filters: Schema.Array(
1836
+ Schema.Struct({
1837
+ key: Schema.Literals([
1838
+ "created_at",
1839
+ "request_content_type",
1840
+ "response_content_type",
1841
+ "success",
1842
+ "cached",
1843
+ "provider",
1844
+ "model",
1845
+ "cost",
1846
+ "tokens",
1847
+ "tokens_in",
1848
+ "tokens_out",
1849
+ "duration",
1850
+ "feedback",
1851
+ ]),
1852
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1853
+ value: Schema.Array(
1854
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1855
+ ),
1856
+ }),
1857
+ ),
1858
+ gatewayId: Schema.String,
1859
+ modifiedAt: Schema.String,
1860
+ name: Schema.String,
1861
+ })
1862
+ .pipe(
1863
+ Schema.encodeKeys({
1864
+ id: "id",
1865
+ accountId: "account_id",
1866
+ accountTag: "account_tag",
1867
+ createdAt: "created_at",
1868
+ enable: "enable",
1869
+ filters: "filters",
1870
+ gatewayId: "gateway_id",
1871
+ modifiedAt: "modified_at",
1872
+ name: "name",
1873
+ }),
1874
+ )
1875
+ .pipe(
1876
+ T.ResponsePath("result"),
1877
+ ) as unknown as Schema.Schema<UpdateDatasetResponse>;
1878
+
1879
+ export type UpdateDatasetError = DefaultErrors;
1880
+
1881
+ export const updateDataset: API.OperationMethod<
1882
+ UpdateDatasetRequest,
1883
+ UpdateDatasetResponse,
1884
+ UpdateDatasetError,
1885
+ Credentials | HttpClient.HttpClient
1886
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1887
+ input: UpdateDatasetRequest,
1888
+ output: UpdateDatasetResponse,
1889
+ errors: [],
1890
+ }));
1891
+
1892
+ export interface DeleteDatasetRequest {
1893
+ gatewayId: string;
1894
+ id: string;
1895
+ accountId: string;
1896
+ }
1897
+
1898
+ export const DeleteDatasetRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1899
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
1900
+ id: Schema.String.pipe(T.HttpPath("id")),
1901
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1902
+ }).pipe(
1903
+ T.Http({
1904
+ method: "DELETE",
1905
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/datasets/{id}",
1906
+ }),
1907
+ ) as unknown as Schema.Schema<DeleteDatasetRequest>;
1908
+
1909
+ export interface DeleteDatasetResponse {
1910
+ id: string;
1911
+ accountId: string;
1912
+ accountTag: string;
1913
+ createdAt: string;
1914
+ enable: boolean;
1915
+ filters: {
1916
+ key:
1917
+ | "created_at"
1918
+ | "request_content_type"
1919
+ | "response_content_type"
1920
+ | "success"
1921
+ | "cached"
1922
+ | "provider"
1923
+ | "model"
1924
+ | "cost"
1925
+ | "tokens"
1926
+ | "tokens_in"
1927
+ | "tokens_out"
1928
+ | "duration"
1929
+ | "feedback";
1930
+ operator: "eq" | "contains" | "lt" | "gt";
1931
+ value: (string | number | boolean)[];
1932
+ }[];
1933
+ /** gateway id */
1934
+ gatewayId: string;
1935
+ modifiedAt: string;
1936
+ name: string;
1937
+ }
1938
+
1939
+ export const DeleteDatasetResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1940
+ id: Schema.String,
1941
+ accountId: Schema.String,
1942
+ accountTag: Schema.String,
1943
+ createdAt: Schema.String,
1944
+ enable: Schema.Boolean,
1945
+ filters: Schema.Array(
1946
+ Schema.Struct({
1947
+ key: Schema.Literals([
1948
+ "created_at",
1949
+ "request_content_type",
1950
+ "response_content_type",
1951
+ "success",
1952
+ "cached",
1953
+ "provider",
1954
+ "model",
1955
+ "cost",
1956
+ "tokens",
1957
+ "tokens_in",
1958
+ "tokens_out",
1959
+ "duration",
1960
+ "feedback",
1961
+ ]),
1962
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
1963
+ value: Schema.Array(
1964
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
1965
+ ),
1966
+ }),
1967
+ ),
1968
+ gatewayId: Schema.String,
1969
+ modifiedAt: Schema.String,
1970
+ name: Schema.String,
1971
+ })
1972
+ .pipe(
1973
+ Schema.encodeKeys({
1974
+ id: "id",
1975
+ accountId: "account_id",
1976
+ accountTag: "account_tag",
1977
+ createdAt: "created_at",
1978
+ enable: "enable",
1979
+ filters: "filters",
1980
+ gatewayId: "gateway_id",
1981
+ modifiedAt: "modified_at",
1982
+ name: "name",
1983
+ }),
1984
+ )
1985
+ .pipe(
1986
+ T.ResponsePath("result"),
1987
+ ) as unknown as Schema.Schema<DeleteDatasetResponse>;
1988
+
1989
+ export type DeleteDatasetError = DefaultErrors;
1990
+
1991
+ export const deleteDataset: API.OperationMethod<
1992
+ DeleteDatasetRequest,
1993
+ DeleteDatasetResponse,
1994
+ DeleteDatasetError,
1995
+ Credentials | HttpClient.HttpClient
1996
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1997
+ input: DeleteDatasetRequest,
1998
+ output: DeleteDatasetResponse,
1999
+ errors: [],
2000
+ }));
2001
+
2002
+ // =============================================================================
2003
+ // Evaluation
2004
+ // =============================================================================
2005
+
2006
+ export interface GetEvaluationRequest {
2007
+ gatewayId: string;
2008
+ id: string;
2009
+ accountId: string;
2010
+ }
2011
+
2012
+ export const GetEvaluationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2013
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
2014
+ id: Schema.String.pipe(T.HttpPath("id")),
2015
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2016
+ }).pipe(
2017
+ T.Http({
2018
+ method: "GET",
2019
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations/{id}",
2020
+ }),
2021
+ ) as unknown as Schema.Schema<GetEvaluationRequest>;
2022
+
2023
+ export interface GetEvaluationResponse {
2024
+ id: string;
2025
+ accountId: string;
2026
+ accountTag: string;
2027
+ createdAt: string;
2028
+ datasets: {
2029
+ id: string;
2030
+ accountId: string;
2031
+ accountTag: string;
2032
+ createdAt: string;
2033
+ enable: boolean;
2034
+ filters: {
2035
+ key:
2036
+ | "created_at"
2037
+ | "request_content_type"
2038
+ | "response_content_type"
2039
+ | "success"
2040
+ | "cached"
2041
+ | "provider"
2042
+ | "model"
2043
+ | "cost"
2044
+ | "tokens"
2045
+ | "tokens_in"
2046
+ | "tokens_out"
2047
+ | "duration"
2048
+ | "feedback";
2049
+ operator: "eq" | "contains" | "lt" | "gt";
2050
+ value: (string | number | boolean)[];
2051
+ }[];
2052
+ gatewayId: string;
2053
+ modifiedAt: string;
2054
+ name: string;
2055
+ }[];
2056
+ /** gateway id */
2057
+ gatewayId: string;
2058
+ modifiedAt: string;
2059
+ name: string;
2060
+ processed: boolean;
2061
+ results: {
2062
+ id: string;
2063
+ createdAt: string;
2064
+ evaluationId: string;
2065
+ evaluationTypeId: string;
2066
+ modifiedAt: string;
2067
+ result: string;
2068
+ status: number;
2069
+ statusDescription: string;
2070
+ totalLogs: number;
2071
+ }[];
2072
+ totalLogs: number;
2073
+ }
2074
+
2075
+ export const GetEvaluationResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2076
+ id: Schema.String,
2077
+ accountId: Schema.String,
2078
+ accountTag: Schema.String,
2079
+ createdAt: Schema.String,
2080
+ datasets: Schema.Array(
2081
+ Schema.Struct({
2082
+ id: Schema.String,
2083
+ accountId: Schema.String,
2084
+ accountTag: Schema.String,
2085
+ createdAt: Schema.String,
2086
+ enable: Schema.Boolean,
2087
+ filters: Schema.Array(
2088
+ Schema.Struct({
2089
+ key: Schema.Literals([
2090
+ "created_at",
2091
+ "request_content_type",
2092
+ "response_content_type",
2093
+ "success",
2094
+ "cached",
2095
+ "provider",
2096
+ "model",
2097
+ "cost",
2098
+ "tokens",
2099
+ "tokens_in",
2100
+ "tokens_out",
2101
+ "duration",
2102
+ "feedback",
2103
+ ]),
2104
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
2105
+ value: Schema.Array(
2106
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
2107
+ ),
2108
+ }),
2109
+ ),
2110
+ gatewayId: Schema.String,
2111
+ modifiedAt: Schema.String,
2112
+ name: Schema.String,
2113
+ }).pipe(
2114
+ Schema.encodeKeys({
2115
+ id: "id",
2116
+ accountId: "account_id",
2117
+ accountTag: "account_tag",
2118
+ createdAt: "created_at",
2119
+ enable: "enable",
2120
+ filters: "filters",
2121
+ gatewayId: "gateway_id",
2122
+ modifiedAt: "modified_at",
2123
+ name: "name",
2124
+ }),
2125
+ ),
2126
+ ),
2127
+ gatewayId: Schema.String,
2128
+ modifiedAt: Schema.String,
2129
+ name: Schema.String,
2130
+ processed: Schema.Boolean,
2131
+ results: Schema.Array(
2132
+ Schema.Struct({
2133
+ id: Schema.String,
2134
+ createdAt: Schema.String,
2135
+ evaluationId: Schema.String,
2136
+ evaluationTypeId: Schema.String,
2137
+ modifiedAt: Schema.String,
2138
+ result: Schema.String,
2139
+ status: Schema.Number,
2140
+ statusDescription: Schema.String,
2141
+ totalLogs: Schema.Number,
2142
+ }).pipe(
2143
+ Schema.encodeKeys({
2144
+ id: "id",
2145
+ createdAt: "created_at",
2146
+ evaluationId: "evaluation_id",
2147
+ evaluationTypeId: "evaluation_type_id",
2148
+ modifiedAt: "modified_at",
2149
+ result: "result",
2150
+ status: "status",
2151
+ statusDescription: "status_description",
2152
+ totalLogs: "total_logs",
2153
+ }),
2154
+ ),
2155
+ ),
2156
+ totalLogs: Schema.Number,
2157
+ })
2158
+ .pipe(
2159
+ Schema.encodeKeys({
2160
+ id: "id",
2161
+ accountId: "account_id",
2162
+ accountTag: "account_tag",
2163
+ createdAt: "created_at",
2164
+ datasets: "datasets",
2165
+ gatewayId: "gateway_id",
2166
+ modifiedAt: "modified_at",
2167
+ name: "name",
2168
+ processed: "processed",
2169
+ results: "results",
2170
+ totalLogs: "total_logs",
2171
+ }),
2172
+ )
2173
+ .pipe(
2174
+ T.ResponsePath("result"),
2175
+ ) as unknown as Schema.Schema<GetEvaluationResponse>;
2176
+
2177
+ export type GetEvaluationError = DefaultErrors;
2178
+
2179
+ export const getEvaluation: API.OperationMethod<
2180
+ GetEvaluationRequest,
2181
+ GetEvaluationResponse,
2182
+ GetEvaluationError,
2183
+ Credentials | HttpClient.HttpClient
2184
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2185
+ input: GetEvaluationRequest,
2186
+ output: GetEvaluationResponse,
2187
+ errors: [],
2188
+ }));
2189
+
2190
+ export interface ListEvaluationsRequest {
2191
+ gatewayId: string;
2192
+ /** Path param: */
2193
+ accountId: string;
2194
+ /** Query param: */
2195
+ name?: string;
2196
+ /** Query param: */
2197
+ processed?: boolean;
2198
+ /** Query param: Search by id, name */
2199
+ search?: string;
2200
+ }
2201
+
2202
+ export const ListEvaluationsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
2203
+ {
2204
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
2205
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2206
+ name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
2207
+ processed: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("processed")),
2208
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
2209
+ },
2210
+ ).pipe(
2211
+ T.Http({
2212
+ method: "GET",
2213
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations",
2214
+ }),
2215
+ ) as unknown as Schema.Schema<ListEvaluationsRequest>;
2216
+
2217
+ export interface ListEvaluationsResponse {
2218
+ result: {
2219
+ id: string;
2220
+ accountId: string;
2221
+ accountTag: string;
2222
+ createdAt: string;
2223
+ datasets: {
2224
+ id: string;
2225
+ accountId: string;
2226
+ accountTag: string;
2227
+ createdAt: string;
2228
+ enable: boolean;
2229
+ filters: {
2230
+ key:
2231
+ | "created_at"
2232
+ | "request_content_type"
2233
+ | "response_content_type"
2234
+ | "success"
2235
+ | "cached"
2236
+ | "provider"
2237
+ | "model"
2238
+ | "cost"
2239
+ | "tokens"
2240
+ | "tokens_in"
2241
+ | "tokens_out"
2242
+ | "duration"
2243
+ | "feedback";
2244
+ operator: "eq" | "contains" | "lt" | "gt";
2245
+ value: (string | number | boolean)[];
2246
+ }[];
2247
+ gatewayId: string;
2248
+ modifiedAt: string;
2249
+ name: string;
2250
+ }[];
2251
+ gatewayId: string;
2252
+ modifiedAt: string;
2253
+ name: string;
2254
+ processed: boolean;
2255
+ results: {
2256
+ id: string;
2257
+ createdAt: string;
2258
+ evaluationId: string;
2259
+ evaluationTypeId: string;
2260
+ modifiedAt: string;
2261
+ result: string;
2262
+ status: number;
2263
+ statusDescription: string;
2264
+ totalLogs: number;
2265
+ }[];
2266
+ totalLogs: number;
2267
+ }[];
2268
+ resultInfo: {
2269
+ count?: number | null;
2270
+ page?: number | null;
2271
+ perPage?: number | null;
2272
+ totalCount?: number | null;
2273
+ };
2274
+ }
2275
+
2276
+ export const ListEvaluationsResponse =
2277
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2278
+ result: Schema.Array(
2279
+ Schema.Struct({
2280
+ id: Schema.String,
2281
+ accountId: Schema.String,
2282
+ accountTag: Schema.String,
2283
+ createdAt: Schema.String,
2284
+ datasets: Schema.Array(
2285
+ Schema.Struct({
2286
+ id: Schema.String,
2287
+ accountId: Schema.String,
2288
+ accountTag: Schema.String,
2289
+ createdAt: Schema.String,
2290
+ enable: Schema.Boolean,
2291
+ filters: Schema.Array(
2292
+ Schema.Struct({
2293
+ key: Schema.Literals([
2294
+ "created_at",
2295
+ "request_content_type",
2296
+ "response_content_type",
2297
+ "success",
2298
+ "cached",
2299
+ "provider",
2300
+ "model",
2301
+ "cost",
2302
+ "tokens",
2303
+ "tokens_in",
2304
+ "tokens_out",
2305
+ "duration",
2306
+ "feedback",
2307
+ ]),
2308
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
2309
+ value: Schema.Array(
2310
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
2311
+ ),
2312
+ }),
2313
+ ),
2314
+ gatewayId: Schema.String,
2315
+ modifiedAt: Schema.String,
2316
+ name: Schema.String,
2317
+ }).pipe(
2318
+ Schema.encodeKeys({
2319
+ id: "id",
2320
+ accountId: "account_id",
2321
+ accountTag: "account_tag",
2322
+ createdAt: "created_at",
2323
+ enable: "enable",
2324
+ filters: "filters",
2325
+ gatewayId: "gateway_id",
2326
+ modifiedAt: "modified_at",
2327
+ name: "name",
2328
+ }),
2329
+ ),
2330
+ ),
2331
+ gatewayId: Schema.String,
2332
+ modifiedAt: Schema.String,
2333
+ name: Schema.String,
2334
+ processed: Schema.Boolean,
2335
+ results: Schema.Array(
2336
+ Schema.Struct({
2337
+ id: Schema.String,
2338
+ createdAt: Schema.String,
2339
+ evaluationId: Schema.String,
2340
+ evaluationTypeId: Schema.String,
2341
+ modifiedAt: Schema.String,
2342
+ result: Schema.String,
2343
+ status: Schema.Number,
2344
+ statusDescription: Schema.String,
2345
+ totalLogs: Schema.Number,
2346
+ }).pipe(
2347
+ Schema.encodeKeys({
2348
+ id: "id",
2349
+ createdAt: "created_at",
2350
+ evaluationId: "evaluation_id",
2351
+ evaluationTypeId: "evaluation_type_id",
2352
+ modifiedAt: "modified_at",
2353
+ result: "result",
2354
+ status: "status",
2355
+ statusDescription: "status_description",
2356
+ totalLogs: "total_logs",
2357
+ }),
2358
+ ),
2359
+ ),
2360
+ totalLogs: Schema.Number,
2361
+ }).pipe(
2362
+ Schema.encodeKeys({
2363
+ id: "id",
2364
+ accountId: "account_id",
2365
+ accountTag: "account_tag",
2366
+ createdAt: "created_at",
2367
+ datasets: "datasets",
2368
+ gatewayId: "gateway_id",
2369
+ modifiedAt: "modified_at",
2370
+ name: "name",
2371
+ processed: "processed",
2372
+ results: "results",
2373
+ totalLogs: "total_logs",
2374
+ }),
2375
+ ),
2376
+ ),
2377
+ resultInfo: Schema.Struct({
2378
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2379
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2380
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2381
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2382
+ }).pipe(
2383
+ Schema.encodeKeys({
2384
+ count: "count",
2385
+ page: "page",
2386
+ perPage: "per_page",
2387
+ totalCount: "total_count",
2388
+ }),
2389
+ ),
2390
+ }).pipe(
2391
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
2392
+ ) as unknown as Schema.Schema<ListEvaluationsResponse>;
2393
+
2394
+ export type ListEvaluationsError = DefaultErrors;
2395
+
2396
+ export const listEvaluations: API.PaginatedOperationMethod<
2397
+ ListEvaluationsRequest,
2398
+ ListEvaluationsResponse,
2399
+ ListEvaluationsError,
2400
+ Credentials | HttpClient.HttpClient
2401
+ > & {
2402
+ pages: (
2403
+ input: ListEvaluationsRequest,
2404
+ ) => stream.Stream<
2405
+ ListEvaluationsResponse,
2406
+ ListEvaluationsError,
2407
+ Credentials | HttpClient.HttpClient
2408
+ >;
2409
+ items: (input: ListEvaluationsRequest) => stream.Stream<
2410
+ {
2411
+ id: string;
2412
+ accountId: string;
2413
+ accountTag: string;
2414
+ createdAt: string;
2415
+ datasets: {
2416
+ id: string;
2417
+ accountId: string;
2418
+ accountTag: string;
2419
+ createdAt: string;
2420
+ enable: boolean;
2421
+ filters: {
2422
+ key:
2423
+ | "created_at"
2424
+ | "request_content_type"
2425
+ | "response_content_type"
2426
+ | "success"
2427
+ | "cached"
2428
+ | "provider"
2429
+ | "model"
2430
+ | "cost"
2431
+ | "tokens"
2432
+ | "tokens_in"
2433
+ | "tokens_out"
2434
+ | "duration"
2435
+ | "feedback";
2436
+ operator: "eq" | "contains" | "lt" | "gt";
2437
+ value: (string | number | boolean)[];
2438
+ }[];
2439
+ gatewayId: string;
2440
+ modifiedAt: string;
2441
+ name: string;
2442
+ }[];
2443
+ gatewayId: string;
2444
+ modifiedAt: string;
2445
+ name: string;
2446
+ processed: boolean;
2447
+ results: {
2448
+ id: string;
2449
+ createdAt: string;
2450
+ evaluationId: string;
2451
+ evaluationTypeId: string;
2452
+ modifiedAt: string;
2453
+ result: string;
2454
+ status: number;
2455
+ statusDescription: string;
2456
+ totalLogs: number;
2457
+ }[];
2458
+ totalLogs: number;
2459
+ },
2460
+ ListEvaluationsError,
2461
+ Credentials | HttpClient.HttpClient
2462
+ >;
2463
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
2464
+ input: ListEvaluationsRequest,
2465
+ output: ListEvaluationsResponse,
2466
+ errors: [],
2467
+ pagination: {
2468
+ mode: "page",
2469
+ inputToken: "page",
2470
+ outputToken: "resultInfo.page",
2471
+ items: "result",
2472
+ pageSize: "perPage",
2473
+ } as const,
2474
+ }));
2475
+
2476
+ export interface CreateEvaluationRequest {
2477
+ gatewayId: string;
2478
+ /** Path param: */
2479
+ accountId: string;
2480
+ /** Body param: */
2481
+ datasetIds: string[];
2482
+ /** Body param: */
2483
+ evaluationTypeIds: string[];
2484
+ /** Body param: */
2485
+ name: string;
2486
+ }
2487
+
2488
+ export const CreateEvaluationRequest =
2489
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2490
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
2491
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2492
+ datasetIds: Schema.Array(Schema.String),
2493
+ evaluationTypeIds: Schema.Array(Schema.String),
2494
+ name: Schema.String,
2495
+ }).pipe(
2496
+ Schema.encodeKeys({
2497
+ datasetIds: "dataset_ids",
2498
+ evaluationTypeIds: "evaluation_type_ids",
2499
+ name: "name",
2500
+ }),
2501
+ T.Http({
2502
+ method: "POST",
2503
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations",
2504
+ }),
2505
+ ) as unknown as Schema.Schema<CreateEvaluationRequest>;
2506
+
2507
+ export interface CreateEvaluationResponse {
2508
+ id: string;
2509
+ accountId: string;
2510
+ accountTag: string;
2511
+ createdAt: string;
2512
+ datasets: {
2513
+ id: string;
2514
+ accountId: string;
2515
+ accountTag: string;
2516
+ createdAt: string;
2517
+ enable: boolean;
2518
+ filters: {
2519
+ key:
2520
+ | "created_at"
2521
+ | "request_content_type"
2522
+ | "response_content_type"
2523
+ | "success"
2524
+ | "cached"
2525
+ | "provider"
2526
+ | "model"
2527
+ | "cost"
2528
+ | "tokens"
2529
+ | "tokens_in"
2530
+ | "tokens_out"
2531
+ | "duration"
2532
+ | "feedback";
2533
+ operator: "eq" | "contains" | "lt" | "gt";
2534
+ value: (string | number | boolean)[];
2535
+ }[];
2536
+ gatewayId: string;
2537
+ modifiedAt: string;
2538
+ name: string;
2539
+ }[];
2540
+ /** gateway id */
2541
+ gatewayId: string;
2542
+ modifiedAt: string;
2543
+ name: string;
2544
+ processed: boolean;
2545
+ results: {
2546
+ id: string;
2547
+ createdAt: string;
2548
+ evaluationId: string;
2549
+ evaluationTypeId: string;
2550
+ modifiedAt: string;
2551
+ result: string;
2552
+ status: number;
2553
+ statusDescription: string;
2554
+ totalLogs: number;
2555
+ }[];
2556
+ totalLogs: number;
2557
+ }
2558
+
2559
+ export const CreateEvaluationResponse =
2560
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2561
+ id: Schema.String,
2562
+ accountId: Schema.String,
2563
+ accountTag: Schema.String,
2564
+ createdAt: Schema.String,
2565
+ datasets: Schema.Array(
2566
+ Schema.Struct({
2567
+ id: Schema.String,
2568
+ accountId: Schema.String,
2569
+ accountTag: Schema.String,
2570
+ createdAt: Schema.String,
2571
+ enable: Schema.Boolean,
2572
+ filters: Schema.Array(
2573
+ Schema.Struct({
2574
+ key: Schema.Literals([
2575
+ "created_at",
2576
+ "request_content_type",
2577
+ "response_content_type",
2578
+ "success",
2579
+ "cached",
2580
+ "provider",
2581
+ "model",
2582
+ "cost",
2583
+ "tokens",
2584
+ "tokens_in",
2585
+ "tokens_out",
2586
+ "duration",
2587
+ "feedback",
2588
+ ]),
2589
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
2590
+ value: Schema.Array(
2591
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
2592
+ ),
2593
+ }),
2594
+ ),
2595
+ gatewayId: Schema.String,
2596
+ modifiedAt: Schema.String,
2597
+ name: Schema.String,
2598
+ }).pipe(
2599
+ Schema.encodeKeys({
2600
+ id: "id",
2601
+ accountId: "account_id",
2602
+ accountTag: "account_tag",
2603
+ createdAt: "created_at",
2604
+ enable: "enable",
2605
+ filters: "filters",
2606
+ gatewayId: "gateway_id",
2607
+ modifiedAt: "modified_at",
2608
+ name: "name",
2609
+ }),
2610
+ ),
2611
+ ),
2612
+ gatewayId: Schema.String,
2613
+ modifiedAt: Schema.String,
2614
+ name: Schema.String,
2615
+ processed: Schema.Boolean,
2616
+ results: Schema.Array(
2617
+ Schema.Struct({
2618
+ id: Schema.String,
2619
+ createdAt: Schema.String,
2620
+ evaluationId: Schema.String,
2621
+ evaluationTypeId: Schema.String,
2622
+ modifiedAt: Schema.String,
2623
+ result: Schema.String,
2624
+ status: Schema.Number,
2625
+ statusDescription: Schema.String,
2626
+ totalLogs: Schema.Number,
2627
+ }).pipe(
2628
+ Schema.encodeKeys({
2629
+ id: "id",
2630
+ createdAt: "created_at",
2631
+ evaluationId: "evaluation_id",
2632
+ evaluationTypeId: "evaluation_type_id",
2633
+ modifiedAt: "modified_at",
2634
+ result: "result",
2635
+ status: "status",
2636
+ statusDescription: "status_description",
2637
+ totalLogs: "total_logs",
2638
+ }),
2639
+ ),
2640
+ ),
2641
+ totalLogs: Schema.Number,
2642
+ })
2643
+ .pipe(
2644
+ Schema.encodeKeys({
2645
+ id: "id",
2646
+ accountId: "account_id",
2647
+ accountTag: "account_tag",
2648
+ createdAt: "created_at",
2649
+ datasets: "datasets",
2650
+ gatewayId: "gateway_id",
2651
+ modifiedAt: "modified_at",
2652
+ name: "name",
2653
+ processed: "processed",
2654
+ results: "results",
2655
+ totalLogs: "total_logs",
2656
+ }),
2657
+ )
2658
+ .pipe(
2659
+ T.ResponsePath("result"),
2660
+ ) as unknown as Schema.Schema<CreateEvaluationResponse>;
2661
+
2662
+ export type CreateEvaluationError = DefaultErrors;
2663
+
2664
+ export const createEvaluation: API.OperationMethod<
2665
+ CreateEvaluationRequest,
2666
+ CreateEvaluationResponse,
2667
+ CreateEvaluationError,
2668
+ Credentials | HttpClient.HttpClient
2669
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2670
+ input: CreateEvaluationRequest,
2671
+ output: CreateEvaluationResponse,
2672
+ errors: [],
2673
+ }));
2674
+
2675
+ export interface DeleteEvaluationRequest {
2676
+ gatewayId: string;
2677
+ id: string;
2678
+ accountId: string;
2679
+ }
2680
+
2681
+ export const DeleteEvaluationRequest =
2682
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2683
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
2684
+ id: Schema.String.pipe(T.HttpPath("id")),
2685
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2686
+ }).pipe(
2687
+ T.Http({
2688
+ method: "DELETE",
2689
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/evaluations/{id}",
2690
+ }),
2691
+ ) as unknown as Schema.Schema<DeleteEvaluationRequest>;
2692
+
2693
+ export interface DeleteEvaluationResponse {
2694
+ id: string;
2695
+ accountId: string;
2696
+ accountTag: string;
2697
+ createdAt: string;
2698
+ datasets: {
2699
+ id: string;
2700
+ accountId: string;
2701
+ accountTag: string;
2702
+ createdAt: string;
2703
+ enable: boolean;
2704
+ filters: {
2705
+ key:
2706
+ | "created_at"
2707
+ | "request_content_type"
2708
+ | "response_content_type"
2709
+ | "success"
2710
+ | "cached"
2711
+ | "provider"
2712
+ | "model"
2713
+ | "cost"
2714
+ | "tokens"
2715
+ | "tokens_in"
2716
+ | "tokens_out"
2717
+ | "duration"
2718
+ | "feedback";
2719
+ operator: "eq" | "contains" | "lt" | "gt";
2720
+ value: (string | number | boolean)[];
2721
+ }[];
2722
+ gatewayId: string;
2723
+ modifiedAt: string;
2724
+ name: string;
2725
+ }[];
2726
+ /** gateway id */
2727
+ gatewayId: string;
2728
+ modifiedAt: string;
2729
+ name: string;
2730
+ processed: boolean;
2731
+ results: {
2732
+ id: string;
2733
+ createdAt: string;
2734
+ evaluationId: string;
2735
+ evaluationTypeId: string;
2736
+ modifiedAt: string;
2737
+ result: string;
2738
+ status: number;
2739
+ statusDescription: string;
2740
+ totalLogs: number;
2741
+ }[];
2742
+ totalLogs: number;
2743
+ }
2744
+
2745
+ export const DeleteEvaluationResponse =
2746
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2747
+ id: Schema.String,
2748
+ accountId: Schema.String,
2749
+ accountTag: Schema.String,
2750
+ createdAt: Schema.String,
2751
+ datasets: Schema.Array(
2752
+ Schema.Struct({
2753
+ id: Schema.String,
2754
+ accountId: Schema.String,
2755
+ accountTag: Schema.String,
2756
+ createdAt: Schema.String,
2757
+ enable: Schema.Boolean,
2758
+ filters: Schema.Array(
2759
+ Schema.Struct({
2760
+ key: Schema.Literals([
2761
+ "created_at",
2762
+ "request_content_type",
2763
+ "response_content_type",
2764
+ "success",
2765
+ "cached",
2766
+ "provider",
2767
+ "model",
2768
+ "cost",
2769
+ "tokens",
2770
+ "tokens_in",
2771
+ "tokens_out",
2772
+ "duration",
2773
+ "feedback",
2774
+ ]),
2775
+ operator: Schema.Literals(["eq", "contains", "lt", "gt"]),
2776
+ value: Schema.Array(
2777
+ Schema.Union([Schema.String, Schema.Number, Schema.Boolean]),
2778
+ ),
2779
+ }),
2780
+ ),
2781
+ gatewayId: Schema.String,
2782
+ modifiedAt: Schema.String,
2783
+ name: Schema.String,
2784
+ }).pipe(
2785
+ Schema.encodeKeys({
2786
+ id: "id",
2787
+ accountId: "account_id",
2788
+ accountTag: "account_tag",
2789
+ createdAt: "created_at",
2790
+ enable: "enable",
2791
+ filters: "filters",
2792
+ gatewayId: "gateway_id",
2793
+ modifiedAt: "modified_at",
2794
+ name: "name",
2795
+ }),
2796
+ ),
2797
+ ),
2798
+ gatewayId: Schema.String,
2799
+ modifiedAt: Schema.String,
2800
+ name: Schema.String,
2801
+ processed: Schema.Boolean,
2802
+ results: Schema.Array(
2803
+ Schema.Struct({
2804
+ id: Schema.String,
2805
+ createdAt: Schema.String,
2806
+ evaluationId: Schema.String,
2807
+ evaluationTypeId: Schema.String,
2808
+ modifiedAt: Schema.String,
2809
+ result: Schema.String,
2810
+ status: Schema.Number,
2811
+ statusDescription: Schema.String,
2812
+ totalLogs: Schema.Number,
2813
+ }).pipe(
2814
+ Schema.encodeKeys({
2815
+ id: "id",
2816
+ createdAt: "created_at",
2817
+ evaluationId: "evaluation_id",
2818
+ evaluationTypeId: "evaluation_type_id",
2819
+ modifiedAt: "modified_at",
2820
+ result: "result",
2821
+ status: "status",
2822
+ statusDescription: "status_description",
2823
+ totalLogs: "total_logs",
2824
+ }),
2825
+ ),
2826
+ ),
2827
+ totalLogs: Schema.Number,
2828
+ })
2829
+ .pipe(
2830
+ Schema.encodeKeys({
2831
+ id: "id",
2832
+ accountId: "account_id",
2833
+ accountTag: "account_tag",
2834
+ createdAt: "created_at",
2835
+ datasets: "datasets",
2836
+ gatewayId: "gateway_id",
2837
+ modifiedAt: "modified_at",
2838
+ name: "name",
2839
+ processed: "processed",
2840
+ results: "results",
2841
+ totalLogs: "total_logs",
2842
+ }),
2843
+ )
2844
+ .pipe(
2845
+ T.ResponsePath("result"),
2846
+ ) as unknown as Schema.Schema<DeleteEvaluationResponse>;
2847
+
2848
+ export type DeleteEvaluationError = DefaultErrors;
2849
+
2850
+ export const deleteEvaluation: API.OperationMethod<
2851
+ DeleteEvaluationRequest,
2852
+ DeleteEvaluationResponse,
2853
+ DeleteEvaluationError,
2854
+ Credentials | HttpClient.HttpClient
2855
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2856
+ input: DeleteEvaluationRequest,
2857
+ output: DeleteEvaluationResponse,
2858
+ errors: [],
2859
+ }));
2860
+
2861
+ // =============================================================================
2862
+ // EvaluationType
2863
+ // =============================================================================
2864
+
2865
+ export interface ListEvaluationTypesRequest {
2866
+ /** Path param: */
2867
+ accountId: string;
2868
+ /** Query param: */
2869
+ orderBy?: string;
2870
+ /** Query param: */
2871
+ orderByDirection?: "asc" | "desc";
2872
+ }
2873
+
2874
+ export const ListEvaluationTypesRequest =
2875
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2876
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2877
+ orderBy: Schema.optional(Schema.String).pipe(T.HttpQuery("order_by")),
2878
+ orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
2879
+ T.HttpQuery("order_by_direction"),
2880
+ ),
2881
+ }).pipe(
2882
+ T.Http({
2883
+ method: "GET",
2884
+ path: "/accounts/{account_id}/ai-gateway/evaluation-types",
2885
+ }),
2886
+ ) as unknown as Schema.Schema<ListEvaluationTypesRequest>;
2887
+
2888
+ export interface ListEvaluationTypesResponse {
2889
+ result: {
2890
+ id: string;
2891
+ createdAt: string;
2892
+ description: string;
2893
+ enable: boolean;
2894
+ mandatory: boolean;
2895
+ modifiedAt: string;
2896
+ name: string;
2897
+ type: string;
2898
+ }[];
2899
+ resultInfo: {
2900
+ count?: number | null;
2901
+ page?: number | null;
2902
+ perPage?: number | null;
2903
+ totalCount?: number | null;
2904
+ };
2905
+ }
2906
+
2907
+ export const ListEvaluationTypesResponse =
2908
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2909
+ result: Schema.Array(
2910
+ Schema.Struct({
2911
+ id: Schema.String,
2912
+ createdAt: Schema.String,
2913
+ description: Schema.String,
2914
+ enable: Schema.Boolean,
2915
+ mandatory: Schema.Boolean,
2916
+ modifiedAt: Schema.String,
2917
+ name: Schema.String,
2918
+ type: Schema.String,
2919
+ }).pipe(
2920
+ Schema.encodeKeys({
2921
+ id: "id",
2922
+ createdAt: "created_at",
2923
+ description: "description",
2924
+ enable: "enable",
2925
+ mandatory: "mandatory",
2926
+ modifiedAt: "modified_at",
2927
+ name: "name",
2928
+ type: "type",
2929
+ }),
2930
+ ),
2931
+ ),
2932
+ resultInfo: Schema.Struct({
2933
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2934
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2935
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2936
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2937
+ }).pipe(
2938
+ Schema.encodeKeys({
2939
+ count: "count",
2940
+ page: "page",
2941
+ perPage: "per_page",
2942
+ totalCount: "total_count",
2943
+ }),
2944
+ ),
2945
+ }).pipe(
2946
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
2947
+ ) as unknown as Schema.Schema<ListEvaluationTypesResponse>;
2948
+
2949
+ export type ListEvaluationTypesError = DefaultErrors;
2950
+
2951
+ export const listEvaluationTypes: API.PaginatedOperationMethod<
2952
+ ListEvaluationTypesRequest,
2953
+ ListEvaluationTypesResponse,
2954
+ ListEvaluationTypesError,
2955
+ Credentials | HttpClient.HttpClient
2956
+ > & {
2957
+ pages: (
2958
+ input: ListEvaluationTypesRequest,
2959
+ ) => stream.Stream<
2960
+ ListEvaluationTypesResponse,
2961
+ ListEvaluationTypesError,
2962
+ Credentials | HttpClient.HttpClient
2963
+ >;
2964
+ items: (input: ListEvaluationTypesRequest) => stream.Stream<
2965
+ {
2966
+ id: string;
2967
+ createdAt: string;
2968
+ description: string;
2969
+ enable: boolean;
2970
+ mandatory: boolean;
2971
+ modifiedAt: string;
2972
+ name: string;
2973
+ type: string;
2974
+ },
2975
+ ListEvaluationTypesError,
2976
+ Credentials | HttpClient.HttpClient
2977
+ >;
2978
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
2979
+ input: ListEvaluationTypesRequest,
2980
+ output: ListEvaluationTypesResponse,
2981
+ errors: [],
2982
+ pagination: {
2983
+ mode: "page",
2984
+ inputToken: "page",
2985
+ outputToken: "resultInfo.page",
2986
+ items: "result",
2987
+ pageSize: "perPage",
2988
+ } as const,
2989
+ }));
2990
+
2991
+ // =============================================================================
2992
+ // Log
2993
+ // =============================================================================
2994
+
2995
+ export interface GetLogRequest {
2996
+ gatewayId: string;
2997
+ id: string;
2998
+ accountId: string;
2999
+ }
3000
+
3001
+ export const GetLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3002
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3003
+ id: Schema.String.pipe(T.HttpPath("id")),
3004
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3005
+ }).pipe(
3006
+ T.Http({
3007
+ method: "GET",
3008
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}",
3009
+ }),
3010
+ ) as unknown as Schema.Schema<GetLogRequest>;
3011
+
3012
+ export interface GetLogResponse {
3013
+ id: string;
3014
+ cached: boolean;
3015
+ createdAt: string;
3016
+ duration: number;
3017
+ model: string;
3018
+ path: string;
3019
+ provider: string;
3020
+ success: boolean;
3021
+ tokensIn: number | null;
3022
+ tokensOut: number | null;
3023
+ cost?: number | null;
3024
+ customCost?: boolean | null;
3025
+ metadata?: string | null;
3026
+ modelType?: string | null;
3027
+ requestContentType?: string | null;
3028
+ requestHead?: string | null;
3029
+ requestHeadComplete?: boolean | null;
3030
+ requestSize?: number | null;
3031
+ requestType?: string | null;
3032
+ responseContentType?: string | null;
3033
+ responseHead?: string | null;
3034
+ responseHeadComplete?: boolean | null;
3035
+ responseSize?: number | null;
3036
+ statusCode?: number | null;
3037
+ step?: number | null;
3038
+ }
3039
+
3040
+ export const GetLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3041
+ id: Schema.String,
3042
+ cached: Schema.Boolean,
3043
+ createdAt: Schema.String,
3044
+ duration: Schema.Number,
3045
+ model: Schema.String,
3046
+ path: Schema.String,
3047
+ provider: Schema.String,
3048
+ success: Schema.Boolean,
3049
+ tokensIn: Schema.Union([Schema.Number, Schema.Null]),
3050
+ tokensOut: Schema.Union([Schema.Number, Schema.Null]),
3051
+ cost: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3052
+ customCost: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3053
+ metadata: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3054
+ modelType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3055
+ requestContentType: Schema.optional(
3056
+ Schema.Union([Schema.String, Schema.Null]),
3057
+ ),
3058
+ requestHead: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3059
+ requestHeadComplete: Schema.optional(
3060
+ Schema.Union([Schema.Boolean, Schema.Null]),
3061
+ ),
3062
+ requestSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3063
+ requestType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3064
+ responseContentType: Schema.optional(
3065
+ Schema.Union([Schema.String, Schema.Null]),
3066
+ ),
3067
+ responseHead: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3068
+ responseHeadComplete: Schema.optional(
3069
+ Schema.Union([Schema.Boolean, Schema.Null]),
3070
+ ),
3071
+ responseSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3072
+ statusCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3073
+ step: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3074
+ })
3075
+ .pipe(
3076
+ Schema.encodeKeys({
3077
+ id: "id",
3078
+ cached: "cached",
3079
+ createdAt: "created_at",
3080
+ duration: "duration",
3081
+ model: "model",
3082
+ path: "path",
3083
+ provider: "provider",
3084
+ success: "success",
3085
+ tokensIn: "tokens_in",
3086
+ tokensOut: "tokens_out",
3087
+ cost: "cost",
3088
+ customCost: "custom_cost",
3089
+ metadata: "metadata",
3090
+ modelType: "model_type",
3091
+ requestContentType: "request_content_type",
3092
+ requestHead: "request_head",
3093
+ requestHeadComplete: "request_head_complete",
3094
+ requestSize: "request_size",
3095
+ requestType: "request_type",
3096
+ responseContentType: "response_content_type",
3097
+ responseHead: "response_head",
3098
+ responseHeadComplete: "response_head_complete",
3099
+ responseSize: "response_size",
3100
+ statusCode: "status_code",
3101
+ step: "step",
3102
+ }),
3103
+ )
3104
+ .pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetLogResponse>;
3105
+
3106
+ export type GetLogError = DefaultErrors;
3107
+
3108
+ export const getLog: API.OperationMethod<
3109
+ GetLogRequest,
3110
+ GetLogResponse,
3111
+ GetLogError,
3112
+ Credentials | HttpClient.HttpClient
3113
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3114
+ input: GetLogRequest,
3115
+ output: GetLogResponse,
3116
+ errors: [],
3117
+ }));
3118
+
3119
+ export interface ListLogsRequest {
3120
+ gatewayId: string;
3121
+ /** Path param: */
3122
+ accountId: string;
3123
+ /** Query param: */
3124
+ filters?: {
3125
+ key:
3126
+ | "id"
3127
+ | "created_at"
3128
+ | "request_content_type"
3129
+ | "response_content_type"
3130
+ | "request_type"
3131
+ | "success"
3132
+ | "cached"
3133
+ | "provider"
3134
+ | "model"
3135
+ | "model_type"
3136
+ | "cost"
3137
+ | "tokens"
3138
+ | "tokens_in"
3139
+ | "tokens_out"
3140
+ | "duration"
3141
+ | "feedback"
3142
+ | "event_id"
3143
+ | "metadata.key"
3144
+ | "metadata.value"
3145
+ | "prompts.prompt_id"
3146
+ | "prompts.version_id"
3147
+ | "authentication"
3148
+ | "wholesale"
3149
+ | "compatibilityMode"
3150
+ | "dlp_action";
3151
+ operator: "eq" | "neq" | "contains" | "lt" | "gt";
3152
+ value: (string | null | number | boolean)[];
3153
+ }[];
3154
+ /** Query param: */
3155
+ metaInfo?: boolean;
3156
+ /** Query param: */
3157
+ orderBy?:
3158
+ | "created_at"
3159
+ | "provider"
3160
+ | "model"
3161
+ | "model_type"
3162
+ | "success"
3163
+ | "cached";
3164
+ /** Query param: */
3165
+ orderByDirection?: "asc" | "desc";
3166
+ /** Query param: */
3167
+ search?: string;
3168
+ /** @deprecated Query param: */
3169
+ cached?: boolean;
3170
+ /** @deprecated Query param: */
3171
+ direction?: "asc" | "desc";
3172
+ /** @deprecated Query param: */
3173
+ endDate?: string;
3174
+ /** @deprecated Query param: */
3175
+ feedback?: "0" | "1";
3176
+ /** @deprecated Query param: */
3177
+ maxCost?: number;
3178
+ /** @deprecated Query param: */
3179
+ maxDuration?: number;
3180
+ /** @deprecated Query param: */
3181
+ maxTokensIn?: number;
3182
+ /** @deprecated Query param: */
3183
+ maxTokensOut?: number;
3184
+ /** @deprecated Query param: */
3185
+ maxTotalTokens?: number;
3186
+ /** @deprecated Query param: */
3187
+ minCost?: number;
3188
+ /** @deprecated Query param: */
3189
+ minDuration?: number;
3190
+ /** @deprecated Query param: */
3191
+ minTokensIn?: number;
3192
+ /** @deprecated Query param: */
3193
+ minTokensOut?: number;
3194
+ /** @deprecated Query param: */
3195
+ minTotalTokens?: number;
3196
+ /** @deprecated Query param: */
3197
+ model?: string;
3198
+ /** @deprecated Query param: */
3199
+ modelType?: string;
3200
+ /** @deprecated Query param: */
3201
+ provider?: string;
3202
+ /** @deprecated Query param: */
3203
+ requestContentType?: string;
3204
+ /** @deprecated Query param: */
3205
+ responseContentType?: string;
3206
+ /** @deprecated Query param: */
3207
+ startDate?: string;
3208
+ /** @deprecated Query param: */
3209
+ success?: boolean;
3210
+ }
3211
+
3212
+ export const ListLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3213
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3214
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3215
+ filters: Schema.optional(
3216
+ Schema.Array(
3217
+ Schema.Struct({
3218
+ key: Schema.Literals([
3219
+ "id",
3220
+ "created_at",
3221
+ "request_content_type",
3222
+ "response_content_type",
3223
+ "request_type",
3224
+ "success",
3225
+ "cached",
3226
+ "provider",
3227
+ "model",
3228
+ "model_type",
3229
+ "cost",
3230
+ "tokens",
3231
+ "tokens_in",
3232
+ "tokens_out",
3233
+ "duration",
3234
+ "feedback",
3235
+ "event_id",
3236
+ "metadata.key",
3237
+ "metadata.value",
3238
+ "prompts.prompt_id",
3239
+ "prompts.version_id",
3240
+ "authentication",
3241
+ "wholesale",
3242
+ "compatibilityMode",
3243
+ "dlp_action",
3244
+ ]),
3245
+ operator: Schema.Literals(["eq", "neq", "contains", "lt", "gt"]),
3246
+ value: Schema.Array(
3247
+ Schema.Union([
3248
+ Schema.String,
3249
+ Schema.Null,
3250
+ Schema.Number,
3251
+ Schema.Boolean,
3252
+ ]),
3253
+ ),
3254
+ }),
3255
+ ),
3256
+ ).pipe(T.HttpQuery("filters")),
3257
+ metaInfo: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("meta_info")),
3258
+ orderBy: Schema.optional(
3259
+ Schema.Literals([
3260
+ "created_at",
3261
+ "provider",
3262
+ "model",
3263
+ "model_type",
3264
+ "success",
3265
+ "cached",
3266
+ ]),
3267
+ ).pipe(T.HttpQuery("order_by")),
3268
+ orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
3269
+ T.HttpQuery("order_by_direction"),
3270
+ ),
3271
+ search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
3272
+ cached: Schema.optional(Schema.Boolean),
3273
+ direction: Schema.optional(Schema.Literals(["asc", "desc"])),
3274
+ endDate: Schema.optional(Schema.String),
3275
+ feedback: Schema.optional(Schema.Literals(["0", "1"])),
3276
+ maxCost: Schema.optional(Schema.Number),
3277
+ maxDuration: Schema.optional(Schema.Number),
3278
+ maxTokensIn: Schema.optional(Schema.Number),
3279
+ maxTokensOut: Schema.optional(Schema.Number),
3280
+ maxTotalTokens: Schema.optional(Schema.Number),
3281
+ minCost: Schema.optional(Schema.Number),
3282
+ minDuration: Schema.optional(Schema.Number),
3283
+ minTokensIn: Schema.optional(Schema.Number),
3284
+ minTokensOut: Schema.optional(Schema.Number),
3285
+ minTotalTokens: Schema.optional(Schema.Number),
3286
+ model: Schema.optional(Schema.String),
3287
+ modelType: Schema.optional(Schema.String),
3288
+ provider: Schema.optional(Schema.String),
3289
+ requestContentType: Schema.optional(Schema.String),
3290
+ responseContentType: Schema.optional(Schema.String),
3291
+ startDate: Schema.optional(Schema.String),
3292
+ success: Schema.optional(Schema.Boolean),
3293
+ }).pipe(
3294
+ Schema.encodeKeys({
3295
+ cached: "cached",
3296
+ direction: "direction",
3297
+ endDate: "end_date",
3298
+ feedback: "feedback",
3299
+ maxCost: "max_cost",
3300
+ maxDuration: "max_duration",
3301
+ maxTokensIn: "max_tokens_in",
3302
+ maxTokensOut: "max_tokens_out",
3303
+ maxTotalTokens: "max_total_tokens",
3304
+ minCost: "min_cost",
3305
+ minDuration: "min_duration",
3306
+ minTokensIn: "min_tokens_in",
3307
+ minTokensOut: "min_tokens_out",
3308
+ minTotalTokens: "min_total_tokens",
3309
+ model: "model",
3310
+ modelType: "model_type",
3311
+ provider: "provider",
3312
+ requestContentType: "request_content_type",
3313
+ responseContentType: "response_content_type",
3314
+ startDate: "start_date",
3315
+ success: "success",
3316
+ }),
3317
+ T.Http({
3318
+ method: "GET",
3319
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs",
3320
+ }),
3321
+ ) as unknown as Schema.Schema<ListLogsRequest>;
3322
+
3323
+ export interface ListLogsResponse {
3324
+ result: {
3325
+ id: string;
3326
+ cached: boolean;
3327
+ createdAt: string;
3328
+ duration: number;
3329
+ model: string;
3330
+ path: string;
3331
+ provider: string;
3332
+ success: boolean;
3333
+ tokensIn: number | null;
3334
+ tokensOut: number | null;
3335
+ cost?: number | null;
3336
+ customCost?: boolean | null;
3337
+ metadata?: string | null;
3338
+ modelType?: string | null;
3339
+ requestContentType?: string | null;
3340
+ requestType?: string | null;
3341
+ responseContentType?: string | null;
3342
+ statusCode?: number | null;
3343
+ step?: number | null;
3344
+ }[];
3345
+ resultInfo: {
3346
+ count?: number | null;
3347
+ page?: number | null;
3348
+ perPage?: number | null;
3349
+ totalCount?: number | null;
3350
+ };
3351
+ }
3352
+
3353
+ export const ListLogsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3354
+ result: Schema.Array(
3355
+ Schema.Struct({
3356
+ id: Schema.String,
3357
+ cached: Schema.Boolean,
3358
+ createdAt: Schema.String,
3359
+ duration: Schema.Number,
3360
+ model: Schema.String,
3361
+ path: Schema.String,
3362
+ provider: Schema.String,
3363
+ success: Schema.Boolean,
3364
+ tokensIn: Schema.Union([Schema.Number, Schema.Null]),
3365
+ tokensOut: Schema.Union([Schema.Number, Schema.Null]),
3366
+ cost: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3367
+ customCost: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
3368
+ metadata: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3369
+ modelType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3370
+ requestContentType: Schema.optional(
3371
+ Schema.Union([Schema.String, Schema.Null]),
3372
+ ),
3373
+ requestType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3374
+ responseContentType: Schema.optional(
3375
+ Schema.Union([Schema.String, Schema.Null]),
3376
+ ),
3377
+ statusCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3378
+ step: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3379
+ }).pipe(
3380
+ Schema.encodeKeys({
3381
+ id: "id",
3382
+ cached: "cached",
3383
+ createdAt: "created_at",
3384
+ duration: "duration",
3385
+ model: "model",
3386
+ path: "path",
3387
+ provider: "provider",
3388
+ success: "success",
3389
+ tokensIn: "tokens_in",
3390
+ tokensOut: "tokens_out",
3391
+ cost: "cost",
3392
+ customCost: "custom_cost",
3393
+ metadata: "metadata",
3394
+ modelType: "model_type",
3395
+ requestContentType: "request_content_type",
3396
+ requestType: "request_type",
3397
+ responseContentType: "response_content_type",
3398
+ statusCode: "status_code",
3399
+ step: "step",
3400
+ }),
3401
+ ),
3402
+ ),
3403
+ resultInfo: Schema.Struct({
3404
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3405
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3406
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3407
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3408
+ }).pipe(
3409
+ Schema.encodeKeys({
3410
+ count: "count",
3411
+ page: "page",
3412
+ perPage: "per_page",
3413
+ totalCount: "total_count",
3414
+ }),
3415
+ ),
3416
+ }).pipe(
3417
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
3418
+ ) as unknown as Schema.Schema<ListLogsResponse>;
3419
+
3420
+ export type ListLogsError = DefaultErrors;
3421
+
3422
+ export const listLogs: API.PaginatedOperationMethod<
3423
+ ListLogsRequest,
3424
+ ListLogsResponse,
3425
+ ListLogsError,
3426
+ Credentials | HttpClient.HttpClient
3427
+ > & {
3428
+ pages: (
3429
+ input: ListLogsRequest,
3430
+ ) => stream.Stream<
3431
+ ListLogsResponse,
3432
+ ListLogsError,
3433
+ Credentials | HttpClient.HttpClient
3434
+ >;
3435
+ items: (input: ListLogsRequest) => stream.Stream<
3436
+ {
3437
+ id: string;
3438
+ cached: boolean;
3439
+ createdAt: string;
3440
+ duration: number;
3441
+ model: string;
3442
+ path: string;
3443
+ provider: string;
3444
+ success: boolean;
3445
+ tokensIn: number | null;
3446
+ tokensOut: number | null;
3447
+ cost?: number | null;
3448
+ customCost?: boolean | null;
3449
+ metadata?: string | null;
3450
+ modelType?: string | null;
3451
+ requestContentType?: string | null;
3452
+ requestType?: string | null;
3453
+ responseContentType?: string | null;
3454
+ statusCode?: number | null;
3455
+ step?: number | null;
3456
+ },
3457
+ ListLogsError,
3458
+ Credentials | HttpClient.HttpClient
3459
+ >;
3460
+ } = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
3461
+ input: ListLogsRequest,
3462
+ output: ListLogsResponse,
3463
+ errors: [],
3464
+ pagination: {
3465
+ mode: "page",
3466
+ inputToken: "page",
3467
+ outputToken: "resultInfo.page",
3468
+ items: "result",
3469
+ pageSize: "perPage",
3470
+ } as const,
3471
+ }));
3472
+
3473
+ export interface PatchLogRequest {
3474
+ gatewayId: string;
3475
+ id: string;
3476
+ /** Path param: */
3477
+ accountId: string;
3478
+ /** Body param: */
3479
+ feedback?: number | null;
3480
+ /** Body param: */
3481
+ metadata?: Record<string, unknown> | null;
3482
+ /** Body param: */
3483
+ score?: number | null;
3484
+ }
3485
+
3486
+ export const PatchLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3487
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3488
+ id: Schema.String.pipe(T.HttpPath("id")),
3489
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3490
+ feedback: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3491
+ metadata: Schema.optional(Schema.Union([Schema.Struct({}), Schema.Null])),
3492
+ score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3493
+ }).pipe(
3494
+ T.Http({
3495
+ method: "PATCH",
3496
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}",
3497
+ }),
3498
+ ) as unknown as Schema.Schema<PatchLogRequest>;
3499
+
3500
+ export type PatchLogResponse = unknown;
3501
+
3502
+ export const PatchLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(
3503
+ T.ResponsePath("result"),
3504
+ ) as unknown as Schema.Schema<PatchLogResponse>;
3505
+
3506
+ export type PatchLogError = DefaultErrors;
3507
+
3508
+ export const patchLog: API.OperationMethod<
3509
+ PatchLogRequest,
3510
+ PatchLogResponse,
3511
+ PatchLogError,
3512
+ Credentials | HttpClient.HttpClient
3513
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3514
+ input: PatchLogRequest,
3515
+ output: PatchLogResponse,
3516
+ errors: [],
3517
+ }));
3518
+
3519
+ export interface DeleteLogRequest {
3520
+ gatewayId: string;
3521
+ /** Path param: */
3522
+ accountId: string;
3523
+ /** Query param: */
3524
+ filters?: {
3525
+ key:
3526
+ | "id"
3527
+ | "created_at"
3528
+ | "request_content_type"
3529
+ | "response_content_type"
3530
+ | "request_type"
3531
+ | "success"
3532
+ | "cached"
3533
+ | "provider"
3534
+ | "model"
3535
+ | "model_type"
3536
+ | "cost"
3537
+ | "tokens"
3538
+ | "tokens_in"
3539
+ | "tokens_out"
3540
+ | "duration"
3541
+ | "feedback"
3542
+ | "event_id"
3543
+ | "metadata.key"
3544
+ | "metadata.value"
3545
+ | "prompts.prompt_id"
3546
+ | "prompts.version_id"
3547
+ | "authentication"
3548
+ | "wholesale"
3549
+ | "compatibilityMode"
3550
+ | "dlp_action";
3551
+ operator: "eq" | "neq" | "contains" | "lt" | "gt";
3552
+ value: (string | null | number | boolean)[];
3553
+ }[];
3554
+ /** Query param: */
3555
+ limit?: number;
3556
+ /** Query param: */
3557
+ orderBy?:
3558
+ | "created_at"
3559
+ | "provider"
3560
+ | "model"
3561
+ | "model_type"
3562
+ | "success"
3563
+ | "cached"
3564
+ | "cost"
3565
+ | "tokens_in"
3566
+ | "tokens_out"
3567
+ | "duration"
3568
+ | "feedback";
3569
+ /** Query param: */
3570
+ orderByDirection?: "asc" | "desc";
3571
+ }
3572
+
3573
+ export const DeleteLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3574
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3575
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3576
+ filters: Schema.optional(
3577
+ Schema.Array(
3578
+ Schema.Struct({
3579
+ key: Schema.Literals([
3580
+ "id",
3581
+ "created_at",
3582
+ "request_content_type",
3583
+ "response_content_type",
3584
+ "request_type",
3585
+ "success",
3586
+ "cached",
3587
+ "provider",
3588
+ "model",
3589
+ "model_type",
3590
+ "cost",
3591
+ "tokens",
3592
+ "tokens_in",
3593
+ "tokens_out",
3594
+ "duration",
3595
+ "feedback",
3596
+ "event_id",
3597
+ "metadata.key",
3598
+ "metadata.value",
3599
+ "prompts.prompt_id",
3600
+ "prompts.version_id",
3601
+ "authentication",
3602
+ "wholesale",
3603
+ "compatibilityMode",
3604
+ "dlp_action",
3605
+ ]),
3606
+ operator: Schema.Literals(["eq", "neq", "contains", "lt", "gt"]),
3607
+ value: Schema.Array(
3608
+ Schema.Union([
3609
+ Schema.String,
3610
+ Schema.Null,
3611
+ Schema.Number,
3612
+ Schema.Boolean,
3613
+ ]),
3614
+ ),
3615
+ }),
3616
+ ),
3617
+ ).pipe(T.HttpQuery("filters")),
3618
+ limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
3619
+ orderBy: Schema.optional(
3620
+ Schema.Literals([
3621
+ "created_at",
3622
+ "provider",
3623
+ "model",
3624
+ "model_type",
3625
+ "success",
3626
+ "cached",
3627
+ "cost",
3628
+ "tokens_in",
3629
+ "tokens_out",
3630
+ "duration",
3631
+ "feedback",
3632
+ ]),
3633
+ ).pipe(T.HttpQuery("order_by")),
3634
+ orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
3635
+ T.HttpQuery("order_by_direction"),
3636
+ ),
3637
+ }).pipe(
3638
+ T.Http({
3639
+ method: "DELETE",
3640
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs",
3641
+ }),
3642
+ ) as unknown as Schema.Schema<DeleteLogRequest>;
3643
+
3644
+ export interface DeleteLogResponse {
3645
+ success: boolean;
3646
+ }
3647
+
3648
+ export const DeleteLogResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3649
+ success: Schema.Boolean,
3650
+ }) as unknown as Schema.Schema<DeleteLogResponse>;
3651
+
3652
+ export type DeleteLogError = DefaultErrors;
3653
+
3654
+ export const deleteLog: API.OperationMethod<
3655
+ DeleteLogRequest,
3656
+ DeleteLogResponse,
3657
+ DeleteLogError,
3658
+ Credentials | HttpClient.HttpClient
3659
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3660
+ input: DeleteLogRequest,
3661
+ output: DeleteLogResponse,
3662
+ errors: [],
3663
+ }));
3664
+
3665
+ export interface RequestLogRequest {
3666
+ gatewayId: string;
3667
+ id: string;
3668
+ accountId: string;
3669
+ }
3670
+
3671
+ export const RequestLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3672
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3673
+ id: Schema.String.pipe(T.HttpPath("id")),
3674
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3675
+ }).pipe(
3676
+ T.Http({
3677
+ method: "GET",
3678
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}/request",
3679
+ }),
3680
+ ) as unknown as Schema.Schema<RequestLogRequest>;
3681
+
3682
+ export type RequestLogResponse = unknown;
3683
+
3684
+ export const RequestLogResponse =
3685
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<RequestLogResponse>;
3686
+
3687
+ export type RequestLogError = DefaultErrors;
3688
+
3689
+ export const requestLog: API.OperationMethod<
3690
+ RequestLogRequest,
3691
+ RequestLogResponse,
3692
+ RequestLogError,
3693
+ Credentials | HttpClient.HttpClient
3694
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3695
+ input: RequestLogRequest,
3696
+ output: RequestLogResponse,
3697
+ errors: [],
3698
+ }));
3699
+
3700
+ export interface ResponseLogRequest {
3701
+ gatewayId: string;
3702
+ id: string;
3703
+ accountId: string;
3704
+ }
3705
+
3706
+ export const ResponseLogRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3707
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3708
+ id: Schema.String.pipe(T.HttpPath("id")),
3709
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3710
+ }).pipe(
3711
+ T.Http({
3712
+ method: "GET",
3713
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs/{id}/response",
3714
+ }),
3715
+ ) as unknown as Schema.Schema<ResponseLogRequest>;
3716
+
3717
+ export type ResponseLogResponse = unknown;
3718
+
3719
+ export const ResponseLogResponse =
3720
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<ResponseLogResponse>;
3721
+
3722
+ export type ResponseLogError = DefaultErrors;
3723
+
3724
+ export const responseLog: API.OperationMethod<
3725
+ ResponseLogRequest,
3726
+ ResponseLogResponse,
3727
+ ResponseLogError,
3728
+ Credentials | HttpClient.HttpClient
3729
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3730
+ input: ResponseLogRequest,
3731
+ output: ResponseLogResponse,
3732
+ errors: [],
3733
+ }));
3734
+
3735
+ // =============================================================================
3736
+ // Url
3737
+ // =============================================================================
3738
+
3739
+ export interface GetUrlRequest {
3740
+ gatewayId: string;
3741
+ provider: string;
3742
+ accountId: string;
3743
+ }
3744
+
3745
+ export const GetUrlRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3746
+ gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
3747
+ provider: Schema.String.pipe(T.HttpPath("provider")),
3748
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3749
+ }).pipe(
3750
+ T.Http({
3751
+ method: "GET",
3752
+ path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/url/{provider}",
3753
+ }),
3754
+ ) as unknown as Schema.Schema<GetUrlRequest>;
3755
+
3756
+ export type GetUrlResponse = string;
3757
+
3758
+ export const GetUrlResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(
3759
+ T.ResponsePath("result"),
3760
+ ) as unknown as Schema.Schema<GetUrlResponse>;
3761
+
3762
+ export type GetUrlError = DefaultErrors;
3763
+
3764
+ export const getUrl: API.OperationMethod<
3765
+ GetUrlRequest,
3766
+ GetUrlResponse,
3767
+ GetUrlError,
3768
+ Credentials | HttpClient.HttpClient
3769
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
3770
+ input: GetUrlRequest,
3771
+ output: GetUrlResponse,
3772
+ errors: [],
3773
+ }));