telnyx 7.23.0 → 7.24.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 (371) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +8 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/ai/ai.d.mts +6 -2
  10. package/resources/ai/ai.d.mts.map +1 -1
  11. package/resources/ai/ai.d.ts +6 -2
  12. package/resources/ai/ai.d.ts.map +1 -1
  13. package/resources/ai/ai.js +4 -0
  14. package/resources/ai/ai.js.map +1 -1
  15. package/resources/ai/ai.mjs +4 -0
  16. package/resources/ai/ai.mjs.map +1 -1
  17. package/resources/ai/assistants/assistants.d.mts +153 -11
  18. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  19. package/resources/ai/assistants/assistants.d.ts +153 -11
  20. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  21. package/resources/ai/assistants/assistants.js.map +1 -1
  22. package/resources/ai/assistants/assistants.mjs.map +1 -1
  23. package/resources/ai/assistants/index.d.mts +1 -1
  24. package/resources/ai/assistants/index.d.mts.map +1 -1
  25. package/resources/ai/assistants/index.d.ts +1 -1
  26. package/resources/ai/assistants/index.d.ts.map +1 -1
  27. package/resources/ai/assistants/index.js.map +1 -1
  28. package/resources/ai/assistants/index.mjs.map +1 -1
  29. package/resources/ai/assistants/versions.d.mts +2 -2
  30. package/resources/ai/assistants/versions.d.mts.map +1 -1
  31. package/resources/ai/assistants/versions.d.ts +2 -2
  32. package/resources/ai/assistants/versions.d.ts.map +1 -1
  33. package/resources/ai/collections/collections.d.mts +3 -3
  34. package/resources/ai/collections/collections.d.mts.map +1 -1
  35. package/resources/ai/collections/collections.d.ts +3 -3
  36. package/resources/ai/collections/collections.d.ts.map +1 -1
  37. package/resources/ai/collections/collections.js.map +1 -1
  38. package/resources/ai/collections/collections.mjs.map +1 -1
  39. package/resources/ai/collections/index.d.mts +1 -1
  40. package/resources/ai/collections/index.d.mts.map +1 -1
  41. package/resources/ai/collections/index.d.ts +1 -1
  42. package/resources/ai/collections/index.d.ts.map +1 -1
  43. package/resources/ai/collections/index.js.map +1 -1
  44. package/resources/ai/collections/index.mjs.map +1 -1
  45. package/resources/ai/collections/sources.d.mts +32 -5
  46. package/resources/ai/collections/sources.d.mts.map +1 -1
  47. package/resources/ai/collections/sources.d.ts +32 -5
  48. package/resources/ai/collections/sources.d.ts.map +1 -1
  49. package/resources/ai/collections/sources.js.map +1 -1
  50. package/resources/ai/collections/sources.mjs.map +1 -1
  51. package/resources/ai/index.d.mts +2 -1
  52. package/resources/ai/index.d.mts.map +1 -1
  53. package/resources/ai/index.d.ts +2 -1
  54. package/resources/ai/index.d.ts.map +1 -1
  55. package/resources/ai/index.js +9 -7
  56. package/resources/ai/index.js.map +1 -1
  57. package/resources/ai/index.mjs +1 -0
  58. package/resources/ai/index.mjs.map +1 -1
  59. package/resources/ai/memory/index.d.mts +3 -0
  60. package/resources/ai/memory/index.d.mts.map +1 -0
  61. package/resources/ai/memory/index.d.ts +3 -0
  62. package/resources/ai/memory/index.d.ts.map +1 -0
  63. package/resources/ai/memory/index.js +9 -0
  64. package/resources/ai/memory/index.js.map +1 -0
  65. package/resources/ai/memory/index.mjs +4 -0
  66. package/resources/ai/memory/index.mjs.map +1 -0
  67. package/resources/ai/memory/memory.d.mts +10 -0
  68. package/resources/ai/memory/memory.d.mts.map +1 -0
  69. package/resources/ai/memory/memory.d.ts +10 -0
  70. package/resources/ai/memory/memory.d.ts.map +1 -0
  71. package/resources/ai/memory/memory.js +17 -0
  72. package/resources/ai/memory/memory.js.map +1 -0
  73. package/resources/ai/memory/memory.mjs +12 -0
  74. package/resources/ai/memory/memory.mjs.map +1 -0
  75. package/resources/ai/memory/namespaces/index.d.mts +4 -0
  76. package/resources/ai/memory/namespaces/index.d.mts.map +1 -0
  77. package/resources/ai/memory/namespaces/index.d.ts +4 -0
  78. package/resources/ai/memory/namespaces/index.d.ts.map +1 -0
  79. package/resources/ai/memory/namespaces/index.js +11 -0
  80. package/resources/ai/memory/namespaces/index.js.map +1 -0
  81. package/resources/ai/memory/namespaces/index.mjs +5 -0
  82. package/resources/ai/memory/namespaces/index.mjs.map +1 -0
  83. package/resources/ai/memory/namespaces/namespaces.d.mts +54 -0
  84. package/resources/ai/memory/namespaces/namespaces.d.mts.map +1 -0
  85. package/resources/ai/memory/namespaces/namespaces.d.ts +54 -0
  86. package/resources/ai/memory/namespaces/namespaces.d.ts.map +1 -0
  87. package/resources/ai/memory/namespaces/namespaces.js +43 -0
  88. package/resources/ai/memory/namespaces/namespaces.js.map +1 -0
  89. package/resources/ai/memory/namespaces/namespaces.mjs +38 -0
  90. package/resources/ai/memory/namespaces/namespaces.mjs.map +1 -0
  91. package/resources/ai/memory/namespaces/profiles/index.d.mts +4 -0
  92. package/resources/ai/memory/namespaces/profiles/index.d.mts.map +1 -0
  93. package/resources/ai/memory/namespaces/profiles/index.d.ts +4 -0
  94. package/resources/ai/memory/namespaces/profiles/index.d.ts.map +1 -0
  95. package/resources/ai/memory/namespaces/profiles/index.js +11 -0
  96. package/resources/ai/memory/namespaces/profiles/index.js.map +1 -0
  97. package/resources/ai/memory/namespaces/profiles/index.mjs +5 -0
  98. package/resources/ai/memory/namespaces/profiles/index.mjs.map +1 -0
  99. package/resources/ai/memory/namespaces/profiles/memories.d.mts +118 -0
  100. package/resources/ai/memory/namespaces/profiles/memories.d.mts.map +1 -0
  101. package/resources/ai/memory/namespaces/profiles/memories.d.ts +118 -0
  102. package/resources/ai/memory/namespaces/profiles/memories.d.ts.map +1 -0
  103. package/resources/ai/memory/namespaces/profiles/memories.js +63 -0
  104. package/resources/ai/memory/namespaces/profiles/memories.js.map +1 -0
  105. package/resources/ai/memory/namespaces/profiles/memories.mjs +59 -0
  106. package/resources/ai/memory/namespaces/profiles/memories.mjs.map +1 -0
  107. package/resources/ai/memory/namespaces/profiles/profiles.d.mts +324 -0
  108. package/resources/ai/memory/namespaces/profiles/profiles.d.mts.map +1 -0
  109. package/resources/ai/memory/namespaces/profiles/profiles.d.ts +324 -0
  110. package/resources/ai/memory/namespaces/profiles/profiles.d.ts.map +1 -0
  111. package/resources/ai/memory/namespaces/profiles/profiles.js +161 -0
  112. package/resources/ai/memory/namespaces/profiles/profiles.js.map +1 -0
  113. package/resources/ai/memory/namespaces/profiles/profiles.mjs +156 -0
  114. package/resources/ai/memory/namespaces/profiles/profiles.mjs.map +1 -0
  115. package/resources/ai/memory/namespaces/profiles/sources.d.mts +163 -0
  116. package/resources/ai/memory/namespaces/profiles/sources.d.mts.map +1 -0
  117. package/resources/ai/memory/namespaces/profiles/sources.d.ts +163 -0
  118. package/resources/ai/memory/namespaces/profiles/sources.d.ts.map +1 -0
  119. package/resources/ai/memory/namespaces/profiles/sources.js +80 -0
  120. package/resources/ai/memory/namespaces/profiles/sources.js.map +1 -0
  121. package/resources/ai/memory/namespaces/profiles/sources.mjs +76 -0
  122. package/resources/ai/memory/namespaces/profiles/sources.mjs.map +1 -0
  123. package/resources/ai/memory/namespaces/profiles.d.mts +2 -0
  124. package/resources/ai/memory/namespaces/profiles.d.mts.map +1 -0
  125. package/resources/ai/memory/namespaces/profiles.d.ts +2 -0
  126. package/resources/ai/memory/namespaces/profiles.d.ts.map +1 -0
  127. package/resources/ai/memory/namespaces/profiles.js +6 -0
  128. package/resources/ai/memory/namespaces/profiles.js.map +1 -0
  129. package/resources/ai/memory/namespaces/profiles.mjs +3 -0
  130. package/resources/ai/memory/namespaces/profiles.mjs.map +1 -0
  131. package/resources/ai/memory/namespaces/settings.d.mts +108 -0
  132. package/resources/ai/memory/namespaces/settings.d.mts.map +1 -0
  133. package/resources/ai/memory/namespaces/settings.d.ts +108 -0
  134. package/resources/ai/memory/namespaces/settings.d.ts.map +1 -0
  135. package/resources/ai/memory/namespaces/settings.js +54 -0
  136. package/resources/ai/memory/namespaces/settings.js.map +1 -0
  137. package/resources/ai/memory/namespaces/settings.mjs +50 -0
  138. package/resources/ai/memory/namespaces/settings.mjs.map +1 -0
  139. package/resources/ai/memory/namespaces.d.mts +2 -0
  140. package/resources/ai/memory/namespaces.d.mts.map +1 -0
  141. package/resources/ai/memory/namespaces.d.ts +2 -0
  142. package/resources/ai/memory/namespaces.d.ts.map +1 -0
  143. package/resources/ai/memory/namespaces.js +6 -0
  144. package/resources/ai/memory/namespaces.js.map +1 -0
  145. package/resources/ai/memory/namespaces.mjs +3 -0
  146. package/resources/ai/memory/namespaces.mjs.map +1 -0
  147. package/resources/ai/memory.d.mts +2 -0
  148. package/resources/ai/memory.d.mts.map +1 -0
  149. package/resources/ai/memory.d.ts +2 -0
  150. package/resources/ai/memory.d.ts.map +1 -0
  151. package/resources/ai/memory.js +6 -0
  152. package/resources/ai/memory.js.map +1 -0
  153. package/resources/ai/memory.mjs +3 -0
  154. package/resources/ai/memory.mjs.map +1 -0
  155. package/resources/ai/typesafe/v1.d.mts +25 -14
  156. package/resources/ai/typesafe/v1.d.mts.map +1 -1
  157. package/resources/ai/typesafe/v1.d.ts +25 -14
  158. package/resources/ai/typesafe/v1.d.ts.map +1 -1
  159. package/resources/ai/typesafe/v1.js +15 -10
  160. package/resources/ai/typesafe/v1.js.map +1 -1
  161. package/resources/ai/typesafe/v1.mjs +15 -10
  162. package/resources/ai/typesafe/v1.mjs.map +1 -1
  163. package/resources/calls/actions.d.mts +43 -5
  164. package/resources/calls/actions.d.mts.map +1 -1
  165. package/resources/calls/actions.d.ts +43 -5
  166. package/resources/calls/actions.d.ts.map +1 -1
  167. package/resources/calls/calls.d.mts +10 -4
  168. package/resources/calls/calls.d.mts.map +1 -1
  169. package/resources/calls/calls.d.ts +10 -4
  170. package/resources/calls/calls.d.ts.map +1 -1
  171. package/resources/calls/calls.js.map +1 -1
  172. package/resources/calls/calls.mjs.map +1 -1
  173. package/resources/calls/index.d.mts +1 -1
  174. package/resources/calls/index.d.mts.map +1 -1
  175. package/resources/calls/index.d.ts +1 -1
  176. package/resources/calls/index.d.ts.map +1 -1
  177. package/resources/calls/index.js.map +1 -1
  178. package/resources/calls/index.mjs.map +1 -1
  179. package/resources/conferences/actions.d.mts +7 -1
  180. package/resources/conferences/actions.d.mts.map +1 -1
  181. package/resources/conferences/actions.d.ts +7 -1
  182. package/resources/conferences/actions.d.ts.map +1 -1
  183. package/resources/email-blocks/email-blocks.d.mts +12 -4
  184. package/resources/email-blocks/email-blocks.d.mts.map +1 -1
  185. package/resources/email-blocks/email-blocks.d.ts +12 -4
  186. package/resources/email-blocks/email-blocks.d.ts.map +1 -1
  187. package/resources/email-blocks/email-blocks.js +5 -3
  188. package/resources/email-blocks/email-blocks.js.map +1 -1
  189. package/resources/email-blocks/email-blocks.mjs +5 -3
  190. package/resources/email-blocks/email-blocks.mjs.map +1 -1
  191. package/resources/email-blocks/imports.d.mts +20 -4
  192. package/resources/email-blocks/imports.d.mts.map +1 -1
  193. package/resources/email-blocks/imports.d.ts +20 -4
  194. package/resources/email-blocks/imports.d.ts.map +1 -1
  195. package/resources/email-blocks/imports.js +17 -3
  196. package/resources/email-blocks/imports.js.map +1 -1
  197. package/resources/email-blocks/imports.mjs +17 -3
  198. package/resources/email-blocks/imports.mjs.map +1 -1
  199. package/resources/email-domains/email-domains.d.mts +98 -1
  200. package/resources/email-domains/email-domains.d.mts.map +1 -1
  201. package/resources/email-domains/email-domains.d.ts +98 -1
  202. package/resources/email-domains/email-domains.d.ts.map +1 -1
  203. package/resources/email-domains/email-domains.js +21 -0
  204. package/resources/email-domains/email-domains.js.map +1 -1
  205. package/resources/email-domains/email-domains.mjs +21 -0
  206. package/resources/email-domains/email-domains.mjs.map +1 -1
  207. package/resources/email-domains/index.d.mts +1 -1
  208. package/resources/email-domains/index.d.mts.map +1 -1
  209. package/resources/email-domains/index.d.ts +1 -1
  210. package/resources/email-domains/index.d.ts.map +1 -1
  211. package/resources/email-domains/index.js.map +1 -1
  212. package/resources/email-domains/index.mjs.map +1 -1
  213. package/resources/email-domains/webhooks.d.mts +6 -4
  214. package/resources/email-domains/webhooks.d.mts.map +1 -1
  215. package/resources/email-domains/webhooks.d.ts +6 -4
  216. package/resources/email-domains/webhooks.d.ts.map +1 -1
  217. package/resources/email-events.d.mts +162 -28
  218. package/resources/email-events.d.mts.map +1 -1
  219. package/resources/email-events.d.ts +162 -28
  220. package/resources/email-events.d.ts.map +1 -1
  221. package/resources/email-events.js +15 -6
  222. package/resources/email-events.js.map +1 -1
  223. package/resources/email-events.mjs +15 -6
  224. package/resources/email-events.mjs.map +1 -1
  225. package/resources/email-inboxes/drafts.d.mts +31 -1
  226. package/resources/email-inboxes/drafts.d.mts.map +1 -1
  227. package/resources/email-inboxes/drafts.d.ts +31 -1
  228. package/resources/email-inboxes/drafts.d.ts.map +1 -1
  229. package/resources/email-inboxes/drafts.js.map +1 -1
  230. package/resources/email-inboxes/drafts.mjs.map +1 -1
  231. package/resources/email-messages/email-messages.d.mts +174 -43
  232. package/resources/email-messages/email-messages.d.mts.map +1 -1
  233. package/resources/email-messages/email-messages.d.ts +174 -43
  234. package/resources/email-messages/email-messages.d.ts.map +1 -1
  235. package/resources/email-messages/email-messages.js +39 -7
  236. package/resources/email-messages/email-messages.js.map +1 -1
  237. package/resources/email-messages/email-messages.mjs +39 -7
  238. package/resources/email-messages/email-messages.mjs.map +1 -1
  239. package/resources/email-messages/index.d.mts +1 -1
  240. package/resources/email-messages/index.d.mts.map +1 -1
  241. package/resources/email-messages/index.d.ts +1 -1
  242. package/resources/email-messages/index.d.ts.map +1 -1
  243. package/resources/email-messages/index.js.map +1 -1
  244. package/resources/email-messages/index.mjs.map +1 -1
  245. package/resources/email-messages/recipients.d.mts +2 -2
  246. package/resources/email-messages/recipients.d.mts.map +1 -1
  247. package/resources/email-messages/recipients.d.ts +2 -2
  248. package/resources/email-messages/recipients.d.ts.map +1 -1
  249. package/resources/email-templates.d.mts +170 -0
  250. package/resources/email-templates.d.mts.map +1 -1
  251. package/resources/email-templates.d.ts +170 -0
  252. package/resources/email-templates.d.ts.map +1 -1
  253. package/resources/email-templates.js +6 -0
  254. package/resources/email-templates.js.map +1 -1
  255. package/resources/email-templates.mjs +6 -0
  256. package/resources/email-templates.mjs.map +1 -1
  257. package/resources/index.d.mts +4 -4
  258. package/resources/index.d.mts.map +1 -1
  259. package/resources/index.d.ts +4 -4
  260. package/resources/index.d.ts.map +1 -1
  261. package/resources/index.js.map +1 -1
  262. package/resources/index.mjs.map +1 -1
  263. package/resources/meeting-sessions/actions.d.mts +7 -1
  264. package/resources/meeting-sessions/actions.d.mts.map +1 -1
  265. package/resources/meeting-sessions/actions.d.ts +7 -1
  266. package/resources/meeting-sessions/actions.d.ts.map +1 -1
  267. package/resources/meeting-sessions/actions.js +7 -1
  268. package/resources/meeting-sessions/actions.js.map +1 -1
  269. package/resources/meeting-sessions/actions.mjs +7 -1
  270. package/resources/meeting-sessions/actions.mjs.map +1 -1
  271. package/resources/meeting-sessions/artifacts.d.mts +38 -11
  272. package/resources/meeting-sessions/artifacts.d.mts.map +1 -1
  273. package/resources/meeting-sessions/artifacts.d.ts +38 -11
  274. package/resources/meeting-sessions/artifacts.d.ts.map +1 -1
  275. package/resources/meeting-sessions/artifacts.js +11 -5
  276. package/resources/meeting-sessions/artifacts.js.map +1 -1
  277. package/resources/meeting-sessions/artifacts.mjs +11 -5
  278. package/resources/meeting-sessions/artifacts.mjs.map +1 -1
  279. package/resources/meeting-sessions/meeting-sessions.d.mts +63 -23
  280. package/resources/meeting-sessions/meeting-sessions.d.mts.map +1 -1
  281. package/resources/meeting-sessions/meeting-sessions.d.ts +63 -23
  282. package/resources/meeting-sessions/meeting-sessions.d.ts.map +1 -1
  283. package/resources/meeting-sessions/meeting-sessions.js +0 -2
  284. package/resources/meeting-sessions/meeting-sessions.js.map +1 -1
  285. package/resources/meeting-sessions/meeting-sessions.mjs +0 -2
  286. package/resources/meeting-sessions/meeting-sessions.mjs.map +1 -1
  287. package/resources/phone-numbers/phone-numbers.d.mts +12 -2
  288. package/resources/phone-numbers/phone-numbers.d.mts.map +1 -1
  289. package/resources/phone-numbers/phone-numbers.d.ts +12 -2
  290. package/resources/phone-numbers/phone-numbers.d.ts.map +1 -1
  291. package/resources/phone-numbers/phone-numbers.js.map +1 -1
  292. package/resources/phone-numbers/phone-numbers.mjs.map +1 -1
  293. package/resources/private-wireless-gateways.d.mts +61 -7
  294. package/resources/private-wireless-gateways.d.mts.map +1 -1
  295. package/resources/private-wireless-gateways.d.ts +61 -7
  296. package/resources/private-wireless-gateways.d.ts.map +1 -1
  297. package/resources/private-wireless-gateways.js +1 -1
  298. package/resources/private-wireless-gateways.js.map +1 -1
  299. package/resources/private-wireless-gateways.mjs +1 -1
  300. package/resources/private-wireless-gateways.mjs.map +1 -1
  301. package/resources/texml/accounts/calls/calls.d.mts +9 -9
  302. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  303. package/resources/texml/accounts/calls/calls.d.ts +9 -9
  304. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  305. package/resources/texml/accounts/calls/calls.js +12 -2
  306. package/resources/texml/accounts/calls/calls.js.map +1 -1
  307. package/resources/texml/accounts/calls/calls.mjs +12 -2
  308. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  309. package/resources/text-to-speech/text-to-speech.d.mts +61 -9
  310. package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
  311. package/resources/text-to-speech/text-to-speech.d.ts +61 -9
  312. package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
  313. package/resources/text-to-speech/text-to-speech.js +10 -3
  314. package/resources/text-to-speech/text-to-speech.js.map +1 -1
  315. package/resources/text-to-speech/text-to-speech.mjs +10 -3
  316. package/resources/text-to-speech/text-to-speech.mjs.map +1 -1
  317. package/resources/webhooks.d.mts +14 -4
  318. package/resources/webhooks.d.mts.map +1 -1
  319. package/resources/webhooks.d.ts +14 -4
  320. package/resources/webhooks.d.ts.map +1 -1
  321. package/src/client.ts +12 -6
  322. package/src/resources/ai/ai.ts +8 -0
  323. package/src/resources/ai/assistants/assistants.ts +221 -11
  324. package/src/resources/ai/assistants/index.ts +1 -0
  325. package/src/resources/ai/assistants/versions.ts +2 -2
  326. package/src/resources/ai/collections/collections.ts +3 -1
  327. package/src/resources/ai/collections/index.ts +2 -0
  328. package/src/resources/ai/collections/sources.ts +38 -4
  329. package/src/resources/ai/index.ts +2 -0
  330. package/src/resources/ai/memory/index.ts +4 -0
  331. package/src/resources/ai/memory/memory.ts +19 -0
  332. package/src/resources/ai/memory/namespaces/index.ts +21 -0
  333. package/src/resources/ai/memory/namespaces/namespaces.ts +116 -0
  334. package/src/resources/ai/memory/namespaces/profiles/index.ts +35 -0
  335. package/src/resources/ai/memory/namespaces/profiles/memories.ts +170 -0
  336. package/src/resources/ai/memory/namespaces/profiles/profiles.ts +482 -0
  337. package/src/resources/ai/memory/namespaces/profiles/sources.ts +226 -0
  338. package/src/resources/ai/memory/namespaces/profiles.ts +3 -0
  339. package/src/resources/ai/memory/namespaces/settings.ts +129 -0
  340. package/src/resources/ai/memory/namespaces.ts +3 -0
  341. package/src/resources/ai/memory.ts +3 -0
  342. package/src/resources/ai/typesafe/v1.ts +26 -14
  343. package/src/resources/calls/actions.ts +50 -4
  344. package/src/resources/calls/calls.ts +12 -2
  345. package/src/resources/calls/index.ts +1 -0
  346. package/src/resources/conferences/actions.ts +8 -1
  347. package/src/resources/email-blocks/email-blocks.ts +12 -4
  348. package/src/resources/email-blocks/imports.ts +20 -4
  349. package/src/resources/email-domains/email-domains.ts +120 -0
  350. package/src/resources/email-domains/index.ts +1 -0
  351. package/src/resources/email-domains/webhooks.ts +9 -4
  352. package/src/resources/email-events.ts +220 -35
  353. package/src/resources/email-inboxes/drafts.ts +32 -1
  354. package/src/resources/email-messages/email-messages.ts +191 -47
  355. package/src/resources/email-messages/index.ts +2 -1
  356. package/src/resources/email-messages/recipients.ts +6 -2
  357. package/src/resources/email-templates.ts +185 -0
  358. package/src/resources/index.ts +6 -3
  359. package/src/resources/meeting-sessions/actions.ts +7 -1
  360. package/src/resources/meeting-sessions/artifacts.ts +42 -11
  361. package/src/resources/meeting-sessions/meeting-sessions.ts +63 -24
  362. package/src/resources/phone-numbers/phone-numbers.ts +13 -2
  363. package/src/resources/private-wireless-gateways.ts +76 -8
  364. package/src/resources/texml/accounts/calls/calls.ts +20 -10
  365. package/src/resources/text-to-speech/text-to-speech.ts +69 -9
  366. package/src/resources/webhooks.ts +16 -4
  367. package/src/version.ts +1 -1
  368. package/version.d.mts +1 -1
  369. package/version.d.ts +1 -1
  370. package/version.js +1 -1
  371. package/version.mjs +1 -1
