@distilled.cloud/cloudflare 0.0.0 → 0.2.0-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (560) hide show
  1. package/lib/auth.d.ts +13 -0
  2. package/lib/auth.d.ts.map +1 -0
  3. package/lib/auth.js +12 -0
  4. package/lib/auth.js.map +1 -0
  5. package/lib/category.d.ts +2 -0
  6. package/lib/category.d.ts.map +1 -0
  7. package/lib/category.js +2 -0
  8. package/lib/category.js.map +1 -0
  9. package/lib/client/api.d.ts +14 -0
  10. package/lib/client/api.d.ts.map +1 -0
  11. package/lib/client/api.js +197 -0
  12. package/lib/client/api.js.map +1 -0
  13. package/lib/client/index.d.ts +8 -0
  14. package/lib/client/index.d.ts.map +1 -0
  15. package/lib/client/index.js +8 -0
  16. package/lib/client/index.js.map +1 -0
  17. package/lib/credentials.d.ts +14 -0
  18. package/lib/credentials.d.ts.map +1 -0
  19. package/lib/credentials.js +17 -0
  20. package/lib/credentials.js.map +1 -0
  21. package/lib/errors.d.ts +48 -0
  22. package/lib/errors.d.ts.map +1 -0
  23. package/lib/errors.js +38 -0
  24. package/lib/errors.js.map +1 -0
  25. package/lib/index.d.ts +10 -0
  26. package/lib/index.d.ts.map +1 -0
  27. package/lib/index.js +10 -0
  28. package/lib/index.js.map +1 -0
  29. package/lib/retry.d.ts +14 -0
  30. package/lib/retry.d.ts.map +1 -0
  31. package/lib/retry.js +14 -0
  32. package/lib/retry.js.map +1 -0
  33. package/lib/schemas.d.ts +29 -0
  34. package/lib/schemas.d.ts.map +1 -0
  35. package/lib/schemas.js +34 -0
  36. package/lib/schemas.js.map +1 -0
  37. package/lib/services/abuse-reports.d.ts +224 -0
  38. package/lib/services/abuse-reports.d.ts.map +1 -0
  39. package/lib/services/abuse-reports.js +353 -0
  40. package/lib/services/abuse-reports.js.map +1 -0
  41. package/lib/services/accounts.d.ts +682 -0
  42. package/lib/services/accounts.d.ts.map +1 -0
  43. package/lib/services/accounts.js +805 -0
  44. package/lib/services/accounts.js.map +1 -0
  45. package/lib/services/acm.d.ts +73 -0
  46. package/lib/services/acm.d.ts.map +1 -0
  47. package/lib/services/acm.js +76 -0
  48. package/lib/services/acm.js.map +1 -0
  49. package/lib/services/addressing.d.ts +1208 -0
  50. package/lib/services/addressing.d.ts.map +1 -0
  51. package/lib/services/addressing.js +1776 -0
  52. package/lib/services/addressing.js.map +1 -0
  53. package/lib/services/ai-gateway.d.ts +956 -0
  54. package/lib/services/ai-gateway.d.ts.map +1 -0
  55. package/lib/services/ai-gateway.js +1706 -0
  56. package/lib/services/ai-gateway.js.map +1 -0
  57. package/lib/services/ai.d.ts +243 -0
  58. package/lib/services/ai.d.ts.map +1 -0
  59. package/lib/services/ai.js +299 -0
  60. package/lib/services/ai.js.map +1 -0
  61. package/lib/services/aisearch.d.ts +915 -0
  62. package/lib/services/aisearch.d.ts.map +1 -0
  63. package/lib/services/aisearch.js +2425 -0
  64. package/lib/services/aisearch.js.map +1 -0
  65. package/lib/services/alerting.d.ts +718 -0
  66. package/lib/services/alerting.d.ts.map +1 -0
  67. package/lib/services/alerting.js +1388 -0
  68. package/lib/services/alerting.js.map +1 -0
  69. package/lib/services/api-gateway.d.ts +830 -0
  70. package/lib/services/api-gateway.d.ts.map +1 -0
  71. package/lib/services/api-gateway.js +1548 -0
  72. package/lib/services/api-gateway.js.map +1 -0
  73. package/lib/services/argo.d.ts +101 -0
  74. package/lib/services/argo.d.ts.map +1 -0
  75. package/lib/services/argo.js +105 -0
  76. package/lib/services/argo.js.map +1 -0
  77. package/lib/services/audit-logs.d.ts +46 -0
  78. package/lib/services/audit-logs.d.ts.map +1 -0
  79. package/lib/services/audit-logs.js +37 -0
  80. package/lib/services/audit-logs.js.map +1 -0
  81. package/lib/services/billing.d.ts +62 -0
  82. package/lib/services/billing.d.ts.map +1 -0
  83. package/lib/services/billing.js +100 -0
  84. package/lib/services/billing.js.map +1 -0
  85. package/lib/services/bot-management.d.ts +124 -0
  86. package/lib/services/bot-management.d.ts.map +1 -0
  87. package/lib/services/bot-management.js +262 -0
  88. package/lib/services/bot-management.js.map +1 -0
  89. package/lib/services/botnet-feed.d.ts +65 -0
  90. package/lib/services/botnet-feed.d.ts.map +1 -0
  91. package/lib/services/botnet-feed.js +84 -0
  92. package/lib/services/botnet-feed.js.map +1 -0
  93. package/lib/services/brand-protection.d.ts +188 -0
  94. package/lib/services/brand-protection.d.ts.map +1 -0
  95. package/lib/services/brand-protection.js +214 -0
  96. package/lib/services/brand-protection.js.map +1 -0
  97. package/lib/services/browser-rendering.d.ts +857 -0
  98. package/lib/services/browser-rendering.d.ts.map +1 -0
  99. package/lib/services/browser-rendering.js +1141 -0
  100. package/lib/services/browser-rendering.js.map +1 -0
  101. package/lib/services/cache.d.ts +287 -0
  102. package/lib/services/cache.d.ts.map +1 -0
  103. package/lib/services/cache.js +330 -0
  104. package/lib/services/cache.js.map +1 -0
  105. package/lib/services/calls.d.ts +202 -0
  106. package/lib/services/calls.d.ts.map +1 -0
  107. package/lib/services/calls.js +175 -0
  108. package/lib/services/calls.js.map +1 -0
  109. package/lib/services/certificate-authorities.d.ts +40 -0
  110. package/lib/services/certificate-authorities.d.ts.map +1 -0
  111. package/lib/services/certificate-authorities.js +49 -0
  112. package/lib/services/certificate-authorities.js.map +1 -0
  113. package/lib/services/client-certificates.d.ts +254 -0
  114. package/lib/services/client-certificates.d.ts.map +1 -0
  115. package/lib/services/client-certificates.js +350 -0
  116. package/lib/services/client-certificates.js.map +1 -0
  117. package/lib/services/cloud-connector.d.ts +59 -0
  118. package/lib/services/cloud-connector.d.ts.map +1 -0
  119. package/lib/services/cloud-connector.js +84 -0
  120. package/lib/services/cloud-connector.js.map +1 -0
  121. package/lib/services/cloudforce-one.d.ts +1318 -0
  122. package/lib/services/cloudforce-one.d.ts.map +1 -0
  123. package/lib/services/cloudforce-one.js +1684 -0
  124. package/lib/services/cloudforce-one.js.map +1 -0
  125. package/lib/services/connectivity.d.ts +248 -0
  126. package/lib/services/connectivity.d.ts.map +1 -0
  127. package/lib/services/connectivity.js +377 -0
  128. package/lib/services/connectivity.js.map +1 -0
  129. package/lib/services/content-scanning.d.ts +131 -0
  130. package/lib/services/content-scanning.d.ts.map +1 -0
  131. package/lib/services/content-scanning.js +156 -0
  132. package/lib/services/content-scanning.js.map +1 -0
  133. package/lib/services/custom-certificates.d.ts +211 -0
  134. package/lib/services/custom-certificates.d.ts.map +1 -0
  135. package/lib/services/custom-certificates.js +309 -0
  136. package/lib/services/custom-certificates.js.map +1 -0
  137. package/lib/services/custom-hostnames.d.ts +525 -0
  138. package/lib/services/custom-hostnames.d.ts.map +1 -0
  139. package/lib/services/custom-hostnames.js +1164 -0
  140. package/lib/services/custom-hostnames.js.map +1 -0
  141. package/lib/services/custom-nameservers.d.ts +67 -0
  142. package/lib/services/custom-nameservers.d.ts.map +1 -0
  143. package/lib/services/custom-nameservers.js +80 -0
  144. package/lib/services/custom-nameservers.js.map +1 -0
  145. package/lib/services/custom-pages.d.ts +74 -0
  146. package/lib/services/custom-pages.d.ts.map +1 -0
  147. package/lib/services/custom-pages.js +125 -0
  148. package/lib/services/custom-pages.js.map +1 -0
  149. package/lib/services/d1.d.ts +326 -0
  150. package/lib/services/d1.d.ts.map +1 -0
  151. package/lib/services/d1.js +448 -0
  152. package/lib/services/d1.js.map +1 -0
  153. package/lib/services/dcv-delegation.d.ts +24 -0
  154. package/lib/services/dcv-delegation.d.ts.map +1 -0
  155. package/lib/services/dcv-delegation.js +24 -0
  156. package/lib/services/dcv-delegation.js.map +1 -0
  157. package/lib/services/diagnostics.d.ts +175 -0
  158. package/lib/services/diagnostics.d.ts.map +1 -0
  159. package/lib/services/diagnostics.js +273 -0
  160. package/lib/services/diagnostics.js.map +1 -0
  161. package/lib/services/dns-firewall.d.ts +288 -0
  162. package/lib/services/dns-firewall.d.ts.map +1 -0
  163. package/lib/services/dns-firewall.js +373 -0
  164. package/lib/services/dns-firewall.js.map +1 -0
  165. package/lib/services/dns.d.ts +2946 -0
  166. package/lib/services/dns.d.ts.map +1 -0
  167. package/lib/services/dns.js +4511 -0
  168. package/lib/services/dns.js.map +1 -0
  169. package/lib/services/durable-objects.d.ts +61 -0
  170. package/lib/services/durable-objects.d.ts.map +1 -0
  171. package/lib/services/durable-objects.js +66 -0
  172. package/lib/services/durable-objects.js.map +1 -0
  173. package/lib/services/email-routing.d.ts +542 -0
  174. package/lib/services/email-routing.d.ts.map +1 -0
  175. package/lib/services/email-routing.js +662 -0
  176. package/lib/services/email-routing.js.map +1 -0
  177. package/lib/services/email-security.d.ts +1131 -0
  178. package/lib/services/email-security.d.ts.map +1 -0
  179. package/lib/services/email-security.js +2065 -0
  180. package/lib/services/email-security.js.map +1 -0
  181. package/lib/services/filters.d.ts +157 -0
  182. package/lib/services/filters.d.ts.map +1 -0
  183. package/lib/services/filters.js +135 -0
  184. package/lib/services/filters.js.map +1 -0
  185. package/lib/services/firewall.d.ts +1080 -0
  186. package/lib/services/firewall.d.ts.map +1 -0
  187. package/lib/services/firewall.js +1881 -0
  188. package/lib/services/firewall.js.map +1 -0
  189. package/lib/services/healthchecks.d.ts +464 -0
  190. package/lib/services/healthchecks.d.ts.map +1 -0
  191. package/lib/services/healthchecks.js +838 -0
  192. package/lib/services/healthchecks.js.map +1 -0
  193. package/lib/services/hostnames.d.ts +74 -0
  194. package/lib/services/hostnames.d.ts.map +1 -0
  195. package/lib/services/hostnames.js +100 -0
  196. package/lib/services/hostnames.js.map +1 -0
  197. package/lib/services/hyperdrive.d.ts +203 -0
  198. package/lib/services/hyperdrive.d.ts.map +1 -0
  199. package/lib/services/hyperdrive.js +299 -0
  200. package/lib/services/hyperdrive.js.map +1 -0
  201. package/lib/services/iam.d.ts +554 -0
  202. package/lib/services/iam.d.ts.map +1 -0
  203. package/lib/services/iam.js +743 -0
  204. package/lib/services/iam.js.map +1 -0
  205. package/lib/services/images.d.ts +403 -0
  206. package/lib/services/images.d.ts.map +1 -0
  207. package/lib/services/images.js +417 -0
  208. package/lib/services/images.js.map +1 -0
  209. package/lib/services/intel.d.ts +768 -0
  210. package/lib/services/intel.d.ts.map +1 -0
  211. package/lib/services/intel.js +1179 -0
  212. package/lib/services/intel.js.map +1 -0
  213. package/lib/services/ips.d.ts +28 -0
  214. package/lib/services/ips.d.ts.map +1 -0
  215. package/lib/services/ips.js +39 -0
  216. package/lib/services/ips.js.map +1 -0
  217. package/lib/services/keyless-certificates.d.ts +177 -0
  218. package/lib/services/keyless-certificates.d.ts.map +1 -0
  219. package/lib/services/keyless-certificates.js +216 -0
  220. package/lib/services/keyless-certificates.js.map +1 -0
  221. package/lib/services/kv.d.ts +339 -0
  222. package/lib/services/kv.d.ts.map +1 -0
  223. package/lib/services/kv.js +402 -0
  224. package/lib/services/kv.js.map +1 -0
  225. package/lib/services/leaked-credential-checks.d.ts +119 -0
  226. package/lib/services/leaked-credential-checks.d.ts.map +1 -0
  227. package/lib/services/leaked-credential-checks.js +130 -0
  228. package/lib/services/leaked-credential-checks.js.map +1 -0
  229. package/lib/services/load-balancers.d.ts +1767 -0
  230. package/lib/services/load-balancers.d.ts.map +1 -0
  231. package/lib/services/load-balancers.js +3068 -0
  232. package/lib/services/load-balancers.js.map +1 -0
  233. package/lib/services/logpush.d.ts +401 -0
  234. package/lib/services/logpush.d.ts.map +1 -0
  235. package/lib/services/logpush.js +724 -0
  236. package/lib/services/logpush.js.map +1 -0
  237. package/lib/services/logs.d.ts +125 -0
  238. package/lib/services/logs.d.ts.map +1 -0
  239. package/lib/services/logs.js +145 -0
  240. package/lib/services/logs.js.map +1 -0
  241. package/lib/services/magic-cloud-networking.d.ts +1599 -0
  242. package/lib/services/magic-cloud-networking.d.ts.map +1 -0
  243. package/lib/services/magic-cloud-networking.js +5205 -0
  244. package/lib/services/magic-cloud-networking.js.map +1 -0
  245. package/lib/services/magic-network-monitoring.d.ts +379 -0
  246. package/lib/services/magic-network-monitoring.d.ts.map +1 -0
  247. package/lib/services/magic-network-monitoring.js +535 -0
  248. package/lib/services/magic-network-monitoring.js.map +1 -0
  249. package/lib/services/magic-transit.d.ts +3650 -0
  250. package/lib/services/magic-transit.d.ts.map +1 -0
  251. package/lib/services/magic-transit.js +6120 -0
  252. package/lib/services/magic-transit.js.map +1 -0
  253. package/lib/services/managed-transforms.d.ts +79 -0
  254. package/lib/services/managed-transforms.d.ts.map +1 -0
  255. package/lib/services/managed-transforms.js +107 -0
  256. package/lib/services/managed-transforms.js.map +1 -0
  257. package/lib/services/memberships.d.ts +172 -0
  258. package/lib/services/memberships.d.ts.map +1 -0
  259. package/lib/services/memberships.js +282 -0
  260. package/lib/services/memberships.js.map +1 -0
  261. package/lib/services/mtls-certificates.d.ts +140 -0
  262. package/lib/services/mtls-certificates.d.ts.map +1 -0
  263. package/lib/services/mtls-certificates.js +173 -0
  264. package/lib/services/mtls-certificates.js.map +1 -0
  265. package/lib/services/network-interconnects.d.ts +410 -0
  266. package/lib/services/network-interconnects.d.ts.map +1 -0
  267. package/lib/services/network-interconnects.js +583 -0
  268. package/lib/services/network-interconnects.js.map +1 -0
  269. package/lib/services/organizations.d.ts +201 -0
  270. package/lib/services/organizations.d.ts.map +1 -0
  271. package/lib/services/organizations.js +355 -0
  272. package/lib/services/organizations.js.map +1 -0
  273. package/lib/services/origin-ca-certificates.d.ts +99 -0
  274. package/lib/services/origin-ca-certificates.d.ts.map +1 -0
  275. package/lib/services/origin-ca-certificates.js +156 -0
  276. package/lib/services/origin-ca-certificates.js.map +1 -0
  277. package/lib/services/origin-post-quantum-encryption.d.ts +50 -0
  278. package/lib/services/origin-post-quantum-encryption.d.ts.map +1 -0
  279. package/lib/services/origin-post-quantum-encryption.js +60 -0
  280. package/lib/services/origin-post-quantum-encryption.js.map +1 -0
  281. package/lib/services/origin-tls-client-auth.d.ts +273 -0
  282. package/lib/services/origin-tls-client-auth.d.ts.map +1 -0
  283. package/lib/services/origin-tls-client-auth.js +401 -0
  284. package/lib/services/origin-tls-client-auth.js.map +1 -0
  285. package/lib/services/page-rules.d.ts +773 -0
  286. package/lib/services/page-rules.d.ts.map +1 -0
  287. package/lib/services/page-rules.js +1365 -0
  288. package/lib/services/page-rules.js.map +1 -0
  289. package/lib/services/page-shield.d.ts +426 -0
  290. package/lib/services/page-shield.d.ts.map +1 -0
  291. package/lib/services/page-shield.js +484 -0
  292. package/lib/services/page-shield.js.map +1 -0
  293. package/lib/services/pages.d.ts +1654 -0
  294. package/lib/services/pages.d.ts.map +1 -0
  295. package/lib/services/pages.js +2954 -0
  296. package/lib/services/pages.js.map +1 -0
  297. package/lib/services/pipelines.d.ts +1461 -0
  298. package/lib/services/pipelines.d.ts.map +1 -0
  299. package/lib/services/pipelines.js +2912 -0
  300. package/lib/services/pipelines.js.map +1 -0
  301. package/lib/services/queues.d.ts +807 -0
  302. package/lib/services/queues.d.ts.map +1 -0
  303. package/lib/services/queues.js +1194 -0
  304. package/lib/services/queues.js.map +1 -0
  305. package/lib/services/r2-data-catalog.d.ts +341 -0
  306. package/lib/services/r2-data-catalog.d.ts.map +1 -0
  307. package/lib/services/r2-data-catalog.js +499 -0
  308. package/lib/services/r2-data-catalog.js.map +1 -0
  309. package/lib/services/r2.d.ts +1041 -0
  310. package/lib/services/r2.d.ts.map +1 -0
  311. package/lib/services/r2.js +1384 -0
  312. package/lib/services/r2.js.map +1 -0
  313. package/lib/services/radar.d.ts +9276 -0
  314. package/lib/services/radar.d.ts.map +1 -0
  315. package/lib/services/radar.js +20491 -0
  316. package/lib/services/radar.js.map +1 -0
  317. package/lib/services/rate-limits.d.ts +315 -0
  318. package/lib/services/rate-limits.d.ts.map +1 -0
  319. package/lib/services/rate-limits.js +521 -0
  320. package/lib/services/rate-limits.js.map +1 -0
  321. package/lib/services/realtime-kit.d.ts +2728 -0
  322. package/lib/services/realtime-kit.d.ts.map +1 -0
  323. package/lib/services/realtime-kit.js +5401 -0
  324. package/lib/services/realtime-kit.js.map +1 -0
  325. package/lib/services/registrar.d.ts +81 -0
  326. package/lib/services/registrar.d.ts.map +1 -0
  327. package/lib/services/registrar.js +154 -0
  328. package/lib/services/registrar.js.map +1 -0
  329. package/lib/services/request-tracers.d.ts +61 -0
  330. package/lib/services/request-tracers.d.ts.map +1 -0
  331. package/lib/services/request-tracers.js +82 -0
  332. package/lib/services/request-tracers.js.map +1 -0
  333. package/lib/services/resource-sharing.d.ts +540 -0
  334. package/lib/services/resource-sharing.d.ts.map +1 -0
  335. package/lib/services/resource-sharing.js +846 -0
  336. package/lib/services/resource-sharing.js.map +1 -0
  337. package/lib/services/rules.d.ts +297 -0
  338. package/lib/services/rules.d.ts.map +1 -0
  339. package/lib/services/rules.js +396 -0
  340. package/lib/services/rules.js.map +1 -0
  341. package/lib/services/rulesets.d.ts +3300 -0
  342. package/lib/services/rulesets.d.ts.map +1 -0
  343. package/lib/services/rulesets.js +7852 -0
  344. package/lib/services/rulesets.js.map +1 -0
  345. package/lib/services/rum.d.ts +289 -0
  346. package/lib/services/rum.d.ts.map +1 -0
  347. package/lib/services/rum.js +409 -0
  348. package/lib/services/rum.js.map +1 -0
  349. package/lib/services/schema-validation.d.ts +240 -0
  350. package/lib/services/schema-validation.d.ts.map +1 -0
  351. package/lib/services/schema-validation.js +306 -0
  352. package/lib/services/schema-validation.js.map +1 -0
  353. package/lib/services/secrets-store.d.ts +321 -0
  354. package/lib/services/secrets-store.d.ts.map +1 -0
  355. package/lib/services/secrets-store.js +385 -0
  356. package/lib/services/secrets-store.js.map +1 -0
  357. package/lib/services/security-center.d.ts +102 -0
  358. package/lib/services/security-center.d.ts.map +1 -0
  359. package/lib/services/security-center.js +170 -0
  360. package/lib/services/security-center.js.map +1 -0
  361. package/lib/services/security-txt.d.ts +105 -0
  362. package/lib/services/security-txt.d.ts.map +1 -0
  363. package/lib/services/security-txt.js +136 -0
  364. package/lib/services/security-txt.js.map +1 -0
  365. package/lib/services/snippets.d.ts +138 -0
  366. package/lib/services/snippets.d.ts.map +1 -0
  367. package/lib/services/snippets.js +178 -0
  368. package/lib/services/snippets.js.map +1 -0
  369. package/lib/services/spectrum.d.ts +316 -0
  370. package/lib/services/spectrum.d.ts.map +1 -0
  371. package/lib/services/spectrum.js +510 -0
  372. package/lib/services/spectrum.js.map +1 -0
  373. package/lib/services/speed.d.ts +227 -0
  374. package/lib/services/speed.d.ts.map +1 -0
  375. package/lib/services/speed.js +444 -0
  376. package/lib/services/speed.js.map +1 -0
  377. package/lib/services/ssl.d.ts +370 -0
  378. package/lib/services/ssl.d.ts.map +1 -0
  379. package/lib/services/ssl.js +732 -0
  380. package/lib/services/ssl.js.map +1 -0
  381. package/lib/services/stream.d.ts +1014 -0
  382. package/lib/services/stream.d.ts.map +1 -0
  383. package/lib/services/stream.js +1049 -0
  384. package/lib/services/stream.js.map +1 -0
  385. package/lib/services/token-validation.d.ts +547 -0
  386. package/lib/services/token-validation.d.ts.map +1 -0
  387. package/lib/services/token-validation.js +768 -0
  388. package/lib/services/token-validation.js.map +1 -0
  389. package/lib/services/turnstile.d.ts +248 -0
  390. package/lib/services/turnstile.d.ts.map +1 -0
  391. package/lib/services/turnstile.js +308 -0
  392. package/lib/services/turnstile.js.map +1 -0
  393. package/lib/services/url-normalization.d.ts +53 -0
  394. package/lib/services/url-normalization.d.ts.map +1 -0
  395. package/lib/services/url-normalization.js +52 -0
  396. package/lib/services/url-normalization.js.map +1 -0
  397. package/lib/services/url-scanner.d.ts +612 -0
  398. package/lib/services/url-scanner.d.ts.map +1 -0
  399. package/lib/services/url-scanner.js +915 -0
  400. package/lib/services/url-scanner.js.map +1 -0
  401. package/lib/services/user.d.ts +441 -0
  402. package/lib/services/user.d.ts.map +1 -0
  403. package/lib/services/user.js +567 -0
  404. package/lib/services/user.js.map +1 -0
  405. package/lib/services/vectorize.d.ts +282 -0
  406. package/lib/services/vectorize.d.ts.map +1 -0
  407. package/lib/services/vectorize.js +340 -0
  408. package/lib/services/vectorize.js.map +1 -0
  409. package/lib/services/waiting-rooms.d.ts +1009 -0
  410. package/lib/services/waiting-rooms.d.ts.map +1 -0
  411. package/lib/services/waiting-rooms.js +1757 -0
  412. package/lib/services/waiting-rooms.js.map +1 -0
  413. package/lib/services/web3.d.ts +274 -0
  414. package/lib/services/web3.d.ts.map +1 -0
  415. package/lib/services/web3.js +362 -0
  416. package/lib/services/web3.js.map +1 -0
  417. package/lib/services/workers-for-platforms.d.ts +1224 -0
  418. package/lib/services/workers-for-platforms.d.ts.map +1 -0
  419. package/lib/services/workers-for-platforms.js +2078 -0
  420. package/lib/services/workers-for-platforms.js.map +1 -0
  421. package/lib/services/workers.d.ts +3498 -0
  422. package/lib/services/workers.d.ts.map +1 -0
  423. package/lib/services/workers.js +5967 -0
  424. package/lib/services/workers.js.map +1 -0
  425. package/lib/services/workflows.d.ts +359 -0
  426. package/lib/services/workflows.d.ts.map +1 -0
  427. package/lib/services/workflows.js +516 -0
  428. package/lib/services/workflows.js.map +1 -0
  429. package/lib/services/zaraz.d.ts +300 -0
  430. package/lib/services/zaraz.d.ts.map +1 -0
  431. package/lib/services/zaraz.js +298 -0
  432. package/lib/services/zaraz.js.map +1 -0
  433. package/lib/services/zero-trust.d.ts +15449 -0
  434. package/lib/services/zero-trust.d.ts.map +1 -0
  435. package/lib/services/zero-trust.js +29194 -0
  436. package/lib/services/zero-trust.js.map +1 -0
  437. package/lib/services/zones.d.ts +1278 -0
  438. package/lib/services/zones.d.ts.map +1 -0
  439. package/lib/services/zones.js +2416 -0
  440. package/lib/services/zones.js.map +1 -0
  441. package/lib/traits.d.ts +28 -0
  442. package/lib/traits.d.ts.map +1 -0
  443. package/lib/traits.js +26 -0
  444. package/lib/traits.js.map +1 -0
  445. package/package.json +67 -5
  446. package/src/auth.ts +14 -0
  447. package/src/category.ts +1 -0
  448. package/src/client/api.ts +269 -0
  449. package/src/client/index.ts +7 -0
  450. package/src/credentials.ts +30 -0
  451. package/src/errors.ts +65 -0
  452. package/src/index.ts +9 -0
  453. package/src/retry.ts +35 -0
  454. package/src/schemas.ts +51 -0
  455. package/src/services/abuse-reports.ts +747 -0
  456. package/src/services/accounts.ts +1947 -0
  457. package/src/services/acm.ts +170 -0
  458. package/src/services/addressing.ts +3947 -0
  459. package/src/services/ai-gateway.ts +3335 -0
  460. package/src/services/ai.ts +727 -0
  461. package/src/services/aisearch.ts +4750 -0
  462. package/src/services/alerting.ts +2947 -0
  463. package/src/services/api-gateway.ts +3391 -0
  464. package/src/services/argo.ts +254 -0
  465. package/src/services/audit-logs.ts +90 -0
  466. package/src/services/billing.ts +172 -0
  467. package/src/services/bot-management.ts +541 -0
  468. package/src/services/botnet-feed.ts +193 -0
  469. package/src/services/brand-protection.ts +553 -0
  470. package/src/services/browser-rendering.ts +2707 -0
  471. package/src/services/cache.ts +827 -0
  472. package/src/services/calls.ts +483 -0
  473. package/src/services/certificate-authorities.ts +110 -0
  474. package/src/services/client-certificates.ts +718 -0
  475. package/src/services/cloud-connector.ts +181 -0
  476. package/src/services/cloudforce-one.ts +3876 -0
  477. package/src/services/connectivity.ts +629 -0
  478. package/src/services/content-scanning.ts +385 -0
  479. package/src/services/custom-certificates.ts +611 -0
  480. package/src/services/custom-hostnames.ts +2453 -0
  481. package/src/services/custom-nameservers.ts +182 -0
  482. package/src/services/custom-pages.ts +264 -0
  483. package/src/services/d1.ts +1034 -0
  484. package/src/services/dcv-delegation.ts +52 -0
  485. package/src/services/diagnostics.ts +603 -0
  486. package/src/services/dns-firewall.ts +823 -0
  487. package/src/services/dns.ts +8897 -0
  488. package/src/services/durable-objects.ts +148 -0
  489. package/src/services/email-routing.ts +1602 -0
  490. package/src/services/email-security.ts +4283 -0
  491. package/src/services/filters.ts +370 -0
  492. package/src/services/firewall.ts +3896 -0
  493. package/src/services/healthchecks.ts +1750 -0
  494. package/src/services/hostnames.ts +218 -0
  495. package/src/services/hyperdrive.ts +592 -0
  496. package/src/services/iam.ts +1668 -0
  497. package/src/services/images.ts +1086 -0
  498. package/src/services/intel.ts +2768 -0
  499. package/src/services/ips.ts +88 -0
  500. package/src/services/keyless-certificates.ts +462 -0
  501. package/src/services/kv.ts +1011 -0
  502. package/src/services/leaked-credential-checks.ts +325 -0
  503. package/src/services/load-balancers.ts +6438 -0
  504. package/src/services/logpush.ts +1667 -0
  505. package/src/services/logs.ts +375 -0
  506. package/src/services/magic-cloud-networking.ts +10020 -0
  507. package/src/services/magic-network-monitoring.ts +1156 -0
  508. package/src/services/magic-transit.ts +13050 -0
  509. package/src/services/managed-transforms.ts +237 -0
  510. package/src/services/memberships.ts +615 -0
  511. package/src/services/mtls-certificates.ts +374 -0
  512. package/src/services/network-interconnects.ts +1253 -0
  513. package/src/services/organizations.ts +674 -0
  514. package/src/services/origin-ca-certificates.ts +303 -0
  515. package/src/services/origin-post-quantum-encryption.ts +128 -0
  516. package/src/services/origin-tls-client-auth.ts +878 -0
  517. package/src/services/page-rules.ts +2612 -0
  518. package/src/services/page-shield.ts +1195 -0
  519. package/src/services/pages.ts +5709 -0
  520. package/src/services/pipelines.ts +6000 -0
  521. package/src/services/queues.ts +2629 -0
  522. package/src/services/r2-data-catalog.ts +1119 -0
  523. package/src/services/r2.ts +3348 -0
  524. package/src/services/radar.ts +42152 -0
  525. package/src/services/rate-limits.ts +1150 -0
  526. package/src/services/realtime-kit.ts +11079 -0
  527. package/src/services/registrar.ts +295 -0
  528. package/src/services/request-tracers.ts +158 -0
  529. package/src/services/resource-sharing.ts +1832 -0
  530. package/src/services/rules.ts +837 -0
  531. package/src/services/rulesets.ts +15144 -0
  532. package/src/services/rum.ts +901 -0
  533. package/src/services/schema-validation.ts +733 -0
  534. package/src/services/secrets-store.ts +860 -0
  535. package/src/services/security-center.ts +397 -0
  536. package/src/services/security-txt.ts +315 -0
  537. package/src/services/snippets.ts +420 -0
  538. package/src/services/spectrum.ts +1103 -0
  539. package/src/services/speed.ts +1056 -0
  540. package/src/services/ssl.ts +1587 -0
  541. package/src/services/stream.ts +2756 -0
  542. package/src/services/token-validation.ts +1585 -0
  543. package/src/services/turnstile.ts +643 -0
  544. package/src/services/url-normalization.ts +129 -0
  545. package/src/services/url-scanner.ts +1851 -0
  546. package/src/services/user.ts +1384 -0
  547. package/src/services/vectorize.ts +816 -0
  548. package/src/services/waiting-rooms.ts +3807 -0
  549. package/src/services/web3.ts +834 -0
  550. package/src/services/workers-for-platforms.ts +3859 -0
  551. package/src/services/workers.ts +11637 -0
  552. package/src/services/workflows.ts +1124 -0
  553. package/src/services/zaraz.ts +797 -0
  554. package/src/services/zero-trust.ts +58933 -0
  555. package/src/services/zones.ts +4875 -0
  556. package/src/traits.ts +47 -0
  557. package/README.md +0 -15
  558. package/bun.lock +0 -26
  559. package/index.ts +0 -1
  560. package/tsconfig.json +0 -29
