gemi 0.126.0 → 0.128.0

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 (230) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/bun/plugin.js +1 -1
  5. package/dist/bun/preload.js +1 -1
  6. package/dist/{chunk-bghxdjqv.js → chunk-03wc6em7.js} +1 -1
  7. package/dist/{chunk-56ryda9y.js → chunk-0m2fyw7g.js} +2 -2
  8. package/dist/{chunk-56ryda9y.js.map → chunk-0m2fyw7g.js.map} +1 -1
  9. package/dist/chunk-0mp9tck6.js +120 -0
  10. package/dist/{chunk-cwpezdpw.js.map → chunk-0mp9tck6.js.map} +9 -4
  11. package/dist/{chunk-ecb8qggy.js → chunk-0vxwrc4t.js} +2 -2
  12. package/dist/{chunk-ecb8qggy.js.map → chunk-0vxwrc4t.js.map} +1 -1
  13. package/dist/{chunk-1v368y9a.js → chunk-1gdzajwb.js} +2 -2
  14. package/dist/{chunk-1v368y9a.js.map → chunk-1gdzajwb.js.map} +1 -1
  15. package/dist/{chunk-h4755p9h.js → chunk-1rq53cb0.js} +2 -2
  16. package/dist/{chunk-h4755p9h.js.map → chunk-1rq53cb0.js.map} +1 -1
  17. package/dist/{chunk-v7nw1g2n.js → chunk-1yttk239.js} +2 -2
  18. package/dist/{chunk-v7nw1g2n.js.map → chunk-1yttk239.js.map} +1 -1
  19. package/dist/{chunk-28bby5pp.js → chunk-1z311hyj.js} +2 -2
  20. package/dist/{chunk-28bby5pp.js.map → chunk-1z311hyj.js.map} +1 -1
  21. package/dist/{chunk-n8mxsfc2.js → chunk-2869cbhd.js} +3 -3
  22. package/dist/{chunk-n8mxsfc2.js.map → chunk-2869cbhd.js.map} +1 -1
  23. package/dist/{chunk-dm7mada7.js → chunk-2bmk0fzm.js} +3 -3
  24. package/dist/{chunk-dm7mada7.js.map → chunk-2bmk0fzm.js.map} +1 -1
  25. package/dist/{chunk-ych1dv5q.js → chunk-2epj17ac.js} +3 -3
  26. package/dist/{chunk-ych1dv5q.js.map → chunk-2epj17ac.js.map} +1 -1
  27. package/dist/{chunk-0arss2xy.js → chunk-2z1gd231.js} +2 -2
  28. package/dist/{chunk-0arss2xy.js.map → chunk-2z1gd231.js.map} +1 -1
  29. package/dist/{chunk-xe2cfmyb.js → chunk-3dyd4z06.js} +2 -2
  30. package/dist/{chunk-xe2cfmyb.js.map → chunk-3dyd4z06.js.map} +1 -1
  31. package/dist/{chunk-p0ccxfkq.js → chunk-43vjbd6n.js} +1 -1
  32. package/dist/{chunk-nv2t87c3.js → chunk-4yp84g2y.js} +2 -2
  33. package/dist/{chunk-nv2t87c3.js.map → chunk-4yp84g2y.js.map} +1 -1
  34. package/dist/{chunk-bhbxhk9e.js → chunk-5bk7767a.js} +2 -2
  35. package/dist/{chunk-bhbxhk9e.js.map → chunk-5bk7767a.js.map} +1 -1
  36. package/dist/{chunk-k6gvbvyw.js → chunk-5nkvpc0a.js} +1 -1
  37. package/dist/{chunk-gxp48t81.js → chunk-5ym464xx.js} +4 -4
  38. package/dist/{chunk-gxp48t81.js.map → chunk-5ym464xx.js.map} +1 -1
  39. package/dist/{chunk-v80890xx.js → chunk-7321qjgb.js} +3 -3
  40. package/dist/{chunk-v80890xx.js.map → chunk-7321qjgb.js.map} +1 -1
  41. package/dist/{chunk-0f0xxqhy.js → chunk-87rtxv9n.js} +3 -3
  42. package/dist/{chunk-0f0xxqhy.js.map → chunk-87rtxv9n.js.map} +1 -1
  43. package/dist/{chunk-avfntxm1.js → chunk-8jqve5dr.js} +2 -2
  44. package/dist/{chunk-avfntxm1.js.map → chunk-8jqve5dr.js.map} +1 -1
  45. package/dist/{chunk-5vvfcdpk.js → chunk-9122838b.js} +2 -2
  46. package/dist/{chunk-5vvfcdpk.js.map → chunk-9122838b.js.map} +1 -1
  47. package/dist/{chunk-jg3kg55f.js → chunk-9701fx4z.js} +2 -2
  48. package/dist/{chunk-jg3kg55f.js.map → chunk-9701fx4z.js.map} +1 -1
  49. package/dist/{chunk-mj7h1dgh.js → chunk-b7wmssj5.js} +2 -2
  50. package/dist/{chunk-mj7h1dgh.js.map → chunk-b7wmssj5.js.map} +1 -1
  51. package/dist/{chunk-etf6h5m1.js → chunk-bg5qb9hm.js} +2 -2
  52. package/dist/{chunk-etf6h5m1.js.map → chunk-bg5qb9hm.js.map} +1 -1
  53. package/dist/{chunk-w4111j5d.js → chunk-bnp6wpzd.js} +2 -2
  54. package/dist/{chunk-w4111j5d.js.map → chunk-bnp6wpzd.js.map} +1 -1
  55. package/dist/{chunk-yg8se4vs.js → chunk-cp84b0ev.js} +3 -3
  56. package/dist/{chunk-yg8se4vs.js.map → chunk-cp84b0ev.js.map} +1 -1
  57. package/dist/{chunk-hye22tpt.js → chunk-dak8txaw.js} +2 -2
  58. package/dist/{chunk-hye22tpt.js.map → chunk-dak8txaw.js.map} +1 -1
  59. package/dist/{chunk-zy5gxk1g.js → chunk-df0mekds.js} +2 -2
  60. package/dist/{chunk-zy5gxk1g.js.map → chunk-df0mekds.js.map} +1 -1
  61. package/dist/{chunk-7x2n788t.js → chunk-er5ed5pg.js} +3 -3
  62. package/dist/{chunk-7x2n788t.js.map → chunk-er5ed5pg.js.map} +1 -1
  63. package/dist/{chunk-s2y2b8tz.js → chunk-f8ce6e9c.js} +2 -2
  64. package/dist/{chunk-s2y2b8tz.js.map → chunk-f8ce6e9c.js.map} +1 -1
  65. package/dist/{chunk-7eerqsg2.js → chunk-fezaxj28.js} +2 -2
  66. package/dist/{chunk-7eerqsg2.js.map → chunk-fezaxj28.js.map} +1 -1
  67. package/dist/{chunk-q9mxjh10.js → chunk-fv53h1q2.js} +2 -2
  68. package/dist/{chunk-q9mxjh10.js.map → chunk-fv53h1q2.js.map} +1 -1
  69. package/dist/{chunk-62zn06wb.js → chunk-gpdsxwkt.js} +2 -2
  70. package/dist/{chunk-62zn06wb.js.map → chunk-gpdsxwkt.js.map} +1 -1
  71. package/dist/{chunk-15bmfr7f.js → chunk-gzaaspe7.js} +2 -2
  72. package/dist/{chunk-15bmfr7f.js.map → chunk-gzaaspe7.js.map} +1 -1
  73. package/dist/{chunk-3fyhd641.js → chunk-h55c9bdf.js} +1 -1
  74. package/dist/{chunk-x5vpjzpp.js → chunk-ja41ts8v.js} +2 -2
  75. package/dist/{chunk-x5vpjzpp.js.map → chunk-ja41ts8v.js.map} +1 -1
  76. package/dist/{chunk-1dzs05dc.js → chunk-jcps2gpp.js} +2 -2
  77. package/dist/{chunk-1dzs05dc.js.map → chunk-jcps2gpp.js.map} +1 -1
  78. package/dist/{chunk-psdyfaf1.js → chunk-jm1f9cas.js} +2 -2
  79. package/dist/{chunk-psdyfaf1.js.map → chunk-jm1f9cas.js.map} +1 -1
  80. package/dist/{chunk-99z9d0sa.js → chunk-k107vw69.js} +2 -2
  81. package/dist/{chunk-99z9d0sa.js.map → chunk-k107vw69.js.map} +1 -1
  82. package/dist/{chunk-7dzprr9b.js → chunk-k10vbrjx.js} +3 -3
  83. package/dist/{chunk-7dzprr9b.js.map → chunk-k10vbrjx.js.map} +1 -1
  84. package/dist/{chunk-c48gag78.js → chunk-kmcnfk2s.js} +1 -1
  85. package/dist/{chunk-yffm8nxa.js → chunk-mc8mxx2a.js} +2 -2
  86. package/dist/{chunk-yffm8nxa.js.map → chunk-mc8mxx2a.js.map} +1 -1
  87. package/dist/{chunk-ewv1m1sv.js → chunk-n1t4ea9g.js} +3 -3
  88. package/dist/{chunk-ewv1m1sv.js.map → chunk-n1t4ea9g.js.map} +1 -1
  89. package/dist/{chunk-9hhxy88x.js → chunk-n4dk0dc9.js} +2 -2
  90. package/dist/{chunk-9hhxy88x.js.map → chunk-n4dk0dc9.js.map} +1 -1
  91. package/dist/{chunk-rvdsaqdv.js → chunk-nh9ewam0.js} +1 -1
  92. package/dist/{chunk-84rbdyhe.js → chunk-njaxnv6c.js} +2 -2
  93. package/dist/{chunk-84rbdyhe.js.map → chunk-njaxnv6c.js.map} +1 -1
  94. package/dist/{chunk-7nfprr9v.js → chunk-np73p641.js} +2 -2
  95. package/dist/{chunk-7nfprr9v.js.map → chunk-np73p641.js.map} +1 -1
  96. package/dist/{chunk-87jj7n9q.js → chunk-nvfhx9d1.js} +2 -2
  97. package/dist/{chunk-87jj7n9q.js.map → chunk-nvfhx9d1.js.map} +1 -1
  98. package/dist/{chunk-qmcjh6de.js → chunk-nwzsgzvy.js} +2 -2
  99. package/dist/{chunk-qmcjh6de.js.map → chunk-nwzsgzvy.js.map} +1 -1
  100. package/dist/{chunk-43faxwf5.js → chunk-p528pvmm.js} +2 -2
  101. package/dist/{chunk-43faxwf5.js.map → chunk-p528pvmm.js.map} +1 -1
  102. package/dist/{chunk-kzk5r6v4.js → chunk-peng31np.js} +3 -3
  103. package/dist/{chunk-kzk5r6v4.js.map → chunk-peng31np.js.map} +1 -1
  104. package/dist/{chunk-mj4n5mar.js → chunk-pgddb43b.js} +2 -2
  105. package/dist/{chunk-mj4n5mar.js.map → chunk-pgddb43b.js.map} +1 -1
  106. package/dist/{chunk-s2krqtwj.js → chunk-pgh7gsag.js} +2 -2
  107. package/dist/{chunk-s2krqtwj.js.map → chunk-pgh7gsag.js.map} +1 -1
  108. package/dist/chunk-pqn9j5s8.js +5 -0
  109. package/dist/{chunk-87bmhng2.js.map → chunk-pqn9j5s8.js.map} +1 -1
  110. package/dist/{chunk-m63v6aze.js → chunk-pxsq9841.js} +2 -2
  111. package/dist/{chunk-m63v6aze.js.map → chunk-pxsq9841.js.map} +1 -1
  112. package/dist/{chunk-1eb4p352.js → chunk-py1twqh8.js} +2 -2
  113. package/dist/{chunk-1eb4p352.js.map → chunk-py1twqh8.js.map} +1 -1
  114. package/dist/{chunk-nrf23yan.js → chunk-qjmcn5m5.js} +2 -2
  115. package/dist/{chunk-nrf23yan.js.map → chunk-qjmcn5m5.js.map} +1 -1
  116. package/dist/{chunk-t8kzaxaa.js → chunk-qpwb3gnh.js} +2 -2
  117. package/dist/{chunk-t8kzaxaa.js.map → chunk-qpwb3gnh.js.map} +1 -1
  118. package/dist/{chunk-c65rh4k8.js → chunk-qv8sj2z3.js} +2 -2
  119. package/dist/{chunk-c65rh4k8.js.map → chunk-qv8sj2z3.js.map} +1 -1
  120. package/dist/{chunk-mpt5jg4e.js → chunk-qz0da20r.js} +2 -2
  121. package/dist/{chunk-mpt5jg4e.js.map → chunk-qz0da20r.js.map} +1 -1
  122. package/dist/{chunk-v1eeh7a7.js → chunk-sh39q44t.js} +3 -3
  123. package/dist/{chunk-v1eeh7a7.js.map → chunk-sh39q44t.js.map} +1 -1
  124. package/dist/{chunk-b2pdqxj3.js → chunk-t7gvgz20.js} +3 -3
  125. package/dist/{chunk-b2pdqxj3.js.map → chunk-t7gvgz20.js.map} +1 -1
  126. package/dist/{chunk-ravssmdy.js → chunk-tchte4dv.js} +2 -2
  127. package/dist/{chunk-ravssmdy.js.map → chunk-tchte4dv.js.map} +1 -1
  128. package/dist/{chunk-gv59djt3.js → chunk-tn3y2qkj.js} +2 -2
  129. package/dist/{chunk-gv59djt3.js.map → chunk-tn3y2qkj.js.map} +1 -1
  130. package/dist/{chunk-9x0pgkns.js → chunk-ty5sp1ym.js} +2 -2
  131. package/dist/{chunk-9x0pgkns.js.map → chunk-ty5sp1ym.js.map} +1 -1
  132. package/dist/{chunk-8df7fn7f.js → chunk-v09w6pr2.js} +3 -3
  133. package/dist/{chunk-8df7fn7f.js.map → chunk-v09w6pr2.js.map} +1 -1
  134. package/dist/{chunk-s0kns9q1.js → chunk-vc5kpxdk.js} +3 -3
  135. package/dist/{chunk-s0kns9q1.js.map → chunk-vc5kpxdk.js.map} +1 -1
  136. package/dist/{chunk-1gd1ykgj.js → chunk-vjpby5sf.js} +3 -3
  137. package/dist/{chunk-1gd1ykgj.js.map → chunk-vjpby5sf.js.map} +1 -1
  138. package/dist/{chunk-p7abyc0b.js → chunk-wf3qe12c.js} +2 -2
  139. package/dist/{chunk-p7abyc0b.js.map → chunk-wf3qe12c.js.map} +1 -1
  140. package/dist/{chunk-094m8mj3.js → chunk-wn437678.js} +2 -2
  141. package/dist/{chunk-094m8mj3.js.map → chunk-wn437678.js.map} +1 -1
  142. package/dist/{chunk-rtb64x14.js → chunk-wv3nnq8c.js} +3 -3
  143. package/dist/{chunk-rtb64x14.js.map → chunk-wv3nnq8c.js.map} +1 -1
  144. package/dist/{chunk-wat33wxh.js → chunk-ww86zqbw.js} +2 -2
  145. package/dist/{chunk-wat33wxh.js.map → chunk-ww86zqbw.js.map} +1 -1
  146. package/dist/chunk-wzfvwvz0.js +10 -0
  147. package/dist/{chunk-zbvdkh6q.js.map → chunk-wzfvwvz0.js.map} +5 -4
  148. package/dist/{chunk-ebdkmzm9.js → chunk-x92g4x4w.js} +2 -2
  149. package/dist/{chunk-ebdkmzm9.js.map → chunk-x92g4x4w.js.map} +1 -1
  150. package/dist/{chunk-qy3s6pwz.js → chunk-xhm5wgfe.js} +2 -2
  151. package/dist/{chunk-qy3s6pwz.js.map → chunk-xhm5wgfe.js.map} +1 -1
  152. package/dist/{chunk-89swy5aq.js → chunk-xtnbcbkf.js} +2 -2
  153. package/dist/{chunk-89swy5aq.js.map → chunk-xtnbcbkf.js.map} +1 -1
  154. package/dist/chunks/{ThemeProvider-CS2a1snV.js → ThemeProvider-BIrCSrFY.js} +2 -2
  155. package/dist/chunks/{ThemeProvider-CS2a1snV.js.map → ThemeProvider-BIrCSrFY.js.map} +1 -1
  156. package/dist/client/fetchFile.d.ts +66 -0
  157. package/dist/client/fetchFile.d.ts.map +1 -0
  158. package/dist/client/index.d.ts +3 -1
  159. package/dist/client/index.d.ts.map +1 -1
  160. package/dist/client/index.js +75 -2
  161. package/dist/client/index.js.map +1 -1
  162. package/dist/client/rpc.d.ts +11 -0
  163. package/dist/client/rpc.d.ts.map +1 -1
  164. package/dist/config/index.js +1 -1
  165. package/dist/console/run.js +2 -2
  166. package/dist/console/run.js.map +1 -1
  167. package/dist/container/index.js +2 -2
  168. package/dist/container/index.js.map +1 -1
  169. package/dist/database/index.js +2 -2
  170. package/dist/database/index.js.map +1 -1
  171. package/dist/email/index.js +2 -2
  172. package/dist/email/index.js.map +1 -1
  173. package/dist/facades/Runs.d.ts +64 -0
  174. package/dist/facades/Runs.d.ts.map +1 -0
  175. package/dist/facades/index.d.ts +1 -0
  176. package/dist/facades/index.d.ts.map +1 -1
  177. package/dist/facades/index.js +2 -2
  178. package/dist/facades/index.js.map +1 -1
  179. package/dist/foundation/index.js +2 -2
  180. package/dist/foundation/index.js.map +1 -1
  181. package/dist/gemi.d.ts +4 -0
  182. package/dist/http/ApiRouter.d.ts +40 -3
  183. package/dist/http/ApiRouter.d.ts.map +1 -1
  184. package/dist/http/index.d.ts +1 -1
  185. package/dist/http/index.d.ts.map +1 -1
  186. package/dist/http/index.js +2 -2
  187. package/dist/http/index.js.map +1 -1
  188. package/dist/i18n/dictionaryRuntime.js +2 -2
  189. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  190. package/dist/i18n/index.js +2 -2
  191. package/dist/i18n/index.js.map +1 -1
  192. package/dist/kernel/index.js +3 -3
  193. package/dist/kernel/index.js.map +3 -3
  194. package/dist/kernel/providers.d.ts.map +1 -1
  195. package/dist/orm/index.js +2 -2
  196. package/dist/orm/index.js.map +1 -1
  197. package/dist/server/index.js +2 -2
  198. package/dist/server/index.js.map +1 -1
  199. package/dist/services/index.d.ts +5 -0
  200. package/dist/services/index.d.ts.map +1 -1
  201. package/dist/services/index.js +3 -3
  202. package/dist/services/index.js.map +2 -2
  203. package/dist/services/queue/work.js +2 -2
  204. package/dist/services/queue/work.js.map +1 -1
  205. package/dist/services/runs/DatabaseRunStore.d.ts +62 -0
  206. package/dist/services/runs/DatabaseRunStore.d.ts.map +1 -0
  207. package/dist/services/runs/RunManager.d.ts +200 -0
  208. package/dist/services/runs/RunManager.d.ts.map +1 -0
  209. package/dist/services/runs/RunStore.d.ts +163 -0
  210. package/dist/services/runs/RunStore.d.ts.map +1 -0
  211. package/dist/services/runs/RunsServiceProvider.d.ts +5 -0
  212. package/dist/services/runs/RunsServiceProvider.d.ts.map +1 -0
  213. package/dist/services/runs/config.d.ts +20 -0
  214. package/dist/services/runs/config.d.ts.map +1 -0
  215. package/dist/stats/route-table.js +1 -1
  216. package/dist/support/index.js +2 -2
  217. package/dist/support/index.js.map +1 -1
  218. package/dist/testing/index.js +1 -1
  219. package/dist/vitest/index.js +1 -1
  220. package/package.json +1 -1
  221. package/skills/gemi-react-best-practices/rules/query-no-hand-rolled-fetch.md +14 -0
  222. package/dist/chunk-87bmhng2.js +0 -5
  223. package/dist/chunk-cwpezdpw.js +0 -57
  224. package/dist/chunk-zbvdkh6q.js +0 -10
  225. /package/dist/{chunk-bghxdjqv.js.map → chunk-03wc6em7.js.map} +0 -0
  226. /package/dist/{chunk-p0ccxfkq.js.map → chunk-43vjbd6n.js.map} +0 -0
  227. /package/dist/{chunk-k6gvbvyw.js.map → chunk-5nkvpc0a.js.map} +0 -0
  228. /package/dist/{chunk-3fyhd641.js.map → chunk-h55c9bdf.js.map} +0 -0
  229. /package/dist/{chunk-c48gag78.js.map → chunk-kmcnfk2s.js.map} +0 -0
  230. /package/dist/{chunk-rvdsaqdv.js.map → chunk-nh9ewam0.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{od as R}from"./chunk-t8kzaxaa.js";import{Ed as S,Jd as E,vd as Q}from"./chunk-b2pdqxj3.js";import{sk as K}from"./chunk-yg8se4vs.js";import{Jk as A,Kk as $,Lk as D}from"./chunk-9x0pgkns.js";class j extends Error{code;constructor(q,z=1){super(q);this.code=z;this.name="CommandFailed"}}class J{static commandName="unset";static description="";static args=[];static options=[];run(q){}}function p(q){return q}function C(){return{commands:[],commandsDir:"app/commands"}}var I=Symbol.for("gemi.console.builder");function k(q){if(q.trim()==="")throw Error("A command name cannot be empty.");if(/[{}]/.test(q)||/\s/.test(q))throw Error(`Invalid command name ${JSON.stringify(q)}. gemi does not parse a signature string; the name is the whole of it. Declare arguments with .arg() and flags with .option():
2
+ import{pd as R}from"./chunk-qpwb3gnh.js";import{Fd as S,Kd as E,wd as Q}from"./chunk-t7gvgz20.js";import{Ek as K}from"./chunk-cp84b0ev.js";import{Vk as A,Wk as $,Xk as D}from"./chunk-ty5sp1ym.js";class j extends Error{code;constructor(q,z=1){super(q);this.code=z;this.name="CommandFailed"}}class J{static commandName="unset";static description="";static args=[];static options=[];run(q){}}function p(q){return q}function C(){return{commands:[],commandsDir:"app/commands"}}var I=Symbol.for("gemi.console.builder");function k(q){if(q.trim()==="")throw Error("A command name cannot be empty.");if(/[{}]/.test(q)||/\s/.test(q))throw Error(`Invalid command name ${JSON.stringify(q)}. gemi does not parse a signature string; the name is the whole of it. Declare arguments with .arg() and flags with .option():
3
3
 
4
4
  defineCommand("mail:send")
5
5
  .arg("user", { required: true })
@@ -14,6 +14,6 @@ import{od as R}from"./chunk-t8kzaxaa.js";import{Ed as S,Jd as E,vd as Q}from"./c
14
14
  static event = UserRegistered;
15
15
 
16
16
  If this is an abstract base its subclasses extend, move it out of the `+"listeners directory \u2014 the walk excludes gemi's `Listener` and "+"nothing else, so a base sitting beside its subclasses is registered and run like one of them.")}function v(q){for(let z of q){if(Object.getOwnPropertyDescriptor(z,"name")?.writable)continue;console.warn(`Event listener ${z.name} does not declare \`static name\`, so it is registered under its class name, which a production build renames. Nothing reads that name across a build boundary while the `+"listener is sync, which is why this is a warning \u2014 but adding "+`\`queued = true\` to it is refused at boot for the same reason, because the queue's key is that string. Add: static name = "${z.name}";`)}}function u(q){let z=new Set;for(let{event:F}of q){if(z.has(F))continue;if(Object.getOwnPropertyDescriptor(F,"name")?.writable)continue;z.add(F),console.warn(`Event ${F.name} does not declare \`static name\`, so it is dispatched under its class name. A production build minifies the code that dispatches it and renames the class, while discovery reads `+"the listener's copy from source and does not \u2014 so the dispatch would "+`reach no listener in production and nowhere else. Add: static name = "${F.name}";`)}}
17
- export{j as _c,J as $c,p as ad,C as bd,c as cd,o as dd,T as ed,i as fd,B as gd,U as hd,W as id,Sq as jd,Zq as kd,_q as ld,Iq as md,Uq as nd};
17
+ export{j as $c,J as ad,p as bd,C as cd,c as dd,o as ed,T as fd,i as gd,B as hd,U as id,W as jd,Sq as kd,Zq as ld,_q as md,Iq as nd,Uq as od};
18
18
 