@@ -1,8 +1,6 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import * as EmailEventsAPI from "./email-events.mjs";
3
- import * as DraftsAPI from "./email-inboxes/drafts.mjs";
4
3
  import { APIPromise } from "../core/api-promise.mjs";
5
- import { EmailCursorPagination, type EmailCursorPaginationParams, PagePromise } from "../core/pagination.mjs";
6
4
  import { RequestOptions } from "../internal/request-options.mjs";
7
5
  /**
8
6
  * Retrieve account-level email events and event statistics.
@@ -10,46 +8,161 @@ import { RequestOptions } from "../internal/request-options.mjs";
10
8
  export declare class EmailEvents extends APIResource {
11
9
  /**
12
10
  * Lists account-level email events sorted oldest first by
13
- * `occurred_at asc, id asc`.
11
+ * `occurred_at asc, id asc`. Each row contains a legacy email.-prefixed event_type
12
+ * and an additive canonical_event_type. Gateway rejection renders email.failed
13
+ * with canonical email.gw_reject; ambiguous injection timeout renders
14
+ * email.injection_timeout in both; MTA expiration renders email.bounced with
15
+ * canonical email.expired. Message-scoped queued, sending, sandbox, cancelled, and
16
+ * daily_limit_exceeded rows fan out per durable recipient with stable derived IDs
17
+ * matching webhook delivery. Scheduled is the cardinality exception: account
18
+ * polling retains one message-scoped scheduled row with its stored event ID, while
19
+ * scheduled webhook publication fans out per recipient with derived IDs; reconcile
20
+ * scheduled events by message ID, event type, and occurrence time rather than
21
+ * event UUID. Recipient-scoped stored rows retain their stored UUIDs across
22
+ * polling and webhook delivery. Legacy names are derived from stored rows; an
23
+ * AdminBounce row stored as failed renders email.failed in polling while its
24
+ * webhook retains email.bounced, both with canonical email.failed.
14
25
  */
