@distilled.cloud/cloudflare 0.0.0-john

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