@@ -0,0 +1,2629 @@
1
+ /**
2
+ * Cloudflare QUEUES API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service queues
6
+ */
7
+
8
+ import * as Schema from "effect/Schema";
9
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
+ import * as API from "../client/api.ts";
11
+ import * as T from "../traits";
12
+ import type { Credentials } from "../credentials";
13
+ import { type DefaultErrors } from "../errors";
14
+
15
+ // =============================================================================
16
+ // Errors
17
+ // =============================================================================
18
+
19
+ export class InvalidMessageBody extends Schema.TaggedErrorClass<InvalidMessageBody>()(
20
+ "InvalidMessageBody",
21
+ { code: Schema.Number, message: Schema.String },
22
+ ) {}
23
+ T.applyErrorMatchers(InvalidMessageBody, [{ code: 10207 }]);
24
+
25
+ export class InvalidQueueName extends Schema.TaggedErrorClass<InvalidQueueName>()(
26
+ "InvalidQueueName",
27
+ { code: Schema.Number, message: Schema.String },
28
+ ) {}
29
+ T.applyErrorMatchers(InvalidQueueName, [{ code: 11003 }]);
30
+
31
+ export class InvalidRequestBody extends Schema.TaggedErrorClass<InvalidRequestBody>()(
32
+ "InvalidRequestBody",
33
+ { code: Schema.Number, message: Schema.String },
34
+ ) {}
35
+ T.applyErrorMatchers(InvalidRequestBody, [{ code: 10026 }]);
36
+
37
+ export class UnrecognizedEventType extends Schema.TaggedErrorClass<UnrecognizedEventType>()(
38
+ "UnrecognizedEventType",
39
+ { code: Schema.Number, message: Schema.String },
40
+ ) {}
41
+ T.applyErrorMatchers(UnrecognizedEventType, [
42
+ { code: 0, message: { includes: "Unrecognized event types" } },
43
+ ]);
44
+
45
+ // =============================================================================
46
+ // Consumer
47
+ // =============================================================================
48
+
49
+ export interface GetConsumerRequest {
50
+ queueId: string;
51
+ consumerId: string;
52
+ /** A Resource identifier. */
53
+ accountId: string;
54
+ }
55
+
56
+ export const GetConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
57
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
58
+ consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
59
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
60
+ }).pipe(
61
+ T.Http({
62
+ method: "GET",
63
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
64
+ }),
65
+ ) as unknown as Schema.Schema<GetConsumerRequest>;
66
+
67
+ export type GetConsumerResponse =
68
+ | {
69
+ consumerId?: string | null;
70
+ createdOn?: string | null;
71
+ queueId?: string | null;
72
+ script?: string | null;
73
+ settings?: {
74
+ batchSize?: number | null;
75
+ maxConcurrency?: number | null;
76
+ maxRetries?: number | null;
77
+ maxWaitTimeMs?: number | null;
78
+ retryDelay?: number | null;
79
+ } | null;
80
+ type?: "worker" | null;
81
+ }
82
+ | {
83
+ consumerId?: string | null;
84
+ createdOn?: string | null;
85
+ queueId?: string | null;
86
+ settings?: {
87
+ batchSize?: number | null;
88
+ maxRetries?: number | null;
89
+ retryDelay?: number | null;
90
+ visibilityTimeoutMs?: number | null;
91
+ } | null;
92
+ type?: "http_pull" | null;
93
+ };
94
+
95
+ export const GetConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
96
+ Schema.Struct({
97
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
98
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
99
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
100
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
101
+ settings: Schema.optional(
102
+ Schema.Union([
103
+ Schema.Struct({
104
+ batchSize: Schema.optional(
105
+ Schema.Union([Schema.Number, Schema.Null]),
106
+ ),
107
+ maxConcurrency: Schema.optional(
108
+ Schema.Union([Schema.Number, Schema.Null]),
109
+ ),
110
+ maxRetries: Schema.optional(
111
+ Schema.Union([Schema.Number, Schema.Null]),
112
+ ),
113
+ maxWaitTimeMs: Schema.optional(
114
+ Schema.Union([Schema.Number, Schema.Null]),
115
+ ),
116
+ retryDelay: Schema.optional(
117
+ Schema.Union([Schema.Number, Schema.Null]),
118
+ ),
119
+ }).pipe(
120
+ Schema.encodeKeys({
121
+ batchSize: "batch_size",
122
+ maxConcurrency: "max_concurrency",
123
+ maxRetries: "max_retries",
124
+ maxWaitTimeMs: "max_wait_time_ms",
125
+ retryDelay: "retry_delay",
126
+ }),
127
+ ),
128
+ Schema.Null,
129
+ ]),
130
+ ),
131
+ type: Schema.optional(
132
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
133
+ ),
134
+ }).pipe(
135
+ Schema.encodeKeys({
136
+ consumerId: "consumer_id",
137
+ createdOn: "created_on",
138
+ queueId: "queue_id",
139
+ script: "script",
140
+ settings: "settings",
141
+ type: "type",
142
+ }),
143
+ ),
144
+ Schema.Struct({
145
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
146
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
147
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
148
+ settings: Schema.optional(
149
+ Schema.Union([
150
+ Schema.Struct({
151
+ batchSize: Schema.optional(
152
+ Schema.Union([Schema.Number, Schema.Null]),
153
+ ),
154
+ maxRetries: Schema.optional(
155
+ Schema.Union([Schema.Number, Schema.Null]),
156
+ ),
157
+ retryDelay: Schema.optional(
158
+ Schema.Union([Schema.Number, Schema.Null]),
159
+ ),
160
+ visibilityTimeoutMs: Schema.optional(
161
+ Schema.Union([Schema.Number, Schema.Null]),
162
+ ),
163
+ }).pipe(
164
+ Schema.encodeKeys({
165
+ batchSize: "batch_size",
166
+ maxRetries: "max_retries",
167
+ retryDelay: "retry_delay",
168
+ visibilityTimeoutMs: "visibility_timeout_ms",
169
+ }),
170
+ ),
171
+ Schema.Null,
172
+ ]),
173
+ ),
174
+ type: Schema.optional(
175
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
176
+ ),
177
+ }).pipe(
178
+ Schema.encodeKeys({
179
+ consumerId: "consumer_id",
180
+ createdOn: "created_on",
181
+ queueId: "queue_id",
182
+ settings: "settings",
183
+ type: "type",
184
+ }),
185
+ ),
186
+ ]) as unknown as Schema.Schema<GetConsumerResponse>;
187
+
188
+ export type GetConsumerError = DefaultErrors | InvalidRequestBody;
189
+
190
+ export const getConsumer: API.OperationMethod<
191
+ GetConsumerRequest,
192
+ GetConsumerResponse,
193
+ GetConsumerError,
194
+ Credentials | HttpClient.HttpClient
195
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
196
+ input: GetConsumerRequest,
197
+ output: GetConsumerResponse,
198
+ errors: [InvalidRequestBody],
199
+ }));
200
+
201
+ export interface ListConsumersRequest {
202
+ queueId: string;
203
+ /** A Resource identifier. */
204
+ accountId: string;
205
+ }
206
+
207
+ export const ListConsumersRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
208
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
209
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
210
+ }).pipe(
211
+ T.Http({
212
+ method: "GET",
213
+ path: "/accounts/{account_id}/queues/{queueId}/consumers",
214
+ }),
215
+ ) as unknown as Schema.Schema<ListConsumersRequest>;
216
+
217
+ export type ListConsumersResponse = (
218
+ | {
219
+ consumerId?: string | null;
220
+ createdOn?: string | null;
221
+ queueId?: string | null;
222
+ script?: string | null;
223
+ settings?: {
224
+ batchSize?: number | null;
225
+ maxConcurrency?: number | null;
226
+ maxRetries?: number | null;
227
+ maxWaitTimeMs?: number | null;
228
+ retryDelay?: number | null;
229
+ } | null;
230
+ type?: "worker" | null;
231
+ }
232
+ | {
233
+ consumerId?: string | null;
234
+ createdOn?: string | null;
235
+ queueId?: string | null;
236
+ settings?: {
237
+ batchSize?: number | null;
238
+ maxRetries?: number | null;
239
+ retryDelay?: number | null;
240
+ visibilityTimeoutMs?: number | null;
241
+ } | null;
242
+ type?: "http_pull" | null;
243
+ }
244
+ )[];
245
+
246
+ export const ListConsumersResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
247
+ Schema.Union([
248
+ Schema.Struct({
249
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
250
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
251
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
252
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
253
+ settings: Schema.optional(
254
+ Schema.Union([
255
+ Schema.Struct({
256
+ batchSize: Schema.optional(
257
+ Schema.Union([Schema.Number, Schema.Null]),
258
+ ),
259
+ maxConcurrency: Schema.optional(
260
+ Schema.Union([Schema.Number, Schema.Null]),
261
+ ),
262
+ maxRetries: Schema.optional(
263
+ Schema.Union([Schema.Number, Schema.Null]),
264
+ ),
265
+ maxWaitTimeMs: Schema.optional(
266
+ Schema.Union([Schema.Number, Schema.Null]),
267
+ ),
268
+ retryDelay: Schema.optional(
269
+ Schema.Union([Schema.Number, Schema.Null]),
270
+ ),
271
+ }).pipe(
272
+ Schema.encodeKeys({
273
+ batchSize: "batch_size",
274
+ maxConcurrency: "max_concurrency",
275
+ maxRetries: "max_retries",
276
+ maxWaitTimeMs: "max_wait_time_ms",
277
+ retryDelay: "retry_delay",
278
+ }),
279
+ ),
280
+ Schema.Null,
281
+ ]),
282
+ ),
283
+ type: Schema.optional(
284
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
285
+ ),
286
+ }).pipe(
287
+ Schema.encodeKeys({
288
+ consumerId: "consumer_id",
289
+ createdOn: "created_on",
290
+ queueId: "queue_id",
291
+ script: "script",
292
+ settings: "settings",
293
+ type: "type",
294
+ }),
295
+ ),
296
+ Schema.Struct({
297
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
298
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
299
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
300
+ settings: Schema.optional(
301
+ Schema.Union([
302
+ Schema.Struct({
303
+ batchSize: Schema.optional(
304
+ Schema.Union([Schema.Number, Schema.Null]),
305
+ ),
306
+ maxRetries: Schema.optional(
307
+ Schema.Union([Schema.Number, Schema.Null]),
308
+ ),
309
+ retryDelay: Schema.optional(
310
+ Schema.Union([Schema.Number, Schema.Null]),
311
+ ),
312
+ visibilityTimeoutMs: Schema.optional(
313
+ Schema.Union([Schema.Number, Schema.Null]),
314
+ ),
315
+ }).pipe(
316
+ Schema.encodeKeys({
317
+ batchSize: "batch_size",
318
+ maxRetries: "max_retries",
319
+ retryDelay: "retry_delay",
320
+ visibilityTimeoutMs: "visibility_timeout_ms",
321
+ }),
322
+ ),
323
+ Schema.Null,
324
+ ]),
325
+ ),
326
+ type: Schema.optional(
327
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
328
+ ),
329
+ }).pipe(
330
+ Schema.encodeKeys({
331
+ consumerId: "consumer_id",
332
+ createdOn: "created_on",
333
+ queueId: "queue_id",
334
+ settings: "settings",
335
+ type: "type",
336
+ }),
337
+ ),
338
+ ]),
339
+ ) as unknown as Schema.Schema<ListConsumersResponse>;
340
+
341
+ export type ListConsumersError = DefaultErrors | InvalidRequestBody;
342
+
343
+ export const listConsumers: API.OperationMethod<
344
+ ListConsumersRequest,
345
+ ListConsumersResponse,
346
+ ListConsumersError,
347
+ Credentials | HttpClient.HttpClient
348
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
349
+ input: ListConsumersRequest,
350
+ output: ListConsumersResponse,
351
+ errors: [InvalidRequestBody],
352
+ }));
353
+
354
+ export interface CreateConsumerRequest {
355
+ queueId: string;
356
+ /** Path param: A Resource identifier. */
357
+ accountId: string;
358
+ /** Body param: */
359
+ deadLetterQueue?: string;
360
+ /** Body param: Name of a Worker */
361
+ scriptName?: string;
362
+ /** Body param: */
363
+ settings?: {
364
+ batchSize?: number;
365
+ maxConcurrency?: number;
366
+ maxRetries?: number;
367
+ maxWaitTimeMs?: number;
368
+ retryDelay?: number;
369
+ };
370
+ /** Body param: */
371
+ type?: "worker";
372
+ }
373
+
374
+ export const CreateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
375
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
376
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
377
+ deadLetterQueue: Schema.optional(Schema.String),
378
+ scriptName: Schema.optional(Schema.String),
379
+ settings: Schema.optional(
380
+ Schema.Struct({
381
+ batchSize: Schema.optional(Schema.Number),
382
+ maxConcurrency: Schema.optional(Schema.Number),
383
+ maxRetries: Schema.optional(Schema.Number),
384
+ maxWaitTimeMs: Schema.optional(Schema.Number),
385
+ retryDelay: Schema.optional(Schema.Number),
386
+ }).pipe(
387
+ Schema.encodeKeys({
388
+ batchSize: "batch_size",
389
+ maxConcurrency: "max_concurrency",
390
+ maxRetries: "max_retries",
391
+ maxWaitTimeMs: "max_wait_time_ms",
392
+ retryDelay: "retry_delay",
393
+ }),
394
+ ),
395
+ ),
396
+ type: Schema.optional(Schema.Literal("worker")),
397
+ }).pipe(
398
+ Schema.encodeKeys({
399
+ deadLetterQueue: "dead_letter_queue",
400
+ scriptName: "script_name",
401
+ settings: "settings",
402
+ type: "type",
403
+ }),
404
+ T.Http({
405
+ method: "POST",
406
+ path: "/accounts/{account_id}/queues/{queueId}/consumers",
407
+ }),
408
+ ) as unknown as Schema.Schema<CreateConsumerRequest>;
409
+
410
+ export type CreateConsumerResponse =
411
+ | {
412
+ consumerId?: string | null;
413
+ createdOn?: string | null;
414
+ queueId?: string | null;
415
+ script?: string | null;
416
+ settings?: {
417
+ batchSize?: number | null;
418
+ maxConcurrency?: number | null;
419
+ maxRetries?: number | null;
420
+ maxWaitTimeMs?: number | null;
421
+ retryDelay?: number | null;
422
+ } | null;
423
+ type?: "worker" | null;
424
+ }
425
+ | {
426
+ consumerId?: string | null;
427
+ createdOn?: string | null;
428
+ queueId?: string | null;
429
+ settings?: {
430
+ batchSize?: number | null;
431
+ maxRetries?: number | null;
432
+ retryDelay?: number | null;
433
+ visibilityTimeoutMs?: number | null;
434
+ } | null;
435
+ type?: "http_pull" | null;
436
+ };
437
+
438
+ export const CreateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
439
+ Schema.Struct({
440
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
441
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
442
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
443
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
444
+ settings: Schema.optional(
445
+ Schema.Union([
446
+ Schema.Struct({
447
+ batchSize: Schema.optional(
448
+ Schema.Union([Schema.Number, Schema.Null]),
449
+ ),
450
+ maxConcurrency: Schema.optional(
451
+ Schema.Union([Schema.Number, Schema.Null]),
452
+ ),
453
+ maxRetries: Schema.optional(
454
+ Schema.Union([Schema.Number, Schema.Null]),
455
+ ),
456
+ maxWaitTimeMs: Schema.optional(
457
+ Schema.Union([Schema.Number, Schema.Null]),
458
+ ),
459
+ retryDelay: Schema.optional(
460
+ Schema.Union([Schema.Number, Schema.Null]),
461
+ ),
462
+ }).pipe(
463
+ Schema.encodeKeys({
464
+ batchSize: "batch_size",
465
+ maxConcurrency: "max_concurrency",
466
+ maxRetries: "max_retries",
467
+ maxWaitTimeMs: "max_wait_time_ms",
468
+ retryDelay: "retry_delay",
469
+ }),
470
+ ),
471
+ Schema.Null,
472
+ ]),
473
+ ),
474
+ type: Schema.optional(
475
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
476
+ ),
477
+ }).pipe(
478
+ Schema.encodeKeys({
479
+ consumerId: "consumer_id",
480
+ createdOn: "created_on",
481
+ queueId: "queue_id",
482
+ script: "script",
483
+ settings: "settings",
484
+ type: "type",
485
+ }),
486
+ ),
487
+ Schema.Struct({
488
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
489
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
490
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
491
+ settings: Schema.optional(
492
+ Schema.Union([
493
+ Schema.Struct({
494
+ batchSize: Schema.optional(
495
+ Schema.Union([Schema.Number, Schema.Null]),
496
+ ),
497
+ maxRetries: Schema.optional(
498
+ Schema.Union([Schema.Number, Schema.Null]),
499
+ ),
500
+ retryDelay: Schema.optional(
501
+ Schema.Union([Schema.Number, Schema.Null]),
502
+ ),
503
+ visibilityTimeoutMs: Schema.optional(
504
+ Schema.Union([Schema.Number, Schema.Null]),
505
+ ),
506
+ }).pipe(
507
+ Schema.encodeKeys({
508
+ batchSize: "batch_size",
509
+ maxRetries: "max_retries",
510
+ retryDelay: "retry_delay",
511
+ visibilityTimeoutMs: "visibility_timeout_ms",
512
+ }),
513
+ ),
514
+ Schema.Null,
515
+ ]),
516
+ ),
517
+ type: Schema.optional(
518
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
519
+ ),
520
+ }).pipe(
521
+ Schema.encodeKeys({
522
+ consumerId: "consumer_id",
523
+ createdOn: "created_on",
524
+ queueId: "queue_id",
525
+ settings: "settings",
526
+ type: "type",
527
+ }),
528
+ ),
529
+ ]) as unknown as Schema.Schema<CreateConsumerResponse>;
530
+
531
+ export type CreateConsumerError = DefaultErrors | InvalidRequestBody;
532
+
533
+ export const createConsumer: API.OperationMethod<
534
+ CreateConsumerRequest,
535
+ CreateConsumerResponse,
536
+ CreateConsumerError,
537
+ Credentials | HttpClient.HttpClient
538
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
539
+ input: CreateConsumerRequest,
540
+ output: CreateConsumerResponse,
541
+ errors: [InvalidRequestBody],
542
+ }));
543
+
544
+ export interface UpdateConsumerRequest {
545
+ queueId: string;
546
+ consumerId: string;
547
+ /** Path param: A Resource identifier. */
548
+ accountId: string;
549
+ /** Body param: */
550
+ deadLetterQueue?: string;
551
+ /** Body param: Name of a Worker */
552
+ scriptName?: string;
553
+ /** Body param: */
554
+ settings?: {
555
+ batchSize?: number;
556
+ maxConcurrency?: number;
557
+ maxRetries?: number;
558
+ maxWaitTimeMs?: number;
559
+ retryDelay?: number;
560
+ };
561
+ /** Body param: */
562
+ type?: "worker";
563
+ }
564
+
565
+ export const UpdateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
566
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
567
+ consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
568
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
569
+ deadLetterQueue: Schema.optional(Schema.String),
570
+ scriptName: Schema.optional(Schema.String),
571
+ settings: Schema.optional(
572
+ Schema.Struct({
573
+ batchSize: Schema.optional(Schema.Number),
574
+ maxConcurrency: Schema.optional(Schema.Number),
575
+ maxRetries: Schema.optional(Schema.Number),
576
+ maxWaitTimeMs: Schema.optional(Schema.Number),
577
+ retryDelay: Schema.optional(Schema.Number),
578
+ }).pipe(
579
+ Schema.encodeKeys({
580
+ batchSize: "batch_size",
581
+ maxConcurrency: "max_concurrency",
582
+ maxRetries: "max_retries",
583
+ maxWaitTimeMs: "max_wait_time_ms",
584
+ retryDelay: "retry_delay",
585
+ }),
586
+ ),
587
+ ),
588
+ type: Schema.optional(Schema.Literal("worker")),
589
+ }).pipe(
590
+ Schema.encodeKeys({
591
+ deadLetterQueue: "dead_letter_queue",
592
+ scriptName: "script_name",
593
+ settings: "settings",
594
+ type: "type",
595
+ }),
596
+ T.Http({
597
+ method: "PUT",
598
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
599
+ }),
600
+ ) as unknown as Schema.Schema<UpdateConsumerRequest>;
601
+
602
+ export type UpdateConsumerResponse =
603
+ | {
604
+ consumerId?: string | null;
605
+ createdOn?: string | null;
606
+ queueId?: string | null;
607
+ script?: string | null;
608
+ settings?: {
609
+ batchSize?: number | null;
610
+ maxConcurrency?: number | null;
611
+ maxRetries?: number | null;
612
+ maxWaitTimeMs?: number | null;
613
+ retryDelay?: number | null;
614
+ } | null;
615
+ type?: "worker" | null;
616
+ }
617
+ | {
618
+ consumerId?: string | null;
619
+ createdOn?: string | null;
620
+ queueId?: string | null;
621
+ settings?: {
622
+ batchSize?: number | null;
623
+ maxRetries?: number | null;
624
+ retryDelay?: number | null;
625
+ visibilityTimeoutMs?: number | null;
626
+ } | null;
627
+ type?: "http_pull" | null;
628
+ };
629
+
630
+ export const UpdateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
631
+ Schema.Struct({
632
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
633
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
634
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
635
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
636
+ settings: Schema.optional(
637
+ Schema.Union([
638
+ Schema.Struct({
639
+ batchSize: Schema.optional(
640
+ Schema.Union([Schema.Number, Schema.Null]),
641
+ ),
642
+ maxConcurrency: Schema.optional(
643
+ Schema.Union([Schema.Number, Schema.Null]),
644
+ ),
645
+ maxRetries: Schema.optional(
646
+ Schema.Union([Schema.Number, Schema.Null]),
647
+ ),
648
+ maxWaitTimeMs: Schema.optional(
649
+ Schema.Union([Schema.Number, Schema.Null]),
650
+ ),
651
+ retryDelay: Schema.optional(
652
+ Schema.Union([Schema.Number, Schema.Null]),
653
+ ),
654
+ }).pipe(
655
+ Schema.encodeKeys({
656
+ batchSize: "batch_size",
657
+ maxConcurrency: "max_concurrency",
658
+ maxRetries: "max_retries",
659
+ maxWaitTimeMs: "max_wait_time_ms",
660
+ retryDelay: "retry_delay",
661
+ }),
662
+ ),
663
+ Schema.Null,
664
+ ]),
665
+ ),
666
+ type: Schema.optional(
667
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
668
+ ),
669
+ }).pipe(
670
+ Schema.encodeKeys({
671
+ consumerId: "consumer_id",
672
+ createdOn: "created_on",
673
+ queueId: "queue_id",
674
+ script: "script",
675
+ settings: "settings",
676
+ type: "type",
677
+ }),
678
+ ),
679
+ Schema.Struct({
680
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
681
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
682
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
683
+ settings: Schema.optional(
684
+ Schema.Union([
685
+ Schema.Struct({
686
+ batchSize: Schema.optional(
687
+ Schema.Union([Schema.Number, Schema.Null]),
688
+ ),
689
+ maxRetries: Schema.optional(
690
+ Schema.Union([Schema.Number, Schema.Null]),
691
+ ),
692
+ retryDelay: Schema.optional(
693
+ Schema.Union([Schema.Number, Schema.Null]),
694
+ ),
695
+ visibilityTimeoutMs: Schema.optional(
696
+ Schema.Union([Schema.Number, Schema.Null]),
697
+ ),
698
+ }).pipe(
699
+ Schema.encodeKeys({
700
+ batchSize: "batch_size",
701
+ maxRetries: "max_retries",
702
+ retryDelay: "retry_delay",
703
+ visibilityTimeoutMs: "visibility_timeout_ms",
704
+ }),
705
+ ),
706
+ Schema.Null,
707
+ ]),
708
+ ),
709
+ type: Schema.optional(
710
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
711
+ ),
712
+ }).pipe(
713
+ Schema.encodeKeys({
714
+ consumerId: "consumer_id",
715
+ createdOn: "created_on",
716
+ queueId: "queue_id",
717
+ settings: "settings",
718
+ type: "type",
719
+ }),
720
+ ),
721
+ ]) as unknown as Schema.Schema<UpdateConsumerResponse>;
722
+
723
+ export type UpdateConsumerError = DefaultErrors | InvalidRequestBody;
724
+
725
+ export const updateConsumer: API.OperationMethod<
726
+ UpdateConsumerRequest,
727
+ UpdateConsumerResponse,
728
+ UpdateConsumerError,
729
+ Credentials | HttpClient.HttpClient
730
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
731
+ input: UpdateConsumerRequest,
732
+ output: UpdateConsumerResponse,
733
+ errors: [InvalidRequestBody],
734
+ }));
735
+
736
+ export interface DeleteConsumerRequest {
737
+ queueId: string;
738
+ consumerId: string;
739
+ /** A Resource identifier. */
740
+ accountId: string;
741
+ }
742
+
743
+ export const DeleteConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
744
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
745
+ consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
746
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
747
+ }).pipe(
748
+ T.Http({
749
+ method: "DELETE",
750
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
751
+ }),
752
+ ) as unknown as Schema.Schema<DeleteConsumerRequest>;
753
+
754
+ export interface DeleteConsumerResponse {
755
+ errors?: unknown[] | null;
756
+ messages?: string[] | null;
757
+ /** Indicates if the API call was successful or not. */
758
+ success?: true | null;
759
+ }
760
+
761
+ export const DeleteConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
762
+ {
763
+ errors: Schema.optional(
764
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
765
+ ),
766
+ messages: Schema.optional(
767
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
768
+ ),
769
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
770
+ },
771
+ ) as unknown as Schema.Schema<DeleteConsumerResponse>;
772
+
773
+ export type DeleteConsumerError = DefaultErrors | InvalidRequestBody;
774
+
775
+ export const deleteConsumer: API.OperationMethod<
776
+ DeleteConsumerRequest,
777
+ DeleteConsumerResponse,
778
+ DeleteConsumerError,
779
+ Credentials | HttpClient.HttpClient
780
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
781
+ input: DeleteConsumerRequest,
782
+ output: DeleteConsumerResponse,
783
+ errors: [InvalidRequestBody],
784
+ }));
785
+
786
+ // =============================================================================
787
+ // Message
788
+ // =============================================================================
789
+
790
+ export interface BulkPushMessagesRequest {
791
+ queueId: string;
792
+ /** Path param: A Resource identifier. */
793
+ accountId: string;
794
+ /** Body param: The number of seconds to wait for attempting to deliver this batch to consumers */
795
+ delaySeconds?: number;
796
+ /** Body param: */
797
+ messages?: (
798
+ | { body?: string; contentType?: "text"; delaySeconds?: number }
799
+ | { body?: unknown; contentType?: "json"; delaySeconds?: number }
800
+ )[];
801
+ }
802
+
803
+ export const BulkPushMessagesRequest =
804
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
805
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
806
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
807
+ delaySeconds: Schema.optional(Schema.Number),
808
+ messages: Schema.optional(
809
+ Schema.Array(
810
+ Schema.Union([
811
+ Schema.Struct({
812
+ body: Schema.optional(Schema.String),
813
+ contentType: Schema.optional(Schema.Literal("text")),
814
+ delaySeconds: Schema.optional(Schema.Number),
815
+ }).pipe(
816
+ Schema.encodeKeys({
817
+ body: "body",
818
+ contentType: "content_type",
819
+ delaySeconds: "delay_seconds",
820
+ }),
821
+ ),
822
+ Schema.Struct({
823
+ body: Schema.optional(Schema.Unknown),
824
+ contentType: Schema.optional(Schema.Literal("json")),
825
+ delaySeconds: Schema.optional(Schema.Number),
826
+ }).pipe(
827
+ Schema.encodeKeys({
828
+ body: "body",
829
+ contentType: "content_type",
830
+ delaySeconds: "delay_seconds",
831
+ }),
832
+ ),
833
+ ]),
834
+ ),
835
+ ),
836
+ }).pipe(
837
+ Schema.encodeKeys({ delaySeconds: "delay_seconds", messages: "messages" }),
838
+ T.Http({
839
+ method: "POST",
840
+ path: "/accounts/{account_id}/queues/{queueId}/messages/batch",
841
+ }),
842
+ ) as unknown as Schema.Schema<BulkPushMessagesRequest>;
843
+
844
+ export interface BulkPushMessagesResponse {
845
+ errors?: unknown[] | null;
846
+ messages?: string[] | null;
847
+ /** Indicates if the API call was successful or not. */
848
+ success?: true | null;
849
+ }
850
+
851
+ export const BulkPushMessagesResponse =
852
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
853
+ errors: Schema.optional(
854
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
855
+ ),
856
+ messages: Schema.optional(
857
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
858
+ ),
859
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
860
+ }) as unknown as Schema.Schema<BulkPushMessagesResponse>;
861
+
862
+ export type BulkPushMessagesError = DefaultErrors | InvalidMessageBody;
863
+
864
+ export const bulkPushMessages: API.OperationMethod<
865
+ BulkPushMessagesRequest,
866
+ BulkPushMessagesResponse,
867
+ BulkPushMessagesError,
868
+ Credentials | HttpClient.HttpClient
869
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
870
+ input: BulkPushMessagesRequest,
871
+ output: BulkPushMessagesResponse,
872
+ errors: [InvalidMessageBody],
873
+ }));
874
+
875
+ export interface PullMessageRequest {
876
+ queueId: string;
877
+ /** Path param: A Resource identifier. */
878
+ accountId: string;
879
+ /** Body param: The maximum number of messages to include in a batch. */
880
+ batchSize?: number;
881
+ /** Body param: The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt. */
882
+ visibilityTimeoutMs?: number;
883
+ }
884
+
885
+ export const PullMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
886
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
887
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
888
+ batchSize: Schema.optional(Schema.Number),
889
+ visibilityTimeoutMs: Schema.optional(Schema.Number),
890
+ }).pipe(
891
+ Schema.encodeKeys({
892
+ batchSize: "batch_size",
893
+ visibilityTimeoutMs: "visibility_timeout_ms",
894
+ }),
895
+ T.Http({
896
+ method: "POST",
897
+ path: "/accounts/{account_id}/queues/{queueId}/messages/pull",
898
+ }),
899
+ ) as unknown as Schema.Schema<PullMessageRequest>;
900
+
901
+ export interface PullMessageResponse {
902
+ /** The number of unacknowledged messages in the queue */
903
+ messageBacklogCount?: number | null;
904
+ messages?:
905
+ | {
906
+ id?: string | null;
907
+ attempts?: number | null;
908
+ body?: string | null;
909
+ leaseId?: string | null;
910
+ metadata?: unknown | null;
911
+ timestampMs?: number | null;
912
+ }[]
913
+ | null;
914
+ }
915
+
916
+ export const PullMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
917
+ messageBacklogCount: Schema.optional(
918
+ Schema.Union([Schema.Number, Schema.Null]),
919
+ ),
920
+ messages: Schema.optional(
921
+ Schema.Union([
922
+ Schema.Array(
923
+ Schema.Struct({
924
+ id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
925
+ attempts: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
926
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
927
+ leaseId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
928
+ metadata: Schema.optional(
929
+ Schema.Union([Schema.Unknown, Schema.Null]),
930
+ ),
931
+ timestampMs: Schema.optional(
932
+ Schema.Union([Schema.Number, Schema.Null]),
933
+ ),
934
+ }).pipe(
935
+ Schema.encodeKeys({
936
+ id: "id",
937
+ attempts: "attempts",
938
+ body: "body",
939
+ leaseId: "lease_id",
940
+ metadata: "metadata",
941
+ timestampMs: "timestamp_ms",
942
+ }),
943
+ ),
944
+ ),
945
+ Schema.Null,
946
+ ]),
947
+ ),
948
+ }).pipe(
949
+ Schema.encodeKeys({
950
+ messageBacklogCount: "message_backlog_count",
951
+ messages: "messages",
952
+ }),
953
+ ) as unknown as Schema.Schema<PullMessageResponse>;
954
+
955
+ export type PullMessageError = DefaultErrors | InvalidRequestBody;
956
+
957
+ export const pullMessage: API.OperationMethod<
958
+ PullMessageRequest,
959
+ PullMessageResponse,
960
+ PullMessageError,
961
+ Credentials | HttpClient.HttpClient
962
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
963
+ input: PullMessageRequest,
964
+ output: PullMessageResponse,
965
+ errors: [InvalidRequestBody],
966
+ }));
967
+
968
+ export interface PushMessageRequest {
969
+ queueId: string;
970
+ /** Path param: A Resource identifier. */
971
+ accountId: string;
972
+ /** Body param: */
973
+ body?: string;
974
+ /** Body param: */
975
+ contentType?: "text";
976
+ /** Body param: The number of seconds to wait for attempting to deliver this message to consumers */
977
+ delaySeconds?: number;
978
+ }
979
+
980
+ export const PushMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
981
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
982
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
983
+ body: Schema.optional(Schema.String).pipe(T.HttpBody()),
984
+ contentType: Schema.optional(Schema.Literal("text")),
985
+ delaySeconds: Schema.optional(Schema.Number),
986
+ }).pipe(
987
+ Schema.encodeKeys({
988
+ contentType: "content_type",
989
+ delaySeconds: "delay_seconds",
990
+ }),
991
+ T.Http({
992
+ method: "POST",
993
+ path: "/accounts/{account_id}/queues/{queueId}/messages",
994
+ }),
995
+ ) as unknown as Schema.Schema<PushMessageRequest>;
996
+
997
+ export interface PushMessageResponse {
998
+ errors?: unknown[] | null;
999
+ messages?: string[] | null;
1000
+ /** Indicates if the API call was successful or not. */
1001
+ success?: true | null;
1002
+ }
1003
+
1004
+ export const PushMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1005
+ errors: Schema.optional(
1006
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1007
+ ),
1008
+ messages: Schema.optional(
1009
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1010
+ ),
1011
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
1012
+ }) as unknown as Schema.Schema<PushMessageResponse>;
1013
+
1014
+ export type PushMessageError = DefaultErrors | InvalidMessageBody;
1015
+
1016
+ export const pushMessage: API.OperationMethod<
1017
+ PushMessageRequest,
1018
+ PushMessageResponse,
1019
+ PushMessageError,
1020
+ Credentials | HttpClient.HttpClient
1021
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1022
+ input: PushMessageRequest,
1023
+ output: PushMessageResponse,
1024
+ errors: [InvalidMessageBody],
1025
+ }));
1026
+
1027
+ export interface AckMessageRequest {
1028
+ queueId: string;
1029
+ /** Path param: A Resource identifier. */
1030
+ accountId: string;
1031
+ /** Body param: */
1032
+ acks?: { leaseId?: string }[];
1033
+ /** Body param: */
1034
+ retries?: { delaySeconds?: number; leaseId?: string }[];
1035
+ }
1036
+
1037
+ export const AckMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1038
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1039
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1040
+ acks: Schema.optional(
1041
+ Schema.Array(
1042
+ Schema.Struct({
1043
+ leaseId: Schema.optional(Schema.String),
1044
+ }).pipe(Schema.encodeKeys({ leaseId: "lease_id" })),
1045
+ ),
1046
+ ),
1047
+ retries: Schema.optional(
1048
+ Schema.Array(
1049
+ Schema.Struct({
1050
+ delaySeconds: Schema.optional(Schema.Number),
1051
+ leaseId: Schema.optional(Schema.String),
1052
+ }).pipe(
1053
+ Schema.encodeKeys({
1054
+ delaySeconds: "delay_seconds",
1055
+ leaseId: "lease_id",
1056
+ }),
1057
+ ),
1058
+ ),
1059
+ ),
1060
+ }).pipe(
1061
+ T.Http({
1062
+ method: "POST",
1063
+ path: "/accounts/{account_id}/queues/{queueId}/messages/ack",
1064
+ }),
1065
+ ) as unknown as Schema.Schema<AckMessageRequest>;
1066
+
1067
+ export interface AckMessageResponse {
1068
+ /** The number of messages that were succesfully acknowledged. */
1069
+ ackCount?: number | null;
1070
+ /** The number of messages that were succesfully retried. */
1071
+ retryCount?: number | null;
1072
+ warnings?: string[] | null;
1073
+ }
1074
+
1075
+ export const AckMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1076
+ ackCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1077
+ retryCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1078
+ warnings: Schema.optional(
1079
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1080
+ ),
1081
+ }) as unknown as Schema.Schema<AckMessageResponse>;
1082
+
1083
+ export type AckMessageError = DefaultErrors | InvalidRequestBody;
1084
+
1085
+ export const ackMessage: API.OperationMethod<
1086
+ AckMessageRequest,
1087
+ AckMessageResponse,
1088
+ AckMessageError,
1089
+ Credentials | HttpClient.HttpClient
1090
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1091
+ input: AckMessageRequest,
1092
+ output: AckMessageResponse,
1093
+ errors: [InvalidRequestBody],
1094
+ }));
1095
+
1096
+ // =============================================================================
1097
+ // Purge
1098
+ // =============================================================================
1099
+
1100
+ export interface StartPurgeRequest {
1101
+ queueId: string;
1102
+ /** Path param: A Resource identifier. */
1103
+ accountId: string;
1104
+ /** Body param: Confimation that all messages will be deleted permanently. */
1105
+ deleteMessagesPermanently?: boolean;
1106
+ }
1107
+
1108
+ export const StartPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1109
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1110
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1111
+ deleteMessagesPermanently: Schema.optional(Schema.Boolean),
1112
+ }).pipe(
1113
+ Schema.encodeKeys({
1114
+ deleteMessagesPermanently: "delete_messages_permanently",
1115
+ }),
1116
+ T.Http({
1117
+ method: "POST",
1118
+ path: "/accounts/{account_id}/queues/{queueId}/purge",
1119
+ }),
1120
+ ) as unknown as Schema.Schema<StartPurgeRequest>;
1121
+
1122
+ export type StartPurgeResponse = unknown;
1123
+
1124
+ export const StartPurgeResponse =
1125
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown as unknown as Schema.Schema<StartPurgeResponse>;
1126
+
1127
+ export type StartPurgeError = DefaultErrors;
1128
+
1129
+ export const startPurge: API.OperationMethod<
1130
+ StartPurgeRequest,
1131
+ StartPurgeResponse,
1132
+ StartPurgeError,
1133
+ Credentials | HttpClient.HttpClient
1134
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1135
+ input: StartPurgeRequest,
1136
+ output: StartPurgeResponse,
1137
+ errors: [],
1138
+ }));
1139
+
1140
+ export interface StatusPurgeRequest {
1141
+ queueId: string;
1142
+ /** A Resource identifier. */
1143
+ accountId: string;
1144
+ }
1145
+
1146
+ export const StatusPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1147
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1148
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1149
+ }).pipe(
1150
+ T.Http({
1151
+ method: "GET",
1152
+ path: "/accounts/{account_id}/queues/{queueId}/purge",
1153
+ }),
1154
+ ) as unknown as Schema.Schema<StatusPurgeRequest>;
1155
+
1156
+ export interface StatusPurgeResponse {
1157
+ /** Indicates if the last purge operation completed successfully. */
1158
+ completed?: string | null;
1159
+ /** Timestamp when the last purge operation started. */
1160
+ startedAt?: string | null;
1161
+ }
1162
+
1163
+ export const StatusPurgeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1164
+ completed: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1165
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1166
+ }).pipe(
1167
+ Schema.encodeKeys({ completed: "completed", startedAt: "started_at" }),
1168
+ ) as unknown as Schema.Schema<StatusPurgeResponse>;
1169
+
1170
+ export type StatusPurgeError = DefaultErrors;
1171
+
1172
+ export const statusPurge: API.OperationMethod<
1173
+ StatusPurgeRequest,
1174
+ StatusPurgeResponse,
1175
+ StatusPurgeError,
1176
+ Credentials | HttpClient.HttpClient
1177
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1178
+ input: StatusPurgeRequest,
1179
+ output: StatusPurgeResponse,
1180
+ errors: [],
1181
+ }));
1182
+
1183
+ // =============================================================================
1184
+ // Queue
1185
+ // =============================================================================
1186
+
1187
+ export interface GetQueueRequest {
1188
+ queueId: string;
1189
+ /** A Resource identifier. */
1190
+ accountId: string;
1191
+ }
1192
+
1193
+ export const GetQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1194
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1195
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1196
+ }).pipe(
1197
+ T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}" }),
1198
+ ) as unknown as Schema.Schema<GetQueueRequest>;
1199
+
1200
+ export interface GetQueueResponse {
1201
+ consumers?: unknown[] | null;
1202
+ consumersTotalCount?: number | null;
1203
+ createdOn?: string | null;
1204
+ modifiedOn?: string | null;
1205
+ producers?:
1206
+ | (
1207
+ | { script?: string | null; type?: "worker" | null }
1208
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1209
+ )[]
1210
+ | null;
1211
+ producersTotalCount?: number | null;
1212
+ queueId?: string | null;
1213
+ queueName?: string | null;
1214
+ settings?: {
1215
+ deliveryDelay?: number | null;
1216
+ deliveryPaused?: boolean | null;
1217
+ messageRetentionPeriod?: number | null;
1218
+ } | null;
1219
+ }
1220
+
1221
+ export const GetQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1222
+ consumers: Schema.optional(
1223
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1224
+ ),
1225
+ consumersTotalCount: Schema.optional(
1226
+ Schema.Union([Schema.Number, Schema.Null]),
1227
+ ),
1228
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1229
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1230
+ producers: Schema.optional(
1231
+ Schema.Union([
1232
+ Schema.Array(
1233
+ Schema.Union([
1234
+ Schema.Struct({
1235
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1236
+ type: Schema.optional(
1237
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1238
+ ),
1239
+ }),
1240
+ Schema.Struct({
1241
+ bucketName: Schema.optional(
1242
+ Schema.Union([Schema.String, Schema.Null]),
1243
+ ),
1244
+ type: Schema.optional(
1245
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1246
+ ),
1247
+ }).pipe(
1248
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1249
+ ),
1250
+ ]),
1251
+ ),
1252
+ Schema.Null,
1253
+ ]),
1254
+ ),
1255
+ producersTotalCount: Schema.optional(
1256
+ Schema.Union([Schema.Number, Schema.Null]),
1257
+ ),
1258
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1259
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1260
+ settings: Schema.optional(
1261
+ Schema.Union([
1262
+ Schema.Struct({
1263
+ deliveryDelay: Schema.optional(
1264
+ Schema.Union([Schema.Number, Schema.Null]),
1265
+ ),
1266
+ deliveryPaused: Schema.optional(
1267
+ Schema.Union([Schema.Boolean, Schema.Null]),
1268
+ ),
1269
+ messageRetentionPeriod: Schema.optional(
1270
+ Schema.Union([Schema.Number, Schema.Null]),
1271
+ ),
1272
+ }).pipe(
1273
+ Schema.encodeKeys({
1274
+ deliveryDelay: "delivery_delay",
1275
+ deliveryPaused: "delivery_paused",
1276
+ messageRetentionPeriod: "message_retention_period",
1277
+ }),
1278
+ ),
1279
+ Schema.Null,
1280
+ ]),
1281
+ ),
1282
+ }).pipe(
1283
+ Schema.encodeKeys({
1284
+ consumers: "consumers",
1285
+ consumersTotalCount: "consumers_total_count",
1286
+ createdOn: "created_on",
1287
+ modifiedOn: "modified_on",
1288
+ producers: "producers",
1289
+ producersTotalCount: "producers_total_count",
1290
+ queueId: "queue_id",
1291
+ queueName: "queue_name",
1292
+ settings: "settings",
1293
+ }),
1294
+ ) as unknown as Schema.Schema<GetQueueResponse>;
1295
+
1296
+ export type GetQueueError = DefaultErrors;
1297
+
1298
+ export const getQueue: API.OperationMethod<
1299
+ GetQueueRequest,
1300
+ GetQueueResponse,
1301
+ GetQueueError,
1302
+ Credentials | HttpClient.HttpClient
1303
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1304
+ input: GetQueueRequest,
1305
+ output: GetQueueResponse,
1306
+ errors: [],
1307
+ }));
1308
+
1309
+ export interface ListQueuesRequest {
1310
+ /** A Resource identifier. */
1311
+ accountId: string;
1312
+ }
1313
+
1314
+ export const ListQueuesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1315
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1316
+ }).pipe(
1317
+ T.Http({ method: "GET", path: "/accounts/{account_id}/queues" }),
1318
+ ) as unknown as Schema.Schema<ListQueuesRequest>;
1319
+
1320
+ export type ListQueuesResponse = {
1321
+ consumers?: unknown[] | null;
1322
+ consumersTotalCount?: number | null;
1323
+ createdOn?: string | null;
1324
+ modifiedOn?: string | null;
1325
+ producers?:
1326
+ | (
1327
+ | { script?: string | null; type?: "worker" | null }
1328
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1329
+ )[]
1330
+ | null;
1331
+ producersTotalCount?: number | null;
1332
+ queueId?: string | null;
1333
+ queueName?: string | null;
1334
+ settings?: {
1335
+ deliveryDelay?: number | null;
1336
+ deliveryPaused?: boolean | null;
1337
+ messageRetentionPeriod?: number | null;
1338
+ } | null;
1339
+ }[];
1340
+
1341
+ export const ListQueuesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
1342
+ Schema.Struct({
1343
+ consumers: Schema.optional(
1344
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1345
+ ),
1346
+ consumersTotalCount: Schema.optional(
1347
+ Schema.Union([Schema.Number, Schema.Null]),
1348
+ ),
1349
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1350
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1351
+ producers: Schema.optional(
1352
+ Schema.Union([
1353
+ Schema.Array(
1354
+ Schema.Union([
1355
+ Schema.Struct({
1356
+ script: Schema.optional(
1357
+ Schema.Union([Schema.String, Schema.Null]),
1358
+ ),
1359
+ type: Schema.optional(
1360
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1361
+ ),
1362
+ }),
1363
+ Schema.Struct({
1364
+ bucketName: Schema.optional(
1365
+ Schema.Union([Schema.String, Schema.Null]),
1366
+ ),
1367
+ type: Schema.optional(
1368
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1369
+ ),
1370
+ }).pipe(
1371
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1372
+ ),
1373
+ ]),
1374
+ ),
1375
+ Schema.Null,
1376
+ ]),
1377
+ ),
1378
+ producersTotalCount: Schema.optional(
1379
+ Schema.Union([Schema.Number, Schema.Null]),
1380
+ ),
1381
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1382
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1383
+ settings: Schema.optional(
1384
+ Schema.Union([
1385
+ Schema.Struct({
1386
+ deliveryDelay: Schema.optional(
1387
+ Schema.Union([Schema.Number, Schema.Null]),
1388
+ ),
1389
+ deliveryPaused: Schema.optional(
1390
+ Schema.Union([Schema.Boolean, Schema.Null]),
1391
+ ),
1392
+ messageRetentionPeriod: Schema.optional(
1393
+ Schema.Union([Schema.Number, Schema.Null]),
1394
+ ),
1395
+ }).pipe(
1396
+ Schema.encodeKeys({
1397
+ deliveryDelay: "delivery_delay",
1398
+ deliveryPaused: "delivery_paused",
1399
+ messageRetentionPeriod: "message_retention_period",
1400
+ }),
1401
+ ),
1402
+ Schema.Null,
1403
+ ]),
1404
+ ),
1405
+ }).pipe(
1406
+ Schema.encodeKeys({
1407
+ consumers: "consumers",
1408
+ consumersTotalCount: "consumers_total_count",
1409
+ createdOn: "created_on",
1410
+ modifiedOn: "modified_on",
1411
+ producers: "producers",
1412
+ producersTotalCount: "producers_total_count",
1413
+ queueId: "queue_id",
1414
+ queueName: "queue_name",
1415
+ settings: "settings",
1416
+ }),
1417
+ ),
1418
+ ) as unknown as Schema.Schema<ListQueuesResponse>;
1419
+
1420
+ export type ListQueuesError = DefaultErrors;
1421
+
1422
+ export const listQueues: API.OperationMethod<
1423
+ ListQueuesRequest,
1424
+ ListQueuesResponse,
1425
+ ListQueuesError,
1426
+ Credentials | HttpClient.HttpClient
1427
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1428
+ input: ListQueuesRequest,
1429
+ output: ListQueuesResponse,
1430
+ errors: [],
1431
+ }));
1432
+
1433
+ export interface CreateQueueRequest {
1434
+ /** Path param: A Resource identifier. */
1435
+ accountId: string;
1436
+ /** Body param: */
1437
+ queueName: string;
1438
+ }
1439
+
1440
+ export const CreateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1441
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1442
+ queueName: Schema.String,
1443
+ }).pipe(
1444
+ Schema.encodeKeys({ queueName: "queue_name" }),
1445
+ T.Http({ method: "POST", path: "/accounts/{account_id}/queues" }),
1446
+ ) as unknown as Schema.Schema<CreateQueueRequest>;
1447
+
1448
+ export interface CreateQueueResponse {
1449
+ consumers?: unknown[] | null;
1450
+ consumersTotalCount?: number | null;
1451
+ createdOn?: string | null;
1452
+ modifiedOn?: string | null;
1453
+ producers?:
1454
+ | (
1455
+ | { script?: string | null; type?: "worker" | null }
1456
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1457
+ )[]
1458
+ | null;
1459
+ producersTotalCount?: number | null;
1460
+ queueId?: string | null;
1461
+ queueName?: string | null;
1462
+ settings?: {
1463
+ deliveryDelay?: number | null;
1464
+ deliveryPaused?: boolean | null;
1465
+ messageRetentionPeriod?: number | null;
1466
+ } | null;
1467
+ }
1468
+
1469
+ export const CreateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1470
+ consumers: Schema.optional(
1471
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1472
+ ),
1473
+ consumersTotalCount: Schema.optional(
1474
+ Schema.Union([Schema.Number, Schema.Null]),
1475
+ ),
1476
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1477
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1478
+ producers: Schema.optional(
1479
+ Schema.Union([
1480
+ Schema.Array(
1481
+ Schema.Union([
1482
+ Schema.Struct({
1483
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1484
+ type: Schema.optional(
1485
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1486
+ ),
1487
+ }),
1488
+ Schema.Struct({
1489
+ bucketName: Schema.optional(
1490
+ Schema.Union([Schema.String, Schema.Null]),
1491
+ ),
1492
+ type: Schema.optional(
1493
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1494
+ ),
1495
+ }).pipe(
1496
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1497
+ ),
1498
+ ]),
1499
+ ),
1500
+ Schema.Null,
1501
+ ]),
1502
+ ),
1503
+ producersTotalCount: Schema.optional(
1504
+ Schema.Union([Schema.Number, Schema.Null]),
1505
+ ),
1506
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1507
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1508
+ settings: Schema.optional(
1509
+ Schema.Union([
1510
+ Schema.Struct({
1511
+ deliveryDelay: Schema.optional(
1512
+ Schema.Union([Schema.Number, Schema.Null]),
1513
+ ),
1514
+ deliveryPaused: Schema.optional(
1515
+ Schema.Union([Schema.Boolean, Schema.Null]),
1516
+ ),
1517
+ messageRetentionPeriod: Schema.optional(
1518
+ Schema.Union([Schema.Number, Schema.Null]),
1519
+ ),
1520
+ }).pipe(
1521
+ Schema.encodeKeys({
1522
+ deliveryDelay: "delivery_delay",
1523
+ deliveryPaused: "delivery_paused",
1524
+ messageRetentionPeriod: "message_retention_period",
1525
+ }),
1526
+ ),
1527
+ Schema.Null,
1528
+ ]),
1529
+ ),
1530
+ }).pipe(
1531
+ Schema.encodeKeys({
1532
+ consumers: "consumers",
1533
+ consumersTotalCount: "consumers_total_count",
1534
+ createdOn: "created_on",
1535
+ modifiedOn: "modified_on",
1536
+ producers: "producers",
1537
+ producersTotalCount: "producers_total_count",
1538
+ queueId: "queue_id",
1539
+ queueName: "queue_name",
1540
+ settings: "settings",
1541
+ }),
1542
+ ) as unknown as Schema.Schema<CreateQueueResponse>;
1543
+
1544
+ export type CreateQueueError = DefaultErrors;
1545
+
1546
+ export const createQueue: API.OperationMethod<
1547
+ CreateQueueRequest,
1548
+ CreateQueueResponse,
1549
+ CreateQueueError,
1550
+ Credentials | HttpClient.HttpClient
1551
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1552
+ input: CreateQueueRequest,
1553
+ output: CreateQueueResponse,
1554
+ errors: [],
1555
+ }));
1556
+
1557
+ export interface UpdateQueueRequest {
1558
+ queueId: string;
1559
+ /** Path param: A Resource identifier. */
1560
+ accountId: string;
1561
+ /** Body param: */
1562
+ queueName?: string;
1563
+ /** Body param: */
1564
+ settings?: {
1565
+ deliveryDelay?: number;
1566
+ deliveryPaused?: boolean;
1567
+ messageRetentionPeriod?: number;
1568
+ };
1569
+ }
1570
+
1571
+ export const UpdateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1572
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1573
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1574
+ queueName: Schema.optional(Schema.String),
1575
+ settings: Schema.optional(
1576
+ Schema.Struct({
1577
+ deliveryDelay: Schema.optional(Schema.Number),
1578
+ deliveryPaused: Schema.optional(Schema.Boolean),
1579
+ messageRetentionPeriod: Schema.optional(Schema.Number),
1580
+ }).pipe(
1581
+ Schema.encodeKeys({
1582
+ deliveryDelay: "delivery_delay",
1583
+ deliveryPaused: "delivery_paused",
1584
+ messageRetentionPeriod: "message_retention_period",
1585
+ }),
1586
+ ),
1587
+ ),
1588
+ }).pipe(
1589
+ Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
1590
+ T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}" }),
1591
+ ) as unknown as Schema.Schema<UpdateQueueRequest>;
1592
+
1593
+ export interface UpdateQueueResponse {
1594
+ consumers?: unknown[] | null;
1595
+ consumersTotalCount?: number | null;
1596
+ createdOn?: string | null;
1597
+ modifiedOn?: string | null;
1598
+ producers?:
1599
+ | (
1600
+ | { script?: string | null; type?: "worker" | null }
1601
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1602
+ )[]
1603
+ | null;
1604
+ producersTotalCount?: number | null;
1605
+ queueId?: string | null;
1606
+ queueName?: string | null;
1607
+ settings?: {
1608
+ deliveryDelay?: number | null;
1609
+ deliveryPaused?: boolean | null;
1610
+ messageRetentionPeriod?: number | null;
1611
+ } | null;
1612
+ }
1613
+
1614
+ export const UpdateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1615
+ consumers: Schema.optional(
1616
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1617
+ ),
1618
+ consumersTotalCount: Schema.optional(
1619
+ Schema.Union([Schema.Number, Schema.Null]),
1620
+ ),
1621
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1622
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1623
+ producers: Schema.optional(
1624
+ Schema.Union([
1625
+ Schema.Array(
1626
+ Schema.Union([
1627
+ Schema.Struct({
1628
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1629
+ type: Schema.optional(
1630
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1631
+ ),
1632
+ }),
1633
+ Schema.Struct({
1634
+ bucketName: Schema.optional(
1635
+ Schema.Union([Schema.String, Schema.Null]),
1636
+ ),
1637
+ type: Schema.optional(
1638
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1639
+ ),
1640
+ }).pipe(
1641
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1642
+ ),
1643
+ ]),
1644
+ ),
1645
+ Schema.Null,
1646
+ ]),
1647
+ ),
1648
+ producersTotalCount: Schema.optional(
1649
+ Schema.Union([Schema.Number, Schema.Null]),
1650
+ ),
1651
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1652
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1653
+ settings: Schema.optional(
1654
+ Schema.Union([
1655
+ Schema.Struct({
1656
+ deliveryDelay: Schema.optional(
1657
+ Schema.Union([Schema.Number, Schema.Null]),
1658
+ ),
1659
+ deliveryPaused: Schema.optional(
1660
+ Schema.Union([Schema.Boolean, Schema.Null]),
1661
+ ),
1662
+ messageRetentionPeriod: Schema.optional(
1663
+ Schema.Union([Schema.Number, Schema.Null]),
1664
+ ),
1665
+ }).pipe(
1666
+ Schema.encodeKeys({
1667
+ deliveryDelay: "delivery_delay",
1668
+ deliveryPaused: "delivery_paused",
1669
+ messageRetentionPeriod: "message_retention_period",
1670
+ }),
1671
+ ),
1672
+ Schema.Null,
1673
+ ]),
1674
+ ),
1675
+ }).pipe(
1676
+ Schema.encodeKeys({
1677
+ consumers: "consumers",
1678
+ consumersTotalCount: "consumers_total_count",
1679
+ createdOn: "created_on",
1680
+ modifiedOn: "modified_on",
1681
+ producers: "producers",
1682
+ producersTotalCount: "producers_total_count",
1683
+ queueId: "queue_id",
1684
+ queueName: "queue_name",
1685
+ settings: "settings",
1686
+ }),
1687
+ ) as unknown as Schema.Schema<UpdateQueueResponse>;
1688
+
1689
+ export type UpdateQueueError = DefaultErrors | InvalidQueueName;
1690
+
1691
+ export const updateQueue: API.OperationMethod<
1692
+ UpdateQueueRequest,
1693
+ UpdateQueueResponse,
1694
+ UpdateQueueError,
1695
+ Credentials | HttpClient.HttpClient
1696
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1697
+ input: UpdateQueueRequest,
1698
+ output: UpdateQueueResponse,
1699
+ errors: [InvalidQueueName],
1700
+ }));
1701
+
1702
+ export interface PatchQueueRequest {
1703
+ queueId: string;
1704
+ /** Path param: A Resource identifier. */
1705
+ accountId: string;
1706
+ /** Body param: */
1707
+ queueName?: string;
1708
+ /** Body param: */
1709
+ settings?: {
1710
+ deliveryDelay?: number;
1711
+ deliveryPaused?: boolean;
1712
+ messageRetentionPeriod?: number;
1713
+ };
1714
+ }
1715
+
1716
+ export const PatchQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1717
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1718
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1719
+ queueName: Schema.optional(Schema.String),
1720
+ settings: Schema.optional(
1721
+ Schema.Struct({
1722
+ deliveryDelay: Schema.optional(Schema.Number),
1723
+ deliveryPaused: Schema.optional(Schema.Boolean),
1724
+ messageRetentionPeriod: Schema.optional(Schema.Number),
1725
+ }).pipe(
1726
+ Schema.encodeKeys({
1727
+ deliveryDelay: "delivery_delay",
1728
+ deliveryPaused: "delivery_paused",
1729
+ messageRetentionPeriod: "message_retention_period",
1730
+ }),
1731
+ ),
1732
+ ),
1733
+ }).pipe(
1734
+ Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
1735
+ T.Http({ method: "PATCH", path: "/accounts/{account_id}/queues/{queueId}" }),
1736
+ ) as unknown as Schema.Schema<PatchQueueRequest>;
1737
+
1738
+ export interface PatchQueueResponse {
1739
+ consumers?: unknown[] | null;
1740
+ consumersTotalCount?: number | null;
1741
+ createdOn?: string | null;
1742
+ modifiedOn?: string | null;
1743
+ producers?:
1744
+ | (
1745
+ | { script?: string | null; type?: "worker" | null }
1746
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1747
+ )[]
1748
+ | null;
1749
+ producersTotalCount?: number | null;
1750
+ queueId?: string | null;
1751
+ queueName?: string | null;
1752
+ settings?: {
1753
+ deliveryDelay?: number | null;
1754
+ deliveryPaused?: boolean | null;
1755
+ messageRetentionPeriod?: number | null;
1756
+ } | null;
1757
+ }
1758
+
1759
+ export const PatchQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1760
+ consumers: Schema.optional(
1761
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1762
+ ),
1763
+ consumersTotalCount: Schema.optional(
1764
+ Schema.Union([Schema.Number, Schema.Null]),
1765
+ ),
1766
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1767
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1768
+ producers: Schema.optional(
1769
+ Schema.Union([
1770
+ Schema.Array(
1771
+ Schema.Union([
1772
+ Schema.Struct({
1773
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1774
+ type: Schema.optional(
1775
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1776
+ ),
1777
+ }),
1778
+ Schema.Struct({
1779
+ bucketName: Schema.optional(
1780
+ Schema.Union([Schema.String, Schema.Null]),
1781
+ ),
1782
+ type: Schema.optional(
1783
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1784
+ ),
1785
+ }).pipe(
1786
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1787
+ ),
1788
+ ]),
1789
+ ),
1790
+ Schema.Null,
1791
+ ]),
1792
+ ),
1793
+ producersTotalCount: Schema.optional(
1794
+ Schema.Union([Schema.Number, Schema.Null]),
1795
+ ),
1796
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1797
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1798
+ settings: Schema.optional(
1799
+ Schema.Union([
1800
+ Schema.Struct({
1801
+ deliveryDelay: Schema.optional(
1802
+ Schema.Union([Schema.Number, Schema.Null]),
1803
+ ),
1804
+ deliveryPaused: Schema.optional(
1805
+ Schema.Union([Schema.Boolean, Schema.Null]),
1806
+ ),
1807
+ messageRetentionPeriod: Schema.optional(
1808
+ Schema.Union([Schema.Number, Schema.Null]),
1809
+ ),
1810
+ }).pipe(
1811
+ Schema.encodeKeys({
1812
+ deliveryDelay: "delivery_delay",
1813
+ deliveryPaused: "delivery_paused",
1814
+ messageRetentionPeriod: "message_retention_period",
1815
+ }),
1816
+ ),
1817
+ Schema.Null,
1818
+ ]),
1819
+ ),
1820
+ }).pipe(
1821
+ Schema.encodeKeys({
1822
+ consumers: "consumers",
1823
+ consumersTotalCount: "consumers_total_count",
1824
+ createdOn: "created_on",
1825
+ modifiedOn: "modified_on",
1826
+ producers: "producers",
1827
+ producersTotalCount: "producers_total_count",
1828
+ queueId: "queue_id",
1829
+ queueName: "queue_name",
1830
+ settings: "settings",
1831
+ }),
1832
+ ) as unknown as Schema.Schema<PatchQueueResponse>;
1833
+
1834
+ export type PatchQueueError = DefaultErrors;
1835
+
1836
+ export const patchQueue: API.OperationMethod<
1837
+ PatchQueueRequest,
1838
+ PatchQueueResponse,
1839
+ PatchQueueError,
1840
+ Credentials | HttpClient.HttpClient
1841
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1842
+ input: PatchQueueRequest,
1843
+ output: PatchQueueResponse,
1844
+ errors: [],
1845
+ }));
1846
+
1847
+ export interface DeleteQueueRequest {
1848
+ queueId: string;
1849
+ /** A Resource identifier. */
1850
+ accountId: string;
1851
+ }
1852
+
1853
+ export const DeleteQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1854
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
1855
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1856
+ }).pipe(
1857
+ T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}" }),
1858
+ ) as unknown as Schema.Schema<DeleteQueueRequest>;
1859
+
1860
+ export interface DeleteQueueResponse {
1861
+ errors?: unknown[] | null;
1862
+ messages?: string[] | null;
1863
+ /** Indicates if the API call was successful or not. */
1864
+ success?: true | null;
1865
+ }
1866
+
1867
+ export const DeleteQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1868
+ errors: Schema.optional(
1869
+ Schema.Union([Schema.Array(Schema.Unknown), Schema.Null]),
1870
+ ),
1871
+ messages: Schema.optional(
1872
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1873
+ ),
1874
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
1875
+ }) as unknown as Schema.Schema<DeleteQueueResponse>;
1876
+
1877
+ export type DeleteQueueError = DefaultErrors;
1878
+
1879
+ export const deleteQueue: API.OperationMethod<
1880
+ DeleteQueueRequest,
1881
+ DeleteQueueResponse,
1882
+ DeleteQueueError,
1883
+ Credentials | HttpClient.HttpClient
1884
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1885
+ input: DeleteQueueRequest,
1886
+ output: DeleteQueueResponse,
1887
+ errors: [],
1888
+ }));
1889
+
1890
+ // =============================================================================
1891
+ // Subscription
1892
+ // =============================================================================
1893
+
1894
+ export interface GetSubscriptionRequest {
1895
+ subscriptionId: string;
1896
+ /** A Resource identifier. */
1897
+ accountId: string;
1898
+ }
1899
+
1900
+ export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
1901
+ {
1902
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1903
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1904
+ },
1905
+ ).pipe(
1906
+ T.Http({
1907
+ method: "GET",
1908
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
1909
+ }),
1910
+ ) as unknown as Schema.Schema<GetSubscriptionRequest>;
1911
+
1912
+ export interface GetSubscriptionResponse {
1913
+ /** Unique identifier for the subscription */
1914
+ id: string;
1915
+ /** When the subscription was created */
1916
+ createdAt: string;
1917
+ /** Destination configuration for the subscription */
1918
+ destination: { queueId: string; type: "queues.queue" };
1919
+ /** Whether the subscription is active */
1920
+ enabled: boolean;
1921
+ /** List of event types this subscription handles */
1922
+ events: string[];
1923
+ /** When the subscription was last modified */
1924
+ modifiedAt: string;
1925
+ /** Name of the subscription */
1926
+ name: string;
1927
+ /** Source configuration for the subscription */
1928
+ source:
1929
+ | { type?: "images" | null }
1930
+ | { type?: "kv" | null }
1931
+ | { type?: "r2" | null }
1932
+ | { type?: "superSlurper" | null }
1933
+ | { type?: "vectorize" | null }
1934
+ | { modelName?: string | null; type?: "workersAi.model" | null }
1935
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
1936
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
1937
+ }
1938
+
1939
+ export const GetSubscriptionResponse =
1940
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1941
+ id: Schema.String,
1942
+ createdAt: Schema.String,
1943
+ destination: Schema.Struct({
1944
+ queueId: Schema.String,
1945
+ type: Schema.Literal("queues.queue"),
1946
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1947
+ enabled: Schema.Boolean,
1948
+ events: Schema.Array(Schema.String),
1949
+ modifiedAt: Schema.String,
1950
+ name: Schema.String,
1951
+ source: Schema.Union([
1952
+ Schema.Struct({
1953
+ type: Schema.optional(
1954
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
1955
+ ),
1956
+ }),
1957
+ Schema.Struct({
1958
+ type: Schema.optional(
1959
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
1960
+ ),
1961
+ }),
1962
+ Schema.Struct({
1963
+ type: Schema.optional(
1964
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
1965
+ ),
1966
+ }),
1967
+ Schema.Struct({
1968
+ type: Schema.optional(
1969
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
1970
+ ),
1971
+ }),
1972
+ Schema.Struct({
1973
+ type: Schema.optional(
1974
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
1975
+ ),
1976
+ }),
1977
+ Schema.Struct({
1978
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1979
+ type: Schema.optional(
1980
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
1981
+ ),
1982
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
1983
+ Schema.Struct({
1984
+ type: Schema.optional(
1985
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
1986
+ ),
1987
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1988
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
1989
+ Schema.Struct({
1990
+ type: Schema.optional(
1991
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
1992
+ ),
1993
+ workflowName: Schema.optional(
1994
+ Schema.Union([Schema.String, Schema.Null]),
1995
+ ),
1996
+ }).pipe(
1997
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
1998
+ ),
1999
+ ]),
2000
+ }).pipe(
2001
+ Schema.encodeKeys({
2002
+ id: "id",
2003
+ createdAt: "created_at",
2004
+ destination: "destination",
2005
+ enabled: "enabled",
2006
+ events: "events",
2007
+ modifiedAt: "modified_at",
2008
+ name: "name",
2009
+ source: "source",
2010
+ }),
2011
+ ) as unknown as Schema.Schema<GetSubscriptionResponse>;
2012
+
2013
+ export type GetSubscriptionError = DefaultErrors | UnrecognizedEventType;
2014
+
2015
+ export const getSubscription: API.OperationMethod<
2016
+ GetSubscriptionRequest,
2017
+ GetSubscriptionResponse,
2018
+ GetSubscriptionError,
2019
+ Credentials | HttpClient.HttpClient
2020
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2021
+ input: GetSubscriptionRequest,
2022
+ output: GetSubscriptionResponse,
2023
+ errors: [UnrecognizedEventType],
2024
+ }));
2025
+
2026
+ export interface ListSubscriptionsRequest {
2027
+ /** Path param: A Resource identifier. */
2028
+ accountId: string;
2029
+ /** Query param: Sort direction */
2030
+ direction?: "asc" | "desc";
2031
+ /** Query param: Field to sort by */
2032
+ order?: "created_at" | "name" | "enabled" | "source";
2033
+ }
2034
+
2035
+ export const ListSubscriptionsRequest =
2036
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2037
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2038
+ direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
2039
+ T.HttpQuery("direction"),
2040
+ ),
2041
+ order: Schema.optional(
2042
+ Schema.Literals(["created_at", "name", "enabled", "source"]),
2043
+ ).pipe(T.HttpQuery("order")),
2044
+ }).pipe(
2045
+ T.Http({
2046
+ method: "GET",
2047
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions",
2048
+ }),
2049
+ ) as unknown as Schema.Schema<ListSubscriptionsRequest>;
2050
+
2051
+ export type ListSubscriptionsResponse = {
2052
+ id: string;
2053
+ createdAt: string;
2054
+ destination: { queueId: string; type: "queues.queue" };
2055
+ enabled: boolean;
2056
+ events: string[];
2057
+ modifiedAt: string;
2058
+ name: string;
2059
+ source:
2060
+ | { type?: "images" | null }
2061
+ | { type?: "kv" | null }
2062
+ | { type?: "r2" | null }
2063
+ | { type?: "superSlurper" | null }
2064
+ | { type?: "vectorize" | null }
2065
+ | { modelName?: string | null; type?: "workersAi.model" | null }
2066
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
2067
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
2068
+ }[];
2069
+
2070
+ export const ListSubscriptionsResponse =
2071
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
2072
+ Schema.Struct({
2073
+ id: Schema.String,
2074
+ createdAt: Schema.String,
2075
+ destination: Schema.Struct({
2076
+ queueId: Schema.String,
2077
+ type: Schema.Literal("queues.queue"),
2078
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2079
+ enabled: Schema.Boolean,
2080
+ events: Schema.Array(Schema.String),
2081
+ modifiedAt: Schema.String,
2082
+ name: Schema.String,
2083
+ source: Schema.Union([
2084
+ Schema.Struct({
2085
+ type: Schema.optional(
2086
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
2087
+ ),
2088
+ }),
2089
+ Schema.Struct({
2090
+ type: Schema.optional(
2091
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
2092
+ ),
2093
+ }),
2094
+ Schema.Struct({
2095
+ type: Schema.optional(
2096
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
2097
+ ),
2098
+ }),
2099
+ Schema.Struct({
2100
+ type: Schema.optional(
2101
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
2102
+ ),
2103
+ }),
2104
+ Schema.Struct({
2105
+ type: Schema.optional(
2106
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
2107
+ ),
2108
+ }),
2109
+ Schema.Struct({
2110
+ modelName: Schema.optional(
2111
+ Schema.Union([Schema.String, Schema.Null]),
2112
+ ),
2113
+ type: Schema.optional(
2114
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
2115
+ ),
2116
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
2117
+ Schema.Struct({
2118
+ type: Schema.optional(
2119
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
2120
+ ),
2121
+ workerName: Schema.optional(
2122
+ Schema.Union([Schema.String, Schema.Null]),
2123
+ ),
2124
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
2125
+ Schema.Struct({
2126
+ type: Schema.optional(
2127
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
2128
+ ),
2129
+ workflowName: Schema.optional(
2130
+ Schema.Union([Schema.String, Schema.Null]),
2131
+ ),
2132
+ }).pipe(
2133
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
2134
+ ),
2135
+ ]),
2136
+ }).pipe(
2137
+ Schema.encodeKeys({
2138
+ id: "id",
2139
+ createdAt: "created_at",
2140
+ destination: "destination",
2141
+ enabled: "enabled",
2142
+ events: "events",
2143
+ modifiedAt: "modified_at",
2144
+ name: "name",
2145
+ source: "source",
2146
+ }),
2147
+ ),
2148
+ ) as unknown as Schema.Schema<ListSubscriptionsResponse>;
2149
+
2150
+ export type ListSubscriptionsError = DefaultErrors;
2151
+
2152
+ export const listSubscriptions: API.OperationMethod<
2153
+ ListSubscriptionsRequest,
2154
+ ListSubscriptionsResponse,
2155
+ ListSubscriptionsError,
2156
+ Credentials | HttpClient.HttpClient
2157
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2158
+ input: ListSubscriptionsRequest,
2159
+ output: ListSubscriptionsResponse,
2160
+ errors: [],
2161
+ }));
2162
+
2163
+ export interface CreateSubscriptionRequest {
2164
+ /** Path param: A Resource identifier. */
2165
+ accountId: string;
2166
+ /** Body param: Destination configuration for the subscription */
2167
+ destination?: { queueId: string; type: "queues.queue" };
2168
+ /** Body param: Whether the subscription is active */
2169
+ enabled?: boolean;
2170
+ /** Body param: List of event types this subscription handles */
2171
+ events?: string[];
2172
+ /** Body param: Name of the subscription */
2173
+ name?: string;
2174
+ /** Body param: Source configuration for the subscription */
2175
+ source?:
2176
+ | { type?: "images" }
2177
+ | { type?: "kv" }
2178
+ | { type?: "r2" }
2179
+ | { type?: "superSlurper" }
2180
+ | { type?: "vectorize" }
2181
+ | { modelName?: string; type?: "workersAi.model" }
2182
+ | { type?: "workersBuilds.worker"; workerName?: string }
2183
+ | { type?: "workflows.workflow"; workflowName?: string };
2184
+ }
2185
+
2186
+ export const CreateSubscriptionRequest =
2187
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2188
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2189
+ destination: Schema.optional(
2190
+ Schema.Struct({
2191
+ queueId: Schema.String,
2192
+ type: Schema.Literal("queues.queue"),
2193
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2194
+ ),
2195
+ enabled: Schema.optional(Schema.Boolean),
2196
+ events: Schema.optional(Schema.Array(Schema.String)),
2197
+ name: Schema.optional(Schema.String),
2198
+ source: Schema.optional(
2199
+ Schema.Union([
2200
+ Schema.Struct({
2201
+ type: Schema.optional(Schema.Literal("images")),
2202
+ }),
2203
+ Schema.Struct({
2204
+ type: Schema.optional(Schema.Literal("kv")),
2205
+ }),
2206
+ Schema.Struct({
2207
+ type: Schema.optional(Schema.Literal("r2")),
2208
+ }),
2209
+ Schema.Struct({
2210
+ type: Schema.optional(Schema.Literal("superSlurper")),
2211
+ }),
2212
+ Schema.Struct({
2213
+ type: Schema.optional(Schema.Literal("vectorize")),
2214
+ }),
2215
+ Schema.Struct({
2216
+ modelName: Schema.optional(Schema.String),
2217
+ type: Schema.optional(Schema.Literal("workersAi.model")),
2218
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
2219
+ Schema.Struct({
2220
+ type: Schema.optional(Schema.Literal("workersBuilds.worker")),
2221
+ workerName: Schema.optional(Schema.String),
2222
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
2223
+ Schema.Struct({
2224
+ type: Schema.optional(Schema.Literal("workflows.workflow")),
2225
+ workflowName: Schema.optional(Schema.String),
2226
+ }).pipe(
2227
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
2228
+ ),
2229
+ ]),
2230
+ ),
2231
+ }).pipe(
2232
+ T.Http({
2233
+ method: "POST",
2234
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions",
2235
+ }),
2236
+ ) as unknown as Schema.Schema<CreateSubscriptionRequest>;
2237
+
2238
+ export interface CreateSubscriptionResponse {
2239
+ /** Unique identifier for the subscription */
2240
+ id: string;
2241
+ /** When the subscription was created */
2242
+ createdAt: string;
2243
+ /** Destination configuration for the subscription */
2244
+ destination: { queueId: string; type: "queues.queue" };
2245
+ /** Whether the subscription is active */
2246
+ enabled: boolean;
2247
+ /** List of event types this subscription handles */
2248
+ events: string[];
2249
+ /** When the subscription was last modified */
2250
+ modifiedAt: string;
2251
+ /** Name of the subscription */
2252
+ name: string;
2253
+ /** Source configuration for the subscription */
2254
+ source:
2255
+ | { type?: "images" | null }
2256
+ | { type?: "kv" | null }
2257
+ | { type?: "r2" | null }
2258
+ | { type?: "superSlurper" | null }
2259
+ | { type?: "vectorize" | null }
2260
+ | { modelName?: string | null; type?: "workersAi.model" | null }
2261
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
2262
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
2263
+ }
2264
+
2265
+ export const CreateSubscriptionResponse =
2266
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2267
+ id: Schema.String,
2268
+ createdAt: Schema.String,
2269
+ destination: Schema.Struct({
2270
+ queueId: Schema.String,
2271
+ type: Schema.Literal("queues.queue"),
2272
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2273
+ enabled: Schema.Boolean,
2274
+ events: Schema.Array(Schema.String),
2275
+ modifiedAt: Schema.String,
2276
+ name: Schema.String,
2277
+ source: Schema.Union([
2278
+ Schema.Struct({
2279
+ type: Schema.optional(
2280
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
2281
+ ),
2282
+ }),
2283
+ Schema.Struct({
2284
+ type: Schema.optional(
2285
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
2286
+ ),
2287
+ }),
2288
+ Schema.Struct({
2289
+ type: Schema.optional(
2290
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
2291
+ ),
2292
+ }),
2293
+ Schema.Struct({
2294
+ type: Schema.optional(
2295
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
2296
+ ),
2297
+ }),
2298
+ Schema.Struct({
2299
+ type: Schema.optional(
2300
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
2301
+ ),
2302
+ }),
2303
+ Schema.Struct({
2304
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2305
+ type: Schema.optional(
2306
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
2307
+ ),
2308
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
2309
+ Schema.Struct({
2310
+ type: Schema.optional(
2311
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
2312
+ ),
2313
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2314
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
2315
+ Schema.Struct({
2316
+ type: Schema.optional(
2317
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
2318
+ ),
2319
+ workflowName: Schema.optional(
2320
+ Schema.Union([Schema.String, Schema.Null]),
2321
+ ),
2322
+ }).pipe(
2323
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
2324
+ ),
2325
+ ]),
2326
+ }).pipe(
2327
+ Schema.encodeKeys({
2328
+ id: "id",
2329
+ createdAt: "created_at",
2330
+ destination: "destination",
2331
+ enabled: "enabled",
2332
+ events: "events",
2333
+ modifiedAt: "modified_at",
2334
+ name: "name",
2335
+ source: "source",
2336
+ }),
2337
+ ) as unknown as Schema.Schema<CreateSubscriptionResponse>;
2338
+
2339
+ export type CreateSubscriptionError = DefaultErrors | UnrecognizedEventType;
2340
+
2341
+ export const createSubscription: API.OperationMethod<
2342
+ CreateSubscriptionRequest,
2343
+ CreateSubscriptionResponse,
2344
+ CreateSubscriptionError,
2345
+ Credentials | HttpClient.HttpClient
2346
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2347
+ input: CreateSubscriptionRequest,
2348
+ output: CreateSubscriptionResponse,
2349
+ errors: [UnrecognizedEventType],
2350
+ }));
2351
+
2352
+ export interface PatchSubscriptionRequest {
2353
+ subscriptionId: string;
2354
+ /** Path param: A Resource identifier. */
2355
+ accountId: string;
2356
+ /** Body param: Destination configuration for the subscription */
2357
+ destination?: { queueId: string; type: "queues.queue" };
2358
+ /** Body param: Whether the subscription is active */
2359
+ enabled?: boolean;
2360
+ /** Body param: List of event types this subscription handles */
2361
+ events?: string[];
2362
+ /** Body param: Name of the subscription */
2363
+ name?: string;
2364
+ }
2365
+
2366
+ export const PatchSubscriptionRequest =
2367
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2368
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
2369
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2370
+ destination: Schema.optional(
2371
+ Schema.Struct({
2372
+ queueId: Schema.String,
2373
+ type: Schema.Literal("queues.queue"),
2374
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2375
+ ),
2376
+ enabled: Schema.optional(Schema.Boolean),
2377
+ events: Schema.optional(Schema.Array(Schema.String)),
2378
+ name: Schema.optional(Schema.String),
2379
+ }).pipe(
2380
+ T.Http({
2381
+ method: "PATCH",
2382
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
2383
+ }),
2384
+ ) as unknown as Schema.Schema<PatchSubscriptionRequest>;
2385
+
2386
+ export interface PatchSubscriptionResponse {
2387
+ /** Unique identifier for the subscription */
2388
+ id: string;
2389
+ /** When the subscription was created */
2390
+ createdAt: string;
2391
+ /** Destination configuration for the subscription */
2392
+ destination: { queueId: string; type: "queues.queue" };
2393
+ /** Whether the subscription is active */
2394
+ enabled: boolean;
2395
+ /** List of event types this subscription handles */
2396
+ events: string[];
2397
+ /** When the subscription was last modified */
2398
+ modifiedAt: string;
2399
+ /** Name of the subscription */
2400
+ name: string;
2401
+ /** Source configuration for the subscription */
2402
+ source:
2403
+ | { type?: "images" | null }
2404
+ | { type?: "kv" | null }
2405
+ | { type?: "r2" | null }
2406
+ | { type?: "superSlurper" | null }
2407
+ | { type?: "vectorize" | null }
2408
+ | { modelName?: string | null; type?: "workersAi.model" | null }
2409
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
2410
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
2411
+ }
2412
+
2413
+ export const PatchSubscriptionResponse =
2414
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2415
+ id: Schema.String,
2416
+ createdAt: Schema.String,
2417
+ destination: Schema.Struct({
2418
+ queueId: Schema.String,
2419
+ type: Schema.Literal("queues.queue"),
2420
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2421
+ enabled: Schema.Boolean,
2422
+ events: Schema.Array(Schema.String),
2423
+ modifiedAt: Schema.String,
2424
+ name: Schema.String,
2425
+ source: Schema.Union([
2426
+ Schema.Struct({
2427
+ type: Schema.optional(
2428
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
2429
+ ),
2430
+ }),
2431
+ Schema.Struct({
2432
+ type: Schema.optional(
2433
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
2434
+ ),
2435
+ }),
2436
+ Schema.Struct({
2437
+ type: Schema.optional(
2438
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
2439
+ ),
2440
+ }),
2441
+ Schema.Struct({
2442
+ type: Schema.optional(
2443
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
2444
+ ),
2445
+ }),
2446
+ Schema.Struct({
2447
+ type: Schema.optional(
2448
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
2449
+ ),
2450
+ }),
2451
+ Schema.Struct({
2452
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2453
+ type: Schema.optional(
2454
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
2455
+ ),
2456
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
2457
+ Schema.Struct({
2458
+ type: Schema.optional(
2459
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
2460
+ ),
2461
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2462
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
2463
+ Schema.Struct({
2464
+ type: Schema.optional(
2465
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
2466
+ ),
2467
+ workflowName: Schema.optional(
2468
+ Schema.Union([Schema.String, Schema.Null]),
2469
+ ),
2470
+ }).pipe(
2471
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
2472
+ ),
2473
+ ]),
2474
+ }).pipe(
2475
+ Schema.encodeKeys({
2476
+ id: "id",
2477
+ createdAt: "created_at",
2478
+ destination: "destination",
2479
+ enabled: "enabled",
2480
+ events: "events",
2481
+ modifiedAt: "modified_at",
2482
+ name: "name",
2483
+ source: "source",
2484
+ }),
2485
+ ) as unknown as Schema.Schema<PatchSubscriptionResponse>;
2486
+
2487
+ export type PatchSubscriptionError = DefaultErrors | UnrecognizedEventType;
2488
+
2489
+ export const patchSubscription: API.OperationMethod<
2490
+ PatchSubscriptionRequest,
2491
+ PatchSubscriptionResponse,
2492
+ PatchSubscriptionError,
2493
+ Credentials | HttpClient.HttpClient
2494
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2495
+ input: PatchSubscriptionRequest,
2496
+ output: PatchSubscriptionResponse,
2497
+ errors: [UnrecognizedEventType],
2498
+ }));
2499
+
2500
+ export interface DeleteSubscriptionRequest {
2501
+ subscriptionId: string;
2502
+ /** A Resource identifier. */
2503
+ accountId: string;
2504
+ }
2505
+
2506
+ export const DeleteSubscriptionRequest =
2507
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2508
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
2509
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2510
+ }).pipe(
2511
+ T.Http({
2512
+ method: "DELETE",
2513
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
2514
+ }),
2515
+ ) as unknown as Schema.Schema<DeleteSubscriptionRequest>;
2516
+
2517
+ export interface DeleteSubscriptionResponse {
2518
+ /** Unique identifier for the subscription */
2519
+ id: string;
2520
+ /** When the subscription was created */
2521
+ createdAt: string;
2522
+ /** Destination configuration for the subscription */
2523
+ destination: { queueId: string; type: "queues.queue" };
2524
+ /** Whether the subscription is active */
2525
+ enabled: boolean;
2526
+ /** List of event types this subscription handles */
2527
+ events: string[];
2528
+ /** When the subscription was last modified */
2529
+ modifiedAt: string;
2530
+ /** Name of the subscription */
2531
+ name: string;
2532
+ /** Source configuration for the subscription */
2533
+ source:
2534
+ | { type?: "images" | null }
2535
+ | { type?: "kv" | null }
2536
+ | { type?: "r2" | null }
2537
+ | { type?: "superSlurper" | null }
2538
+ | { type?: "vectorize" | null }
2539
+ | { modelName?: string | null; type?: "workersAi.model" | null }
2540
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
2541
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
2542
+ }
2543
+
2544
+ export const DeleteSubscriptionResponse =
2545
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2546
+ id: Schema.String,
2547
+ createdAt: Schema.String,
2548
+ destination: Schema.Struct({
2549
+ queueId: Schema.String,
2550
+ type: Schema.Literal("queues.queue"),
2551
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
2552
+ enabled: Schema.Boolean,
2553
+ events: Schema.Array(Schema.String),
2554
+ modifiedAt: Schema.String,
2555
+ name: Schema.String,
2556
+ source: Schema.Union([
2557
+ Schema.Struct({
2558
+ type: Schema.optional(
2559
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
2560
+ ),
2561
+ }),
2562
+ Schema.Struct({
2563
+ type: Schema.optional(
2564
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
2565
+ ),
2566
+ }),
2567
+ Schema.Struct({
2568
+ type: Schema.optional(
2569
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
2570
+ ),
2571
+ }),
2572
+ Schema.Struct({
2573
+ type: Schema.optional(
2574
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
2575
+ ),
2576
+ }),
2577
+ Schema.Struct({
2578
+ type: Schema.optional(
2579
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
2580
+ ),
2581
+ }),
2582
+ Schema.Struct({
2583
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2584
+ type: Schema.optional(
2585
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
2586
+ ),
2587
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
2588
+ Schema.Struct({
2589
+ type: Schema.optional(
2590
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
2591
+ ),
2592
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2593
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
2594
+ Schema.Struct({
2595
+ type: Schema.optional(
2596
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
2597
+ ),
2598
+ workflowName: Schema.optional(
2599
+ Schema.Union([Schema.String, Schema.Null]),
2600
+ ),
2601
+ }).pipe(
2602
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
2603
+ ),
2604
+ ]),
2605
+ }).pipe(
2606
+ Schema.encodeKeys({
2607
+ id: "id",
2608
+ createdAt: "created_at",
2609
+ destination: "destination",
2610
+ enabled: "enabled",
2611
+ events: "events",
2612
+ modifiedAt: "modified_at",
2613
+ name: "name",
2614
+ source: "source",
2615
+ }),
2616
+ ) as unknown as Schema.Schema<DeleteSubscriptionResponse>;
2617
+
2618
+ export type DeleteSubscriptionError = DefaultErrors | UnrecognizedEventType;
2619
+
2620
+ export const deleteSubscription: API.OperationMethod<
2621
+ DeleteSubscriptionRequest,
2622
+ DeleteSubscriptionResponse,
2623
+ DeleteSubscriptionError,
2624
+ Credentials | HttpClient.HttpClient
2625
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2626
+ input: DeleteSubscriptionRequest,
2627
+ output: DeleteSubscriptionResponse,
2628
+ errors: [UnrecognizedEventType],
2629
+ }));