15
- list(query?: EmailEventListParams | null | undefined, options?: RequestOptions): PagePromise<EmailEventListResponsesEmailCursorPagination, EmailEventListResponse>;
26
+ list(query?: EmailEventListParams | null | undefined, options?: RequestOptions): APIPromise<EmailEventListResponse>;
16
27
  /**
17
28
  * Returns counts and rates for email events over a time range. The default start
18
29
  * time is 30 days ago.
19
30
  */
20
31
  retrieveStats(query?: EmailEventRetrieveStatsParams | null | undefined, options?: RequestOptions): APIPromise<EmailEventRetrieveStatsResponse>;
21
32
  }
22
- export type EmailEventListResponsesEmailCursorPagination = EmailCursorPagination<EmailEventListResponse>;
23
- export type EmailEventType = 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded';
33
+ /**
34
+ * Bare stored event names returned by message history. In addition to the normal
35
+ * send and delivery lifecycle, polling can expose suppression, scan, and
36
+ * quarantine lifecycle rows. Sharp canonical names gw_reject, injection_timeout,
37
+ * and expired distinguish gateway rejection, ambiguous injection timeout, and MTA
38
+ * expiration. The failed and bounced names remain valid for system/admin failures
39
+ * and hard bounces respectively. Existing stored rows retain their original names.
40
+ */
41
+ export type EmailEventType = 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'suppressed' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded' | 'scan_deferred' | 'quarantined' | 'quarantine_released' | 'quarantine_release_dispatched' | 'quarantine_rejected' | 'quarantine_expired' | 'gw_reject' | 'injection_timeout' | 'expired';
42
+ export interface EmailWebhookRecipient {
43
+ email: string;
44
+ kind?: 'to' | 'cc' | 'bcc';
45
+ name?: string | null;
46
+ }
24
47
  export interface TimeRange {
25
48
  from: string | null;
26
49
  to: string | null;
27
50
  }