19
- //# debugId=C96D436D786F6FF864756E2164756E21
19
+ //# debugId=3DAFCDC35D76808364756E2164756E21
@@ -12,6 +12,6 @@
12
12
  "import { existsSync } from \"node:fs\";\nimport { dirname, isAbsolute, join } from \"node:path\";\n\nimport {\n discoverClasses,\n DiscoveryError,\n projectRoot,\n} from \"../support/discover\";\nimport { Command, type CommandClass } from \"../console/Command\";\nimport { commandConfigDefaults } from \"../console/config\";\nimport { isUnfinishedBuilder } from \"../console/builder\";\nimport { CronJob } from \"./cron/CronJob\";\nimport { scheduleConfigDefaults } from \"./cron/config\";\nimport { eventConfigDefaults } from \"./events/config\";\nimport type { EventClass } from \"./events/Event\";\nimport { Listener, type ListenerClass } from \"./events/Listener\";\nimport { Job } from \"./queue/Job\";\nimport { queueConfigDefaults } from \"./queue/config\";\nimport { Workflow, type WorkflowClass } from \"./queue/workflow/Workflow\";\n\n/**\n * Reading an application's jobs off the filesystem, for the two subsystems that\n * were asking every app to write its job list twice.\n *\n * Both functions here are the same call to `discoverClasses` with a different\n * base class, which is deliberate: one walk, one set of skip rules, one answer\n * to \"what does this app have\". They are exported from `gemi/services` rather\n * than kept private to the providers because the list stopped being something\n * an app could import — a test that used to walk the exported `jobs` array\n * needs somewhere to ask the same question, and so does a script.\n *\n * What the providers add on top of these is the decision of *whether* to ask,\n * which is the config's to make and not this file's.\n */\n\n/**\n * A directory the app named, resolved the way the app meant it.\n *\n * Relative paths hang off the project root rather than `process.cwd()` at the\n * moment of the call, because a config slice saying `app/jobs` means the app's\n * `app/jobs` and not whatever directory somebody happened to launch a script\n * from. Absolute paths are taken as given, which is what makes these callable\n * from a test that has no project around it.\n */\nfunction resolveDir(dir: string): string {\n return isAbsolute(dir) ? dir : join(projectRoot(), dir);\n}\n\n/**\n * Says something when the directory is missing *and so is the tree it lives in*.\n *\n * A missing directory has two readings and they want opposite responses. An app\n * that has never written a cron job has no `app/cron`, and warning about that on\n * every boot for the rest of its life is noise — the answer \"you have no cron\n * jobs\" is correct and uninteresting. But a deploy that ships `dist/` and\n * `node_modules/` without the source has no `app/cron` *and no `app/`*, and\n * there discovery quietly returns nothing while the app very much does have\n * jobs: the exact silence #322 and #323 exist to remove, reintroduced one layer\n * down and in production only.\n *\n * The parent directory is what tells them apart. If neither the directory nor\n * the one above it is there, the tree this was pointed into is not there\n * either, and that is worth a sentence.\n */\nfunction warnIfSourceIsMissing(\n resolved: string,\n subject: string,\n slice: string,\n) {\n if (existsSync(resolved) || existsSync(dirname(resolved))) return;\n\n console.warn(\n `No ${subject} were discovered: neither ${resolved} nor the directory ` +\n `above it exists, so this process cannot see the application's source. ` +\n `If this is a deploy that ships only the build output, list the classes ` +\n `explicitly in app/config/${slice}.ts so they travel with it.`,\n );\n}\n\n/**\n * The `Job` subclasses under `dir`, defaulting to the config slice's `app/jobs`.\n *\n * This is what a `queue` config slice with no `jobs` key resolves to. Call it\n * directly to ask the question a test used to answer by importing the array:\n * every job this application would register, in the order it would register\n * them.\n *\n * Every file underneath is imported, so calling this runs the app's job modules\n * — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverJobs(\n dir: string = queueConfigDefaults().jobsDir,\n): Promise<Array<new () => Job>> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"queue jobs\", \"queue\");\n const jobs = await discoverClasses(resolved, Job);\n warnIfNameWillNotSurviveTheBuild(jobs);\n return jobs;\n}\n\n/**\n * The `Workflow` subclasses under `dir`, defaulting to the queue slice's\n * `app/workflows`: what a `queue` slice with no `workflows` key resolves to.\n * A missing directory is no workflows, said nothing about unless the tree\n * above it is missing too.\n */\nexport async function discoverWorkflows(\n dir: string = queueConfigDefaults().workflowsDir,\n): Promise<WorkflowClass[]> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"workflows\", \"queue\");\n const workflows = (await discoverClasses(resolved, Workflow)) as WorkflowClass[];\n for (const workflow of workflows) {\n if (Object.getOwnPropertyDescriptor(workflow, \"name\")?.writable) continue;\n console.warn(\n `Workflow ${workflow.name} does not declare \\`static name\\`. A workflow ` +\n `is stored under its name, and a production build renames the class. ` +\n `Add: static name = \"${workflow.name}\";`,\n );\n }\n return workflows;\n}\n\n/**\n * Says something about a discovered job that never declared `static name`.\n *\n * This is the one hazard discovery introduces rather than removes, and it is\n * production-only. `gemi build` minifies the server entry, and app code\n * reachable from it — a controller, and every job class that controller\n * imports to dispatch — is bundled and minified with it. Minification renames\n * the class binding, and a class's implicit `.name` is that binding: a\n * `TestJob` in the bundle reports `\"D\"`. Discovery, meanwhile, imports\n * `app/jobs/TestJob.ts` from source at runtime, where it is still `\"TestJob\"`.\n * The queue is keyed by that name, so the two halves stop agreeing and the\n * dispatch is dropped — in production, and only there.\n *\n * A declared `static name = \"TestJob\"` is a string literal, which survives\n * minification intact, and the two halves agree again. `docs/jobs-and-queues.md`\n * has always called it required; before discovery an app could get away without\n * it, because the explicit `jobs` array was bundled too and both sides were\n * wrong in the same way.\n *\n * The check is exact rather than a guess: a `static name = \"...\"` class field\n * defines a *writable* own property, while the implicit class name is\n * non-writable. Cron is unaffected — `CronJob.name` is an instance field\n * holding a string literal, not the class binding.\n */\nfunction warnIfNameWillNotSurviveTheBuild(jobs: Array<new () => Job>) {\n for (const job of jobs) {\n if (Object.getOwnPropertyDescriptor(job, \"name\")?.writable) continue;\n\n console.warn(\n `Queued job ${job.name} does not declare \\`static name\\`, so it is ` +\n `registered under its class name. A production build minifies the ` +\n `class that dispatches it and renames it, while discovery reads this ` +\n `file from source and does not — so the dispatch would be dropped in ` +\n `production and nowhere else. Add: static name = \"${job.name}\";`,\n );\n }\n}\n\n/**\n * The `CronJob` subclasses under `dir`, defaulting to the config slice's\n * `app/cron`.\n *\n * This is what a `schedule` config slice with no `jobs` key resolves to. Call it\n * directly to ask the question a test used to answer by importing the array —\n * though after boot `app(Scheduler).jobs` is the better one, because it is what\n * the scheduler actually took rather than what this would find if asked again.\n *\n * Every file underneath is imported, so calling this runs the app's cron\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverCronJobs(\n dir: string = scheduleConfigDefaults().jobsDir,\n): Promise<Array<new () => CronJob>> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"cron jobs\", \"schedule\");\n return await discoverClasses(resolved, CronJob);\n}\n\n/**\n * The `Command` subclasses under `dir`, defaulting to the config slice's\n * `app/commands`.\n *\n * This is what a `commands`-less `command` slice resolves to, and what\n * `gemi run` lists. Unlike the two above it is not called during boot — a\n * command registry has one consumer, and importing every file under\n * `app/commands` into every server process would be a cost paid on every start\n * for code no request reaches.\n *\n * Every file underneath is imported, so calling this runs the app's command\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n */\nexport async function discoverCommands(\n dir: string = commandConfigDefaults().commandsDir,\n): Promise<CommandClass[]> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"commands\", \"command\");\n\n const unfinished: string[] = [];\n\n const commands = await discoverClasses(\n resolved,\n Command,\n [],\n (value, file) => {\n if (isUnfinishedBuilder(value)) unfinished.push(file);\n },\n );\n\n refuseUnfinishedBuilders(unfinished);\n\n return commands as CommandClass[];\n}\n\n/**\n * Stops the walk for a builder chain that was never finished.\n *\n * This is the one silence the builder introduces, and it is the exact shape\n * #322 and #323 exist to remove. `defineCommand(...).arg(...)` without a\n * trailing `.handle(...)` is a plain object rather than a class, so\n * `discoverClasses` discards it along with every constant and helper a command\n * file happens to export — and the command disappears from `gemi run` with\n * nothing raised. The author sees a listing containing every command except the\n * one they just wrote.\n *\n * A throw rather than a warning, because there is no reading of an unfinished\n * builder under which the author meant it: the chain builds a description of a\n * command and then discards it.\n *\n * \"Unfinished\" is decided by `.handle()` clearing the brand, not by the export\n * still being a builder object. Those differ for the natural way to share\n * declarations —\n *\n * export const base = defineCommand(\"reindex\").option(\"verbose\", …);\n * export default base.handle(async () => {});\n *\n * — where `base` is a builder that *did* produce a command. Keying off the shape\n * alone made that file abort the whole of `gemi run`, taking every other command\n * in the project down with it, under a message that was untrue for it.\n */\nfunction refuseUnfinishedBuilders(files: string[]): void {\n if (files.length === 0) return;\n\n const subject =\n files.length === 1\n ? `${files[0]} exports a command builder that never called \\`.handle()\\``\n : `${files.length} files export a command builder that never called ` +\n `\\`.handle()\\`:\\n ${files.join(\"\\n \")}`;\n\n throw new DiscoveryError(\n `${subject}, so there is no command to run. \\`.handle()\\` is what turns ` +\n `the chain into a command — finish it:\\n\\n` +\n ` export default defineCommand(\"my-command\")\\n` +\n ` .handle(async ({ line }) => { line(\"hello\") })`,\n );\n}\n\n/**\n * The `Listener` subclasses under `dir`, defaulting to the config slice's\n * `app/listeners`.\n *\n * This is what an `events` config slice with no `listeners` key resolves to.\n * Call it directly to ask what an application would register: every listener,\n * in the order it would register them.\n *\n * Only listeners are walked. Event classes are never discovered — each is\n * imported by the listener that binds to it and by the code that dispatches it,\n * so there is nothing a walk over them would find that is not already in the\n * module graph.\n *\n * **Known residual, matching jobs and cron.** `discoverClasses` excludes the\n * `base` it is handed and not intermediates, so an abstract listener base\n * written in `listenersDir` and extended by its siblings is discovered and\n * registered alongside them — constructed, with its `handle` called, on every\n * dispatch of whatever event it declares. Keep shared bases outside the\n * directory.\n *\n * Every file underneath is imported, so calling this runs the app's listener\n * modules — the cost `discoverClasses` documents at length, paid once per call.\n *\n * @throws DiscoveryError if a discovered listener declares no `static event`.\n */\nexport async function discoverListeners(\n dir: string = eventConfigDefaults().listenersDir,\n): Promise<ListenerClass[]> {\n const resolved = resolveDir(dir);\n warnIfSourceIsMissing(resolved, \"event listeners\", \"events\");\n\n const listeners = (await discoverClasses(\n resolved,\n Listener,\n )) as ListenerClass[];\n\n refuseListenersWithNoEvent(listeners);\n warnIfListenerNameWillNotSurviveTheBuild(listeners);\n warnIfEventNameWillNotSurviveTheBuild(listeners);\n\n return listeners;\n}\n\n/**\n * Stops the walk for a listener that binds to nothing.\n *\n * `static event` is declared as required on the base and the compiler still\n * cannot see it missing: every subclass inherits the declaration whether or not\n * it assigns to one, so `typeof SomeListener` type-checks either way. What the\n * author gets instead is a file that is imported, registered under no name, and\n * never called — the silence this whole module is arranged against.\n *\n * A throw rather than a warning, because there is no reading of a listener with\n * no event under which the author meant it. The usual cause is the residual\n * above: an abstract base sharing a gate between two listeners, sitting in\n * `listenersDir` where the walk finds it. Moving it out is the fix, and the\n * message says so — the alternative, excluding it by some guess about\n * abstractness, is how a discovery pass ends up quietly covering less than the\n * directory holds.\n */\nfunction refuseListenersWithNoEvent(listeners: ListenerClass[]): void {\n const orphans = listeners.filter((listener) => !listener.event);\n if (orphans.length === 0) return;\n\n throw new DiscoveryError(\n `${orphans\n .map((listener) => listener.name)\n .join(\", \")} declare no \\`static event\\`, so there is no event name to ` +\n `register them under and their \\`handle\\` would never run. Every ` +\n `listener binds to exactly one event:\\n\\n` +\n ` static event = UserRegistered;\\n\\n` +\n `If this is an abstract base its subclasses extend, move it out of the ` +\n `listeners directory — the walk excludes gemi's \\`Listener\\` and ` +\n `nothing else, so a base sitting beside its subclasses is registered ` +\n `and run like one of them.`,\n );\n}\n\n/**\n * Says something about a discovered listener that never declared `static name`.\n *\n * The hazard is `warnIfNameWillNotSurviveTheBuild`'s, one subsystem over: a\n * `static name = \"...\"` class field defines a *writable* own property while the\n * implicit class binding does not, and a minifier renames the binding while\n * leaving the string literal alone. The two spellings are indistinguishable by\n * value — both read `\"SendWelcomeEmail\"` in development — so the descriptor is\n * the only thing that tells them apart, and the difference only becomes visible\n * in a production build.\n *\n * A warning rather than a refusal, because a *sync* listener's name has no\n * second half to disagree with: every reader of it comes from this same\n * source-side walk, so a minified build and this walk cannot produce two\n * different strings for it. A **queued** listener does have one — the name is\n * the queue's key and it crosses a JSON boundary — and that case is refused\n * outright, by `jobForListener`, at the point the listener is registered with\n * the queue rather than here. This walk cannot tell the two apart without\n * constructing every listener it found; the registry constructs them anyway.\n */\nfunction warnIfListenerNameWillNotSurviveTheBuild(listeners: ListenerClass[]) {\n for (const listener of listeners) {\n if (Object.getOwnPropertyDescriptor(listener, \"name\")?.writable) continue;\n\n console.warn(\n `Event listener ${listener.name} does not declare \\`static name\\`, so ` +\n `it is registered under its class name, which a production build ` +\n `renames. Nothing reads that name across a build boundary while the ` +\n `listener is sync, which is why this is a warning — but adding ` +\n `\\`queued = true\\` to it is refused at boot for the same reason, ` +\n `because the queue's key is that string. Add: static name = ` +\n `\"${listener.name}\";`,\n );\n }\n}\n\n/**\n * Says something about the *event* a discovered listener binds to, when that\n * event's name is the implicit class binding.\n *\n * This is the check that matters from the first dispatch, and it is the reason\n * `discoverListeners` reads `static event` at all. The registry is keyed by the\n * event's name; the dispatcher supplies that name from the class it constructs.\n * A production build minifies the server entry and the app code reachable from\n * it — the controller, and the event class it imports in order to dispatch —\n * while discovery imports `app/listeners/*.ts` from source, and those files\n * import `app/events/*.ts` from source too. Two module graphs, two class\n * objects, and an implicit `.name` that reads `\"UserRegistered\"` on one side\n * and `\"D\"` on the other. The dispatch then finds no listeners, which is legal,\n * normal, and completely silent.\n *\n * A declared `static name` is a string literal, which survives minification\n * intact, and the two halves agree again.\n *\n * Checked through the descriptor rather than the string, and not by comparing\n * `event.name` to anything: in development the two spellings produce the same\n * value, so a check on the string would be a tautology that passes forever.\n */\nfunction warnIfEventNameWillNotSurviveTheBuild(listeners: ListenerClass[]) {\n const warned = new Set<EventClass>();\n\n for (const { event } of listeners) {\n if (warned.has(event)) continue;\n if (Object.getOwnPropertyDescriptor(event, \"name\")?.writable) continue;\n warned.add(event);\n\n console.warn(\n `Event ${event.name} does not declare \\`static name\\`, so it is ` +\n `dispatched under its class name. A production build minifies the ` +\n `code that dispatches it and renames the class, while discovery reads ` +\n `the listener's copy from source and does not — so the dispatch would ` +\n `reach no listener in production and nowhere else. Add: ` +\n `static name = \"${event.name}\";`,\n );\n }\n}\n"
13
13
  ],
14
14
  "mappings": ";sNA4GO,AAAM,IAAsB,DAAM,CAG5B,KAFX,WAAW,CACT,EACS,EAAe,EACxB,CACA,MAAM,CAAO,EAFJ,YAGT,KAAK,KAAO,gBAEhB,CAYO,MAAM,CAAQ,OAKZ,aAAc,cAGd,aAAc,SAGd,MAA0B,CAAC,QAG3B,SAA2B,CAAC,EAWnC,GAAG,CAAC,EAA0B,EAChC,CC1GO,SAAS,CAAmB,CAAC,EAAsC,CACxE,OAAO,EAGF,SAAS,CAAqB,EAA4B,CAC/D,MAAO,CACL,SAAU,CAAC,EACX,YAAa,cACf,ECDK,IAAM,EAA+B,OAAO,IAAI,sBAAsB,EAoF7E,SAAS,CAAgB,CAAC,EAAoB,CAC5C,GAAI,EAAK,KAAK,IAAM,GAClB,MAAU,MAAM,iCAAiC,EAGnD,GAAI,OAAO,KAAK,CAAI,GAAK,KAAK,KAAK,CAAI,EACrC,MAAU,MACR,wBAAwB,KAAK,UAAU,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA,oDAO7C,EAIG,SAAS,CAAa,CAAC,EAAsC,CAClE,EAAiB,CAAI,EAErB,IAAM,EAA0B,CAAC,EAC3B,EAA2B,CAAC,EAC9B,EAAc,GAEZ,EAAU,EACb,GAAgB,EAEjB,QAAQ,CAAC,EAAc,CAErB,OADA,EAAc,EACP,GAGT,GAAG,CAAC,EAAiB,EAAgB,CAAC,EAAG,CAKvC,GAAI,EAAK,UAAY,EAAK,UAAY,OACpC,MAAU,MACR,aAAa,kBAAwB,kGAEnC,yBACJ,EAOF,GAAI,EAAK,UAAY,EAAK,UAAY,OACpC,MAAU,MACR,aAAa,kBAAwB,4JAGnC,2CACJ,EAGF,IAAM,EAAW,EAAK,KAAK,CAAC,IAAa,EAAS,QAAQ,EAC1D,GAAI,EACF,MAAU,MACR,aAAa,kBAAwB,+CACb,EAAS,sDACV,4EAEzB,EAGF,GAAI,EAAK,KAAK,CAAC,IAAa,EAAS,OAAS,CAAO,EACnD,MAAU,MACR,YAAY,6BAAgC,WAC9C,EAIF,OADA,EAAK,KAAK,IAAK,EAAM,KAAM,CAAQ,CAAC,EAC7B,GAGT,MAAM,CAAC,EAAoB,EAAkB,CAC3C,GAAI,EAAQ,KAAK,CAAC,IAAa,EAAS,OAAS,CAAU,EACzD,MAAU,MACR,YAAY,2BAA8B,WAC5C,EAGF,IAAM,EAAQ,UAAW,EAAO,EAAK,MAAQ,OACvC,EACJ,IAAU,OACN,OACA,EAAQ,KACN,CAAC,KAAa,UAAW,IAAY,EAAS,QAAU,CAC1D,EACN,GAAI,EACF,MAAU,MACR,YAAY,EAAM,cAAc,kBAA2B,2BACjC,KAC5B,EAIF,OADA,EAAQ,KAAK,IAAK,EAAM,KAAM,CAAW,CAAC,EACnC,GAGT,MAAM,CAAC,EAAiC,CACtC,IAAM,EAAc,EACd,EAAqB,EAErB,EAAM,cAAc,CAAQ,OACzB,aAAc,QACd,aAAc,QAOd,MAAO,CAAC,GAAG,CAAI,QACf,SAAU,CAAC,GAAG,CAAO,EAE5B,GAAG,CAAC,EAAU,CACZ,OAAO,EAAG,CAAG,EAEjB,EAuBA,OAVA,OAAQ,EAAyC,GAKjD,OAAO,eAAe,EAAK,OAAQ,CACjC,MAAO,EACP,aAAc,EAChB,CAAC,EAEM,EAEX,EAEA,OAAO,EAIF,SAAS,CAAmB,CACjC,EACsC,CACtC,OACE,OAAO,IAAU,UACjB,IAAU,MACV,OAAQ,EAAuC,KAAmB,SC1P/D,SAAS,CAAoB,CAAC,EAAwC,CAC3E,OAAO,EAGF,SAAS,CAAsB,EAA6B,CACjE,MAAO,CACL,KAAM,CAAC,EACP,QAAS,UACX,ECDK,SAAS,CAAiB,CAAC,EAAkC,CAClE,OAAO,EAGF,SAAS,CAAmB,EAA0B,CAC3D,MAAO,CACL,UAAW,CAAC,EACZ,aAAc,eAChB,ECZK,MAAe,CAAS,OAsBtB,MAAO,cAsBP,OAuCP,OAAS,GAWT,YAAc,EASd,QAA6B,EAU7B,OAAS,EAuBX,CChGO,MAAM,CAAS,OACb,MAAO,QAMd,GAAG,CAAC,KAAgB,EAAuB,CACzC,MAAU,MAAM,gBAAiB,KAAK,YAAgC,yBAAyB,EAQjG,QAAQ,CAAC,KAAgB,EAAuB,CAC9C,aASK,MAAyB,IAE3B,EACc,CACjB,OAAO,EAAI,CAAY,EAAE,UAAU,MAAM,KAAkC,CAAI,QAS1E,OAAM,CAAC,EAAY,EAAa,EAAqC,CAC1E,OAAO,EAAI,CAAY,EAAE,UAAU,OAAO,EAAI,EAAK,CAAO,QAIrD,KAAI,CAAC,EAA4C,CACtD,OAAO,EAAI,CAAY,EAAE,UAAU,KAAK,CAAE,QAQrC,OAAM,CAAC,EAA8B,CAC1C,OAAO,EAAI,CAAY,EAAE,UAAU,OAAO,CAAE,EAEhD,CCpJA,qBAAS,WACT,kBAAS,gBAAS,UAAY,aA2C9B,SAAS,CAAU,CAAC,EAAqB,CACvC,OAAO,EAAW,CAAG,EAAI,EAAM,EAAK,EAAY,EAAG,CAAG,EAmBxD,SAAS,CAAqB,CAC5B,EACA,EACA,EACA,CACA,GAAI,EAAW,CAAQ,GAAK,EAAW,EAAQ,CAAQ,CAAC,EAAG,OAE3D,QAAQ,KACN,MAAM,8BAAoC,6LAGZ,8BAChC,EAcF,eAAsB,EAAY,CAChC,EAAc,EAAoB,EAAE,QACL,CAC/B,IAAM,EAAW,EAAW,CAAG,EAC/B,EAAsB,EAAU,aAAc,OAAO,EACrD,IAAM,EAAO,MAAM,EAAgB,EAAU,CAAG,EAEhD,OADA,EAAiC,CAAI,EAC9B,EAST,eAAsB,EAAiB,CACrC,EAAc,EAAoB,EAAE,aACV,CAC1B,IAAM,EAAW,EAAW,CAAG,EAC/B,EAAsB,EAAU,YAAa,OAAO,EACpD,IAAM,EAAa,MAAM,EAAgB,EAAU,CAAQ,EAC3D,QAAW,KAAY,EAAW,CAChC,GAAI,OAAO,yBAAyB,EAAU,MAAM,GAAG,SAAU,SACjE,QAAQ,KACN,YAAY,EAAS,6IAEI,EAAS,QACpC,EAEF,OAAO,EA2BT,SAAS,CAAgC,CAAC,EAA4B,CACpE,QAAW,KAAO,EAAM,CACtB,GAAI,OAAO,yBAAyB,EAAK,MAAM,GAAG,SAAU,SAE5D,QAAQ,KACN,cAAc,EAAI,wLAGhB,4EACA,oDAAoD,EAAI,QAC5D,GAgBJ,eAAsB,EAAgB,CACpC,EAAc,EAAuB,EAAE,QACJ,CACnC,IAAM,EAAW,EAAW,CAAG,EAE/B,OADA,EAAsB,EAAU,YAAa,UAAU,EAChD,MAAM,EAAgB,EAAU,CAAO,EAgBhD,eAAsB,EAAgB,CACpC,EAAc,EAAsB,EAAE,YACb,CACzB,IAAM,EAAW,EAAW,CAAG,EAC/B,EAAsB,EAAU,WAAY,SAAS,EAErD,IAAM,EAAuB,CAAC,EAExB,EAAW,MAAM,EACrB,EACA,EACA,CAAC,EACD,CAAC,EAAO,IAAS,CACf,GAAI,EAAoB,CAAK,EAAG,EAAW,KAAK,CAAI,EAExD,EAIA,OAFA,EAAyB,CAAU,EAE5B,EA6BT,SAAS,CAAwB,CAAC,EAAuB,CACvD,GAAI,EAAM,SAAW,EAAG,OAExB,IAAM,EACJ,EAAM,SAAW,EACb,GAAG,EAAM,+DACT,GAAG,EAAM;AAAA,MACc,EAAM,KAAK;AAAA,KAAQ,IAEhD,MAAM,IAAI,EACR,GAAG,iEACD;AAAA;AAAA,EACA;AAAA,qDAEJ,EA4BF,eAAsB,EAAiB,CACrC,EAAc,EAAoB,EAAE,aACV,CAC1B,IAAM,EAAW,EAAW,CAAG,EAC/B,EAAsB,EAAU,kBAAmB,QAAQ,EAE3D,IAAM,EAAa,MAAM,EACvB,EACA,CACF,EAMA,OAJA,EAA2B,CAAS,EACpC,EAAyC,CAAS,EAClD,EAAsC,CAAS,EAExC,EAoBT,SAAS,CAA0B,CAAC,EAAkC,CACpE,IAAM,EAAU,EAAU,OAAO,CAAC,IAAa,CAAC,EAAS,KAAK,EAC9D,GAAI,EAAQ,SAAW,EAAG,OAE1B,MAAM,IAAI,EACR,GAAG,EACA,IAAI,CAAC,IAAa,EAAS,IAAI,EAC/B,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,wEAKV,sEACA,+FAEJ,EAuBF,SAAS,CAAwC,CAAC,EAA4B,CAC5E,QAAW,KAAY,EAAW,CAChC,GAAI,OAAO,yBAAyB,EAAU,MAAM,GAAG,SAAU,SAEjE,QAAQ,KACN,kBAAkB,EAAS,gLAGzB,sEACA,+HAEI,EAAS,QACjB,GA0BJ,SAAS,CAAqC,CAAC,EAA4B,CACzE,IAAM,EAAS,IAAI,IAEnB,QAAa,WAAW,EAAW,CACjC,GAAI,EAAO,IAAI,CAAK,EAAG,SACvB,GAAI,OAAO,yBAAyB,EAAO,MAAM,GAAG,SAAU,SAC9D,EAAO,IAAI,CAAK,EAEhB,QAAQ,KACN,SAAS,EAAM,yLAGb,6EACA,yEACkB,EAAM,QAC5B",