28
51
  export interface EmailEventListResponse {
29
- id: string;
30
- email_id: string;
31
- occurred_at: string;
32
- record_type: 'email_event';
33
- type: EmailEventType;
34
- /**
35
- * Summary of the associated email message. Present when the email_message preload
36
- * is available.
37
- */
38
- email?: EmailEventListResponse.Email;
39
- payload?: {
40
- [key: string]: unknown;
41
- };
52
+ data: Array<EmailEventListResponse.Data>;
53
+ meta: EmailEventListResponse.Meta;
42
54
  }
43
55
  export declare namespace EmailEventListResponse {
44
56
  /**
45
- * Summary of the associated email message. Present when the email_message preload
46
- * is available.
57
+ * An account-polling event. The envelope is webhook-shaped, but polling preserves
58
+ * stored-event cardinality: queued, sending, sandbox, cancelled, and
59
+ * daily_limit_exceeded message events fan out per recipient; scheduled remains one
60
+ * message-scoped row. Payload fields vary among recipient-scoped, message-scoped,
61
+ * and minimal fallback rows.
47
62
  */
48
- interface Email {
49
- cc: Array<DraftsAPI.EmailAddress>;
50
- from: DraftsAPI.EmailAddress;
51
- subject: string;
52
- to: Array<DraftsAPI.EmailAddress>;
63
+ interface Data {
64
+ /**
65
+ * Event UUID.
66
+ */
67
+ id: string;
68
+ /**
69
+ * Additive canonical outcome name, prefixed with `email.`. Gateway rejection is
70
+ * `email.gw_reject`, ambiguous injection timeout is `email.injection_timeout`, and
71
+ * MTA expiration is `email.expired`. Unchanged outcomes retain their names.
72
+ * Existing stored rows are translated only when recorded payload evidence proves
73
+ * the outcome; a legacy failed row is not guessed or sharpened.
74
+ */
75
+ canonical_event_type: string;
76
+ /**
77
+ * Legacy customer-visible event name, prefixed with `email.`. Gateway rejections
78
+ * render `email.failed`; MTA expirations render `email.bounced`. Webhook
79
+ * subscription allowlists match the legacy name.
80
+ */
81
+ event_type: string;
82
+ occurred_at: string;
83
+ /**
84
+ * Payload returned by GET /email_events. Every row includes id, status, and
85
+ * occurred_at. Recipient-scoped rows also include recipient_id, from, subject, and
86
+ * exactly one object-valued to, cc, or bcc field. Legacy or message-scoped rows
87
+ * can omit recipient_id and use object-valued or string-valued to/cc fields,
88
+ * including an empty string when no address exists; bcc is redacted. If the
89
+ * related message or recipient cannot be loaded, the minimal fallback can omit
90
+ * from, subject, and recipient fields. Additional persisted public evidence can be
91
+ * present.
92
+ */
93
+ payload: Data.Payload;
94
+ /**
95
+ * Durable email recipient UUID. Present for recipient-scoped events, including
96
+ * each queued, sending, sandbox, cancelled, and daily_limit_exceeded fan-out
97
+ * event.
98
+ */
99
+ recipient_id?: string;
100
+ }
101
+ namespace Data {
102
+ /**
103
+ * Payload returned by GET /email_events. Every row includes id, status, and
104
+ * occurred_at. Recipient-scoped rows also include recipient_id, from, subject, and
105
+ * exactly one object-valued to, cc, or bcc field. Legacy or message-scoped rows
106
+ * can omit recipient_id and use object-valued or string-valued to/cc fields,
107
+ * including an empty string when no address exists; bcc is redacted. If the
108
+ * related message or recipient cannot be loaded, the minimal fallback can omit
109
+ * from, subject, and recipient fields. Additional persisted public evidence can be
110
+ * present.
111
+ */
112
+ interface Payload {
113
+ /**
114
+ * Email message UUID.
115
+ */
116
+ id: string;
117
+ occurred_at: string;
118
+ /**
119
+ * Stored event outcome slug, not the authoritative recipient status. Account
120
+ * polling returns the stored name, including suppression, scan, and quarantine
121
+ * lifecycle names. Webhooks retain legacy payload names: gateway rejections use
122
+ * failed and MTA expirations use bounced. New sharp stored rows can expose
123
+ * gw_reject, injection_timeout, or expired. Use the envelope canonical_event_type
124
+ * to identify the outcome across surfaces.
125
+ */
126
+ status: 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'suppressed' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded' | 'scan_deferred' | 'quarantined' | 'quarantine_released' | 'quarantine_release_dispatched' | 'quarantine_rejected' | 'quarantine_expired' | 'gw_reject' | 'injection_timeout' | 'expired';
127
+ bcc?: EmailEventsAPI.EmailWebhookRecipient | 'redacted';
128
+ /**
129
+ * Legacy message-scoped address, or an empty string when absent.
130
+ */
131
+ cc?: EmailEventsAPI.EmailWebhookRecipient | string;
132
+ /**
133
+ * Sender projection in account event polling. The display name is explicitly null
134
+ * when the message has no sender name.
135
+ */
136
+ from?: Payload.From;
137
+ /**
138
+ * Durable email recipient UUID. Present for recipient-scoped events.
139
+ */
140
+ recipient_id?: string;
141
+ subject?: string;
142
+ /**
143
+ * Legacy message-scoped address, or an empty string when absent.
144
+ */
145
+ to?: EmailEventsAPI.EmailWebhookRecipient | string;
146
+ [k: string]: unknown;
147
+ }
148
+ namespace Payload {
149
+ /**
150
+ * Sender projection in account event polling. The display name is explicitly null
151
+ * when the message has no sender name.
152
+ */
153
+ interface From {
154
+ email: string;
155
+ name: string | null;
156
+ }
157
+ }
158
+ }
159
+ interface Meta {
160
+ page_size: number;
161
+ time_range: EmailEventsAPI.TimeRange;
162
+ /**
163
+ * Cursor for the next page, when more results are available.
164
+ */
165
+ page_cursor?: string;
53
166
  }
54
167
  }
55
168
  export interface EmailEventRetrieveStatsResponse {
@@ -126,7 +239,7 @@ export declare namespace EmailEventRetrieveStatsResponse {
126
239
  }
127
240
  }
128
241
  }
129
- export interface EmailEventListParams extends EmailCursorPaginationParams {
242
+ export interface EmailEventListParams {
130
243
  /**
131
244
  * Filter events for a specific email message UUID. Invalid UUID values are
132
245
  * silently ignored (no filter applied).
@@ -136,12 +249,33 @@ export interface EmailEventListParams extends EmailCursorPaginationParams {
136
249
  * Comma-separated list of event types to include. Also accepts repeated query
137
250
  * parameters (e.g. event_type=delivered&event_type=bounced). Unknown values return
138
251
  * no matches.
252
+ *
253
+ * Dual-name compatibility: values are accepted bare or `email.`-prefixed. A legacy
254
+ * value keeps matching the rows it matched pre-rename — no widening: `failed` also
255
+ * matches the rows that now store the canonical names of the outcomes it covered
256
+ * (`gw_reject`, `injection_timeout`, `expired`); `bounced` matches stored
257
+ * `bounced` rows only (recipient-scoped Expirations stored `failed` pre-rename and
258
+ * never matched `bounced`, so `expired` is deliberately not a `bounced`
259
+ * expansion). A canonical value matches its own rows plus legacy rows whose
260
+ * recorded payload evidence proves that outcome (`expired` also surfaces legacy
261
+ * `bounced` rows with `bounce_category: transient`). The additive
262
+ * `canonical_event_type` field in each response row names the canonical outcome.
139
263
  */
140
264
  event_type?: string | Array<string>;
141
265
  /**
142
266
  * Inclusive ISO 8601 start timestamp. Defaults to 30 days ago when omitted.
143
267
  */
144
268
  from?: string;
269
+ /**
270
+ * Number of results to return. Defaults to 25; maximum is 100. Invalid values are
271
+ * clamped to the valid range.
272
+ */
273
+ page_size?: number;
274
+ /**
275
+ * Opaque URL-safe Base64 cursor returned by a previous event list response. The
276
+ * legacy `page[after]` and flat `page_cursor` forms are also accepted.
277
+ */
278
+ 'page[cursor]'?: string;
145
279
  /**
146
280
  * Inclusive ISO 8601 end timestamp. When `from` is provided without `to`, defaults
147
281
  * to `from + 30 days`.
@@ -160,6 +294,6 @@ export interface EmailEventRetrieveStatsParams {
160
294
  to?: string;
161
295
  }
162
296
  export declare namespace EmailEvents {
163
- export { type EmailEventType as EmailEventType, type TimeRange as TimeRange, type EmailEventListResponse as EmailEventListResponse, type EmailEventRetrieveStatsResponse as EmailEventRetrieveStatsResponse, type EmailEventListResponsesEmailCursorPagination as EmailEventListResponsesEmailCursorPagination, type EmailEventListParams as EmailEventListParams, type EmailEventRetrieveStatsParams as EmailEventRetrieveStatsParams, };
297
+ export { type EmailEventType as EmailEventType, type EmailWebhookRecipient as EmailWebhookRecipient, type TimeRange as TimeRange, type EmailEventListResponse as EmailEventListResponse, type EmailEventRetrieveStatsResponse as EmailEventRetrieveStatsResponse, type EmailEventListParams as EmailEventListParams, type EmailEventRetrieveStatsParams as EmailEventRetrieveStatsParams, };
164
298
  }
165
299
  //# sourceMappingURL=email-events.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-events.d.mts","sourceRoot":"","sources":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AK,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -1,8 +1,6 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import * as EmailEventsAPI from "./email-events.js";
3
- import * as DraftsAPI from "./email-inboxes/drafts.js";
4
3
  import { APIPromise } from "../core/api-promise.js";
5
- import { EmailCursorPagination, type EmailCursorPaginationParams, PagePromise } from "../core/pagination.js";
6
4
  import { RequestOptions } from "../internal/request-options.js";
7
5
  /**
8
6
  * Retrieve account-level email events and event statistics.
@@ -10,46 +8,161 @@ import { RequestOptions } from "../internal/request-options.js";
10
8
  export declare class EmailEvents extends APIResource {
11
9
  /**
12
10
  * Lists account-level email events sorted oldest first by
13
- * `occurred_at asc, id asc`.
11
+ * `occurred_at asc, id asc`. Each row contains a legacy email.-prefixed event_type
12
+ * and an additive canonical_event_type. Gateway rejection renders email.failed
13
+ * with canonical email.gw_reject; ambiguous injection timeout renders
14
+ * email.injection_timeout in both; MTA expiration renders email.bounced with
15
+ * canonical email.expired. Message-scoped queued, sending, sandbox, cancelled, and
16
+ * daily_limit_exceeded rows fan out per durable recipient with stable derived IDs
17
+ * matching webhook delivery. Scheduled is the cardinality exception: account
18
+ * polling retains one message-scoped scheduled row with its stored event ID, while
19
+ * scheduled webhook publication fans out per recipient with derived IDs; reconcile
20
+ * scheduled events by message ID, event type, and occurrence time rather than
21
+ * event UUID. Recipient-scoped stored rows retain their stored UUIDs across
22
+ * polling and webhook delivery. Legacy names are derived from stored rows; an
23
+ * AdminBounce row stored as failed renders email.failed in polling while its
24
+ * webhook retains email.bounced, both with canonical email.failed.
14
25
  */
15
- list(query?: EmailEventListParams | null | undefined, options?: RequestOptions): PagePromise<EmailEventListResponsesEmailCursorPagination, EmailEventListResponse>;
26
+ list(query?: EmailEventListParams | null | undefined, options?: RequestOptions): APIPromise<EmailEventListResponse>;
16
27
  /**
17
28
  * Returns counts and rates for email events over a time range. The default start
18
29
  * time is 30 days ago.
19
30
  */
20
31
  retrieveStats(query?: EmailEventRetrieveStatsParams | null | undefined, options?: RequestOptions): APIPromise<EmailEventRetrieveStatsResponse>;
21
32
  }
22
- export type EmailEventListResponsesEmailCursorPagination = EmailCursorPagination<EmailEventListResponse>;
23
- export type EmailEventType = 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded';
33
+ /**
34
+ * Bare stored event names returned by message history. In addition to the normal
35
+ * send and delivery lifecycle, polling can expose suppression, scan, and
36
+ * quarantine lifecycle rows. Sharp canonical names gw_reject, injection_timeout,
37
+ * and expired distinguish gateway rejection, ambiguous injection timeout, and MTA
38
+ * expiration. The failed and bounced names remain valid for system/admin failures
39
+ * and hard bounces respectively. Existing stored rows retain their original names.
40
+ */
41
+ export type EmailEventType = 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'suppressed' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded' | 'scan_deferred' | 'quarantined' | 'quarantine_released' | 'quarantine_release_dispatched' | 'quarantine_rejected' | 'quarantine_expired' | 'gw_reject' | 'injection_timeout' | 'expired';
42
+ export interface EmailWebhookRecipient {
43
+ email: string;
44
+ kind?: 'to' | 'cc' | 'bcc';
45
+ name?: string | null;
46
+ }
24
47
  export interface TimeRange {
25
48
  from: string | null;
26
49
  to: string | null;
27
50
  }
28
51
  export interface EmailEventListResponse {
29
- id: string;
30
- email_id: string;
31
- occurred_at: string;
32
- record_type: 'email_event';
33
- type: EmailEventType;
34
- /**
35
- * Summary of the associated email message. Present when the email_message preload
36
- * is available.
37
- */
38
- email?: EmailEventListResponse.Email;
39
- payload?: {
40
- [key: string]: unknown;
41
- };
52
+ data: Array<EmailEventListResponse.Data>;
53
+ meta: EmailEventListResponse.Meta;
42
54
  }
43
55
  export declare namespace EmailEventListResponse {
44
56
  /**
45
- * Summary of the associated email message. Present when the email_message preload
46
- * is available.
57
+ * An account-polling event. The envelope is webhook-shaped, but polling preserves
58
+ * stored-event cardinality: queued, sending, sandbox, cancelled, and
59
+ * daily_limit_exceeded message events fan out per recipient; scheduled remains one
60
+ * message-scoped row. Payload fields vary among recipient-scoped, message-scoped,
61
+ * and minimal fallback rows.
47
62
  */
48
- interface Email {
49
- cc: Array<DraftsAPI.EmailAddress>;
50
- from: DraftsAPI.EmailAddress;
51
- subject: string;
52
- to: Array<DraftsAPI.EmailAddress>;
63
+ interface Data {
64
+ /**
65
+ * Event UUID.
66
+ */
67
+ id: string;
68
+ /**
69
+ * Additive canonical outcome name, prefixed with `email.`. Gateway rejection is
70
+ * `email.gw_reject`, ambiguous injection timeout is `email.injection_timeout`, and
71
+ * MTA expiration is `email.expired`. Unchanged outcomes retain their names.
72
+ * Existing stored rows are translated only when recorded payload evidence proves
73
+ * the outcome; a legacy failed row is not guessed or sharpened.
74
+ */
75
+ canonical_event_type: string;
76
+ /**
77
+ * Legacy customer-visible event name, prefixed with `email.`. Gateway rejections
78
+ * render `email.failed`; MTA expirations render `email.bounced`. Webhook
79
+ * subscription allowlists match the legacy name.
80
+ */
81
+ event_type: string;
82
+ occurred_at: string;
83
+ /**
84
+ * Payload returned by GET /email_events. Every row includes id, status, and
85
+ * occurred_at. Recipient-scoped rows also include recipient_id, from, subject, and
86
+ * exactly one object-valued to, cc, or bcc field. Legacy or message-scoped rows
87
+ * can omit recipient_id and use object-valued or string-valued to/cc fields,
88
+ * including an empty string when no address exists; bcc is redacted. If the
89
+ * related message or recipient cannot be loaded, the minimal fallback can omit
90
+ * from, subject, and recipient fields. Additional persisted public evidence can be
91
+ * present.
92
+ */
93
+ payload: Data.Payload;
94
+ /**
95
+ * Durable email recipient UUID. Present for recipient-scoped events, including
96
+ * each queued, sending, sandbox, cancelled, and daily_limit_exceeded fan-out
97
+ * event.
98
+ */
99
+ recipient_id?: string;
100
+ }
101
+ namespace Data {
102
+ /**
103
+ * Payload returned by GET /email_events. Every row includes id, status, and
104
+ * occurred_at. Recipient-scoped rows also include recipient_id, from, subject, and
105
+ * exactly one object-valued to, cc, or bcc field. Legacy or message-scoped rows
106
+ * can omit recipient_id and use object-valued or string-valued to/cc fields,
107
+ * including an empty string when no address exists; bcc is redacted. If the
108
+ * related message or recipient cannot be loaded, the minimal fallback can omit
109
+ * from, subject, and recipient fields. Additional persisted public evidence can be
110
+ * present.
111
+ */
112
+ interface Payload {
113
+ /**
114
+ * Email message UUID.
115
+ */
116
+ id: string;
117
+ occurred_at: string;
118
+ /**
119
+ * Stored event outcome slug, not the authoritative recipient status. Account
120
+ * polling returns the stored name, including suppression, scan, and quarantine
121
+ * lifecycle names. Webhooks retain legacy payload names: gateway rejections use
122
+ * failed and MTA expirations use bounced. New sharp stored rows can expose
123
+ * gw_reject, injection_timeout, or expired. Use the envelope canonical_event_type
124
+ * to identify the outcome across surfaces.
125
+ */
126
+ status: 'queued' | 'deferred' | 'scheduled' | 'cancelled' | 'sandbox' | 'sending' | 'sent' | 'failed' | 'delivered' | 'bounced' | 'complained' | 'suppressed' | 'rejected' | 'opened' | 'clicked' | 'unsubscribed' | 'daily_limit_exceeded' | 'scan_deferred' | 'quarantined' | 'quarantine_released' | 'quarantine_release_dispatched' | 'quarantine_rejected' | 'quarantine_expired' | 'gw_reject' | 'injection_timeout' | 'expired';
127
+ bcc?: EmailEventsAPI.EmailWebhookRecipient | 'redacted';
128
+ /**
129
+ * Legacy message-scoped address, or an empty string when absent.
130
+ */
131
+ cc?: EmailEventsAPI.EmailWebhookRecipient | string;
132
+ /**
133
+ * Sender projection in account event polling. The display name is explicitly null
134
+ * when the message has no sender name.
135
+ */
136
+ from?: Payload.From;
137
+ /**
138
+ * Durable email recipient UUID. Present for recipient-scoped events.
139
+ */
140
+ recipient_id?: string;
141
+ subject?: string;
142
+ /**
143
+ * Legacy message-scoped address, or an empty string when absent.
144
+ */
145
+ to?: EmailEventsAPI.EmailWebhookRecipient | string;
146
+ [k: string]: unknown;
147
+ }
148
+ namespace Payload {
149
+ /**
150
+ * Sender projection in account event polling. The display name is explicitly null
151
+ * when the message has no sender name.
152
+ */
153
+ interface From {
154
+ email: string;
155
+ name: string | null;
156
+ }
157
+ }
158
+ }
159
+ interface Meta {
160
+ page_size: number;
161
+ time_range: EmailEventsAPI.TimeRange;
162
+ /**
163
+ * Cursor for the next page, when more results are available.
164
+ */
165
+ page_cursor?: string;
53
166
  }
54
167
  }
55
168
  export interface EmailEventRetrieveStatsResponse {
@@ -126,7 +239,7 @@ export declare namespace EmailEventRetrieveStatsResponse {
126
239
  }
127
240
  }
128
241
  }
129
- export interface EmailEventListParams extends EmailCursorPaginationParams {
242
+ export interface EmailEventListParams {
130
243
  /**
131
244
  * Filter events for a specific email message UUID. Invalid UUID values are
132
245
  * silently ignored (no filter applied).
@@ -136,12 +249,33 @@ export interface EmailEventListParams extends EmailCursorPaginationParams {
136
249
  * Comma-separated list of event types to include. Also accepts repeated query
137
250
  * parameters (e.g. event_type=delivered&event_type=bounced). Unknown values return
138
251
  * no matches.
252
+ *
253
+ * Dual-name compatibility: values are accepted bare or `email.`-prefixed. A legacy
254
+ * value keeps matching the rows it matched pre-rename — no widening: `failed` also
255
+ * matches the rows that now store the canonical names of the outcomes it covered
256
+ * (`gw_reject`, `injection_timeout`, `expired`); `bounced` matches stored
257
+ * `bounced` rows only (recipient-scoped Expirations stored `failed` pre-rename and
258
+ * never matched `bounced`, so `expired` is deliberately not a `bounced`
259
+ * expansion). A canonical value matches its own rows plus legacy rows whose
260
+ * recorded payload evidence proves that outcome (`expired` also surfaces legacy
261
+ * `bounced` rows with `bounce_category: transient`). The additive
262
+ * `canonical_event_type` field in each response row names the canonical outcome.
139
263
  */
140
264
  event_type?: string | Array<string>;
141
265
  /**
142
266
  * Inclusive ISO 8601 start timestamp. Defaults to 30 days ago when omitted.
143
267
  */
144
268
  from?: string;
269
+ /**
270
+ * Number of results to return. Defaults to 25; maximum is 100. Invalid values are
271
+ * clamped to the valid range.
272
+ */
273
+ page_size?: number;
274
+ /**
275
+ * Opaque URL-safe Base64 cursor returned by a previous event list response. The
276
+ * legacy `page[after]` and flat `page_cursor` forms are also accepted.
277
+ */
278
+ 'page[cursor]'?: string;
145
279
  /**
146
280
  * Inclusive ISO 8601 end timestamp. When `from` is provided without `to`, defaults
147
281
  * to `from + 30 days`.
@@ -160,6 +294,6 @@ export interface EmailEventRetrieveStatsParams {
160
294
  to?: string;
161
295
  }
162
296
  export declare namespace EmailEvents {
163
- export { type EmailEventType as EmailEventType, type TimeRange as TimeRange, type EmailEventListResponse as EmailEventListResponse, type EmailEventRetrieveStatsResponse as EmailEventRetrieveStatsResponse, type EmailEventListResponsesEmailCursorPagination as EmailEventListResponsesEmailCursorPagination, type EmailEventListParams as EmailEventListParams, type EmailEventRetrieveStatsParams as EmailEventRetrieveStatsParams, };
297
+ export { type EmailEventType as EmailEventType, type EmailWebhookRecipient as EmailWebhookRecipient, type TimeRange as TimeRange, type EmailEventListResponse as EmailEventListResponse, type EmailEventRetrieveStatsResponse as EmailEventRetrieveStatsResponse, type EmailEventListParams as EmailEventListParams, type EmailEventRetrieveStatsParams as EmailEventRetrieveStatsParams, };
164
298
  }
165
299
  //# sourceMappingURL=email-events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-events.d.ts","sourceRoot":"","sources":["../src/resources/email-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,cAAc,0BAAuB;AACjD,OAAO,KAAK,SAAS,kCAA+B;AACpD,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,WAAW,EAAE,8BAA2B;AAC1G,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,4CAA4C,EAAE,sBAAsB,CAAC;IAOpF;;;OAGG;IACH,aAAa,CACX,KAAK,GAAE,6BAA6B,GAAG,IAAI,GAAG,SAAc,EAC5D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;CAG/C;AAED,MAAM,MAAM,4CAA4C,GAAG,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;AAEzG,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,WAAW,GACX,SAAS,GACT,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,cAAc,GACd,sBAAsB,CAAC;AAE3B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAE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AAC;YAEtB;;eAEG;YACH,aAAa,EAAE,MAAM,CAAC;YAEtB;;eAEG;YACH,SAAS,EAAE,MAAM,CAAC;SACnB;KACF;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -3,20 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.EmailEvents = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
- const pagination_1 = require("../core/pagination.js");
7
6
  /**
8
7
  * Retrieve account-level email events and event statistics.
9
8
  */
10
9
  class EmailEvents extends resource_1.APIResource {
11
10
  /**
12
11
  * Lists account-level email events sorted oldest first by
13
- * `occurred_at asc, id asc`.
12
+ * `occurred_at asc, id asc`. Each row contains a legacy email.-prefixed event_type
13
+ * and an additive canonical_event_type. Gateway rejection renders email.failed
14
+ * with canonical email.gw_reject; ambiguous injection timeout renders
15
+ * email.injection_timeout in both; MTA expiration renders email.bounced with
16
+ * canonical email.expired. Message-scoped queued, sending, sandbox, cancelled, and
17
+ * daily_limit_exceeded rows fan out per durable recipient with stable derived IDs
18
+ * matching webhook delivery. Scheduled is the cardinality exception: account
19
+ * polling retains one message-scoped scheduled row with its stored event ID, while
20
+ * scheduled webhook publication fans out per recipient with derived IDs; reconcile
21
+ * scheduled events by message ID, event type, and occurrence time rather than
22
+ * event UUID. Recipient-scoped stored rows retain their stored UUIDs across
23
+ * polling and webhook delivery. Legacy names are derived from stored rows; an
24
+ * AdminBounce row stored as failed renders email.failed in polling while its
25
+ * webhook retains email.bounced, both with canonical email.failed.
14
26
  */
15
27
  list(query = {}, options) {
16
- return this._client.getAPIList('/email_events', (pagination_1.EmailCursorPagination), {
17
- query,
18
- ...options,
19
- });
28
+ return this._client.get('/email_events', { query, ...options });
20
29
  }
21
30
  /**
22
31
  * Returns counts and rates for email events over a time range. The default start
@@ -1 +1 @@
1
- {"version":3,"file":"email-events.js","sourceRoot":"","sources":["../src/resources/email-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,sDAA0G;AAG1G;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;OAGG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,kCAA6C,CAAA,EAAE;YAC7F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AAzBD,kCAyBC"}
1
+ {"version":3,"file":"email-events.js","sourceRoot":"","sources":["../src/resources/email-events.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF;AAnCD,kCAmCC"}
@@ -1,19 +1,28 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
- import { EmailCursorPagination } from "../core/pagination.mjs";
4
3
  /**
5
4
  * Retrieve account-level email events and event statistics.
6
5
  */
7
6
  export class EmailEvents extends APIResource {
8
7
  /**
9
8
  * Lists account-level email events sorted oldest first by
10
- * `occurred_at asc, id asc`.
9
+ * `occurred_at asc, id asc`. Each row contains a legacy email.-prefixed event_type
10
+ * and an additive canonical_event_type. Gateway rejection renders email.failed
11
+ * with canonical email.gw_reject; ambiguous injection timeout renders
12
+ * email.injection_timeout in both; MTA expiration renders email.bounced with
13
+ * canonical email.expired. Message-scoped queued, sending, sandbox, cancelled, and
14
+ * daily_limit_exceeded rows fan out per durable recipient with stable derived IDs
15
+ * matching webhook delivery. Scheduled is the cardinality exception: account
16
+ * polling retains one message-scoped scheduled row with its stored event ID, while
17
+ * scheduled webhook publication fans out per recipient with derived IDs; reconcile
18
+ * scheduled events by message ID, event type, and occurrence time rather than
19
+ * event UUID. Recipient-scoped stored rows retain their stored UUIDs across
20
+ * polling and webhook delivery. Legacy names are derived from stored rows; an
21
+ * AdminBounce row stored as failed renders email.failed in polling while its
22
+ * webhook retains email.bounced, both with canonical email.failed.
11
23
  */
12
24
  list(query = {}, options) {
13
- return this._client.getAPIList('/email_events', (EmailCursorPagination), {
14
- query,
15
- ...options,
16
- });
25
+ return this._client.get('/email_events', { query, ...options });
17
26
  }
18
27
  /**
19
28
  * Returns counts and rates for email events over a time range. The default start
@@ -1 +1 @@
1
- {"version":3,"file":"email-events.mjs","sourceRoot":"","sources":["../src/resources/email-events.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,qBAAqB,EAAiD,+BAA2B;AAG1G;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;OAGG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE,CAAA,qBAA6C,CAAA,EAAE;YAC7F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}
1
+ {"version":3,"file":"email-events.mjs","sourceRoot":"","sources":["../src/resources/email-events.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAK/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAED;;;OAGG;IACH,aAAa,CACX,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CACF"}