15
- "debugId": "C96D436D786F6FF864756E2164756E21",
15
+ "debugId": "3DAFCDC35D76808364756E2164756E21",
16
16
  "names": []
17
17
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ok as cJ,Pk as E,Sk as LE}from"./chunk-89swy5aq.js";var T2=E((n0)=>{Object.defineProperty(n0,"__esModule",{value:!0});n0.ApplicationInSerializer=void 0;n0.ApplicationInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}}}});var t2=E((o0)=>{Object.defineProperty(o0,"__esModule",{value:!0});o0.ApplicationOutSerializer=void 0;o0.ApplicationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt}}}});var Du=E((e0)=>{Object.defineProperty(e0,"__esModule",{value:!0});e0.ApplicationPatchSerializer=void 0;e0.ApplicationPatchSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}}}});var wu=E((Bu)=>{Object.defineProperty(Bu,"__esModule",{value:!0});Bu.ListResponseApplicationOutSerializer=void 0;var Au=t2();Bu.ListResponseApplicationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Au.ApplicationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Au.ApplicationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var e2=E((Gu)=>{Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ApiException=void 0;class Eu extends Error{constructor(u,D,A){super(`HTTP-Code: ${u}
2
+ import{$k as E,_k as cJ,cl as LE}from"./chunk-xtnbcbkf.js";var T2=E((n0)=>{Object.defineProperty(n0,"__esModule",{value:!0});n0.ApplicationInSerializer=void 0;n0.ApplicationInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}}}});var t2=E((o0)=>{Object.defineProperty(o0,"__esModule",{value:!0});o0.ApplicationOutSerializer=void 0;o0.ApplicationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt}}}});var Du=E((e0)=>{Object.defineProperty(e0,"__esModule",{value:!0});e0.ApplicationPatchSerializer=void 0;e0.ApplicationPatchSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}}}});var wu=E((Bu)=>{Object.defineProperty(Bu,"__esModule",{value:!0});Bu.ListResponseApplicationOutSerializer=void 0;var Au=t2();Bu.ListResponseApplicationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Au.ApplicationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Au.ApplicationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var e2=E((Gu)=>{Object.defineProperty(Gu,"__esModule",{value:!0});Gu.ApiException=void 0;class Eu extends Error{constructor(u,D,A){super(`HTTP-Code: ${u}
3
3
  Headers: ${JSON.stringify(A)}`);this.code=u,this.body=D,this.headers={},A.forEach((B,F)=>{this.headers[F]=B})}}Gu.ApiException=Eu});var R=E((d)=>{var V2=d&&d.__awaiter||function(u,D,A,B){function F(G){return G instanceof A?G:new A(function(w){w(G)})}return new(A||(A=Promise))(function(G,w){function N(X){try{$(B.next(X))}catch(z){w(z)}}function J(X){try{$(B.throw(X))}catch(z){w(z)}}function $(X){X.done?G(X.value):F(X.value).then(N,J)}$((B=B.apply(u,D||[])).next())})};Object.defineProperty(d,"__esModule",{value:!0});d.SvixRequest=d.HttpMethod=d.LIB_VERSION=void 0;var u0=e2();d.LIB_VERSION="1.92.2";var lE=`svix-libs/${d.LIB_VERSION}/javascript`,dE;(function(u){u.GET="GET",u.HEAD="HEAD",u.POST="POST",u.PUT="PUT",u.DELETE="DELETE",u.CONNECT="CONNECT",u.OPTIONS="OPTIONS",u.TRACE="TRACE",u.PATCH="PATCH"})(dE=d.HttpMethod||(d.HttpMethod={}));class Ju{constructor(u,D){this.method=u,this.path=D,this.queryParams={},this.headerParams={}}setPathParam(u,D){let A=this.path.replace(`{${u}}`,encodeURIComponent(D));if(this.path===A)throw Error(`path parameter ${u} not found`);this.path=A}setQueryParams(u){for(let[D,A]of Object.entries(u))this.setQueryParam(D,A)}setQueryParam(u,D){if(D===void 0||D===null)return;if(typeof D==="string")this.queryParams[u]=D;else if(typeof D==="boolean"||typeof D==="number")this.queryParams[u]=D.toString();else if(D instanceof Date)this.queryParams[u]=D.toISOString();else if(Array.isArray(D)){if(D.length>0)this.queryParams[u]=D.join(",")}else{let A=D;throw Error(`query parameter ${u} has unsupported type`)}}setHeaderParam(u,D){if(D===void 0)return;this.headerParams[u]=D}setBody(u){this.body=JSON.stringify(u)}send(u,D){return V2(this,void 0,void 0,function*(){let A=yield this.sendInner(u);if(A.status===204)return null;let B=yield A.text();return D(JSON.parse(B))})}sendNoResponseBody(u){return V2(this,void 0,void 0,function*(){yield this.sendInner(u)})}sendInner(u){var D,A;return V2(this,void 0,void 0,function*(){let B=new URL(u.baseUrl+this.path);for(let[N,J]of Object.entries(this.queryParams))B.searchParams.set(N,J);if(this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST")this.headerParams["idempotency-key"]=`auto_${crypto.randomUUID()}`;let F=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);if(this.body!=null)this.headerParams["content-type"]="application/json";let G="credentials"in Request.prototype,w=yield Zu(B,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${u.token}`,"user-agent":lE,"svix-req-id":F.toString()},this.headerParams),credentials:G?"same-origin":void 0,signal:u.timeout!==void 0?AbortSignal.timeout(u.timeout):void 0},u.retryScheduleInMs,(D=u.retryScheduleInMs)===null||D===void 0?void 0:D[0],((A=u.retryScheduleInMs)===null||A===void 0?void 0:A.length)||u.numRetries,u.fetch);return rE(w)})}}d.SvixRequest=Ju;function rE(u){return V2(this,void 0,void 0,function*(){if(u.status<300)return u;let D=yield u.text();if(u.status===422)throw new u0.ApiException(u.status,JSON.parse(D),u.headers);if(u.status>=400&&u.status<=499)throw new u0.ApiException(u.status,JSON.parse(D),u.headers);throw new u0.ApiException(u.status,D,u.headers)})}function Zu(u,D,A,B=50,F=2,G=fetch,w=1){return V2(this,void 0,void 0,function*(){let N=(J)=>new Promise(($)=>setTimeout($,J));try{let J=yield G(u,D);if(F<=0||J.status<500)return J}catch(J){if(F<=0)throw J}return yield N(B),D.headers["svix-retry-count"]=w.toString(),B=(A===null||A===void 0?void 0:A[w])||B*2,yield Zu(u,D,A,B,--F,G,++w)})}});var Yu=E(($u)=>{Object.defineProperty($u,"__esModule",{value:!0});$u.Application=void 0;var D0=T2(),W2=t2(),cE=Du(),iE=wu(),g=R();class zu{constructor(u){this.requestCtx=u}list(u){let D=new g.SvixRequest(g.HttpMethod.GET,"/api/v1/app");return D.setQueryParams({exclude_apps_with_no_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithSvixPlayEndpoints,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,iE.ListResponseApplicationOutSerializer._fromJsonObject)}create(u,D){let A=new g.SvixRequest(g.HttpMethod.POST,"/api/v1/app");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(D0.ApplicationInSerializer._toJsonObject(u)),A.send(this.requestCtx,W2.ApplicationOutSerializer._fromJsonObject)}getOrCreate(u,D){let A=new g.SvixRequest(g.HttpMethod.POST,"/api/v1/app");return A.setQueryParam("get_if_exists",!0),A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(D0.ApplicationInSerializer._toJsonObject(u)),A.send(this.requestCtx,W2.ApplicationOutSerializer._fromJsonObject)}get(u){let D=new g.SvixRequest(g.HttpMethod.GET,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.send(this.requestCtx,W2.ApplicationOutSerializer._fromJsonObject)}update(u,D){let A=new g.SvixRequest(g.HttpMethod.PUT,"/api/v1/app/{app_id}");return A.setPathParam("app_id",u),A.setBody(D0.ApplicationInSerializer._toJsonObject(D)),A.send(this.requestCtx,W2.ApplicationOutSerializer._fromJsonObject)}delete(u){let D=new g.SvixRequest(g.HttpMethod.DELETE,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let A=new g.SvixRequest(g.HttpMethod.PATCH,"/api/v1/app/{app_id}");return A.setPathParam("app_id",u),A.setBody(cE.ApplicationPatchSerializer._toJsonObject(D)),A.send(this.requestCtx,W2.ApplicationOutSerializer._fromJsonObject)}}$u.Application=zu});var Wu=E((Qu)=>{Object.defineProperty(Qu,"__esModule",{value:!0});Qu.ApiTokenOutSerializer=void 0;Qu.ApiTokenOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),expiresAt:u.expiresAt?new Date(u.expiresAt):null,id:u.id,name:u.name,scopes:u.scopes,token:u.token}},_toJsonObject(u){return{createdAt:u.createdAt,expiresAt:u.expiresAt,id:u.id,name:u.name,scopes:u.scopes,token:u.token}}}});var A0=E((Hu)=>{Object.defineProperty(Hu,"__esModule",{value:!0});Hu.AppPortalCapabilitySerializer=Hu.AppPortalCapability=void 0;var aE;(function(u){u.ViewBase="ViewBase",u.ViewEndpointSecret="ViewEndpointSecret",u.ManageEndpointSecret="ManageEndpointSecret",u.ManageTransformations="ManageTransformations",u.CreateAttempts="CreateAttempts",u.ManageEndpoint="ManageEndpoint"})(aE=Hu.AppPortalCapability||(Hu.AppPortalCapability={}));Hu.AppPortalCapabilitySerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var vu=E((Ru)=>{Object.defineProperty(Ru,"__esModule",{value:!0});Ru.AppPortalAccessInSerializer=void 0;var Uu=A0(),Pu=T2();Ru.AppPortalAccessInSerializer={_fromJsonObject(u){var D;return{application:u.application!=null?Pu.ApplicationInSerializer._fromJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((A)=>Uu.AppPortalCapabilitySerializer._fromJsonObject(A)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}},_toJsonObject(u){var D;return{application:u.application!=null?Pu.ApplicationInSerializer._toJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((A)=>Uu.AppPortalCapabilitySerializer._toJsonObject(A)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}}}});var Tu=E((Mu)=>{Object.defineProperty(Mu,"__esModule",{value:!0});Mu.AppPortalAccessOutSerializer=void 0;Mu.AppPortalAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var qu=E((hu)=>{Object.defineProperty(hu,"__esModule",{value:!0});hu.ApplicationTokenExpireInSerializer=void 0;hu.ApplicationTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var xu=E((ku)=>{Object.defineProperty(ku,"__esModule",{value:!0});ku.RotatePollerTokenInSerializer=void 0;ku.RotatePollerTokenInSerializer={_fromJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}},_toJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}}}});var mu=E((yu)=>{Object.defineProperty(yu,"__esModule",{value:!0});yu.StreamPortalAccessInSerializer=void 0;yu.StreamPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}},_toJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}}}});var ju=E((gu)=>{Object.defineProperty(gu,"__esModule",{value:!0});gu.StreamTokenExpireInSerializer=void 0;gu.StreamTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var B0=E((fu)=>{Object.defineProperty(fu,"__esModule",{value:!0});fu.DashboardAccessOutSerializer=void 0;fu.DashboardAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var pu=E((iu)=>{Object.defineProperty(iu,"__esModule",{value:!0});iu.Authentication=void 0;var du=Wu(),pE=vu(),ru=Tu(),nE=qu(),sE=xu(),oE=mu(),tE=ju(),eE=B0(),q=R();class cu{constructor(u){this.requestCtx=u}appPortalAccess(u,D,A){let B=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(pE.AppPortalAccessInSerializer._toJsonObject(D)),B.send(this.requestCtx,ru.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(u,D,A){let B=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(nE.ApplicationTokenExpireInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}dashboardAccess(u,D){let A=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.send(this.requestCtx,eE.DashboardAccessOutSerializer._fromJsonObject)}logout(u){let D=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamLogout(u){let D=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/stream-logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamPortalAccess(u,D,A){let B=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return B.setPathParam("stream_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(oE.StreamPortalAccessInSerializer._toJsonObject(D)),B.send(this.requestCtx,ru.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(u,D,A){let B=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return B.setPathParam("stream_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(tE.StreamTokenExpireInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(u,D){let A=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.send(this.requestCtx,du.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(u,D,A,B){let F=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return F.setPathParam("stream_id",u),F.setPathParam("sink_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(sE.RotatePollerTokenInSerializer._toJsonObject(A)),F.send(this.requestCtx,du.ApiTokenOutSerializer._fromJsonObject)}}iu.Authentication=cu});var t=E((su)=>{Object.defineProperty(su,"__esModule",{value:!0});su.BackgroundTaskStatusSerializer=su.BackgroundTaskStatus=void 0;var uG;(function(u){u.Running="running",u.Finished="finished",u.Failed="failed"})(uG=su.BackgroundTaskStatus||(su.BackgroundTaskStatus={}));su.BackgroundTaskStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var e=E((eu)=>{Object.defineProperty(eu,"__esModule",{value:!0});eu.BackgroundTaskTypeSerializer=eu.BackgroundTaskType=void 0;var DG;(function(u){u.EndpointReplay="endpoint.replay",u.EndpointRecover="endpoint.recover",u.ApplicationStats="application.stats",u.MessageBroadcast="message.broadcast",u.SdkGenerate="sdk.generate",u.EventTypeAggregate="event-type.aggregate",u.ApplicationPurgeContent="application.purge_content",u.EndpointBulkReplay="endpoint.bulk-replay"})(DG=eu.BackgroundTaskType||(eu.BackgroundTaskType={}));eu.BackgroundTaskTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var F0=E((BD)=>{Object.defineProperty(BD,"__esModule",{value:!0});BD.BackgroundTaskOutSerializer=void 0;var DD=t(),AD=e();BD.BackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data,id:u.id,status:DD.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:AD.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{data:u.data,id:u.id,status:DD.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:AD.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var ND=E((ED)=>{Object.defineProperty(ED,"__esModule",{value:!0});ED.ListResponseBackgroundTaskOutSerializer=void 0;var wD=F0();ED.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>wD.BackgroundTaskOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>wD.BackgroundTaskOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var $D=E((ZD)=>{Object.defineProperty(ZD,"__esModule",{value:!0});ZD.BackgroundTask=void 0;var AG=F0(),BG=ND(),h2=R();class JD{constructor(u){this.requestCtx=u}list(u){let D=new h2.SvixRequest(h2.HttpMethod.GET,"/api/v1/background-task");return D.setQueryParams({status:u===null||u===void 0?void 0:u.status,task:u===null||u===void 0?void 0:u.task,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,BG.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(u){return this.list(u)}get(u){let D=new h2.SvixRequest(h2.HttpMethod.GET,"/api/v1/background-task/{task_id}");return D.setPathParam("task_id",u),D.send(this.requestCtx,AG.BackgroundTaskOutSerializer._fromJsonObject)}}ZD.BackgroundTask=JD});var w2=E((YD)=>{Object.defineProperty(YD,"__esModule",{value:!0});YD.ConnectorKindSerializer=YD.ConnectorKind=void 0;var FG;(function(u){u.Custom="Custom",u.AgenticCommerceProtocol="AgenticCommerceProtocol",u.CloseCrm="CloseCRM",u.CustomerIo="CustomerIO",u.Discord="Discord",u.Hubspot="Hubspot",u.Inngest="Inngest",u.Loops="Loops",u.Otel="Otel",u.Resend="Resend",u.Salesforce="Salesforce",u.Segment="Segment",u.Sendgrid="Sendgrid",u.Slack="Slack",u.Teams="Teams",u.TriggerDev="TriggerDev",u.Windmill="Windmill",u.Zapier="Zapier"})(FG=YD.ConnectorKind||(YD.ConnectorKind={}));YD.ConnectorKindSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var O2=E((WD)=>{Object.defineProperty(WD,"__esModule",{value:!0});WD.ConnectorProductSerializer=WD.ConnectorProduct=void 0;var wG;(function(u){u.Dispatch="Dispatch",u.Stream="Stream"})(wG=WD.ConnectorProduct||(WD.ConnectorProduct={}));WD.ConnectorProductSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var w0=E((UD)=>{Object.defineProperty(UD,"__esModule",{value:!0});UD.ConnectorInSerializer=void 0;var HD=w2(),CD=O2();UD.ConnectorInSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?HD.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?CD.ConnectorProductSerializer._fromJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?HD.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?CD.ConnectorProductSerializer._toJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}}}});var q2=E((vD)=>{Object.defineProperty(vD,"__esModule",{value:!0});vD.ConnectorOutSerializer=void 0;var RD=w2(),LD=O2();vD.ConnectorOutSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:new Date(u.createdAt),description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:RD.ConnectorKindSerializer._fromJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:LD.ConnectorProductSerializer._fromJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:new Date(u.transformationUpdatedAt),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:u.createdAt,description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:RD.ConnectorKindSerializer._toJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:LD.ConnectorProductSerializer._toJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:u.transformationUpdatedAt,uid:u.uid,updatedAt:u.updatedAt}}}});var OD=E((TD)=>{Object.defineProperty(TD,"__esModule",{value:!0});TD.ConnectorPatchSerializer=void 0;var SD=w2();TD.ConnectorPatchSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?SD.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?SD.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var xD=E((kD)=>{Object.defineProperty(kD,"__esModule",{value:!0});kD.ConnectorUpdateSerializer=void 0;var qD=w2();kD.ConnectorUpdateSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?qD.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?qD.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var gD=E((_D)=>{Object.defineProperty(_D,"__esModule",{value:!0});_D.ListResponseConnectorOutSerializer=void 0;var yD=q2();_D.ListResponseConnectorOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>yD.ConnectorOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>yD.ConnectorOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var lD=E((jD)=>{Object.defineProperty(jD,"__esModule",{value:!0});jD.Connector=void 0;var EG=w0(),k2=q2(),GG=OD(),NG=xD(),JG=gD(),r=R();class bD{constructor(u){this.requestCtx=u}list(u){let D=new r.SvixRequest(r.HttpMethod.GET,"/api/v1/connector");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,product_type:u===null||u===void 0?void 0:u.productType}),D.send(this.requestCtx,JG.ListResponseConnectorOutSerializer._fromJsonObject)}create(u,D){let A=new r.SvixRequest(r.HttpMethod.POST,"/api/v1/connector");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(EG.ConnectorInSerializer._toJsonObject(u)),A.send(this.requestCtx,k2.ConnectorOutSerializer._fromJsonObject)}get(u){let D=new r.SvixRequest(r.HttpMethod.GET,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.send(this.requestCtx,k2.ConnectorOutSerializer._fromJsonObject)}update(u,D){let A=new r.SvixRequest(r.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return A.setPathParam("connector_id",u),A.setBody(NG.ConnectorUpdateSerializer._toJsonObject(D)),A.send(this.requestCtx,k2.ConnectorOutSerializer._fromJsonObject)}delete(u){let D=new r.SvixRequest(r.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let A=new r.SvixRequest(r.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return A.setPathParam("connector_id",u),A.setBody(GG.ConnectorPatchSerializer._toJsonObject(D)),A.send(this.requestCtx,k2.ConnectorOutSerializer._fromJsonObject)}}jD.Connector=bD});var E2=E((rD)=>{Object.defineProperty(rD,"__esModule",{value:!0});rD.MessageStatusSerializer=rD.MessageStatus=void 0;var ZG;(function(u){u[u.Success=0]="Success",u[u.Pending=1]="Pending",u[u.Fail=2]="Fail",u[u.Sending=3]="Sending"})(ZG=rD.MessageStatus||(rD.MessageStatus={}));rD.MessageStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var E0=E((aD)=>{Object.defineProperty(aD,"__esModule",{value:!0});aD.StatusCodeClassSerializer=aD.StatusCodeClass=void 0;var zG;(function(u){u[u.CodeNone=0]="CodeNone",u[u.Code1xx=100]="Code1xx",u[u.Code2xx=200]="Code2xx",u[u.Code3xx=300]="Code3xx",u[u.Code4xx=400]="Code4xx",u[u.Code5xx=500]="Code5xx"})(zG=aD.StatusCodeClass||(aD.StatusCodeClass={}));aD.StatusCodeClassSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var eD=E((oD)=>{Object.defineProperty(oD,"__esModule",{value:!0});oD.BulkReplayInSerializer=void 0;var nD=E2(),sD=E0();oD.BulkReplayInSerializer={_fromJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:new Date(u.since),status:u.status!=null?nD.MessageStatusSerializer._fromJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?sD.StatusCodeClassSerializer._fromJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until?new Date(u.until):null}},_toJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:u.since,status:u.status!=null?nD.MessageStatusSerializer._toJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?sD.StatusCodeClassSerializer._toJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until}}}});var A1=E((u1)=>{Object.defineProperty(u1,"__esModule",{value:!0});u1.EndpointHeadersInSerializer=void 0;u1.EndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var G0=E((B1)=>{Object.defineProperty(B1,"__esModule",{value:!0});B1.EndpointHeadersOutSerializer=void 0;B1.EndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var G1=E((w1)=>{Object.defineProperty(w1,"__esModule",{value:!0});w1.EndpointHeadersPatchInSerializer=void 0;w1.EndpointHeadersPatchInSerializer={_fromJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}},_toJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}}}});var Z1=E((N1)=>{Object.defineProperty(N1,"__esModule",{value:!0});N1.EndpointInSerializer=void 0;N1.EndpointInSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var N0=E((z1)=>{Object.defineProperty(z1,"__esModule",{value:!0});z1.EndpointOutSerializer=void 0;z1.EndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var Q1=E((X1)=>{Object.defineProperty(X1,"__esModule",{value:!0});X1.EndpointPatchSerializer=void 0;X1.EndpointPatchSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var K1=E((V1)=>{Object.defineProperty(V1,"__esModule",{value:!0});V1.EndpointSecretOutSerializer=void 0;V1.EndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var J0=E((H1)=>{Object.defineProperty(H1,"__esModule",{value:!0});H1.EndpointSecretRotateInSerializer=void 0;H1.EndpointSecretRotateInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var R1=E((U1)=>{Object.defineProperty(U1,"__esModule",{value:!0});U1.EndpointStatsSerializer=void 0;U1.EndpointStatsSerializer={_fromJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}},_toJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}}}});var M1=E((L1)=>{Object.defineProperty(L1,"__esModule",{value:!0});L1.EndpointTransformationInSerializer=void 0;L1.EndpointTransformationInSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var h1=E((S1)=>{Object.defineProperty(S1,"__esModule",{value:!0});S1.EndpointTransformationOutSerializer=void 0;S1.EndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt?new Date(u.updatedAt):null}},_toJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt}}}});var k1=E((O1)=>{Object.defineProperty(O1,"__esModule",{value:!0});O1.EndpointTransformationPatchSerializer=void 0;O1.EndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var y1=E((I1)=>{Object.defineProperty(I1,"__esModule",{value:!0});I1.EndpointUpdateSerializer=void 0;I1.EndpointUpdateSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var g1=E((_1)=>{Object.defineProperty(_1,"__esModule",{value:!0});_1.EventExampleInSerializer=void 0;_1.EventExampleInSerializer={_fromJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}},_toJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}}}});var l1=E((j1)=>{Object.defineProperty(j1,"__esModule",{value:!0});j1.ListResponseEndpointOutSerializer=void 0;var b1=N0();j1.ListResponseEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>b1.EndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>b1.EndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var K2=E((d1)=>{Object.defineProperty(d1,"__esModule",{value:!0});d1.MessageOutSerializer=void 0;d1.MessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var a1=E((c1)=>{Object.defineProperty(c1,"__esModule",{value:!0});c1.RecoverInSerializer=void 0;c1.RecoverInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var t1=E((s1)=>{Object.defineProperty(s1,"__esModule",{value:!0});s1.RecoverOutSerializer=void 0;var p1=t(),n1=e();s1.RecoverOutSerializer={_fromJsonObject(u){return{id:u.id,status:p1.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:n1.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:p1.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:n1.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var D3=E((e1)=>{Object.defineProperty(e1,"__esModule",{value:!0});e1.ReplayInSerializer=void 0;e1.ReplayInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var E3=E((F3)=>{Object.defineProperty(F3,"__esModule",{value:!0});F3.ReplayOutSerializer=void 0;var A3=t(),B3=e();F3.ReplayOutSerializer={_fromJsonObject(u){return{id:u.id,status:A3.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:B3.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:A3.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:B3.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var z3=E((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});J3.Endpoint=void 0;var $G=eD(),XG=A1(),YG=G0(),QG=G1(),VG=Z1(),I2=N0(),WG=Q1(),KG=K1(),HG=J0(),CG=R1(),UG=M1(),PG=h1(),RG=k1(),LG=y1(),vG=g1(),MG=l1(),SG=K2(),TG=a1(),hG=t1(),OG=D3(),G3=E3(),V=R();class N3{constructor(u){this.requestCtx=u}list(u,D){let A=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return A.setPathParam("app_id",u),A.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),A.send(this.requestCtx,MG.ListResponseEndpointOutSerializer._fromJsonObject)}create(u,D,A){let B=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(VG.EndpointInSerializer._toJsonObject(D)),B.send(this.requestCtx,I2.EndpointOutSerializer._fromJsonObject)}get(u,D){let A=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,I2.EndpointOutSerializer._fromJsonObject)}update(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(LG.EndpointUpdateSerializer._toJsonObject(A)),B.send(this.requestCtx,I2.EndpointOutSerializer._fromJsonObject)}delete(u,D){let A=new V.SvixRequest(V.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.sendNoResponseBody(this.requestCtx)}patch(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(WG.EndpointPatchSerializer._toJsonObject(A)),B.send(this.requestCtx,I2.EndpointOutSerializer._fromJsonObject)}bulkReplay(u,D,A,B){let F=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return F.setPathParam("app_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody($G.BulkReplayInSerializer._toJsonObject(A)),F.send(this.requestCtx,G3.ReplayOutSerializer._fromJsonObject)}getHeaders(u,D){let A=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,YG.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(XG.EndpointHeadersInSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}headersUpdate(u,D,A){return this.updateHeaders(u,D,A)}patchHeaders(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(QG.EndpointHeadersPatchInSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}headersPatch(u,D,A){return this.patchHeaders(u,D,A)}recover(u,D,A,B){let F=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return F.setPathParam("app_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(TG.RecoverInSerializer._toJsonObject(A)),F.send(this.requestCtx,hG.RecoverOutSerializer._fromJsonObject)}replayMissing(u,D,A,B){let F=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return F.setPathParam("app_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(OG.ReplayInSerializer._toJsonObject(A)),F.send(this.requestCtx,G3.ReplayOutSerializer._fromJsonObject)}getSecret(u,D){let A=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,KG.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,A,B){let F=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return F.setPathParam("app_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(HG.EndpointSecretRotateInSerializer._toJsonObject(A)),F.sendNoResponseBody(this.requestCtx)}sendExample(u,D,A,B){let F=new V.SvixRequest(V.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return F.setPathParam("app_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(vG.EventExampleInSerializer._toJsonObject(A)),F.send(this.requestCtx,SG.MessageOutSerializer._fromJsonObject)}getStats(u,D,A){let B=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setQueryParams({since:A===null||A===void 0?void 0:A.since,until:A===null||A===void 0?void 0:A.until}),B.send(this.requestCtx,CG.EndpointStatsSerializer._fromJsonObject)}transformationGet(u,D){let A=new V.SvixRequest(V.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,PG.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(RG.EndpointTransformationPatchSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(u,D,A){let B=new V.SvixRequest(V.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setBody(UG.EndpointTransformationInSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}}J3.Endpoint=N3});var Z0=E(($3)=>{Object.defineProperty($3,"__esModule",{value:!0});$3.EventTypeInSerializer=void 0;$3.EventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var K3=E((V3)=>{Object.defineProperty(V3,"__esModule",{value:!0});V3.EnvironmentInSerializer=void 0;var Y3=w0(),Q3=Z0();V3.EnvironmentInSerializer={_fromJsonObject(u){var D,A;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((B)=>Y3.ConnectorInSerializer._fromJsonObject(B)),eventTypes:(A=u.eventTypes)===null||A===void 0?void 0:A.map((B)=>Q3.EventTypeInSerializer._fromJsonObject(B)),settings:u.settings}},_toJsonObject(u){var D,A;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((B)=>Y3.ConnectorInSerializer._toJsonObject(B)),eventTypes:(A=u.eventTypes)===null||A===void 0?void 0:A.map((B)=>Q3.EventTypeInSerializer._toJsonObject(B)),settings:u.settings}}}});var x2=E((H3)=>{Object.defineProperty(H3,"__esModule",{value:!0});H3.EventTypeOutSerializer=void 0;H3.EventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:u.updatedAt}}}});var v3=E((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});R3.EnvironmentOutSerializer=void 0;var U3=q2(),P3=x2();R3.EnvironmentOutSerializer={_fromJsonObject(u){return{connectors:u.connectors.map((D)=>U3.ConnectorOutSerializer._fromJsonObject(D)),createdAt:new Date(u.createdAt),eventTypes:u.eventTypes.map((D)=>P3.EventTypeOutSerializer._fromJsonObject(D)),settings:u.settings,version:u.version}},_toJsonObject(u){return{connectors:u.connectors.map((D)=>U3.ConnectorOutSerializer._toJsonObject(D)),createdAt:u.createdAt,eventTypes:u.eventTypes.map((D)=>P3.EventTypeOutSerializer._toJsonObject(D)),settings:u.settings,version:u.version}}}});var h3=E((S3)=>{Object.defineProperty(S3,"__esModule",{value:!0});S3.Environment=void 0;var qG=K3(),kG=v3(),y2=R();class M3{constructor(u){this.requestCtx=u}export(u){let D=new y2.SvixRequest(y2.HttpMethod.POST,"/api/v1/environment/export");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.send(this.requestCtx,kG.EnvironmentOutSerializer._fromJsonObject)}import(u,D){let A=new y2.SvixRequest(y2.HttpMethod.POST,"/api/v1/environment/import");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(qG.EnvironmentInSerializer._toJsonObject(u)),A.sendNoResponseBody(this.requestCtx)}}S3.Environment=M3});var k3=E((O3)=>{Object.defineProperty(O3,"__esModule",{value:!0});O3.EventTypeImportOpenApiInSerializer=void 0;O3.EventTypeImportOpenApiInSerializer={_fromJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}},_toJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}}}});var y3=E((I3)=>{Object.defineProperty(I3,"__esModule",{value:!0});I3.EventTypeFromOpenApiSerializer=void 0;I3.EventTypeFromOpenApiSerializer={_fromJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var b3=E((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});m3.EventTypeImportOpenApiOutDataSerializer=void 0;var _3=y3();m3.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(u){var D;return{modified:u.modified,toModify:(D=u.to_modify)===null||D===void 0?void 0:D.map((A)=>_3.EventTypeFromOpenApiSerializer._fromJsonObject(A))}},_toJsonObject(u){var D;return{modified:u.modified,to_modify:(D=u.toModify)===null||D===void 0?void 0:D.map((A)=>_3.EventTypeFromOpenApiSerializer._toJsonObject(A))}}}});var d3=E((f3)=>{Object.defineProperty(f3,"__esModule",{value:!0});f3.EventTypeImportOpenApiOutSerializer=void 0;var j3=b3();f3.EventTypeImportOpenApiOutSerializer={_fromJsonObject(u){return{data:j3.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(u.data)}},_toJsonObject(u){return{data:j3.EventTypeImportOpenApiOutDataSerializer._toJsonObject(u.data)}}}});var i3=E((r3)=>{Object.defineProperty(r3,"__esModule",{value:!0});r3.EventTypePatchSerializer=void 0;r3.EventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var n3=E((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});a3.EventTypeUpdateSerializer=void 0;a3.EventTypeUpdateSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var e3=E((o3)=>{Object.defineProperty(o3,"__esModule",{value:!0});o3.ListResponseEventTypeOutSerializer=void 0;var s3=x2();o3.ListResponseEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>s3.EventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>s3.EventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var B5=E((D5)=>{Object.defineProperty(D5,"__esModule",{value:!0});D5.EventType=void 0;var IG=k3(),xG=d3(),yG=Z0(),_2=x2(),_G=i3(),mG=n3(),gG=e3(),b=R();class u5{constructor(u){this.requestCtx=u}list(u){let D=new b.SvixRequest(b.HttpMethod.GET,"/api/v1/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived,with_content:u===null||u===void 0?void 0:u.withContent}),D.send(this.requestCtx,gG.ListResponseEventTypeOutSerializer._fromJsonObject)}create(u,D){let A=new b.SvixRequest(b.HttpMethod.POST,"/api/v1/event-type");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(yG.EventTypeInSerializer._toJsonObject(u)),A.send(this.requestCtx,_2.EventTypeOutSerializer._fromJsonObject)}importOpenapi(u,D){let A=new b.SvixRequest(b.HttpMethod.POST,"/api/v1/event-type/import/openapi");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(IG.EventTypeImportOpenApiInSerializer._toJsonObject(u)),A.send(this.requestCtx,xG.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(u){let D=new b.SvixRequest(b.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return D.setPathParam("event_type_name",u),D.send(this.requestCtx,_2.EventTypeOutSerializer._fromJsonObject)}update(u,D){let A=new b.SvixRequest(b.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return A.setPathParam("event_type_name",u),A.setBody(mG.EventTypeUpdateSerializer._toJsonObject(D)),A.send(this.requestCtx,_2.EventTypeOutSerializer._fromJsonObject)}delete(u,D){let A=new b.SvixRequest(b.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return A.setPathParam("event_type_name",u),A.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),A.sendNoResponseBody(this.requestCtx)}patch(u,D){let A=new b.SvixRequest(b.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return A.setPathParam("event_type_name",u),A.setBody(_G.EventTypePatchSerializer._toJsonObject(D)),A.send(this.requestCtx,_2.EventTypeOutSerializer._fromJsonObject)}}D5.EventType=u5});var N5=E((E5)=>{Object.defineProperty(E5,"__esModule",{value:!0});E5.Health=void 0;var F5=R();class w5{constructor(u){this.requestCtx=u}get(){return new F5.SvixRequest(F5.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}}E5.Health=w5});var z5=E((J5)=>{Object.defineProperty(J5,"__esModule",{value:!0});J5.IngestSourceConsumerPortalAccessInSerializer=void 0;J5.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}},_toJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}}}});var Y5=E(($5)=>{Object.defineProperty($5,"__esModule",{value:!0});$5.IngestEndpointHeadersInSerializer=void 0;$5.IngestEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var W5=E((Q5)=>{Object.defineProperty(Q5,"__esModule",{value:!0});Q5.IngestEndpointHeadersOutSerializer=void 0;Q5.IngestEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var C5=E((K5)=>{Object.defineProperty(K5,"__esModule",{value:!0});K5.IngestEndpointInSerializer=void 0;K5.IngestEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var z0=E((U5)=>{Object.defineProperty(U5,"__esModule",{value:!0});U5.IngestEndpointOutSerializer=void 0;U5.IngestEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var v5=E((R5)=>{Object.defineProperty(R5,"__esModule",{value:!0});R5.IngestEndpointSecretInSerializer=void 0;R5.IngestEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var T5=E((M5)=>{Object.defineProperty(M5,"__esModule",{value:!0});M5.IngestEndpointSecretOutSerializer=void 0;M5.IngestEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var q5=E((h5)=>{Object.defineProperty(h5,"__esModule",{value:!0});h5.IngestEndpointTransformationOutSerializer=void 0;h5.IngestEndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var x5=E((k5)=>{Object.defineProperty(k5,"__esModule",{value:!0});k5.IngestEndpointTransformationPatchSerializer=void 0;k5.IngestEndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var m5=E((y5)=>{Object.defineProperty(y5,"__esModule",{value:!0});y5.IngestEndpointUpdateSerializer=void 0;y5.IngestEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var f5=E((b5)=>{Object.defineProperty(b5,"__esModule",{value:!0});b5.ListResponseIngestEndpointOutSerializer=void 0;var g5=z0();b5.ListResponseIngestEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>g5.IngestEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>g5.IngestEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var c5=E((d5)=>{Object.defineProperty(d5,"__esModule",{value:!0});d5.IngestEndpoint=void 0;var bG=Y5(),jG=W5(),fG=C5(),$0=z0(),lG=v5(),dG=T5(),rG=q5(),cG=x5(),iG=m5(),aG=f5(),v=R();class l5{constructor(u){this.requestCtx=u}list(u,D){let A=new v.SvixRequest(v.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return A.setPathParam("source_id",u),A.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),A.send(this.requestCtx,aG.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(u,D,A){let B=new v.SvixRequest(v.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return B.setPathParam("source_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(fG.IngestEndpointInSerializer._toJsonObject(D)),B.send(this.requestCtx,$0.IngestEndpointOutSerializer._fromJsonObject)}get(u,D){let A=new v.SvixRequest(v.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,$0.IngestEndpointOutSerializer._fromJsonObject)}update(u,D,A){let B=new v.SvixRequest(v.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.setBody(iG.IngestEndpointUpdateSerializer._toJsonObject(A)),B.send(this.requestCtx,$0.IngestEndpointOutSerializer._fromJsonObject)}delete(u,D){let A=new v.SvixRequest(v.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.sendNoResponseBody(this.requestCtx)}getHeaders(u,D){let A=new v.SvixRequest(v.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,jG.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,A){let B=new v.SvixRequest(v.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.setBody(bG.IngestEndpointHeadersInSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}getSecret(u,D){let A=new v.SvixRequest(v.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,dG.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,A,B){let F=new v.SvixRequest(v.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return F.setPathParam("source_id",u),F.setPathParam("endpoint_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(lG.IngestEndpointSecretInSerializer._toJsonObject(A)),F.sendNoResponseBody(this.requestCtx)}getTransformation(u,D){let A=new v.SvixRequest(v.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.send(this.requestCtx,rG.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(u,D,A){let B=new v.SvixRequest(v.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.setBody(cG.IngestEndpointTransformationPatchSerializer._toJsonObject(A)),B.sendNoResponseBody(this.requestCtx)}}d5.IngestEndpoint=l5});var p5=E((i5)=>{Object.defineProperty(i5,"__esModule",{value:!0});i5.AdobeSignConfigSerializer=void 0;i5.AdobeSignConfigSerializer={_fromJsonObject(u){return{clientId:u.clientId}},_toJsonObject(u){return{clientId:u.clientId}}}});var o5=E((n5)=>{Object.defineProperty(n5,"__esModule",{value:!0});n5.AirwallexConfigSerializer=void 0;n5.AirwallexConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var uA=E((t5)=>{Object.defineProperty(t5,"__esModule",{value:!0});t5.CheckbookConfigSerializer=void 0;t5.CheckbookConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var X0=E((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.CronConfigSerializer=void 0;DA.CronConfigSerializer={_fromJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}},_toJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}}}});var wA=E((BA)=>{Object.defineProperty(BA,"__esModule",{value:!0});BA.DocusignConfigSerializer=void 0;BA.DocusignConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var NA=E((EA)=>{Object.defineProperty(EA,"__esModule",{value:!0});EA.EasypostConfigSerializer=void 0;EA.EasypostConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var zA=E((JA)=>{Object.defineProperty(JA,"__esModule",{value:!0});JA.GithubConfigSerializer=void 0;JA.GithubConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var YA=E(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.HubspotConfigSerializer=void 0;$A.HubspotConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var WA=E((QA)=>{Object.defineProperty(QA,"__esModule",{value:!0});QA.MetaConfigSerializer=void 0;QA.MetaConfigSerializer={_fromJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}},_toJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}}}});var CA=E((KA)=>{Object.defineProperty(KA,"__esModule",{value:!0});KA.OrumIoConfigSerializer=void 0;KA.OrumIoConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var RA=E((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.PandaDocConfigSerializer=void 0;UA.PandaDocConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var MA=E((LA)=>{Object.defineProperty(LA,"__esModule",{value:!0});LA.PortIoConfigSerializer=void 0;LA.PortIoConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var hA=E((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.RutterConfigSerializer=void 0;SA.RutterConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var kA=E((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.SegmentConfigSerializer=void 0;OA.SegmentConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var yA=E((IA)=>{Object.defineProperty(IA,"__esModule",{value:!0});IA.ShopifyConfigSerializer=void 0;IA.ShopifyConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var gA=E((_A)=>{Object.defineProperty(_A,"__esModule",{value:!0});_A.SlackConfigSerializer=void 0;_A.SlackConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var fA=E((bA)=>{Object.defineProperty(bA,"__esModule",{value:!0});bA.StripeConfigSerializer=void 0;bA.StripeConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var rA=E((lA)=>{Object.defineProperty(lA,"__esModule",{value:!0});lA.SvixConfigSerializer=void 0;lA.SvixConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var aA=E((cA)=>{Object.defineProperty(cA,"__esModule",{value:!0});cA.TelnyxConfigSerializer=void 0;cA.TelnyxConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var sA=E((pA)=>{Object.defineProperty(pA,"__esModule",{value:!0});pA.VapiConfigSerializer=void 0;pA.VapiConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var eA=E((oA)=>{Object.defineProperty(oA,"__esModule",{value:!0});oA.VeriffConfigSerializer=void 0;oA.VeriffConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var A9=E((u9)=>{Object.defineProperty(u9,"__esModule",{value:!0});u9.ZoomConfigSerializer=void 0;u9.ZoomConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var M9=E((L9)=>{Object.defineProperty(L9,"__esModule",{value:!0});L9.IngestSourceInSerializer=void 0;var B9=p5(),F9=o5(),w9=uA(),E9=X0(),G9=wA(),N9=NA(),J9=zA(),Z9=YA(),z9=WA(),$9=CA(),X9=RA(),Y9=MA(),Q9=hA(),V9=kA(),W9=yA(),K9=gA(),H9=fA(),W=rA(),C9=aA(),U9=sA(),P9=eA(),R9=A9();L9.IngestSourceInSerializer={_fromJsonObject(u){let D=u.type;function A(B){switch(B){case"generic-webhook":return{};case"cron":return E9.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return B9.AdobeSignConfigSerializer._fromJsonObject(u.config);case"beehiiv":return W.SvixConfigSerializer._fromJsonObject(u.config);case"brex":return W.SvixConfigSerializer._fromJsonObject(u.config);case"checkbook":return w9.CheckbookConfigSerializer._fromJsonObject(u.config);case"clerk":return W.SvixConfigSerializer._fromJsonObject(u.config);case"docusign":return G9.DocusignConfigSerializer._fromJsonObject(u.config);case"easypost":return N9.EasypostConfigSerializer._fromJsonObject(u.config);case"github":return J9.GithubConfigSerializer._fromJsonObject(u.config);case"guesty":return W.SvixConfigSerializer._fromJsonObject(u.config);case"hubspot":return Z9.HubspotConfigSerializer._fromJsonObject(u.config);case"incident-io":return W.SvixConfigSerializer._fromJsonObject(u.config);case"lithic":return W.SvixConfigSerializer._fromJsonObject(u.config);case"meta":return z9.MetaConfigSerializer._fromJsonObject(u.config);case"nash":return W.SvixConfigSerializer._fromJsonObject(u.config);case"orum-io":return $9.OrumIoConfigSerializer._fromJsonObject(u.config);case"panda-doc":return X9.PandaDocConfigSerializer._fromJsonObject(u.config);case"port-io":return Y9.PortIoConfigSerializer._fromJsonObject(u.config);case"pleo":return W.SvixConfigSerializer._fromJsonObject(u.config);case"psi-fi":return W.SvixConfigSerializer._fromJsonObject(u.config);case"replicate":return W.SvixConfigSerializer._fromJsonObject(u.config);case"resend":return W.SvixConfigSerializer._fromJsonObject(u.config);case"rutter":return Q9.RutterConfigSerializer._fromJsonObject(u.config);case"safebase":return W.SvixConfigSerializer._fromJsonObject(u.config);case"sardine":return W.SvixConfigSerializer._fromJsonObject(u.config);case"segment":return V9.SegmentConfigSerializer._fromJsonObject(u.config);case"shopify":return W9.ShopifyConfigSerializer._fromJsonObject(u.config);case"slack":return K9.SlackConfigSerializer._fromJsonObject(u.config);case"stripe":return H9.StripeConfigSerializer._fromJsonObject(u.config);case"stych":return W.SvixConfigSerializer._fromJsonObject(u.config);case"svix":return W.SvixConfigSerializer._fromJsonObject(u.config);case"zoom":return R9.ZoomConfigSerializer._fromJsonObject(u.config);case"telnyx":return C9.TelnyxConfigSerializer._fromJsonObject(u.config);case"vapi":return U9.VapiConfigSerializer._fromJsonObject(u.config);case"open-ai":return W.SvixConfigSerializer._fromJsonObject(u.config);case"render":return W.SvixConfigSerializer._fromJsonObject(u.config);case"veriff":return P9.VeriffConfigSerializer._fromJsonObject(u.config);case"airwallex":return F9.AirwallexConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${B}`)}}return{type:D,config:A(D),metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=E9.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=B9.AdobeSignConfigSerializer._toJsonObject(u.config);break;case"beehiiv":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"brex":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"checkbook":D=w9.CheckbookConfigSerializer._toJsonObject(u.config);break;case"clerk":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"docusign":D=G9.DocusignConfigSerializer._toJsonObject(u.config);break;case"easypost":D=N9.EasypostConfigSerializer._toJsonObject(u.config);break;case"github":D=J9.GithubConfigSerializer._toJsonObject(u.config);break;case"guesty":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"hubspot":D=Z9.HubspotConfigSerializer._toJsonObject(u.config);break;case"incident-io":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"lithic":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"meta":D=z9.MetaConfigSerializer._toJsonObject(u.config);break;case"nash":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"orum-io":D=$9.OrumIoConfigSerializer._toJsonObject(u.config);break;case"panda-doc":D=X9.PandaDocConfigSerializer._toJsonObject(u.config);break;case"port-io":D=Y9.PortIoConfigSerializer._toJsonObject(u.config);break;case"pleo":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"psi-fi":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"replicate":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"resend":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"rutter":D=Q9.RutterConfigSerializer._toJsonObject(u.config);break;case"safebase":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"sardine":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"segment":D=V9.SegmentConfigSerializer._toJsonObject(u.config);break;case"shopify":D=W9.ShopifyConfigSerializer._toJsonObject(u.config);break;case"slack":D=K9.SlackConfigSerializer._toJsonObject(u.config);break;case"stripe":D=H9.StripeConfigSerializer._toJsonObject(u.config);break;case"stych":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"svix":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"zoom":D=R9.ZoomConfigSerializer._toJsonObject(u.config);break;case"telnyx":D=C9.TelnyxConfigSerializer._toJsonObject(u.config);break;case"vapi":D=U9.VapiConfigSerializer._toJsonObject(u.config);break;case"open-ai":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"render":D=W.SvixConfigSerializer._toJsonObject(u.config);break;case"veriff":D=P9.VeriffConfigSerializer._toJsonObject(u.config);break;case"airwallex":D=F9.AirwallexConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,metadata:u.metadata,name:u.name,uid:u.uid}}}});var h9=E((S9)=>{Object.defineProperty(S9,"__esModule",{value:!0});S9.AdobeSignConfigOutSerializer=void 0;S9.AdobeSignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var k9=E((O9)=>{Object.defineProperty(O9,"__esModule",{value:!0});O9.AirwallexConfigOutSerializer=void 0;O9.AirwallexConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var y9=E((I9)=>{Object.defineProperty(I9,"__esModule",{value:!0});I9.CheckbookConfigOutSerializer=void 0;I9.CheckbookConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var g9=E((_9)=>{Object.defineProperty(_9,"__esModule",{value:!0});_9.DocusignConfigOutSerializer=void 0;_9.DocusignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var f9=E((b9)=>{Object.defineProperty(b9,"__esModule",{value:!0});b9.EasypostConfigOutSerializer=void 0;b9.EasypostConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var r9=E((l9)=>{Object.defineProperty(l9,"__esModule",{value:!0});l9.GithubConfigOutSerializer=void 0;l9.GithubConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var a9=E((c9)=>{Object.defineProperty(c9,"__esModule",{value:!0});c9.HubspotConfigOutSerializer=void 0;c9.HubspotConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var s9=E((p9)=>{Object.defineProperty(p9,"__esModule",{value:!0});p9.MetaConfigOutSerializer=void 0;p9.MetaConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var e9=E((o9)=>{Object.defineProperty(o9,"__esModule",{value:!0});o9.OrumIoConfigOutSerializer=void 0;o9.OrumIoConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var A8=E((u8)=>{Object.defineProperty(u8,"__esModule",{value:!0});u8.PandaDocConfigOutSerializer=void 0;u8.PandaDocConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var w8=E((B8)=>{Object.defineProperty(B8,"__esModule",{value:!0});B8.PortIoConfigOutSerializer=void 0;B8.PortIoConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var N8=E((E8)=>{Object.defineProperty(E8,"__esModule",{value:!0});E8.RutterConfigOutSerializer=void 0;E8.RutterConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var z8=E((J8)=>{Object.defineProperty(J8,"__esModule",{value:!0});J8.SegmentConfigOutSerializer=void 0;J8.SegmentConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Y8=E(($8)=>{Object.defineProperty($8,"__esModule",{value:!0});$8.ShopifyConfigOutSerializer=void 0;$8.ShopifyConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var W8=E((Q8)=>{Object.defineProperty(Q8,"__esModule",{value:!0});Q8.SlackConfigOutSerializer=void 0;Q8.SlackConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var C8=E((K8)=>{Object.defineProperty(K8,"__esModule",{value:!0});K8.StripeConfigOutSerializer=void 0;K8.StripeConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var R8=E((U8)=>{Object.defineProperty(U8,"__esModule",{value:!0});U8.SvixConfigOutSerializer=void 0;U8.SvixConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var M8=E((L8)=>{Object.defineProperty(L8,"__esModule",{value:!0});L8.TelnyxConfigOutSerializer=void 0;L8.TelnyxConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var h8=E((S8)=>{Object.defineProperty(S8,"__esModule",{value:!0});S8.VapiConfigOutSerializer=void 0;S8.VapiConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var k8=E((O8)=>{Object.defineProperty(O8,"__esModule",{value:!0});O8.VeriffConfigOutSerializer=void 0;O8.VeriffConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var y8=E((I8)=>{Object.defineProperty(I8,"__esModule",{value:!0});I8.ZoomConfigOutSerializer=void 0;I8.ZoomConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Y0=E((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.IngestSourceOutSerializer=void 0;var _8=h9(),m8=k9(),g8=y9(),b8=X0(),j8=g9(),f8=f9(),l8=r9(),d8=a9(),r8=s9(),c8=e9(),i8=A8(),a8=w8(),p8=N8(),n8=z8(),s8=Y8(),o8=W8(),t8=C8(),K=R8(),e8=M8(),u4=h8(),D4=k8(),A4=y8();B4.IngestSourceOutSerializer={_fromJsonObject(u){let D=u.type;function A(B){switch(B){case"generic-webhook":return{};case"cron":return b8.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return _8.AdobeSignConfigOutSerializer._fromJsonObject(u.config);case"beehiiv":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"brex":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"checkbook":return g8.CheckbookConfigOutSerializer._fromJsonObject(u.config);case"clerk":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"docusign":return j8.DocusignConfigOutSerializer._fromJsonObject(u.config);case"easypost":return f8.EasypostConfigOutSerializer._fromJsonObject(u.config);case"github":return l8.GithubConfigOutSerializer._fromJsonObject(u.config);case"guesty":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"hubspot":return d8.HubspotConfigOutSerializer._fromJsonObject(u.config);case"incident-io":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"lithic":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"meta":return r8.MetaConfigOutSerializer._fromJsonObject(u.config);case"nash":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"orum-io":return c8.OrumIoConfigOutSerializer._fromJsonObject(u.config);case"panda-doc":return i8.PandaDocConfigOutSerializer._fromJsonObject(u.config);case"port-io":return a8.PortIoConfigOutSerializer._fromJsonObject(u.config);case"psi-fi":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"pleo":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"replicate":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"resend":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"rutter":return p8.RutterConfigOutSerializer._fromJsonObject(u.config);case"safebase":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"sardine":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"segment":return n8.SegmentConfigOutSerializer._fromJsonObject(u.config);case"shopify":return s8.ShopifyConfigOutSerializer._fromJsonObject(u.config);case"slack":return o8.SlackConfigOutSerializer._fromJsonObject(u.config);case"stripe":return t8.StripeConfigOutSerializer._fromJsonObject(u.config);case"stych":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"svix":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"zoom":return A4.ZoomConfigOutSerializer._fromJsonObject(u.config);case"telnyx":return e8.TelnyxConfigOutSerializer._fromJsonObject(u.config);case"vapi":return u4.VapiConfigOutSerializer._fromJsonObject(u.config);case"open-ai":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"render":return K.SvixConfigOutSerializer._fromJsonObject(u.config);case"veriff":return D4.VeriffConfigOutSerializer._fromJsonObject(u.config);case"airwallex":return m8.AirwallexConfigOutSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${B}`)}}return{type:D,config:A(D),createdAt:new Date(u.createdAt),id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=b8.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=_8.AdobeSignConfigOutSerializer._toJsonObject(u.config);break;case"beehiiv":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"brex":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"checkbook":D=g8.CheckbookConfigOutSerializer._toJsonObject(u.config);break;case"clerk":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"docusign":D=j8.DocusignConfigOutSerializer._toJsonObject(u.config);break;case"easypost":D=f8.EasypostConfigOutSerializer._toJsonObject(u.config);break;case"github":D=l8.GithubConfigOutSerializer._toJsonObject(u.config);break;case"guesty":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"hubspot":D=d8.HubspotConfigOutSerializer._toJsonObject(u.config);break;case"incident-io":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"lithic":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"meta":D=r8.MetaConfigOutSerializer._toJsonObject(u.config);break;case"nash":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"orum-io":D=c8.OrumIoConfigOutSerializer._toJsonObject(u.config);break;case"panda-doc":D=i8.PandaDocConfigOutSerializer._toJsonObject(u.config);break;case"port-io":D=a8.PortIoConfigOutSerializer._toJsonObject(u.config);break;case"psi-fi":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"pleo":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"replicate":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"resend":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"rutter":D=p8.RutterConfigOutSerializer._toJsonObject(u.config);break;case"safebase":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"sardine":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"segment":D=n8.SegmentConfigOutSerializer._toJsonObject(u.config);break;case"shopify":D=s8.ShopifyConfigOutSerializer._toJsonObject(u.config);break;case"slack":D=o8.SlackConfigOutSerializer._toJsonObject(u.config);break;case"stripe":D=t8.StripeConfigOutSerializer._toJsonObject(u.config);break;case"stych":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"svix":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"zoom":D=A4.ZoomConfigOutSerializer._toJsonObject(u.config);break;case"telnyx":D=e8.TelnyxConfigOutSerializer._toJsonObject(u.config);break;case"vapi":D=u4.VapiConfigOutSerializer._toJsonObject(u.config);break;case"open-ai":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"render":D=K.SvixConfigOutSerializer._toJsonObject(u.config);break;case"veriff":D=D4.VeriffConfigOutSerializer._toJsonObject(u.config);break;case"airwallex":D=m8.AirwallexConfigOutSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,createdAt:u.createdAt,id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var N4=E((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.ListResponseIngestSourceOutSerializer=void 0;var w4=Y0();E4.ListResponseIngestSourceOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>w4.IngestSourceOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>w4.IngestSourceOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var z4=E((J4)=>{Object.defineProperty(J4,"__esModule",{value:!0});J4.RotateTokenOutSerializer=void 0;J4.RotateTokenOutSerializer={_fromJsonObject(u){return{ingestUrl:u.ingestUrl}},_toJsonObject(u){return{ingestUrl:u.ingestUrl}}}});var V4=E((Y4)=>{Object.defineProperty(Y4,"__esModule",{value:!0});Y4.IngestSource=void 0;var $4=M9(),Q0=Y0(),pG=N4(),nG=z4(),c=R();class X4{constructor(u){this.requestCtx=u}list(u){let D=new c.SvixRequest(c.HttpMethod.GET,"/ingest/api/v1/source");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,pG.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(u,D){let A=new c.SvixRequest(c.HttpMethod.POST,"/ingest/api/v1/source");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody($4.IngestSourceInSerializer._toJsonObject(u)),A.send(this.requestCtx,Q0.IngestSourceOutSerializer._fromJsonObject)}get(u){let D=new c.SvixRequest(c.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.send(this.requestCtx,Q0.IngestSourceOutSerializer._fromJsonObject)}update(u,D){let A=new c.SvixRequest(c.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return A.setPathParam("source_id",u),A.setBody($4.IngestSourceInSerializer._toJsonObject(D)),A.send(this.requestCtx,Q0.IngestSourceOutSerializer._fromJsonObject)}delete(u){let D=new c.SvixRequest(c.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.sendNoResponseBody(this.requestCtx)}rotateToken(u,D){let A=new c.SvixRequest(c.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.send(this.requestCtx,nG.RotateTokenOutSerializer._fromJsonObject)}}Y4.IngestSource=X4});var U4=E((H4)=>{Object.defineProperty(H4,"__esModule",{value:!0});H4.Ingest=void 0;var sG=B0(),oG=z5(),tG=c5(),eG=V4(),W4=R();class K4{constructor(u){this.requestCtx=u}get endpoint(){return new tG.IngestEndpoint(this.requestCtx)}get source(){return new eG.IngestSource(this.requestCtx)}dashboard(u,D,A){let B=new W4.SvixRequest(W4.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return B.setPathParam("source_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(oG.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(D)),B.send(this.requestCtx,sG.DashboardAccessOutSerializer._fromJsonObject)}}H4.Ingest=K4});var L4=E((P4)=>{Object.defineProperty(P4,"__esModule",{value:!0});P4.IntegrationInSerializer=void 0;P4.IntegrationInSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var S4=E((v4)=>{Object.defineProperty(v4,"__esModule",{value:!0});v4.IntegrationKeyOutSerializer=void 0;v4.IntegrationKeyOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var V0=E((T4)=>{Object.defineProperty(T4,"__esModule",{value:!0});T4.IntegrationOutSerializer=void 0;T4.IntegrationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:u.updatedAt}}}});var k4=E((O4)=>{Object.defineProperty(O4,"__esModule",{value:!0});O4.IntegrationUpdateSerializer=void 0;O4.IntegrationUpdateSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var _4=E((x4)=>{Object.defineProperty(x4,"__esModule",{value:!0});x4.ListResponseIntegrationOutSerializer=void 0;var I4=V0();x4.ListResponseIntegrationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>I4.IntegrationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>I4.IntegrationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var f4=E((b4)=>{Object.defineProperty(b4,"__esModule",{value:!0});b4.Integration=void 0;var uN=L4(),m4=S4(),W0=V0(),DN=k4(),AN=_4(),j=R();class g4{constructor(u){this.requestCtx=u}list(u,D){let A=new j.SvixRequest(j.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return A.setPathParam("app_id",u),A.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),A.send(this.requestCtx,AN.ListResponseIntegrationOutSerializer._fromJsonObject)}create(u,D,A){let B=new j.SvixRequest(j.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(uN.IntegrationInSerializer._toJsonObject(D)),B.send(this.requestCtx,W0.IntegrationOutSerializer._fromJsonObject)}get(u,D){let A=new j.SvixRequest(j.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.send(this.requestCtx,W0.IntegrationOutSerializer._fromJsonObject)}update(u,D,A){let B=new j.SvixRequest(j.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.setBody(DN.IntegrationUpdateSerializer._toJsonObject(A)),B.send(this.requestCtx,W0.IntegrationOutSerializer._fromJsonObject)}delete(u,D){let A=new j.SvixRequest(j.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.sendNoResponseBody(this.requestCtx)}getKey(u,D){let A=new j.SvixRequest(j.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.send(this.requestCtx,m4.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(u,D,A){let B=new j.SvixRequest(j.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.send(this.requestCtx,m4.IntegrationKeyOutSerializer._fromJsonObject)}}b4.Integration=g4});var i4=E((r4)=>{Object.defineProperty(r4,"__esModule",{value:!0});r4.ExpungeAllContentsOutSerializer=void 0;var l4=t(),d4=e();r4.ExpungeAllContentsOutSerializer={_fromJsonObject(u){return{id:u.id,status:l4.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:d4.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:l4.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:d4.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var s4=E((p4)=>{Object.defineProperty(p4,"__esModule",{value:!0});p4.ListResponseMessageOutSerializer=void 0;var a4=K2();p4.ListResponseMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>a4.MessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>a4.MessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var e4=E((o4)=>{Object.defineProperty(o4,"__esModule",{value:!0});o4.MessagePrecheckInSerializer=void 0;o4.MessagePrecheckInSerializer={_fromJsonObject(u){return{channels:u.channels,eventType:u.eventType}},_toJsonObject(u){return{channels:u.channels,eventType:u.eventType}}}});var A6=E((u6)=>{Object.defineProperty(u6,"__esModule",{value:!0});u6.MessagePrecheckOutSerializer=void 0;u6.MessagePrecheckOutSerializer={_fromJsonObject(u){return{active:u.active}},_toJsonObject(u){return{active:u.active}}}});var w6=E((B6)=>{Object.defineProperty(B6,"__esModule",{value:!0});B6.PollingEndpointConsumerSeekInSerializer=void 0;B6.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(u){return{after:new Date(u.after)}},_toJsonObject(u){return{after:u.after}}}});var N6=E((E6)=>{Object.defineProperty(E6,"__esModule",{value:!0});E6.PollingEndpointConsumerSeekOutSerializer=void 0;E6.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(u){return{iterator:u.iterator}},_toJsonObject(u){return{iterator:u.iterator}}}});var z6=E((J6)=>{Object.defineProperty(J6,"__esModule",{value:!0});J6.PollingEndpointMessageOutSerializer=void 0;J6.PollingEndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var Q6=E((X6)=>{Object.defineProperty(X6,"__esModule",{value:!0});X6.PollingEndpointOutSerializer=void 0;var $6=z6();X6.PollingEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>$6.PollingEndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>$6.PollingEndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var C6=E((K6)=>{Object.defineProperty(K6,"__esModule",{value:!0});K6.MessagePoller=void 0;var BN=w6(),FN=N6(),V6=Q6(),G2=R();class W6{constructor(u){this.requestCtx=u}poll(u,D,A){let B=new G2.SvixRequest(G2.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return B.setPathParam("app_id",u),B.setPathParam("sink_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator,event_type:A===null||A===void 0?void 0:A.eventType,channel:A===null||A===void 0?void 0:A.channel,after:A===null||A===void 0?void 0:A.after}),B.send(this.requestCtx,V6.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(u,D,A,B){let F=new G2.SvixRequest(G2.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return F.setPathParam("app_id",u),F.setPathParam("sink_id",D),F.setPathParam("consumer_id",A),F.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator}),F.send(this.requestCtx,V6.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(u,D,A,B,F){let G=new G2.SvixRequest(G2.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return G.setPathParam("app_id",u),G.setPathParam("sink_id",D),G.setPathParam("consumer_id",A),G.setHeaderParam("idempotency-key",F===null||F===void 0?void 0:F.idempotencyKey),G.setBody(BN.PollingEndpointConsumerSeekInSerializer._toJsonObject(B)),G.send(this.requestCtx,FN.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}}K6.MessagePoller=W6});var L6=E((P6)=>{Object.defineProperty(P6,"__esModule",{value:!0});P6.MessageInSerializer=void 0;var U6=T2();P6.MessageInSerializer={_fromJsonObject(u){return{application:u.application!=null?U6.ApplicationInSerializer._fromJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}},_toJsonObject(u){return{application:u.application!=null?U6.ApplicationInSerializer._toJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}}}});var K0=E((S6)=>{Object.defineProperty(S6,"__esModule",{value:!0});S6.messageInRaw=S6.Message=void 0;var wN=i4(),EN=s4(),v6=K2(),GN=e4(),NN=A6(),JN=C6(),i=R(),ZN=L6();class M6{constructor(u){this.requestCtx=u}get poller(){return new JN.MessagePoller(this.requestCtx)}list(u,D){let A=new i.SvixRequest(i.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return A.setPathParam("app_id",u),A.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,channel:D===null||D===void 0?void 0:D.channel,before:D===null||D===void 0?void 0:D.before,after:D===null||D===void 0?void 0:D.after,with_content:D===null||D===void 0?void 0:D.withContent,tag:D===null||D===void 0?void 0:D.tag,event_types:D===null||D===void 0?void 0:D.eventTypes}),A.send(this.requestCtx,EN.ListResponseMessageOutSerializer._fromJsonObject)}create(u,D,A){let B=new i.SvixRequest(i.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return B.setPathParam("app_id",u),B.setQueryParams({with_content:A===null||A===void 0?void 0:A.withContent}),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(ZN.MessageInSerializer._toJsonObject(D)),B.send(this.requestCtx,v6.MessageOutSerializer._fromJsonObject)}expungeAllContents(u,D){let A=new i.SvixRequest(i.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.send(this.requestCtx,wN.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(u,D,A){let B=new i.SvixRequest(i.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(GN.MessagePrecheckInSerializer._toJsonObject(D)),B.send(this.requestCtx,NN.MessagePrecheckOutSerializer._fromJsonObject)}get(u,D,A){let B=new i.SvixRequest(i.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.setQueryParams({with_content:A===null||A===void 0?void 0:A.withContent}),B.send(this.requestCtx,v6.MessageOutSerializer._fromJsonObject)}expungeContent(u,D){let A=new i.SvixRequest(i.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.sendNoResponseBody(this.requestCtx)}}S6.Message=M6;function zN(u,D,A){return{eventType:u,payload:{},transformationsParams:{rawPayload:D,headers:A?{"content-type":A}:void 0}}}S6.messageInRaw=zN});var H0=E((h6)=>{Object.defineProperty(h6,"__esModule",{value:!0});h6.EmptyResponseSerializer=void 0;h6.EmptyResponseSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var H2=E((k6)=>{Object.defineProperty(k6,"__esModule",{value:!0});k6.MessageStatusTextSerializer=k6.MessageStatusText=void 0;var XN;(function(u){u.Success="success",u.Pending="pending",u.Fail="fail",u.Sending="sending"})(XN=k6.MessageStatusText||(k6.MessageStatusText={}));k6.MessageStatusTextSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var g6=E((_6)=>{Object.defineProperty(_6,"__esModule",{value:!0});_6.EndpointMessageOutSerializer=void 0;var x6=E2(),y6=H2();_6.EndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,payload:u.payload,status:x6.MessageStatusSerializer._fromJsonObject(u.status),statusText:y6.MessageStatusTextSerializer._fromJsonObject(u.statusText),tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt,payload:u.payload,status:x6.MessageStatusSerializer._toJsonObject(u.status),statusText:y6.MessageStatusTextSerializer._toJsonObject(u.statusText),tags:u.tags,timestamp:u.timestamp}}}});var l6=E((j6)=>{Object.defineProperty(j6,"__esModule",{value:!0});j6.ListResponseEndpointMessageOutSerializer=void 0;var b6=g6();j6.ListResponseEndpointMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>b6.EndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>b6.EndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var C0=E((r6)=>{Object.defineProperty(r6,"__esModule",{value:!0});r6.MessageAttemptTriggerTypeSerializer=r6.MessageAttemptTriggerType=void 0;var YN;(function(u){u[u.Scheduled=0]="Scheduled",u[u.Manual=1]="Manual"})(YN=r6.MessageAttemptTriggerType||(r6.MessageAttemptTriggerType={}));r6.MessageAttemptTriggerTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var U0=E((s6)=>{Object.defineProperty(s6,"__esModule",{value:!0});s6.MessageAttemptOutSerializer=void 0;var i6=C0(),a6=K2(),p6=E2(),n6=H2();s6.MessageAttemptOutSerializer={_fromJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?a6.MessageOutSerializer._fromJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:p6.MessageStatusSerializer._fromJsonObject(u.status),statusText:n6.MessageStatusTextSerializer._fromJsonObject(u.statusText),timestamp:new Date(u.timestamp),triggerType:i6.MessageAttemptTriggerTypeSerializer._fromJsonObject(u.triggerType),url:u.url}},_toJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?a6.MessageOutSerializer._toJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:p6.MessageStatusSerializer._toJsonObject(u.status),statusText:n6.MessageStatusTextSerializer._toJsonObject(u.statusText),timestamp:u.timestamp,triggerType:i6.MessageAttemptTriggerTypeSerializer._toJsonObject(u.triggerType),url:u.url}}}});var DB=E((e6)=>{Object.defineProperty(e6,"__esModule",{value:!0});e6.ListResponseMessageAttemptOutSerializer=void 0;var t6=U0();e6.ListResponseMessageAttemptOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>t6.MessageAttemptOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>t6.MessageAttemptOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var EB=E((FB)=>{Object.defineProperty(FB,"__esModule",{value:!0});FB.MessageEndpointOutSerializer=void 0;var AB=E2(),BB=H2();FB.MessageEndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,rateLimit:u.rateLimit,status:AB.MessageStatusSerializer._fromJsonObject(u.status),statusText:BB.MessageStatusTextSerializer._fromJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt,rateLimit:u.rateLimit,status:AB.MessageStatusSerializer._toJsonObject(u.status),statusText:BB.MessageStatusTextSerializer._toJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var ZB=E((NB)=>{Object.defineProperty(NB,"__esModule",{value:!0});NB.ListResponseMessageEndpointOutSerializer=void 0;var GB=EB();NB.ListResponseMessageEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>GB.MessageEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>GB.MessageEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var QB=E((XB)=>{Object.defineProperty(XB,"__esModule",{value:!0});XB.MessageAttempt=void 0;var QN=H0(),VN=l6(),zB=DB(),WN=ZB(),KN=U0(),f=R();class $B{constructor(u){this.requestCtx=u}listByEndpoint(u,D,A){let B=new f.SvixRequest(f.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator,status:A===null||A===void 0?void 0:A.status,status_code_class:A===null||A===void 0?void 0:A.statusCodeClass,channel:A===null||A===void 0?void 0:A.channel,tag:A===null||A===void 0?void 0:A.tag,before:A===null||A===void 0?void 0:A.before,after:A===null||A===void 0?void 0:A.after,with_content:A===null||A===void 0?void 0:A.withContent,with_msg:A===null||A===void 0?void 0:A.withMsg,event_types:A===null||A===void 0?void 0:A.eventTypes}),B.send(this.requestCtx,zB.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(u,D,A){let B=new f.SvixRequest(f.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator,status:A===null||A===void 0?void 0:A.status,status_code_class:A===null||A===void 0?void 0:A.statusCodeClass,channel:A===null||A===void 0?void 0:A.channel,tag:A===null||A===void 0?void 0:A.tag,endpoint_id:A===null||A===void 0?void 0:A.endpointId,before:A===null||A===void 0?void 0:A.before,after:A===null||A===void 0?void 0:A.after,with_content:A===null||A===void 0?void 0:A.withContent,event_types:A===null||A===void 0?void 0:A.eventTypes}),B.send(this.requestCtx,zB.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(u,D,A){let B=new f.SvixRequest(f.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator,channel:A===null||A===void 0?void 0:A.channel,tag:A===null||A===void 0?void 0:A.tag,status:A===null||A===void 0?void 0:A.status,before:A===null||A===void 0?void 0:A.before,after:A===null||A===void 0?void 0:A.after,with_content:A===null||A===void 0?void 0:A.withContent,event_types:A===null||A===void 0?void 0:A.eventTypes}),B.send(this.requestCtx,VN.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(u,D,A){let B=new f.SvixRequest(f.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.setPathParam("attempt_id",A),B.send(this.requestCtx,KN.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(u,D,A){let B=new f.SvixRequest(f.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.setPathParam("attempt_id",A),B.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(u,D,A){let B=new f.SvixRequest(f.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator}),B.send(this.requestCtx,WN.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(u,D,A,B){let F=new f.SvixRequest(f.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return F.setPathParam("app_id",u),F.setPathParam("msg_id",D),F.setPathParam("endpoint_id",A),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.send(this.requestCtx,QN.EmptyResponseSerializer._fromJsonObject)}}XB.MessageAttempt=$B});var P0=E((VB)=>{Object.defineProperty(VB,"__esModule",{value:!0});VB.OperationalWebhookEndpointOutSerializer=void 0;VB.OperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var UB=E((HB)=>{Object.defineProperty(HB,"__esModule",{value:!0});HB.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var KB=P0();HB.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>KB.OperationalWebhookEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>KB.OperationalWebhookEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var LB=E((PB)=>{Object.defineProperty(PB,"__esModule",{value:!0});PB.OperationalWebhookEndpointHeadersInSerializer=void 0;PB.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var SB=E((vB)=>{Object.defineProperty(vB,"__esModule",{value:!0});vB.OperationalWebhookEndpointHeadersOutSerializer=void 0;vB.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var OB=E((TB)=>{Object.defineProperty(TB,"__esModule",{value:!0});TB.OperationalWebhookEndpointInSerializer=void 0;TB.OperationalWebhookEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var IB=E((qB)=>{Object.defineProperty(qB,"__esModule",{value:!0});qB.OperationalWebhookEndpointSecretInSerializer=void 0;qB.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var _B=E((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});xB.OperationalWebhookEndpointSecretOutSerializer=void 0;xB.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var bB=E((mB)=>{Object.defineProperty(mB,"__esModule",{value:!0});mB.OperationalWebhookEndpointUpdateSerializer=void 0;mB.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var L0=E((fB)=>{Object.defineProperty(fB,"__esModule",{value:!0});fB.OperationalWebhookEndpoint=void 0;var HN=UB(),CN=LB(),UN=SB(),PN=OB(),R0=P0(),RN=IB(),LN=_B(),vN=bB(),k=R();class jB{constructor(u){this.requestCtx=u}list(u){let D=new k.SvixRequest(k.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,HN.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(u,D){let A=new k.SvixRequest(k.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(PN.OperationalWebhookEndpointInSerializer._toJsonObject(u)),A.send(this.requestCtx,R0.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(u){let D=new k.SvixRequest(k.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,R0.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(u,D){let A=new k.SvixRequest(k.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return A.setPathParam("endpoint_id",u),A.setBody(vN.OperationalWebhookEndpointUpdateSerializer._toJsonObject(D)),A.send(this.requestCtx,R0.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(u){let D=new k.SvixRequest(k.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.sendNoResponseBody(this.requestCtx)}getHeaders(u){let D=new k.SvixRequest(k.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,UN.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D){let A=new k.SvixRequest(k.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return A.setPathParam("endpoint_id",u),A.setBody(CN.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}getSecret(u){let D=new k.SvixRequest(k.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,LN.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,A){let B=new k.SvixRequest(k.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return B.setPathParam("endpoint_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(RN.OperationalWebhookEndpointSecretInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}}fB.OperationalWebhookEndpoint=jB});var iB=E((rB)=>{Object.defineProperty(rB,"__esModule",{value:!0});rB.OperationalWebhook=void 0;var MN=L0();class dB{constructor(u){this.requestCtx=u}get endpoint(){return new MN.OperationalWebhookEndpoint(this.requestCtx)}}rB.OperationalWebhook=dB});var oB=E((nB)=>{Object.defineProperty(nB,"__esModule",{value:!0});nB.AggregateEventTypesOutSerializer=void 0;var aB=t(),pB=e();nB.AggregateEventTypesOutSerializer={_fromJsonObject(u){return{id:u.id,status:aB.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:pB.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:aB.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:pB.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var uF=E((tB)=>{Object.defineProperty(tB,"__esModule",{value:!0});tB.AppUsageStatsInSerializer=void 0;tB.AppUsageStatsInSerializer={_fromJsonObject(u){return{appIds:u.appIds,since:new Date(u.since),until:new Date(u.until)}},_toJsonObject(u){return{appIds:u.appIds,since:u.since,until:u.until}}}});var wF=E((BF)=>{Object.defineProperty(BF,"__esModule",{value:!0});BF.AppUsageStatsOutSerializer=void 0;var DF=t(),AF=e();BF.AppUsageStatsOutSerializer={_fromJsonObject(u){return{id:u.id,status:DF.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:AF.BackgroundTaskTypeSerializer._fromJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:DF.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:AF.BackgroundTaskTypeSerializer._toJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:u.updatedAt}}}});var JF=E((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});GF.Statistics=void 0;var SN=oB(),TN=uF(),hN=wF(),m2=R();class EF{constructor(u){this.requestCtx=u}aggregateAppStats(u,D){let A=new m2.SvixRequest(m2.HttpMethod.POST,"/api/v1/stats/usage/app");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(TN.AppUsageStatsInSerializer._toJsonObject(u)),A.send(this.requestCtx,hN.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new m2.SvixRequest(m2.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,SN.AggregateEventTypesOutSerializer._fromJsonObject)}}GF.Statistics=EF});var $F=E((ZF)=>{Object.defineProperty(ZF,"__esModule",{value:!0});ZF.HttpSinkHeadersPatchInSerializer=void 0;ZF.HttpSinkHeadersPatchInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var QF=E((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});XF.SinkTransformationOutSerializer=void 0;XF.SinkTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var v0=E((VF)=>{Object.defineProperty(VF,"__esModule",{value:!0});VF.StreamEventTypeOutSerializer=void 0;VF.StreamEventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:u.updatedAt}}}});var UF=E((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});HF.ListResponseStreamEventTypeOutSerializer=void 0;var KF=v0();HF.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>KF.StreamEventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>KF.StreamEventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var LF=E((PF)=>{Object.defineProperty(PF,"__esModule",{value:!0});PF.StreamEventTypeInSerializer=void 0;PF.StreamEventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var SF=E((vF)=>{Object.defineProperty(vF,"__esModule",{value:!0});vF.StreamEventTypePatchSerializer=void 0;vF.StreamEventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var kF=E((OF)=>{Object.defineProperty(OF,"__esModule",{value:!0});OF.StreamingEventType=void 0;var ON=UF(),TF=LF(),g2=v0(),qN=SF(),a=R();class hF{constructor(u){this.requestCtx=u}list(u){let D=new a.SvixRequest(a.HttpMethod.GET,"/api/v1/stream/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived}),D.send(this.requestCtx,ON.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(u,D){let A=new a.SvixRequest(a.HttpMethod.POST,"/api/v1/stream/event-type");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(TF.StreamEventTypeInSerializer._toJsonObject(u)),A.send(this.requestCtx,g2.StreamEventTypeOutSerializer._fromJsonObject)}get(u){let D=new a.SvixRequest(a.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return D.setPathParam("name",u),D.send(this.requestCtx,g2.StreamEventTypeOutSerializer._fromJsonObject)}update(u,D){let A=new a.SvixRequest(a.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return A.setPathParam("name",u),A.setBody(TF.StreamEventTypeInSerializer._toJsonObject(D)),A.send(this.requestCtx,g2.StreamEventTypeOutSerializer._fromJsonObject)}delete(u,D){let A=new a.SvixRequest(a.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return A.setPathParam("name",u),A.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),A.sendNoResponseBody(this.requestCtx)}patch(u,D){let A=new a.SvixRequest(a.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return A.setPathParam("name",u),A.setBody(qN.StreamEventTypePatchSerializer._toJsonObject(D)),A.send(this.requestCtx,g2.StreamEventTypeOutSerializer._fromJsonObject)}}OF.StreamingEventType=hF});var yF=E((IF)=>{Object.defineProperty(IF,"__esModule",{value:!0});IF.EventInSerializer=void 0;IF.EventInSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload}}}});var M0=E((_F)=>{Object.defineProperty(_F,"__esModule",{value:!0});_F.StreamInSerializer=void 0;_F.StreamInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}}}});var lF=E((jF)=>{Object.defineProperty(jF,"__esModule",{value:!0});jF.CreateStreamEventsInSerializer=void 0;var gF=yF(),bF=M0();jF.CreateStreamEventsInSerializer={_fromJsonObject(u){return{events:u.events.map((D)=>gF.EventInSerializer._fromJsonObject(D)),stream:u.stream!=null?bF.StreamInSerializer._fromJsonObject(u.stream):void 0}},_toJsonObject(u){return{events:u.events.map((D)=>gF.EventInSerializer._toJsonObject(D)),stream:u.stream!=null?bF.StreamInSerializer._toJsonObject(u.stream):void 0}}}});var cF=E((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});dF.CreateStreamEventsOutSerializer=void 0;dF.CreateStreamEventsOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var pF=E((iF)=>{Object.defineProperty(iF,"__esModule",{value:!0});iF.EventOutSerializer=void 0;iF.EventOutSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:u.timestamp}}}});var tF=E((sF)=>{Object.defineProperty(sF,"__esModule",{value:!0});sF.EventStreamOutSerializer=void 0;var nF=pF();sF.EventStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>nF.EventOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>nF.EventOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var A7=E((u7)=>{Object.defineProperty(u7,"__esModule",{value:!0});u7.StreamingEvents=void 0;var kN=lF(),IN=cF(),xN=tF(),b2=R();class eF{constructor(u){this.requestCtx=u}create(u,D,A){let B=new b2.SvixRequest(b2.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return B.setPathParam("stream_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(kN.CreateStreamEventsInSerializer._toJsonObject(D)),B.send(this.requestCtx,IN.CreateStreamEventsOutSerializer._fromJsonObject)}get(u,D,A){let B=new b2.SvixRequest(b2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator,after:A===null||A===void 0?void 0:A.after}),B.send(this.requestCtx,xN.EventStreamOutSerializer._fromJsonObject)}}u7.StreamingEvents=eF});var S0=E((B7)=>{Object.defineProperty(B7,"__esModule",{value:!0});B7.AzureBlobStorageConfigSerializer=void 0;B7.AzureBlobStorageConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var T0=E((w7)=>{Object.defineProperty(w7,"__esModule",{value:!0});w7.GoogleCloudStorageConfigSerializer=void 0;w7.GoogleCloudStorageConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var h0=E((G7)=>{Object.defineProperty(G7,"__esModule",{value:!0});G7.S3ConfigSerializer=void 0;G7.S3ConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var O0=E((J7)=>{Object.defineProperty(J7,"__esModule",{value:!0});J7.SinkHttpConfigSerializer=void 0;J7.SinkHttpConfigSerializer={_fromJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}},_toJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}}}});var q0=E((z7)=>{Object.defineProperty(z7,"__esModule",{value:!0});z7.SinkOtelV1ConfigSerializer=void 0;z7.SinkOtelV1ConfigSerializer={_fromJsonObject(u){return{headers:u.headers,url:u.url}},_toJsonObject(u){return{headers:u.headers,url:u.url}}}});var k0=E((Y7)=>{Object.defineProperty(Y7,"__esModule",{value:!0});Y7.SinkStatusSerializer=Y7.SinkStatus=void 0;var yN;(function(u){u.Enabled="enabled",u.Paused="paused",u.Disabled="disabled",u.Retrying="retrying"})(yN=Y7.SinkStatus||(Y7.SinkStatus={}));Y7.SinkStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var I0=E((P7)=>{Object.defineProperty(P7,"__esModule",{value:!0});P7.StreamSinkOutSerializer=void 0;var V7=S0(),W7=T0(),K7=h0(),H7=O0(),C7=q0(),U7=k0();P7.StreamSinkOutSerializer={_fromJsonObject(u){let D=u.type;function A(B){switch(B){case"poller":return{};case"azureBlobStorage":return V7.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return C7.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return H7.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return K7.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return W7.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${B}`)}}return{type:D,config:A(D),batchSize:u.batchSize,createdAt:new Date(u.createdAt),currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt?new Date(u.nextRetryAt):null,status:U7.SinkStatusSerializer._fromJsonObject(u.status),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=V7.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=C7.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=H7.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=K7.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=W7.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,createdAt:u.createdAt,currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt,status:U7.SinkStatusSerializer._toJsonObject(u.status),uid:u.uid,updatedAt:u.updatedAt}}}});var S7=E((v7)=>{Object.defineProperty(v7,"__esModule",{value:!0});v7.ListResponseStreamSinkOutSerializer=void 0;var L7=I0();v7.ListResponseStreamSinkOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>L7.StreamSinkOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>L7.StreamSinkOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var O7=E((T7)=>{Object.defineProperty(T7,"__esModule",{value:!0});T7.SinkSecretOutSerializer=void 0;T7.SinkSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var I7=E((q7)=>{Object.defineProperty(q7,"__esModule",{value:!0});q7.SinkTransformInSerializer=void 0;q7.SinkTransformInSerializer={_fromJsonObject(u){return{code:u.code}},_toJsonObject(u){return{code:u.code}}}});var j2=E((y7)=>{Object.defineProperty(y7,"__esModule",{value:!0});y7.SinkStatusInSerializer=y7.SinkStatusIn=void 0;var _N;(function(u){u.Enabled="enabled",u.Disabled="disabled"})(_N=y7.SinkStatusIn||(y7.SinkStatusIn={}));y7.SinkStatusInSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var c7=E((d7)=>{Object.defineProperty(d7,"__esModule",{value:!0});d7.StreamSinkInSerializer=void 0;var m7=S0(),g7=T0(),b7=h0(),j7=O0(),f7=q0(),l7=j2();d7.StreamSinkInSerializer={_fromJsonObject(u){let D=u.type;function A(B){switch(B){case"poller":return{};case"azureBlobStorage":return m7.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return f7.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return j7.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return b7.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return g7.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${B}`)}}return{type:D,config:A(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?l7.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=m7.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=f7.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=j7.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=b7.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=g7.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?l7.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var p7=E((i7)=>{Object.defineProperty(i7,"__esModule",{value:!0});i7.AmazonS3PatchConfigSerializer=void 0;i7.AmazonS3PatchConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var o7=E((n7)=>{Object.defineProperty(n7,"__esModule",{value:!0});n7.AzureBlobStoragePatchConfigSerializer=void 0;n7.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var uw=E((t7)=>{Object.defineProperty(t7,"__esModule",{value:!0});t7.GoogleCloudStoragePatchConfigSerializer=void 0;t7.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var Bw=E((Dw)=>{Object.defineProperty(Dw,"__esModule",{value:!0});Dw.HttpPatchConfigSerializer=void 0;Dw.HttpPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var Ew=E((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.OtelTracingPatchConfigSerializer=void 0;Fw.OtelTracingPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var Qw=E((Xw)=>{Object.defineProperty(Xw,"__esModule",{value:!0});Xw.StreamSinkPatchSerializer=void 0;var Gw=p7(),Nw=o7(),Jw=uw(),Zw=Bw(),zw=Ew(),$w=j2();Xw.StreamSinkPatchSerializer={_fromJsonObject(u){let D=u.type;function A(B){switch(B){case"poller":return{};case"azureBlobStorage":return Nw.AzureBlobStoragePatchConfigSerializer._fromJsonObject(u.config);case"otelTracing":return zw.OtelTracingPatchConfigSerializer._fromJsonObject(u.config);case"http":return Zw.HttpPatchConfigSerializer._fromJsonObject(u.config);case"amazonS3":return Gw.AmazonS3PatchConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return Jw.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${B}`)}}return{type:D,config:A(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?$w.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=Nw.AzureBlobStoragePatchConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=zw.OtelTracingPatchConfigSerializer._toJsonObject(u.config);break;case"http":D=Zw.HttpPatchConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=Gw.AmazonS3PatchConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=Jw.GoogleCloudStoragePatchConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?$w.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var Uw=E((Hw)=>{Object.defineProperty(Hw,"__esModule",{value:!0});Hw.StreamingSink=void 0;var Vw=H0(),mN=J0(),gN=S7(),bN=O7(),jN=I7(),Ww=c7(),f2=I0(),fN=Qw(),I=R();class Kw{constructor(u){this.requestCtx=u}list(u,D){let A=new I.SvixRequest(I.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return A.setPathParam("stream_id",u),A.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),A.send(this.requestCtx,gN.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(u,D,A){let B=new I.SvixRequest(I.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return B.setPathParam("stream_id",u),B.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),B.setBody(Ww.StreamSinkInSerializer._toJsonObject(D)),B.send(this.requestCtx,f2.StreamSinkOutSerializer._fromJsonObject)}get(u,D){let A=new I.SvixRequest(I.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.send(this.requestCtx,f2.StreamSinkOutSerializer._fromJsonObject)}update(u,D,A){let B=new I.SvixRequest(I.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.setBody(Ww.StreamSinkInSerializer._toJsonObject(A)),B.send(this.requestCtx,f2.StreamSinkOutSerializer._fromJsonObject)}delete(u,D){let A=new I.SvixRequest(I.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.sendNoResponseBody(this.requestCtx)}patch(u,D,A){let B=new I.SvixRequest(I.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.setBody(fN.StreamSinkPatchSerializer._toJsonObject(A)),B.send(this.requestCtx,f2.StreamSinkOutSerializer._fromJsonObject)}getSecret(u,D){let A=new I.SvixRequest(I.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.send(this.requestCtx,bN.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,A,B){let F=new I.SvixRequest(I.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return F.setPathParam("stream_id",u),F.setPathParam("sink_id",D),F.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),F.setBody(mN.EndpointSecretRotateInSerializer._toJsonObject(A)),F.send(this.requestCtx,Vw.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(u,D,A){let B=new I.SvixRequest(I.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.setBody(jN.SinkTransformInSerializer._toJsonObject(A)),B.send(this.requestCtx,Vw.EmptyResponseSerializer._fromJsonObject)}}Hw.StreamingSink=Kw});var x0=E((Pw)=>{Object.defineProperty(Pw,"__esModule",{value:!0});Pw.StreamOutSerializer=void 0;Pw.StreamOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var Sw=E((vw)=>{Object.defineProperty(vw,"__esModule",{value:!0});vw.ListResponseStreamOutSerializer=void 0;var Lw=x0();vw.ListResponseStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Lw.StreamOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Lw.StreamOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Ow=E((Tw)=>{Object.defineProperty(Tw,"__esModule",{value:!0});Tw.StreamPatchSerializer=void 0;Tw.StreamPatchSerializer={_fromJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}},_toJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}}}});var yw=E((Iw)=>{Object.defineProperty(Iw,"__esModule",{value:!0});Iw.StreamingStream=void 0;var lN=Sw(),qw=M0(),l2=x0(),dN=Ow(),p=R();class kw{constructor(u){this.requestCtx=u}list(u){let D=new p.SvixRequest(p.HttpMethod.GET,"/api/v1/stream");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,lN.ListResponseStreamOutSerializer._fromJsonObject)}create(u,D){let A=new p.SvixRequest(p.HttpMethod.POST,"/api/v1/stream");return A.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),A.setBody(qw.StreamInSerializer._toJsonObject(u)),A.send(this.requestCtx,l2.StreamOutSerializer._fromJsonObject)}get(u){let D=new p.SvixRequest(p.HttpMethod.GET,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.send(this.requestCtx,l2.StreamOutSerializer._fromJsonObject)}update(u,D){let A=new p.SvixRequest(p.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return A.setPathParam("stream_id",u),A.setBody(qw.StreamInSerializer._toJsonObject(D)),A.send(this.requestCtx,l2.StreamOutSerializer._fromJsonObject)}delete(u){let D=new p.SvixRequest(p.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let A=new p.SvixRequest(p.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return A.setPathParam("stream_id",u),A.setBody(dN.StreamPatchSerializer._toJsonObject(D)),A.send(this.requestCtx,l2.StreamOutSerializer._fromJsonObject)}}Iw.StreamingStream=kw});var jw=E((gw)=>{Object.defineProperty(gw,"__esModule",{value:!0});gw.Streaming=void 0;var _w=G0(),rN=$F(),cN=QF(),iN=kF(),aN=A7(),pN=Uw(),nN=yw(),N2=R();class mw{constructor(u){this.requestCtx=u}get event_type(){return new iN.StreamingEventType(this.requestCtx)}get events(){return new aN.StreamingEvents(this.requestCtx)}get sink(){return new pN.StreamingSink(this.requestCtx)}get stream(){return new nN.StreamingStream(this.requestCtx)}sinkHeadersGet(u,D){let A=new N2.SvixRequest(N2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.send(this.requestCtx,_w.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(u,D,A){let B=new N2.SvixRequest(N2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.setBody(rN.HttpSinkHeadersPatchInSerializer._toJsonObject(A)),B.send(this.requestCtx,_w.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(u,D){let A=new N2.SvixRequest(N2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.send(this.requestCtx,cN.SinkTransformationOutSerializer._fromJsonObject)}}gw.Streaming=mw});var dw=E((fw)=>{Object.defineProperty(fw,"__esModule",{value:!0});fw.HTTPValidationError=fw.ValidationError=fw.HttpErrorOut=void 0;class J2{static getAttributeTypeMap(){return J2.attributeTypeMap}}fw.HttpErrorOut=J2;J2.discriminator=void 0;J2.mapping=void 0;J2.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];class Z2{static getAttributeTypeMap(){return Z2.attributeTypeMap}}fw.ValidationError=Z2;Z2.discriminator=void 0;Z2.mapping=void 0;Z2.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];class z2{static getAttributeTypeMap(){return z2.attributeTypeMap}}fw.HTTPValidationError=z2;z2.discriminator=void 0;z2.mapping=void 0;z2.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var aw=E((cw)=>{Object.defineProperty(cw,"__esModule",{value:!0});cw.timingSafeEqual=void 0;function rw(u,D=""){if(!u)throw Error(D)}function tN(u,D){if(u.byteLength!==D.byteLength)return!1;if(!(u instanceof DataView))u=new DataView(ArrayBuffer.isView(u)?u.buffer:u);if(!(D instanceof DataView))D=new DataView(ArrayBuffer.isView(D)?D.buffer:D);rw(u instanceof DataView),rw(D instanceof DataView);let A=u.byteLength,B=0,F=-1;while(++F<A)B|=u.getUint8(F)^D.getUint8(F);return B===0}cw.timingSafeEqual=tN});var sw=E((l)=>{var eN=l&&l.__extends||function(){var u=function(D,A){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,F){B.__proto__=F}||function(B,F){for(var G in F)if(F.hasOwnProperty(G))B[G]=F[G]},u(D,A)};return function(D,A){u(D,A);function B(){this.constructor=D}D.prototype=A===null?Object.create(A):(B.prototype=A.prototype,new B)}}();Object.defineProperty(l,"__esModule",{value:!0});var M=256,y0=function(){function u(D){if(D===void 0)D="=";this._paddingCharacter=D}return u.prototype.encodedLength=function(D){if(!this._paddingCharacter)return(D*8+5)/6|0;return(D+2)/3*4|0},u.prototype.encode=function(D){var A="",B=0;for(;B<D.length-2;B+=3){var F=D[B]<<16|D[B+1]<<8|D[B+2];A+=this._encodeByte(F>>>18&63),A+=this._encodeByte(F>>>12&63),A+=this._encodeByte(F>>>6&63),A+=this._encodeByte(F>>>0&63)}var G=D.length-B;if(G>0){var F=D[B]<<16|(G===2?D[B+1]<<8:0);if(A+=this._encodeByte(F>>>18&63),A+=this._encodeByte(F>>>12&63),G===2)A+=this._encodeByte(F>>>6&63);else A+=this._paddingCharacter||"";A+=this._paddingCharacter||""}return A},u.prototype.maxDecodedLength=function(D){if(!this._paddingCharacter)return(D*6+7)/8|0;return D/4*3|0},u.prototype.decodedLength=function(D){return this.maxDecodedLength(D.length-this._getPaddingLength(D))},u.prototype.decode=function(D){if(D.length===0)return new Uint8Array(0);var A=this._getPaddingLength(D),B=D.length-A,F=new Uint8Array(this.maxDecodedLength(B)),G=0,w=0,N=0,J=0,$=0,X=0,z=0;for(;w<B-4;w+=4)J=this._decodeChar(D.charCodeAt(w+0)),$=this._decodeChar(D.charCodeAt(w+1)),X=this._decodeChar(D.charCodeAt(w+2)),z=this._decodeChar(D.charCodeAt(w+3)),F[G++]=J<<2|$>>>4,F[G++]=$<<4|X>>>2,F[G++]=X<<6|z,N|=J&M,N|=$&M,N|=X&M,N|=z&M;if(w<B-1)J=this._decodeChar(D.charCodeAt(w)),$=this._decodeChar(D.charCodeAt(w+1)),F[G++]=J<<2|$>>>4,N|=J&M,N|=$&M;if(w<B-2)X=this._decodeChar(D.charCodeAt(w+2)),F[G++]=$<<4|X>>>2,N|=X&M;if(w<B-3)z=this._decodeChar(D.charCodeAt(w+3)),F[G++]=X<<6|z,N|=z&M;if(N!==0)throw Error("Base64Coder: incorrect characters for decoding");return F},u.prototype._encodeByte=function(D){var A=D;return A+=65,A+=25-D>>>8&6,A+=51-D>>>8&-75,A+=61-D>>>8&-15,A+=62-D>>>8&3,String.fromCharCode(A)},u.prototype._decodeChar=function(D){var A=M;return A+=(42-D&D-44)>>>8&-M+D-43+62,A+=(46-D&D-48)>>>8&-M+D-47+63,A+=(47-D&D-58)>>>8&-M+D-48+52,A+=(64-D&D-91)>>>8&-M+D-65+0,A+=(96-D&D-123)>>>8&-M+D-97+26,A},u.prototype._getPaddingLength=function(D){var A=0;if(this._paddingCharacter){for(var B=D.length-1;B>=0;B--){if(D[B]!==this._paddingCharacter)break;A++}if(D.length<4||A>2)throw Error("Base64Coder: incorrect padding")}return A},u}();l.Coder=y0;var C2=new y0;function uJ(u){return C2.encode(u)}l.encode=uJ;function DJ(u){return C2.decode(u)}l.decode=DJ;var pw=function(u){eN(D,u);function D(){return u!==null&&u.apply(this,arguments)||this}return D.prototype._encodeByte=function(A){var B=A;return B+=65,B+=25-A>>>8&6,B+=51-A>>>8&-75,B+=61-A>>>8&-13,B+=62-A>>>8&49,String.fromCharCode(B)},D.prototype._decodeChar=function(A){var B=M;return B+=(44-A&A-46)>>>8&-M+A-45+62,B+=(94-A&A-96)>>>8&-M+A-95+63,B+=(47-A&A-58)>>>8&-M+A-48+52,B+=(64-A&A-91)>>>8&-M+A-65+0,B+=(96-A&A-123)>>>8&-M+A-97+26,B},D}(y0);l.URLSafeCoder=pw;var nw=new pw;function AJ(u){return nw.encode(u)}l.encodeURLSafe=AJ;function BJ(u){return nw.decode(u)}l.decodeURLSafe=BJ;l.encodedLength=function(u){return C2.encodedLength(u)};l.maxDecodedLength=function(u){return C2.maxDecodedLength(u)};l.decodedLength=function(u){return C2.decodedLength(u)}});var tw=E((ow,d2)=>{(function(u,D){var A={};D(A);var B=A.default;for(var F in A)B[F]=A[F];if(typeof d2==="object"&&typeof d2.exports==="object")d2.exports=B;else if(typeof define==="function"&&define.amd)define(function(){return B});else u.sha256=B})(ow,function(u){u.__esModule=!0,u.digestLength=32,u.blockSize=64;var D=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function A(z,Z,Y,Q,L){var C,U,H,_,T,P,n,h,y,O,$2,X2,P2;while(L>=64){C=Z[0],U=Z[1],H=Z[2],_=Z[3],T=Z[4],P=Z[5],n=Z[6],h=Z[7];for(O=0;O<16;O++)$2=Q+O*4,z[O]=(Y[$2]&255)<<24|(Y[$2+1]&255)<<16|(Y[$2+2]&255)<<8|Y[$2+3]&255;for(O=16;O<64;O++)y=z[O-2],X2=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10,y=z[O-15],P2=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3,z[O]=(X2+z[O-7]|0)+(P2+z[O-16]|0);for(O=0;O<64;O++)X2=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&P^~T&n)|0)+(h+(D[O]+z[O]|0)|0)|0,P2=((C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10))+(C&U^C&H^U&H)|0,h=n,n=P,P=T,T=_+X2|0,_=H,H=U,U=C,C=X2+P2|0;Z[0]+=C,Z[1]+=U,Z[2]+=H,Z[3]+=_,Z[4]+=T,Z[5]+=P,Z[6]+=n,Z[7]+=h,Q+=64,L-=64}return Q}var B=function(){function z(){this.digestLength=u.digestLength,this.blockSize=u.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return z.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},z.prototype.clean=function(){for(var Z=0;Z<this.buffer.length;Z++)this.buffer[Z]=0;for(var Z=0;Z<this.temp.length;Z++)this.temp[Z]=0;this.reset()},z.prototype.update=function(Z,Y){if(Y===void 0)Y=Z.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var Q=0;if(this.bytesHashed+=Y,this.bufferLength>0){while(this.bufferLength<64&&Y>0)this.buffer[this.bufferLength++]=Z[Q++],Y--;if(this.bufferLength===64)A(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(Y>=64)Q=A(this.temp,this.state,Z,Q,Y),Y%=64;while(Y>0)this.buffer[this.bufferLength++]=Z[Q++],Y--;return this},z.prototype.finish=function(Z){if(!this.finished){var Y=this.bytesHashed,Q=this.bufferLength,L=Y/536870912|0,C=Y<<3,U=Y%64<56?64:128;this.buffer[Q]=128;for(var H=Q+1;H<U-8;H++)this.buffer[H]=0;this.buffer[U-8]=L>>>24&255,this.buffer[U-7]=L>>>16&255,this.buffer[U-6]=L>>>8&255,this.buffer[U-5]=L>>>0&255,this.buffer[U-4]=C>>>24&255,this.buffer[U-3]=C>>>16&255,this.buffer[U-2]=C>>>8&255,this.buffer[U-1]=C>>>0&255,A(this.temp,this.state,this.buffer,0,U),this.finished=!0}for(var H=0;H<8;H++)Z[H*4+0]=this.state[H]>>>24&255,Z[H*4+1]=this.state[H]>>>16&255,Z[H*4+2]=this.state[H]>>>8&255,Z[H*4+3]=this.state[H]>>>0&255;return this},z.prototype.digest=function(){var Z=new Uint8Array(this.digestLength);return this.finish(Z),Z},z.prototype._saveState=function(Z){for(var Y=0;Y<this.state.length;Y++)Z[Y]=this.state[Y]},z.prototype._restoreState=function(Z,Y){for(var Q=0;Q<this.state.length;Q++)this.state[Q]=Z[Q];this.bytesHashed=Y,this.finished=!1,this.bufferLength=0},z}();u.Hash=B;var F=function(){function z(Z){this.inner=new B,this.outer=new B,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var Y=new Uint8Array(this.blockSize);if(Z.length>this.blockSize)new B().update(Z).finish(Y).clean();else for(var Q=0;Q<Z.length;Q++)Y[Q]=Z[Q];for(var Q=0;Q<Y.length;Q++)Y[Q]^=54;this.inner.update(Y);for(var Q=0;Q<Y.length;Q++)Y[Q]^=106;this.outer.update(Y),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var Q=0;Q<Y.length;Q++)Y[Q]=0}return z.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},z.prototype.clean=function(){for(var Z=0;Z<this.istate.length;Z++)this.ostate[Z]=this.istate[Z]=0;this.inner.clean(),this.outer.clean()},z.prototype.update=function(Z){return this.inner.update(Z),this},z.prototype.finish=function(Z){if(this.outer.finished)this.outer.finish(Z);else this.inner.finish(Z),this.outer.update(Z,this.digestLength).finish(Z);return this},z.prototype.digest=function(){var Z=new Uint8Array(this.digestLength);return this.finish(Z),Z},z}();u.HMAC=F;function G(z){var Z=new B().update(z),Y=Z.digest();return Z.clean(),Y}u.hash=G,u.default=G;function w(z,Z){var Y=new F(z).update(Z),Q=Y.digest();return Y.clean(),Q}u.hmac=w;function N(z,Z,Y,Q){var L=Q[0];if(L===0)throw Error("hkdf: cannot expand more");if(Z.reset(),L>1)Z.update(z);if(Y)Z.update(Y);Z.update(Q),Z.finish(z),Q[0]++}var J=new Uint8Array(u.digestLength);function $(z,Z,Y,Q){if(Z===void 0)Z=J;if(Q===void 0)Q=32;var L=new Uint8Array([1]),C=w(Z,z),U=new F(C),H=new Uint8Array(U.digestLength),_=H.length,T=new Uint8Array(Q);for(var P=0;P<Q;P++){if(_===H.length)N(H,U,Y,L),_=0;T[P]=H[_++]}return U.clean(),H.fill(0),L.fill(0),T}u.hkdf=$;function X(z,Z,Y,Q){var L=new F(z),C=L.digestLength,U=new Uint8Array(4),H=new Uint8Array(C),_=new Uint8Array(C),T=new Uint8Array(Q);for(var P=0;P*C<Q;P++){var n=P+1;U[0]=n>>>24&255,U[1]=n>>>16&255,U[2]=n>>>8&255,U[3]=n>>>0&255,L.reset(),L.update(Z),L.update(U),L.finish(_);for(var h=0;h<C;h++)H[h]=_[h];for(var h=2;h<=Y;h++){L.reset(),L.update(_).finish(_);for(var y=0;y<C;y++)H[y]^=_[y]}for(var h=0;h<C&&P*C+h<Q;h++)T[P*C+h]=H[h]}for(var P=0;P<C;P++)H[P]=_[P]=0;for(var P=0;P<4;P++)U[P]=0;return L.clean(),T}u.pbkdf2=X})});var m0=E((DE)=>{Object.defineProperty(DE,"__esModule",{value:!0});DE.Webhook=DE.WebhookVerificationError=void 0;var FJ=aw(),ew=sw(),wJ=tw(),uE=300;class _0 extends Error{constructor(u){super(u);Object.setPrototypeOf(this,_0.prototype),this.name="ExtendableError",this.stack=Error(u).stack}}class u2 extends _0{constructor(u){super(u);Object.setPrototypeOf(this,u2.prototype),this.name="WebhookVerificationError"}}DE.WebhookVerificationError=u2;class U2{constructor(u,D){if(!u)throw Error("Secret can't be empty.");if((D===null||D===void 0?void 0:D.format)==="raw")if(u instanceof Uint8Array)this.key=u;else this.key=Uint8Array.from(u,(A)=>A.charCodeAt(0));else{if(typeof u!=="string")throw Error("Expected secret to be of type string");if(u.startsWith(U2.prefix))u=u.substring(U2.prefix.length);this.key=ew.decode(u)}}verify(u,D){let A={};for(let z of Object.keys(D))A[z.toLowerCase()]=D[z];let B=A["webhook-id"],F=A["webhook-signature"],G=A["webhook-timestamp"];if(!F||!B||!G)throw new u2("Missing required headers");let w=this.verifyTimestamp(G),J=this.sign(B,w,u).split(",")[1],$=F.split(" "),X=new globalThis.TextEncoder;for(let z of $){let[Z,Y]=z.split(",");if(Z!=="v1")continue;if((0,FJ.timingSafeEqual)(X.encode(Y),X.encode(J)))return JSON.parse(u.toString())}throw new u2("No matching signature found")}sign(u,D,A){if(typeof A==="string");else if(A.constructor.name==="Buffer")A=A.toString();else throw Error("Expected payload to be of type string or Buffer.");let B=new TextEncoder,F=Math.floor(D.getTime()/1000),G=B.encode(`${u}.${F}.${A}`);return`v1,${ew.encode(wJ.hmac(this.key,G))}`}verifyTimestamp(u){let D=Math.floor(Date.now()/1000),A=parseInt(u,10);if(isNaN(A))throw new u2("Invalid Signature Headers");if(D-A>uE)throw new u2("Message timestamp too old");if(A>D+uE)throw new u2("Message timestamp too new");return new Date(A*1000)}}DE.Webhook=U2;U2.prefix="whsec_"});var wE=E((g0)=>{Object.defineProperty(g0,"__esModule",{value:!0});g0.Webhook=g0.WebhookVerificationError=void 0;var GJ=m0(),NJ=m0();Object.defineProperty(g0,"WebhookVerificationError",{enumerable:!0,get:function(){return NJ.WebhookVerificationError}});class BE{constructor(u,D){this.inner=new GJ.Webhook(u,D)}verify(u,D){var A,B,F,G,w,N;let J={};for(let $ of Object.keys(D))J[$.toLowerCase()]=D[$];return J["webhook-id"]=(B=(A=J["svix-id"])!==null&&A!==void 0?A:J["webhook-id"])!==null&&B!==void 0?B:"",J["webhook-signature"]=(G=(F=J["svix-signature"])!==null&&F!==void 0?F:J["webhook-signature"])!==null&&G!==void 0?G:"",J["webhook-timestamp"]=(N=(w=J["svix-timestamp"])!==null&&w!==void 0?w:J["webhook-timestamp"])!==null&&N!==void 0?N:"",this.inner.verify(u,J)}sign(u,D,A){return this.inner.sign(u,D,A)}}g0.Webhook=BE});var JE=E((GE)=>{Object.defineProperty(GE,"__esModule",{value:!0});GE.EndpointDisabledTriggerSerializer=GE.EndpointDisabledTrigger=void 0;var JJ;(function(u){u.Manual="manual",u.Automatic="automatic"})(JJ=GE.EndpointDisabledTrigger||(GE.EndpointDisabledTrigger={}));GE.EndpointDisabledTriggerSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var XE=E((zE)=>{Object.defineProperty(zE,"__esModule",{value:!0});zE.OrderingSerializer=zE.Ordering=void 0;var ZJ;(function(u){u.Ascending="ascending",u.Descending="descending"})(ZJ=zE.Ordering||(zE.Ordering={}));zE.OrderingSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var YE=E((m)=>{Object.defineProperty(m,"__esModule",{value:!0});m.StatusCodeClass=m.SinkStatusIn=m.SinkStatus=m.Ordering=m.MessageStatusText=m.MessageStatus=m.MessageAttemptTriggerType=m.EndpointDisabledTrigger=m.ConnectorProduct=m.ConnectorKind=m.BackgroundTaskType=m.BackgroundTaskStatus=m.AppPortalCapability=void 0;var zJ=A0();Object.defineProperty(m,"AppPortalCapability",{enumerable:!0,get:function(){return zJ.AppPortalCapability}});var $J=t();Object.defineProperty(m,"BackgroundTaskStatus",{enumerable:!0,get:function(){return $J.BackgroundTaskStatus}});var XJ=e();Object.defineProperty(m,"BackgroundTaskType",{enumerable:!0,get:function(){return XJ.BackgroundTaskType}});var YJ=w2();Object.defineProperty(m,"ConnectorKind",{enumerable:!0,get:function(){return YJ.ConnectorKind}});var QJ=O2();Object.defineProperty(m,"ConnectorProduct",{enumerable:!0,get:function(){return QJ.ConnectorProduct}});var VJ=JE();Object.defineProperty(m,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return VJ.EndpointDisabledTrigger}});var WJ=C0();Object.defineProperty(m,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return WJ.MessageAttemptTriggerType}});var KJ=E2();Object.defineProperty(m,"MessageStatus",{enumerable:!0,get:function(){return KJ.MessageStatus}});var HJ=H2();Object.defineProperty(m,"MessageStatusText",{enumerable:!0,get:function(){return HJ.MessageStatusText}});var CJ=XE();Object.defineProperty(m,"Ordering",{enumerable:!0,get:function(){return CJ.Ordering}});var UJ=k0();Object.defineProperty(m,"SinkStatus",{enumerable:!0,get:function(){return UJ.SinkStatus}});var PJ=j2();Object.defineProperty(m,"SinkStatusIn",{enumerable:!0,get:function(){return PJ.SinkStatusIn}});var RJ=E0();Object.defineProperty(m,"StatusCodeClass",{enumerable:!0,get:function(){return RJ.StatusCodeClass}})});var WE=E((S)=>{var vJ=S&&S.__createBinding||(Object.create?function(u,D,A,B){if(B===void 0)B=A;var F=Object.getOwnPropertyDescriptor(D,A);if(!F||("get"in F?!D.__esModule:F.writable||F.configurable))F={enumerable:!0,get:function(){return D[A]}};Object.defineProperty(u,B,F)}:function(u,D,A,B){if(B===void 0)B=A;u[B]=D[A]}),QE=S&&S.__exportStar||function(u,D){for(var A in u)if(A!=="default"&&!Object.prototype.hasOwnProperty.call(D,A))vJ(D,u,A)};Object.defineProperty(S,"__esModule",{value:!0});S.Svix=S.messageInRaw=S.ValidationError=S.HttpErrorOut=S.HTTPValidationError=S.ApiException=void 0;var MJ=Yu(),SJ=pu(),TJ=$D(),hJ=lD(),OJ=z3(),qJ=h3(),kJ=B5(),IJ=N5(),xJ=U4(),yJ=f4(),_J=K0(),mJ=QB(),gJ=iB(),bJ=JF(),jJ=jw(),fJ=L0(),lJ=e2();Object.defineProperty(S,"ApiException",{enumerable:!0,get:function(){return lJ.ApiException}});var b0=dw();Object.defineProperty(S,"HTTPValidationError",{enumerable:!0,get:function(){return b0.HTTPValidationError}});Object.defineProperty(S,"HttpErrorOut",{enumerable:!0,get:function(){return b0.HttpErrorOut}});Object.defineProperty(S,"ValidationError",{enumerable:!0,get:function(){return b0.ValidationError}});QE(wE(),S);QE(YE(),S);var dJ=K0();Object.defineProperty(S,"messageInRaw",{enumerable:!0,get:function(){return dJ.messageInRaw}});var rJ=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}];class VE{constructor(u,D={}){var A,B,F;let G=(A=rJ.find((N)=>N.region===u.split(".")[1]))===null||A===void 0?void 0:A.url,w=(F=(B=D.serverUrl)!==null&&B!==void 0?B:G)!==null&&F!==void 0?F:"https://api.svix.com";if(D.retryScheduleInMs){this.requestCtx={baseUrl:w,token:u,timeout:D.requestTimeout,retryScheduleInMs:D.retryScheduleInMs,fetch:D.fetch};return}if(D.numRetries){this.requestCtx={baseUrl:w,token:u,timeout:D.requestTimeout,numRetries:D.numRetries,fetch:D.fetch};return}this.requestCtx={baseUrl:w,token:u,timeout:D.requestTimeout,fetch:D.fetch}}get application(){return new MJ.Application(this.requestCtx)}get authentication(){return new SJ.Authentication(this.requestCtx)}get backgroundTask(){return new TJ.BackgroundTask(this.requestCtx)}get connector(){return new hJ.Connector(this.requestCtx)}get endpoint(){return new OJ.Endpoint(this.requestCtx)}get environment(){return new qJ.Environment(this.requestCtx)}get eventType(){return new kJ.EventType(this.requestCtx)}get health(){return new IJ.Health(this.requestCtx)}get ingest(){return new xJ.Ingest(this.requestCtx)}get integration(){return new yJ.Integration(this.requestCtx)}get message(){return new _J.Message(this.requestCtx)}get messageAttempt(){return new mJ.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new gJ.OperationalWebhook(this.requestCtx)}get statistics(){return new bJ.Statistics(this.requestCtx)}get streaming(){return new jJ.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new fJ.OperationalWebhookEndpoint(this.requestCtx)}}S.Svix=VE});var s=new TextEncoder;var Y2=new Uint8Array(256);for(let u=0;u<64;u++)Y2["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(u)]=u;function R2(u){let D=Math.ceil(u.length/4)*3,A=u.length,B=0;if(u.length%4===3)D--;else if(u.length%4===2)D-=2;else if(u[u.length-1]==="="){if(D--,u[u.length-2]==="=")D--}let F=new ArrayBuffer(D),G=new Uint8Array(F);for(let w=0;w<A;w+=4){let N=Y2[u.charCodeAt(w)],J=Y2[u.charCodeAt(w+1)],$=Y2[u.charCodeAt(w+2)],X=Y2[u.charCodeAt(w+3)];G[B++]=N<<2|J>>4,G[B++]=(J&15)<<4|$>>2,G[B++]=($&3)<<6|X&63}return F}function B2(u){u=u||"utf8";let D;try{D=new TextDecoder(u)}catch(A){D=new TextDecoder("windows-1252")}return D}async function o(u){if("arrayBuffer"in u)return await u.arrayBuffer();let D=new FileReader;return new Promise((A,B)=>{D.onload=function(F){A(F.target.result)},D.onerror=function(F){B(D.error)},D.readAsArrayBuffer(u)})}function j0(u){if(u>=48&&u<=57||u>=97&&u<=102||u>=65&&u<=70)return String.fromCharCode(u);return!1}function hE(u,D,A){let B=u.indexOf("*");if(B>=0)u=u.substr(0,B);D=D.toUpperCase();let F;if(D==="Q"){A=A.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let G=s.encode(A),w=[];for(let J=0,$=G.length;J<$;J++){let X=G[J];if(J<=$-2&&X===61){let z=j0(G[J+1]),Z=j0(G[J+2]);if(z&&Z){let Y=parseInt(z+Z,16);w.push(Y),J+=2;continue}}w.push(X)}F=new ArrayBuffer(w.length);let N=new DataView(F);for(let J=0,$=w.length;J<$;J++)N.setUint8(J,w[J])}else if(D==="B")F=R2(A.replace(/[^a-zA-Z0-9\+\/=]+/g,""));else F=s.encode(A);return B2(u).decode(F)}function D2(u){let D=!0,A=!1;while(!A){let B=(u||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(F,G,w,N,J)=>{if(!D)return F;if(w===J&&N.length%4===0&&!/=$/.test(N))return G+"__\x00JOIN\x00__";return F}).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(F,G,w,N)=>{if(!D)return F;if(w===N)return G+"__\x00JOIN\x00__";return F}).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(F,G,w,N)=>hE(G,w,N));if(D&&B.indexOf("\uFFFD")>=0)D=!1;else return B}}function OE(u,D){D=D||"utf-8";let A=[];for(let G=0;G<u.length;G++){let w=u.charAt(G);if(w==="%"&&/^[a-f0-9]{2}/i.test(u.substr(G+1,2))){let N=u.substr(G+1,2);G+=2,A.push(parseInt(N,16))}else if(w.charCodeAt(0)>126){w=s.encode(w);for(let N=0;N<w.length;N++)A.push(w[N])}else A.push(w.charCodeAt(0))}let B=new ArrayBuffer(A.length),F=new DataView(B);for(let G=0,w=A.length;G<w;G++)F.setUint8(G,A[G]);return B2(D).decode(B)}function f0(u){let D=new Map;Object.keys(u.params).forEach((A)=>{let B=A.match(/\*((\d+)\*?)?$/);if(!B)return;let F=A.substr(0,B.index).toLowerCase(),G=Number(B[2])||0,w;if(!D.has(F))w={charset:!1,values:[]},D.set(F,w);else w=D.get(F);let N=u.params[A];if(G===0&&B[0].charAt(B[0].length-1)==="*"&&(B=N.match(/^([^']*)'[^']*'(.*)$/)))w.charset=B[1]||"utf-8",N=B[2];w.values.push({nr:G,value:N}),delete u.params[A]}),D.forEach((A,B)=>{u.params[B]=OE(A.values.sort((F,G)=>F.nr-G.nr).map((F)=>F.value).join(""),A.charset)})}class L2{constructor(){this.chunks=[]}update(u){this.chunks.push(u),this.chunks.push(`
4
4
  `)}finalize(){return o(new Blob(this.chunks,{type:"application/octet-stream"}))}}class v2{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.chunks=[],this.remainder=""}update(u){let D=this.decoder.decode(u);if(D=D.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=D,this.remainder.length>=this.maxChunkSize){let A=Math.floor(this.remainder.length/4)*4,B;if(A===this.remainder.length)B=this.remainder,this.remainder="";else B=this.remainder.substr(0,A),this.remainder=this.remainder.substr(A);if(B.length)this.chunks.push(R2(B))}}finalize(){if(this.remainder&&!/^=+$/.test(this.remainder))this.chunks.push(R2(this.remainder));return o(new Blob(this.chunks,{type:"application/octet-stream"}))}}var l0=/^=[a-f0-9]{2}$/i,qE=/(?==[a-f0-9]{2})/i,kE=/=\r?\n/g,IE=/=[a-fA-F0-9]?$/;class M2{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.remainder="",this.chunks=[]}decodeQPBytes(u){let D=new ArrayBuffer(u.length),A=new DataView(D);for(let B=0,F=u.length;B<F;B++)A.setUint8(B,parseInt(u[B],16));return D}decodeChunks(u){u=u.replace(kE,"");let D=u.split(qE),A=[];for(let B of D){if(B.charAt(0)!=="="){if(A.length)this.chunks.push(this.decodeQPBytes(A)),A=[];this.chunks.push(B);continue}if(B.length===3){if(l0.test(B))A.push(B.substr(1));else{if(A.length)this.chunks.push(this.decodeQPBytes(A)),A=[];this.chunks.push(B)}continue}if(B.length>3){let F=B.substr(0,3);if(l0.test(F))A.push(B.substr(1,2)),this.chunks.push(this.decodeQPBytes(A)),A=[],B=B.substr(3),this.chunks.push(B);else{if(A.length)this.chunks.push(this.decodeQPBytes(A)),A=[];this.chunks.push(B)}}}if(A.length)this.chunks.push(this.decodeQPBytes(A))}update(u){let D=this.decoder.decode(u)+`
5
5
  `;if(D=this.remainder+D,D.length<this.maxChunkSize){this.remainder=D;return}this.remainder="";let A=D.match(IE);if(A){if(A.index===0){this.remainder=D;return}this.remainder=D.substr(A.index),D=D.substr(0,A.index)}this.decodeChunks(D)}finalize(){if(this.remainder.length)this.decodeChunks(this.remainder),this.remainder="";return o(new Blob(this.chunks,{type:"application/octet-stream"}))}}var xE=B2();class Q2{constructor(u){if(this.options=u||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let A=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:A,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(u){if(/base64/i.test(u))this.contentDecoder=new v2;else if(/quoted-printable/i.test(u))this.contentDecoder=new M2({decoder:B2(this.contentType.parsed.params.charset)});else this.contentDecoder=new L2}async finalize(){if(this.state==="finished")return;if(this.state==="header")this.processHeaders();let u=this.postalMime.boundaries;for(let D=u.length-1;D>=0;D--)if(u[D].node===this){u.splice(D,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let u of this.childNodes)await u.finalize()}stripComments(u){let D="",A=0,B=!1,F=!1;for(let G=0;G<u.length;G++){let w=u.charAt(G);if(B){if(A===0)D+=w;B=!1;continue}if(w==="\\"){if(B=!0,A===0)D+=w;continue}if(w==='"'&&A===0){F=!F,D+=w;continue}if(!F){if(w==="("){A++;continue}if(w===")"&&A>0){A--;continue}}if(A===0)D+=w}return D}parseStructuredHeader(u){u=this.stripComments(u);let D={value:!1,params:{}},A=!1,B="",F="value",G=!1,w=!1,N;for(let J=0,$=u.length;J<$;J++)switch(N=u.charAt(J),F){case"key":if(N==="="){A=B.trim().toLowerCase(),F="value",B="";break}B+=N;break;case"value":if(w)B+=N;else if(N==="\\"){w=!0;continue}else if(G&&N===G)G=!1;else if(!G&&N==='"')G=N;else if(!G&&N===";"){if(A===!1)D.value=B.trim();else D.params[A]=B.trim();F="key",B=""}else B+=N;w=!1;break}if(B=B.trim(),F==="value")if(A===!1)D.value=B;else D.params[A]=B;else if(B)D.params[B.toLowerCase()]="";if(D.value)D.value=D.value.toLowerCase();return f0(D),D}decodeFlowedText(u,D){return u.split(/\r?\n/).reduce((A,B)=>{if(A.endsWith(" ")&&A!=="-- "&&!A.endsWith(`
@@ -30,4 +30,4 @@ ${F}
30
30
  `);$.content=s.encode(X);break}default:$.content=G.content}this.attachments.push($)}}else if(G.contentType.multipart==="alternative")w=G;else if(G.contentType.multipart==="related")N=G;for(let J of G.childNodes)await F(J,w,N)};await F(this.root,!1,!1),A.forEach((G)=>{D.forEach((w)=>{if(!u[w])u[w]=[];if(G[w])G[w].forEach((N)=>{switch(N.type){case"text":u[w].push(N.value);break;case"subMessage":switch(w){case"html":u[w].push(n2(N.value));break;case"plain":u[w].push(p2(N.value));break}break}});else{let N;switch(w){case"html":N="plain";break;case"plain":N="html";break}(G[N]||[]).forEach((J)=>{switch(J.type){case"text":switch(w){case"html":u[w].push(d0(J.value));break;case"plain":u[w].push(r0(J.value));break}break;case"subMessage":switch(w){case"html":u[w].push(n2(J.value));break;case"plain":u[w].push(p2(J.value));break}break}})}})}),Object.keys(u).forEach((G)=>{u[G]=u[G].join(`
31
31
  `)}),this.textContent=u}isInlineTextNode(u){if(u.contentDisposition?.parsed?.value==="attachment")return!1;switch(u.contentType.parsed?.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(u){if(u.contentType.parsed?.value!=="message/rfc822")return!1;return(u.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let u=!1,D=(A)=>{if(!A.contentType.multipart){if(A.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(A.contentType.parsed.value))u=!0}for(let B of A.childNodes)D(B)};return D(this.root),u}async resolveStream(u){let D=0,A=[],B=u.getReader();while(!0){let{done:w,value:N}=await B.read();if(w)break;A.push(N),D+=N.length}let F=new Uint8Array(D),G=0;for(let w of A)F.set(w,G),G+=w.length;return F}async parse(u){if(this.started)throw Error("Can not reuse parser, create a new PostalMime object");if(this.started=!0,u&&typeof u.getReader==="function")u=await this.resolveStream(u);if(u=u||new ArrayBuffer(0),typeof u==="string")u=s.encode(u);if(u instanceof Blob||Object.prototype.toString.call(u)==="[object Blob]")u=await o(u);if(u.buffer instanceof ArrayBuffer)u=new Uint8Array(u).buffer;this.buf=u,this.av=new Uint8Array(u),this.readPos=0;while(this.readPos<this.av.length){let B=this.readLine();await this.processLine(B.bytes,B.done)}await this.processNodeTree();let D={headers:this.root.headers.map((B)=>({key:B.key,originalKey:B.originalKey,value:B.value})).reverse()};for(let B of["from","sender"]){let F=this.root.headers.find((G)=>G.key===B);if(F&&F.value){let G=S2(F.value);if(G&&G.length)D[B]=G[0]}}for(let B of["delivered-to","return-path"]){let F=this.root.headers.find((G)=>G.key===B);if(F&&F.value){let G=S2(F.value);if(G&&G.length&&G[0].address){let w=o2(B);D[w]=G[0].address}}}for(let B of["to","cc","bcc","reply-to"]){let F=this.root.headers.filter((w)=>w.key===B),G=[];if(F.filter((w)=>w&&w.value).map((w)=>S2(w.value)).forEach((w)=>G=G.concat(w||[])),G&&G.length){let w=o2(B);D[w]=G}}for(let B of["subject","message-id","in-reply-to","references"]){let F=this.root.headers.find((G)=>G.key===B);if(F&&F.value){let G=o2(B);D[G]=D2(F.value)}}let A=this.root.headers.find((B)=>B.key==="date");if(A){let B=new Date(A.value);if(B.toString()==="Invalid Date")B=A.value;else B=B.toISOString();D.date=B}if(this.textContent?.html)D.html=this.textContent.html;if(this.textContent?.plain)D.text=this.textContent.plain;switch(D.attachments=this.attachments,D.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let F of D.attachments||[])if(F?.content)F.content=p0(F.content),F.encoding="base64";break;case"utf8":let B=new TextDecoder("utf8");for(let F of D.attachments||[])if(F?.content)F.content=B.decode(F.content),F.encoding="utf8";break;default:throw Error("Unknown attachment encoding")}return D}}var vE=cJ(WE(),1),iJ="6.12.3";function x(u){let D=new URLSearchParams;if(u.limit!==void 0)D.set("limit",u.limit.toString());if("after"in u&&u.after!==void 0)D.set("after",u.after);if("before"in u&&u.before!==void 0)D.set("before",u.before);return D.toString()}var aJ=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/api-keys",u,D)}async list(u={}){let D=x(u),A=D?`/api-keys?${D}`:"/api-keys";return await this.resend.get(A)}async remove(u){return await this.resend.delete(`/api-keys/${u}`)}},pJ=class{constructor(u){this.resend=u}async get(u){return await this.resend.get(`/automations/${u.automationId}/runs/${u.runId}`)}async list(u){let D=x(u),A=new URLSearchParams(D);if(u.status){let G=Array.isArray(u.status)?u.status.join(","):u.status;A.set("status",G)}let B=A.toString(),F=B?`/automations/${u.automationId}/runs?${B}`:`/automations/${u.automationId}/runs`;return await this.resend.get(F)}};function ME(u){switch(u.type){case"trigger":return{key:u.key,type:u.type,config:{event_name:u.config.eventName}};case"delay":return{key:u.key,type:u.type,config:u.config};case"send_email":return{key:u.key,type:u.type,config:{template:u.config.template,subject:u.config.subject,from:u.config.from,reply_to:u.config.replyTo}};case"wait_for_event":return{key:u.key,type:u.type,config:{event_name:u.config.eventName,timeout:u.config.timeout,filter_rule:u.config.filterRule}};case"condition":return{key:u.key,type:u.type,config:u.config};case"contact_update":return{key:u.key,type:u.type,config:{first_name:u.config.firstName,last_name:u.config.lastName,unsubscribed:u.config.unsubscribed,properties:u.config.properties}};case"contact_delete":return{key:u.key,type:u.type,config:u.config};case"add_to_segment":return{key:u.key,type:u.type,config:{segment_id:u.config.segmentId}}}}function SE(u){return{from:u.from,to:u.to,type:u.type}}function nJ(u){return{name:u.name,status:u.status,steps:u.steps.map(ME),connections:u.connections.map(SE)}}function sJ(u){return{event:u.event,contact_id:u.contactId,email:u.email,payload:u.payload}}var oJ=class{constructor(u){this.resend=u,this.runs=new pJ(this.resend)}async create(u){return await this.resend.post("/automations",nJ(u))}async list(u={}){let D=[x(u)];if(u.status)D.push(`status=${encodeURIComponent(u.status)}`);let A=D.filter(Boolean).join("&"),B=A?`/automations?${A}`:"/automations";return await this.resend.get(B)}async get(u){return await this.resend.get(`/automations/${u}`)}async remove(u){return await this.resend.delete(`/automations/${u}`)}async update(u,D){let A={};if(D.name!==void 0)A.name=D.name;if(D.status!==void 0)A.status=D.status;if(D.steps!==void 0)A.steps=D.steps.map(ME);if(D.connections!==void 0)A.connections=D.connections.map(SE);return await this.resend.patch(`/automations/${u}`,A)}async stop(u){return await this.resend.post(`/automations/${u}/stop`)}};function tJ(u){return u?.map((D)=>({content:D.content,filename:D.filename,path:D.path,content_type:D.contentType,content_id:D.contentId}))}function TE(u){return{attachments:tJ(u.attachments),bcc:u.bcc,cc:u.cc,from:u.from,headers:u.headers,html:u.html,reply_to:u.replyTo,scheduled_at:u.scheduledAt,subject:u.subject,tags:u.tags,text:u.text,to:u.to,template:u.template?{id:u.template.id,variables:u.template.variables}:void 0,topic_id:u.topicId}}async function r2(u){let D;try{({render:D}=await import("@react-email/render"))}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return D(u)}var eJ=class{constructor(u){this.resend=u}async send(u,D){return this.create(u,D)}async create(u,D){let A=[];for(let B of u){if(B.react)B.html=await r2(B.react),B.react=void 0;A.push(TE(B))}return await this.resend.post("/emails/batch",A,{...D,headers:{"x-batch-validation":D?.batchValidation??"strict",...D?.headers}})}},uZ=class{constructor(u){this.resend=u}async create(u,D={}){if(u.react)u.html=await r2(u.react);return await this.resend.post("/broadcasts",{name:u.name,segment_id:u.segmentId,audience_id:u.audienceId,preview_text:u.previewText,from:u.from,html:u.html,reply_to:u.replyTo,subject:u.subject,text:u.text,topic_id:u.topicId,send:u.send,scheduled_at:u.scheduledAt},D)}async send(u,D){return await this.resend.post(`/broadcasts/${u}/send`,{scheduled_at:D?.scheduledAt})}async list(u={}){let D=x(u),A=D?`/broadcasts?${D}`:"/broadcasts";return await this.resend.get(A)}async get(u){return await this.resend.get(`/broadcasts/${u}`)}async remove(u){return await this.resend.delete(`/broadcasts/${u}`)}async update(u,D){if(D.react)D.html=await r2(D.react);return await this.resend.patch(`/broadcasts/${u}`,{name:D.name,segment_id:D.segmentId,audience_id:D.audienceId,from:D.from,html:D.html,text:D.text,subject:D.subject,reply_to:D.replyTo,preview_text:D.previewText,topic_id:D.topicId})}};function KE(u){return{id:u.id,key:u.key,createdAt:u.created_at,type:u.type,fallbackValue:u.fallback_value}}function HE(u){if("key"in u)return{key:u.key,type:u.type,fallback_value:u.fallbackValue};return{fallback_value:u.fallbackValue}}var DZ=class{constructor(u){this.resend=u}async create(u){let D=HE(u);return await this.resend.post("/contact-properties",D)}async list(u={}){let D=x(u),A=D?`/contact-properties?${D}`:"/contact-properties",B=await this.resend.get(A);if(B.data)return{data:{...B.data,data:B.data.data.map((F)=>KE(F))},headers:B.headers,error:null};return B}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=await this.resend.get(`/contact-properties/${u}`);if(D.data)return{data:{object:"contact_property",...KE(D.data)},headers:D.headers,error:null};return D}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=HE(u);return await this.resend.patch(`/contact-properties/${u.id}`,D)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/contact-properties/${u}`)}},AZ=class{constructor(u){this.resend=u}async list(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId,A=x(u),B=A?`/contacts/${D}/segments?${A}`:`/contacts/${D}/segments`;return await this.resend.get(B)}async add(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.post(`/contacts/${D}/segments/${u.segmentId}`)}async remove(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.delete(`/contacts/${D}/segments/${u.segmentId}`)}},BZ=class{constructor(u){this.resend=u}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id;return this.resend.patch(`/contacts/${D}/topics`,u.topics)}async list(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id,A=x(u),B=A?`/contacts/${D}/topics?${A}`:`/contacts/${D}/topics`;return this.resend.get(B)}},FZ=class{constructor(u){this.resend=u,this.topics=new BZ(this.resend),this.segments=new AZ(this.resend)}async create(u,D={}){if("audienceId"in u){if("segments"in u||"topics"in u)return{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}};return await this.resend.post(`/audiences/${u.audienceId}/contacts`,{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties},D)}return await this.resend.post("/contacts",{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties,segments:u.segments,topics:u.topics},D)}async list(u={}){let D=u.segmentId??u.audienceId;if(!D){let F=x(u),G=F?`/contacts?${F}`:"/contacts";return await this.resend.get(G)}let A=x(u),B=A?`/segments/${D}/contacts?${A}`:`/segments/${D}/contacts`;return await this.resend.get(B)}async get(u){if(typeof u==="string")return this.resend.get(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.get(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.get(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return await this.resend.patch(`/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties});return await this.resend.patch(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties})}async remove(u){if(typeof u==="string")return this.resend.delete(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.delete(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.delete(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}};function wZ(u){return{name:u.name,region:u.region,custom_return_path:u.customReturnPath,capabilities:u.capabilities,open_tracking:u.openTracking,click_tracking:u.clickTracking,tls:u.tls,tracking_subdomain:u.trackingSubdomain}}var EZ=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/domains",wZ(u),D)}async list(u={}){let D=x(u),A=D?`/domains?${D}`:"/domains";return await this.resend.get(A)}async get(u){return await this.resend.get(`/domains/${u}`)}async update(u){return await this.resend.patch(`/domains/${u.id}`,{click_tracking:u.clickTracking,open_tracking:u.openTracking,tls:u.tls,capabilities:u.capabilities,tracking_subdomain:u.trackingSubdomain})}async remove(u){return await this.resend.delete(`/domains/${u}`)}async verify(u){return await this.resend.post(`/domains/${u}/verify`)}},GZ=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:A}=u;return await this.resend.get(`/emails/${D}/attachments/${A}`)}async list(u){let{emailId:D}=u,A=x(u),B=A?`/emails/${D}/attachments?${A}`:`/emails/${D}/attachments`;return await this.resend.get(B)}},NZ=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:A}=u;return await this.resend.get(`/emails/receiving/${D}/attachments/${A}`)}async list(u){let{emailId:D}=u,A=x(u),B=A?`/emails/receiving/${D}/attachments?${A}`:`/emails/receiving/${D}/attachments`;return await this.resend.get(B)}},JZ=class{constructor(u){this.resend=u,this.attachments=new NZ(u)}async get(u){return await this.resend.get(`/emails/receiving/${u}`)}async list(u={}){let D=x(u),A=D?`/emails/receiving?${D}`:"/emails/receiving";return await this.resend.get(A)}async forward(u){let{emailId:D,to:A,from:B}=u,F=u.passthrough!==!1,G=await this.get(D);if(G.error)return{data:null,error:G.error,headers:G.headers};let w=G.data,N=w.subject||"(no subject)";if(F)return this.forwardPassthrough(w,{to:A,from:B,subject:N});let J=N.startsWith("Fwd:")?N:`Fwd: ${N}`;return this.forwardWrapped(w,{to:A,from:B,subject:J,text:"text"in u?u.text:void 0,html:"html"in u?u.html:void 0})}async forwardPassthrough(u,D){let{to:A,from:B,subject:F}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let G=await fetch(u.raw.download_url);if(!G.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:G.status},headers:null};let w=await G.text(),N=await F2.parse(w,{attachmentEncoding:"base64"}),J=N.attachments.map(($)=>{let X=$.contentId?$.contentId.replace(/^<|>$/g,""):void 0;return{filename:$.filename,content:$.content.toString(),content_type:$.mimeType,content_id:X||void 0}});return await this.resend.post("/emails",{from:B,to:A,subject:F,text:N.text||void 0,html:N.html||void 0,attachments:J.length>0?J:void 0})}async forwardWrapped(u,D){let{to:A,from:B,subject:F,text:G,html:w}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let N=await fetch(u.raw.download_url);if(!N.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:N.status},headers:null};let J=await N.text();return await this.resend.post("/emails",{from:B,to:A,subject:F,text:G,html:w,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(J).toString("base64"),content_type:"message/rfc822"}]})}},ZZ=class{constructor(u){this.resend=u,this.attachments=new GZ(u),this.receiving=new JZ(u)}async send(u,D={}){return this.create(u,D)}async create(u,D={}){if(u.react)u.html=await r2(u.react);return await this.resend.post("/emails",TE(u),D)}async get(u){return await this.resend.get(`/emails/${u}`)}async list(u={}){let D=x(u),A=D?`/emails?${D}`:"/emails";return await this.resend.get(A)}async update(u){return await this.resend.patch(`/emails/${u.id}`,{scheduled_at:u.scheduledAt})}async cancel(u){return await this.resend.post(`/emails/${u}/cancel`)}},zZ=class{constructor(u){this.resend=u}async send(u){return await this.resend.post("/events/send",sJ(u))}async create(u){return await this.resend.post("/events",u)}async get(u){return await this.resend.get(`/events/${encodeURIComponent(u)}`)}async list(u={}){let D=x(u),A=D?`/events?${D}`:"/events";return await this.resend.get(A)}async update(u,D){return await this.resend.patch(`/events/${encodeURIComponent(u)}`,D)}async remove(u){return await this.resend.delete(`/events/${encodeURIComponent(u)}`)}},$Z=class{constructor(u){this.resend=u}async list(u={}){let D=x(u),A=D?`/logs?${D}`:"/logs";return await this.resend.get(A)}async get(u){return await this.resend.get(`/logs/${u}`)}},XZ=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/segments",u,D)}async list(u={}){let D=x(u),A=D?`/segments?${D}`:"/segments";return await this.resend.get(A)}async get(u){return await this.resend.get(`/segments/${u}`)}async remove(u){return await this.resend.delete(`/segments/${u}`)}};function YZ(u={}){let D=new URLSearchParams;if(u.before)D.set("before",u.before);if(u.after)D.set("after",u.after);if(u.limit)D.set("limit",u.limit.toString());return D.size>0?`?${D.toString()}`:""}function QZ(u){return u?.map((D)=>({key:D.key,type:D.type,fallback_value:D.fallbackValue}))}function CE(u){return{name:"name"in u?u.name:void 0,subject:u.subject,html:u.html,text:u.text,alias:u.alias,from:u.from,reply_to:u.replyTo,variables:QZ(u.variables)}}var UE=class{constructor(u,D){this.promise=u,this.publishFn=D}then(u,D){return this.promise.then(u,D)}async publish(){let{data:u,error:D}=await this.promise;if(D)return{data:null,headers:null,error:D};return this.publishFn(u.id)}},VZ=class{constructor(u){this.resend=u}create(u){return new UE(this.performCreate(u),this.publish.bind(this))}async performCreate(u){if(u.react){if(!this.renderAsync)try{let{renderAsync:D}=await import("@react-email/render");this.renderAsync=D}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render`")}u.html=await this.renderAsync(u.react)}return this.resend.post("/templates",CE(u))}async remove(u){return await this.resend.delete(`/templates/${u}`)}async get(u){return await this.resend.get(`/templates/${u}`)}async list(u={}){return this.resend.get(`/templates${YZ(u)}`)}duplicate(u){return new UE(this.resend.post(`/templates/${u}/duplicate`),this.publish.bind(this))}async publish(u){return await this.resend.post(`/templates/${u}/publish`)}async update(u,D){return await this.resend.patch(`/templates/${u}`,CE(D))}},WZ=class{constructor(u){this.resend=u}async create(u){let{defaultSubscription:D,...A}=u;return await this.resend.post("/topics",{...A,default_subscription:D})}async list(){return await this.resend.get("/topics")}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.get(`/topics/${u}`)}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.patch(`/topics/${u.id}`,u)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/topics/${u}`)}},KZ=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/webhooks",u,D)}async get(u){return await this.resend.get(`/webhooks/${u}`)}async list(u={}){let D=x(u),A=D?`/webhooks?${D}`:"/webhooks";return await this.resend.get(A)}async update(u,D){return await this.resend.patch(`/webhooks/${u}`,D)}async remove(u){return await this.resend.delete(`/webhooks/${u}`)}verify(u){return new vE.Webhook(u.webhookSecret).verify(u.payload,{"svix-id":u.headers.id,"svix-timestamp":u.headers.timestamp,"svix-signature":u.headers.signature})}},PE="https://api.resend.com",RE=`resend-node:${iJ}`,HZ=typeof process<"u"&&process.env?process.env.RESEND_BASE_URL||PE:PE,CZ=typeof process<"u"&&process.env?process.env.RESEND_USER_AGENT||RE:RE,EQ=class{constructor(u){if(this.key=u,this.segments=new XZ(this),this.apiKeys=new aJ(this),this.audiences=this.segments,this.automations=new oJ(this),this.batch=new eJ(this),this.broadcasts=new uZ(this),this.contactProperties=new DZ(this),this.contacts=new FZ(this),this.domains=new EZ(this),this.emails=new ZZ(this),this.events=new zZ(this),this.logs=new $Z(this),this.templates=new VZ(this),this.topics=new WZ(this),this.webhooks=new KZ(this),!u){if(typeof process<"u"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":CZ,"Content-Type":"application/json"})}async fetchRequest(u,D={}){try{let A=await fetch(`${HZ}${u}`,D);if(!A.ok)try{let B=await A.text();return{data:null,error:JSON.parse(B),headers:Object.fromEntries(A.headers.entries())}}catch(B){if(B instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:A.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(A.headers.entries())};let F={message:A.statusText,statusCode:A.status,name:"application_error"};if(B instanceof Error)return{data:null,error:{...F,message:B.message},headers:Object.fromEntries(A.headers.entries())};return{data:null,error:F,headers:Object.fromEntries(A.headers.entries())}}return{data:await A.json(),error:null,headers:Object.fromEntries(A.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(u,D,A={}){let B=new Headers(this.headers);if(A.headers)for(let[G,w]of new Headers(A.headers).entries())B.set(G,w);if(A.idempotencyKey)B.set("Idempotency-Key",A.idempotencyKey);let F={method:"POST",body:JSON.stringify(D),...A,headers:B};return this.fetchRequest(u,F)}async get(u,D={}){let A=new Headers(this.headers);if(D.headers)for(let[F,G]of new Headers(D.headers).entries())A.set(F,G);let B={method:"GET",...D,headers:A};return this.fetchRequest(u,B)}async put(u,D,A={}){let B=new Headers(this.headers);if(A.headers)for(let[G,w]of new Headers(A.headers).entries())B.set(G,w);let F={method:"PUT",body:JSON.stringify(D),...A,headers:B};return this.fetchRequest(u,F)}async patch(u,D,A={}){let B=new Headers(this.headers);if(A.headers)for(let[G,w]of new Headers(A.headers).entries())B.set(G,w);let F={method:"PATCH",body:JSON.stringify(D),...A,headers:B};return this.fetchRequest(u,F)}async delete(u,D){let A={method:"DELETE",body:JSON.stringify(D),headers:this.headers};return this.fetchRequest(u,A)}};export{EQ as Resend};
32
32
 
33
- //# debugId=043AA145DDCAFE9764756E2164756E21
33
+ //# debugId=ED2DBE0FF251524564756E2164756E21