telnyx 7.11.0 → 7.13.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 (502) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +56 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +56 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +54 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +54 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/ai/ai.d.mts +6 -0
  12. package/resources/ai/ai.d.mts.map +1 -1
  13. package/resources/ai/ai.d.ts +6 -0
  14. package/resources/ai/ai.d.ts.map +1 -1
  15. package/resources/ai/ai.js.map +1 -1
  16. package/resources/ai/ai.mjs.map +1 -1
  17. package/resources/ai/anthropic/v1.d.mts +3 -1
  18. package/resources/ai/anthropic/v1.d.mts.map +1 -1
  19. package/resources/ai/anthropic/v1.d.ts +3 -1
  20. package/resources/ai/anthropic/v1.d.ts.map +1 -1
  21. package/resources/ai/assistants/assistants.d.mts +6 -2
  22. package/resources/ai/assistants/assistants.d.mts.map +1 -1
  23. package/resources/ai/assistants/assistants.d.ts +6 -2
  24. package/resources/ai/assistants/assistants.d.ts.map +1 -1
  25. package/resources/ai/assistants/assistants.js.map +1 -1
  26. package/resources/ai/assistants/assistants.mjs.map +1 -1
  27. package/resources/ai/chat.d.mts +6 -0
  28. package/resources/ai/chat.d.mts.map +1 -1
  29. package/resources/ai/chat.d.ts +6 -0
  30. package/resources/ai/chat.d.ts.map +1 -1
  31. package/resources/ai/openai/chat.d.mts +6 -0
  32. package/resources/ai/openai/chat.d.mts.map +1 -1
  33. package/resources/ai/openai/chat.d.ts +6 -0
  34. package/resources/ai/openai/chat.d.ts.map +1 -1
  35. package/resources/ai/openai/openai.d.mts +6 -0
  36. package/resources/ai/openai/openai.d.mts.map +1 -1
  37. package/resources/ai/openai/openai.d.ts +6 -0
  38. package/resources/ai/openai/openai.d.ts.map +1 -1
  39. package/resources/ai/openai/openai.js.map +1 -1
  40. package/resources/ai/openai/openai.mjs.map +1 -1
  41. package/resources/calls/actions.d.mts +223 -48
  42. package/resources/calls/actions.d.mts.map +1 -1
  43. package/resources/calls/actions.d.ts +223 -48
  44. package/resources/calls/actions.d.ts.map +1 -1
  45. package/resources/calls/actions.js +31 -0
  46. package/resources/calls/actions.js.map +1 -1
  47. package/resources/calls/actions.mjs +31 -0
  48. package/resources/calls/actions.mjs.map +1 -1
  49. package/resources/calls/calls.d.mts +3 -2
  50. package/resources/calls/calls.d.mts.map +1 -1
  51. package/resources/calls/calls.d.ts +3 -2
  52. package/resources/calls/calls.d.ts.map +1 -1
  53. package/resources/calls/calls.js.map +1 -1
  54. package/resources/calls/calls.mjs.map +1 -1
  55. package/resources/calls/index.d.mts +1 -1
  56. package/resources/calls/index.d.mts.map +1 -1
  57. package/resources/calls/index.d.ts +1 -1
  58. package/resources/calls/index.d.ts.map +1 -1
  59. package/resources/calls/index.js.map +1 -1
  60. package/resources/calls/index.mjs.map +1 -1
  61. package/resources/custom-storage-credentials.d.mts +110 -14
  62. package/resources/custom-storage-credentials.d.mts.map +1 -1
  63. package/resources/custom-storage-credentials.d.ts +110 -14
  64. package/resources/custom-storage-credentials.d.ts.map +1 -1
  65. package/resources/dir/dir.d.mts +3 -2
  66. package/resources/dir/dir.d.mts.map +1 -1
  67. package/resources/dir/dir.d.ts +3 -2
  68. package/resources/dir/dir.d.ts.map +1 -1
  69. package/resources/dir/dir.js +3 -2
  70. package/resources/dir/dir.js.map +1 -1
  71. package/resources/dir/dir.mjs +3 -2
  72. package/resources/dir/dir.mjs.map +1 -1
  73. package/resources/dir/references.d.mts +41 -11
  74. package/resources/dir/references.d.mts.map +1 -1
  75. package/resources/dir/references.d.ts +41 -11
  76. package/resources/dir/references.d.ts.map +1 -1
  77. package/resources/dir/references.js +30 -8
  78. package/resources/dir/references.js.map +1 -1
  79. package/resources/dir/references.mjs +30 -8
  80. package/resources/dir/references.mjs.map +1 -1
  81. package/resources/dir/verify-email.d.mts +10 -0
  82. package/resources/dir/verify-email.d.mts.map +1 -1
  83. package/resources/dir/verify-email.d.ts +10 -0
  84. package/resources/dir/verify-email.d.ts.map +1 -1
  85. package/resources/email-blocks/email-blocks.d.mts +255 -0
  86. package/resources/email-blocks/email-blocks.d.mts.map +1 -0
  87. package/resources/email-blocks/email-blocks.d.ts +255 -0
  88. package/resources/email-blocks/email-blocks.d.ts.map +1 -0
  89. package/resources/email-blocks/email-blocks.js +99 -0
  90. package/resources/email-blocks/email-blocks.js.map +1 -0
  91. package/resources/email-blocks/email-blocks.mjs +94 -0
  92. package/resources/email-blocks/email-blocks.mjs.map +1 -0
  93. package/resources/email-blocks/import.d.mts +111 -0
  94. package/resources/email-blocks/import.d.mts.map +1 -0
  95. package/resources/email-blocks/import.d.ts +111 -0
  96. package/resources/email-blocks/import.d.ts.map +1 -0
  97. package/resources/email-blocks/import.js +40 -0
  98. package/resources/email-blocks/import.js.map +1 -0
  99. package/resources/email-blocks/import.mjs +36 -0
  100. package/resources/email-blocks/import.mjs.map +1 -0
  101. package/resources/email-blocks/index.d.mts +3 -0
  102. package/resources/email-blocks/index.d.mts.map +1 -0
  103. package/resources/email-blocks/index.d.ts +3 -0
  104. package/resources/email-blocks/index.d.ts.map +1 -0
  105. package/resources/email-blocks/index.js +9 -0
  106. package/resources/email-blocks/index.js.map +1 -0
  107. package/resources/email-blocks/index.mjs +4 -0
  108. package/resources/email-blocks/index.mjs.map +1 -0
  109. package/resources/email-blocks.d.mts +2 -0
  110. package/resources/email-blocks.d.mts.map +1 -0
  111. package/resources/email-blocks.d.ts +2 -0
  112. package/resources/email-blocks.d.ts.map +1 -0
  113. package/resources/email-blocks.js +6 -0
  114. package/resources/email-blocks.js.map +1 -0
  115. package/resources/email-blocks.mjs +3 -0
  116. package/resources/email-blocks.mjs.map +1 -0
  117. package/resources/email-domains/email-domains.d.mts +344 -0
  118. package/resources/email-domains/email-domains.d.mts.map +1 -0
  119. package/resources/email-domains/email-domains.d.ts +344 -0
  120. package/resources/email-domains/email-domains.d.ts.map +1 -0
  121. package/resources/email-domains/email-domains.js +146 -0
  122. package/resources/email-domains/email-domains.js.map +1 -0
  123. package/resources/email-domains/email-domains.mjs +141 -0
  124. package/resources/email-domains/email-domains.mjs.map +1 -0
  125. package/resources/email-domains/index.d.mts +3 -0
  126. package/resources/email-domains/index.d.mts.map +1 -0
  127. package/resources/email-domains/index.d.ts +3 -0
  128. package/resources/email-domains/index.d.ts.map +1 -0
  129. package/resources/email-domains/index.js +9 -0
  130. package/resources/email-domains/index.js.map +1 -0
  131. package/resources/email-domains/index.mjs +4 -0
  132. package/resources/email-domains/index.mjs.map +1 -0
  133. package/resources/email-domains/webhooks.d.mts +170 -0
  134. package/resources/email-domains/webhooks.d.mts.map +1 -0
  135. package/resources/email-domains/webhooks.d.ts +170 -0
  136. package/resources/email-domains/webhooks.d.ts.map +1 -0
  137. package/resources/email-domains/webhooks.js +110 -0
  138. package/resources/email-domains/webhooks.js.map +1 -0
  139. package/resources/email-domains/webhooks.mjs +106 -0
  140. package/resources/email-domains/webhooks.mjs.map +1 -0
  141. package/resources/email-domains.d.mts +2 -0
  142. package/resources/email-domains.d.mts.map +1 -0
  143. package/resources/email-domains.d.ts +2 -0
  144. package/resources/email-domains.d.ts.map +1 -0
  145. package/resources/email-domains.js +6 -0
  146. package/resources/email-domains.js.map +1 -0
  147. package/resources/email-domains.mjs +3 -0
  148. package/resources/email-domains.mjs.map +1 -0
  149. package/resources/email-events.d.mts +186 -0
  150. package/resources/email-events.d.mts.map +1 -0
  151. package/resources/email-events.d.ts +186 -0
  152. package/resources/email-events.d.ts.map +1 -0
  153. package/resources/email-events.js +26 -0
  154. package/resources/email-events.js.map +1 -0
  155. package/resources/email-events.mjs +22 -0
  156. package/resources/email-events.mjs.map +1 -0
  157. package/resources/email-inboxes/drafts.d.mts +549 -0
  158. package/resources/email-inboxes/drafts.d.mts.map +1 -0
  159. package/resources/email-inboxes/drafts.d.ts +549 -0
  160. package/resources/email-inboxes/drafts.d.ts.map +1 -0
  161. package/resources/email-inboxes/drafts.js +161 -0
  162. package/resources/email-inboxes/drafts.js.map +1 -0
  163. package/resources/email-inboxes/drafts.mjs +157 -0
  164. package/resources/email-inboxes/drafts.mjs.map +1 -0
  165. package/resources/email-inboxes/email-inboxes.d.mts +131 -0
  166. package/resources/email-inboxes/email-inboxes.d.mts.map +1 -0
  167. package/resources/email-inboxes/email-inboxes.d.ts +131 -0
  168. package/resources/email-inboxes/email-inboxes.d.ts.map +1 -0
  169. package/resources/email-inboxes/email-inboxes.js +93 -0
  170. package/resources/email-inboxes/email-inboxes.js.map +1 -0
  171. package/resources/email-inboxes/email-inboxes.mjs +88 -0
  172. package/resources/email-inboxes/email-inboxes.mjs.map +1 -0
  173. package/resources/email-inboxes/filters.d.mts +137 -0
  174. package/resources/email-inboxes/filters.d.mts.map +1 -0
  175. package/resources/email-inboxes/filters.d.ts +137 -0
  176. package/resources/email-inboxes/filters.d.ts.map +1 -0
  177. package/resources/email-inboxes/filters.js +81 -0
  178. package/resources/email-inboxes/filters.js.map +1 -0
  179. package/resources/email-inboxes/filters.mjs +77 -0
  180. package/resources/email-inboxes/filters.mjs.map +1 -0
  181. package/resources/email-inboxes/index.d.mts +6 -0
  182. package/resources/email-inboxes/index.d.mts.map +1 -0
  183. package/resources/email-inboxes/index.d.ts +6 -0
  184. package/resources/email-inboxes/index.d.ts.map +1 -0
  185. package/resources/email-inboxes/index.js +15 -0
  186. package/resources/email-inboxes/index.js.map +1 -0
  187. package/resources/email-inboxes/index.mjs +7 -0
  188. package/resources/email-inboxes/index.mjs.map +1 -0
  189. package/resources/email-inboxes/messages/actions.d.mts +190 -0
  190. package/resources/email-inboxes/messages/actions.d.mts.map +1 -0
  191. package/resources/email-inboxes/messages/actions.d.ts +190 -0
  192. package/resources/email-inboxes/messages/actions.d.ts.map +1 -0
  193. package/resources/email-inboxes/messages/actions.js +106 -0
  194. package/resources/email-inboxes/messages/actions.js.map +1 -0
  195. package/resources/email-inboxes/messages/actions.mjs +102 -0
  196. package/resources/email-inboxes/messages/actions.mjs.map +1 -0
  197. package/resources/email-inboxes/messages/index.d.mts +4 -0
  198. package/resources/email-inboxes/messages/index.d.mts.map +1 -0
  199. package/resources/email-inboxes/messages/index.d.ts +4 -0
  200. package/resources/email-inboxes/messages/index.d.ts.map +1 -0
  201. package/resources/email-inboxes/messages/index.js +11 -0
  202. package/resources/email-inboxes/messages/index.js.map +1 -0
  203. package/resources/email-inboxes/messages/index.mjs +5 -0
  204. package/resources/email-inboxes/messages/index.mjs.map +1 -0
  205. package/resources/email-inboxes/messages/labels.d.mts +101 -0
  206. package/resources/email-inboxes/messages/labels.d.mts.map +1 -0
  207. package/resources/email-inboxes/messages/labels.d.ts +101 -0
  208. package/resources/email-inboxes/messages/labels.d.ts.map +1 -0
  209. package/resources/email-inboxes/messages/labels.js +69 -0
  210. package/resources/email-inboxes/messages/labels.js.map +1 -0
  211. package/resources/email-inboxes/messages/labels.mjs +65 -0
  212. package/resources/email-inboxes/messages/labels.mjs.map +1 -0
  213. package/resources/email-inboxes/messages/messages.d.mts +212 -0
  214. package/resources/email-inboxes/messages/messages.d.mts.map +1 -0
  215. package/resources/email-inboxes/messages/messages.d.ts +212 -0
  216. package/resources/email-inboxes/messages/messages.d.ts.map +1 -0
  217. package/resources/email-inboxes/messages/messages.js +89 -0
  218. package/resources/email-inboxes/messages/messages.js.map +1 -0
  219. package/resources/email-inboxes/messages/messages.mjs +84 -0
  220. package/resources/email-inboxes/messages/messages.mjs.map +1 -0
  221. package/resources/email-inboxes/messages.d.mts +2 -0
  222. package/resources/email-inboxes/messages.d.mts.map +1 -0
  223. package/resources/email-inboxes/messages.d.ts +2 -0
  224. package/resources/email-inboxes/messages.d.ts.map +1 -0
  225. package/resources/email-inboxes/messages.js +6 -0
  226. package/resources/email-inboxes/messages.js.map +1 -0
  227. package/resources/email-inboxes/messages.mjs +3 -0
  228. package/resources/email-inboxes/messages.mjs.map +1 -0
  229. package/resources/email-inboxes/threads/index.d.mts +3 -0
  230. package/resources/email-inboxes/threads/index.d.mts.map +1 -0
  231. package/resources/email-inboxes/threads/index.d.ts +3 -0
  232. package/resources/email-inboxes/threads/index.d.ts.map +1 -0
  233. package/resources/email-inboxes/threads/index.js +9 -0
  234. package/resources/email-inboxes/threads/index.js.map +1 -0
  235. package/resources/email-inboxes/threads/index.mjs +4 -0
  236. package/resources/email-inboxes/threads/index.mjs.map +1 -0
  237. package/resources/email-inboxes/threads/labels.d.mts +99 -0
  238. package/resources/email-inboxes/threads/labels.d.mts.map +1 -0
  239. package/resources/email-inboxes/threads/labels.d.ts +99 -0
  240. package/resources/email-inboxes/threads/labels.d.ts.map +1 -0
  241. package/resources/email-inboxes/threads/labels.js +64 -0
  242. package/resources/email-inboxes/threads/labels.js.map +1 -0
  243. package/resources/email-inboxes/threads/labels.mjs +60 -0
  244. package/resources/email-inboxes/threads/labels.mjs.map +1 -0
  245. package/resources/email-inboxes/threads/threads.d.mts +199 -0
  246. package/resources/email-inboxes/threads/threads.d.mts.map +1 -0
  247. package/resources/email-inboxes/threads/threads.d.ts +199 -0
  248. package/resources/email-inboxes/threads/threads.d.ts.map +1 -0
  249. package/resources/email-inboxes/threads/threads.js +51 -0
  250. package/resources/email-inboxes/threads/threads.js.map +1 -0
  251. package/resources/email-inboxes/threads/threads.mjs +46 -0
  252. package/resources/email-inboxes/threads/threads.mjs.map +1 -0
  253. package/resources/email-inboxes/threads.d.mts +2 -0
  254. package/resources/email-inboxes/threads.d.mts.map +1 -0
  255. package/resources/email-inboxes/threads.d.ts +2 -0
  256. package/resources/email-inboxes/threads.d.ts.map +1 -0
  257. package/resources/email-inboxes/threads.js +6 -0
  258. package/resources/email-inboxes/threads.js.map +1 -0
  259. package/resources/email-inboxes/threads.mjs +3 -0
  260. package/resources/email-inboxes/threads.mjs.map +1 -0
  261. package/resources/email-inboxes.d.mts +2 -0
  262. package/resources/email-inboxes.d.mts.map +1 -0
  263. package/resources/email-inboxes.d.ts +2 -0
  264. package/resources/email-inboxes.d.ts.map +1 -0
  265. package/resources/email-inboxes.js +6 -0
  266. package/resources/email-inboxes.js.map +1 -0
  267. package/resources/email-inboxes.mjs +3 -0
  268. package/resources/email-inboxes.mjs.map +1 -0
  269. package/resources/email-messages/email-messages.d.mts +543 -0
  270. package/resources/email-messages/email-messages.d.mts.map +1 -0
  271. package/resources/email-messages/email-messages.d.ts +543 -0
  272. package/resources/email-messages/email-messages.d.ts.map +1 -0
  273. package/resources/email-messages/email-messages.js +186 -0
  274. package/resources/email-messages/email-messages.js.map +1 -0
  275. package/resources/email-messages/email-messages.mjs +181 -0
  276. package/resources/email-messages/email-messages.mjs.map +1 -0
  277. package/resources/email-messages/index.d.mts +3 -0
  278. package/resources/email-messages/index.d.mts.map +1 -0
  279. package/resources/email-messages/index.d.ts +3 -0
  280. package/resources/email-messages/index.d.ts.map +1 -0
  281. package/resources/email-messages/index.js +9 -0
  282. package/resources/email-messages/index.js.map +1 -0
  283. package/resources/email-messages/index.mjs +4 -0
  284. package/resources/email-messages/index.mjs.map +1 -0
  285. package/resources/email-messages/recipients.d.mts +118 -0
  286. package/resources/email-messages/recipients.d.mts.map +1 -0
  287. package/resources/email-messages/recipients.d.ts +118 -0
  288. package/resources/email-messages/recipients.d.ts.map +1 -0
  289. package/resources/email-messages/recipients.js +48 -0
  290. package/resources/email-messages/recipients.js.map +1 -0
  291. package/resources/email-messages/recipients.mjs +44 -0
  292. package/resources/email-messages/recipients.mjs.map +1 -0
  293. package/resources/email-messages.d.mts +2 -0
  294. package/resources/email-messages.d.mts.map +1 -0
  295. package/resources/email-messages.d.ts +2 -0
  296. package/resources/email-messages.d.ts.map +1 -0
  297. package/resources/email-messages.js +6 -0
  298. package/resources/email-messages.js.map +1 -0
  299. package/resources/email-messages.mjs +3 -0
  300. package/resources/email-messages.mjs.map +1 -0
  301. package/resources/email-templates.d.mts +236 -0
  302. package/resources/email-templates.d.mts.map +1 -0
  303. package/resources/email-templates.d.ts +236 -0
  304. package/resources/email-templates.d.ts.map +1 -0
  305. package/resources/email-templates.js +124 -0
  306. package/resources/email-templates.js.map +1 -0
  307. package/resources/email-templates.mjs +120 -0
  308. package/resources/email-templates.mjs.map +1 -0
  309. package/resources/email-threads.d.mts +71 -0
  310. package/resources/email-threads.d.mts.map +1 -0
  311. package/resources/email-threads.d.ts +71 -0
  312. package/resources/email-threads.d.ts.map +1 -0
  313. package/resources/email-threads.js +34 -0
  314. package/resources/email-threads.js.map +1 -0
  315. package/resources/email-threads.mjs +30 -0
  316. package/resources/email-threads.mjs.map +1 -0
  317. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.mts +90 -0
  318. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.mts.map +1 -0
  319. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.ts +90 -0
  320. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.d.ts.map +1 -0
  321. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.js +70 -0
  322. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.js.map +1 -0
  323. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.mjs +65 -0
  324. package/resources/email-unsubscribe-groups/email-unsubscribe-groups.mjs.map +1 -0
  325. package/resources/email-unsubscribe-groups/index.d.mts +3 -0
  326. package/resources/email-unsubscribe-groups/index.d.mts.map +1 -0
  327. package/resources/email-unsubscribe-groups/index.d.ts +3 -0
  328. package/resources/email-unsubscribe-groups/index.d.ts.map +1 -0
  329. package/resources/email-unsubscribe-groups/index.js +9 -0
  330. package/resources/email-unsubscribe-groups/index.js.map +1 -0
  331. package/resources/email-unsubscribe-groups/index.mjs +4 -0
  332. package/resources/email-unsubscribe-groups/index.mjs.map +1 -0
  333. package/resources/email-unsubscribe-groups/suppressions.d.mts +54 -0
  334. package/resources/email-unsubscribe-groups/suppressions.d.mts.map +1 -0
  335. package/resources/email-unsubscribe-groups/suppressions.d.ts +54 -0
  336. package/resources/email-unsubscribe-groups/suppressions.d.ts.map +1 -0
  337. package/resources/email-unsubscribe-groups/suppressions.js +52 -0
  338. package/resources/email-unsubscribe-groups/suppressions.js.map +1 -0
  339. package/resources/email-unsubscribe-groups/suppressions.mjs +48 -0
  340. package/resources/email-unsubscribe-groups/suppressions.mjs.map +1 -0
  341. package/resources/email-unsubscribe-groups.d.mts +2 -0
  342. package/resources/email-unsubscribe-groups.d.mts.map +1 -0
  343. package/resources/email-unsubscribe-groups.d.ts +2 -0
  344. package/resources/email-unsubscribe-groups.d.ts.map +1 -0
  345. package/resources/email-unsubscribe-groups.js +6 -0
  346. package/resources/email-unsubscribe-groups.js.map +1 -0
  347. package/resources/email-unsubscribe-groups.mjs +3 -0
  348. package/resources/email-unsubscribe-groups.mjs.map +1 -0
  349. package/resources/email-validations/batch.d.mts +136 -0
  350. package/resources/email-validations/batch.d.mts.map +1 -0
  351. package/resources/email-validations/batch.d.ts +136 -0
  352. package/resources/email-validations/batch.d.ts.map +1 -0
  353. package/resources/email-validations/batch.js +51 -0
  354. package/resources/email-validations/batch.js.map +1 -0
  355. package/resources/email-validations/batch.mjs +47 -0
  356. package/resources/email-validations/batch.mjs.map +1 -0
  357. package/resources/email-validations/email-validations.d.mts +87 -0
  358. package/resources/email-validations/email-validations.d.mts.map +1 -0
  359. package/resources/email-validations/email-validations.d.ts +87 -0
  360. package/resources/email-validations/email-validations.d.ts.map +1 -0
  361. package/resources/email-validations/email-validations.js +43 -0
  362. package/resources/email-validations/email-validations.js.map +1 -0
  363. package/resources/email-validations/email-validations.mjs +38 -0
  364. package/resources/email-validations/email-validations.mjs.map +1 -0
  365. package/resources/email-validations/index.d.mts +3 -0
  366. package/resources/email-validations/index.d.mts.map +1 -0
  367. package/resources/email-validations/index.d.ts +3 -0
  368. package/resources/email-validations/index.d.ts.map +1 -0
  369. package/resources/email-validations/index.js +9 -0
  370. package/resources/email-validations/index.js.map +1 -0
  371. package/resources/email-validations/index.mjs +4 -0
  372. package/resources/email-validations/index.mjs.map +1 -0
  373. package/resources/email-validations.d.mts +2 -0
  374. package/resources/email-validations.d.mts.map +1 -0
  375. package/resources/email-validations.d.ts +2 -0
  376. package/resources/email-validations.d.ts.map +1 -0
  377. package/resources/email-validations.js +6 -0
  378. package/resources/email-validations.js.map +1 -0
  379. package/resources/email-validations.mjs +3 -0
  380. package/resources/email-validations.mjs.map +1 -0
  381. package/resources/index.d.mts +11 -1
  382. package/resources/index.d.mts.map +1 -1
  383. package/resources/index.d.ts +11 -1
  384. package/resources/index.d.ts.map +1 -1
  385. package/resources/index.js +24 -4
  386. package/resources/index.js.map +1 -1
  387. package/resources/index.mjs +10 -0
  388. package/resources/index.mjs.map +1 -1
  389. package/resources/pricing/index.d.mts +3 -0
  390. package/resources/pricing/index.d.mts.map +1 -0
  391. package/resources/pricing/index.d.ts +3 -0
  392. package/resources/pricing/index.d.ts.map +1 -0
  393. package/resources/pricing/index.js +9 -0
  394. package/resources/pricing/index.js.map +1 -0
  395. package/resources/pricing/index.mjs +4 -0
  396. package/resources/pricing/index.mjs.map +1 -0
  397. package/resources/pricing/pricing.d.mts +10 -0
  398. package/resources/pricing/pricing.d.mts.map +1 -0
  399. package/resources/pricing/pricing.d.ts +10 -0
  400. package/resources/pricing/pricing.d.ts.map +1 -0
  401. package/resources/pricing/pricing.js +17 -0
  402. package/resources/pricing/pricing.js.map +1 -0
  403. package/resources/pricing/pricing.mjs +12 -0
  404. package/resources/pricing/pricing.mjs.map +1 -0
  405. package/resources/pricing/products.d.mts +161 -0
  406. package/resources/pricing/products.d.mts.map +1 -0
  407. package/resources/pricing/products.d.ts +161 -0
  408. package/resources/pricing/products.d.ts.map +1 -0
  409. package/resources/pricing/products.js +32 -0
  410. package/resources/pricing/products.js.map +1 -0
  411. package/resources/pricing/products.mjs +28 -0
  412. package/resources/pricing/products.mjs.map +1 -0
  413. package/resources/pricing.d.mts +2 -0
  414. package/resources/pricing.d.mts.map +1 -0
  415. package/resources/pricing.d.ts +2 -0
  416. package/resources/pricing.d.ts.map +1 -0
  417. package/resources/pricing.js +6 -0
  418. package/resources/pricing.js.map +1 -0
  419. package/resources/pricing.mjs +3 -0
  420. package/resources/pricing.mjs.map +1 -0
  421. package/resources/speech-to-text/speech-to-text.d.mts +4 -4
  422. package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
  423. package/resources/speech-to-text/speech-to-text.d.ts +4 -4
  424. package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
  425. package/resources/speech-to-text/speech-to-text.js +1 -1
  426. package/resources/speech-to-text/speech-to-text.mjs +1 -1
  427. package/resources/uac-connections/uac-connections.d.mts +5 -0
  428. package/resources/uac-connections/uac-connections.d.mts.map +1 -1
  429. package/resources/uac-connections/uac-connections.d.ts +5 -0
  430. package/resources/uac-connections/uac-connections.d.ts.map +1 -1
  431. package/resources/uac-connections/uac-connections.js.map +1 -1
  432. package/resources/uac-connections/uac-connections.mjs.map +1 -1
  433. package/resources/webhooks.d.mts +483 -85
  434. package/resources/webhooks.d.mts.map +1 -1
  435. package/resources/webhooks.d.ts +483 -85
  436. package/resources/webhooks.d.ts.map +1 -1
  437. package/resources/webhooks.js.map +1 -1
  438. package/resources/webhooks.mjs.map +1 -1
  439. package/src/client.ts +260 -0
  440. package/src/resources/ai/ai.ts +7 -0
  441. package/src/resources/ai/anthropic/v1.ts +3 -1
  442. package/src/resources/ai/assistants/assistants.ts +6 -1
  443. package/src/resources/ai/chat.ts +7 -0
  444. package/src/resources/ai/openai/chat.ts +7 -0
  445. package/src/resources/ai/openai/openai.ts +7 -0
  446. package/src/resources/calls/actions.ts +269 -51
  447. package/src/resources/calls/calls.ts +8 -0
  448. package/src/resources/calls/index.ts +3 -0
  449. package/src/resources/custom-storage-credentials.ts +140 -14
  450. package/src/resources/dir/dir.ts +3 -2
  451. package/src/resources/dir/references.ts +41 -11
  452. package/src/resources/dir/verify-email.ts +12 -0
  453. package/src/resources/email-blocks/email-blocks.ts +358 -0
  454. package/src/resources/email-blocks/import.ts +143 -0
  455. package/src/resources/email-blocks/index.ts +16 -0
  456. package/src/resources/email-blocks.ts +3 -0
  457. package/src/resources/email-domains/email-domains.ts +510 -0
  458. package/src/resources/email-domains/index.ts +33 -0
  459. package/src/resources/email-domains/webhooks.ts +267 -0
  460. package/src/resources/email-domains.ts +3 -0
  461. package/src/resources/email-events.ts +269 -0
  462. package/src/resources/email-inboxes/drafts.ts +746 -0
  463. package/src/resources/email-inboxes/email-inboxes.ts +276 -0
  464. package/src/resources/email-inboxes/filters.ts +193 -0
  465. package/src/resources/email-inboxes/index.ts +58 -0
  466. package/src/resources/email-inboxes/messages/actions.ts +258 -0
  467. package/src/resources/email-inboxes/messages/index.ts +27 -0
  468. package/src/resources/email-inboxes/messages/labels.ts +139 -0
  469. package/src/resources/email-inboxes/messages/messages.ts +313 -0
  470. package/src/resources/email-inboxes/messages.ts +3 -0
  471. package/src/resources/email-inboxes/threads/index.ts +21 -0
  472. package/src/resources/email-inboxes/threads/labels.ts +143 -0
  473. package/src/resources/email-inboxes/threads/threads.ts +292 -0
  474. package/src/resources/email-inboxes/threads.ts +3 -0
  475. package/src/resources/email-inboxes.ts +3 -0
  476. package/src/resources/email-messages/email-messages.ts +713 -0
  477. package/src/resources/email-messages/index.ts +26 -0
  478. package/src/resources/email-messages/recipients.ts +182 -0
  479. package/src/resources/email-messages.ts +3 -0
  480. package/src/resources/email-templates.ts +333 -0
  481. package/src/resources/email-threads.ts +100 -0
  482. package/src/resources/email-unsubscribe-groups/email-unsubscribe-groups.ts +171 -0
  483. package/src/resources/email-unsubscribe-groups/index.ts +19 -0
  484. package/src/resources/email-unsubscribe-groups/suppressions.ts +90 -0
  485. package/src/resources/email-unsubscribe-groups.ts +3 -0
  486. package/src/resources/email-validations/batch.ts +187 -0
  487. package/src/resources/email-validations/email-validations.ts +141 -0
  488. package/src/resources/email-validations/index.ts +15 -0
  489. package/src/resources/email-validations.ts +3 -0
  490. package/src/resources/index.ts +103 -0
  491. package/src/resources/pricing/index.ts +13 -0
  492. package/src/resources/pricing/pricing.ts +33 -0
  493. package/src/resources/pricing/products.ts +226 -0
  494. package/src/resources/pricing.ts +3 -0
  495. package/src/resources/speech-to-text/speech-to-text.ts +6 -3
  496. package/src/resources/uac-connections/uac-connections.ts +6 -0
  497. package/src/resources/webhooks.ts +636 -110
  498. package/src/version.ts +1 -1
  499. package/version.d.mts +1 -1
  500. package/version.d.ts +1 -1
  501. package/version.js +1 -1
  502. package/version.mjs +1 -1
@@ -0,0 +1,255 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as ImportAPI from "./import.mjs";
3
+ import { EmailBlockImportResponse, Import, ImportCreateParams } from "./import.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from "../../core/pagination.mjs";
6
+ import { RequestOptions } from "../../internal/request-options.mjs";
7
+ /**
8
+ * Recipient suppression records (`/v2/email_blocks`).
9
+ */
10
+ export declare class EmailBlocks extends APIResource {
11
+ import: ImportAPI.Import;
12
+ /**
13
+ * Account-scoped list. Two mutually exclusive pagination modes:
14
+ *
15
+ * - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
16
+ * `meta` contains `total_pages`.
17
+ * - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
18
+ * `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
19
+ * together is an error. `meta` contains `next_cursor` / `previous_cursor`
20
+ * (omitted when their flag is false).
21
+ *
22
+ * Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
23
+ * prefix is an error. `nil`/empty filter values are silently dropped.
24
+ */
25
+ list(query?: EmailBlockListParams | null | undefined, options?: RequestOptions): PagePromise<EmailBlocksDefaultFlatPagination, EmailBlock>;
26
+ /**
27
+ * Creates a suppression with `reason: manual_block` and `source: manual`.
28
+ * Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
29
+ * server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
30
+ * matching row already exists (NULL-safe dedupe key: account_id, scope, to,
31
+ * reason, domain_id, from), returns the existing record with `200` (no new audit
32
+ * event).
33
+ *
34
+ * `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
35
+ * the public surface. Use the unsubscribe-group suppression endpoint or the
36
+ * internal create surface for those.
37
+ */
38
+ create(body: EmailBlockCreateParams, options?: RequestOptions): APIPromise<EmailBlockResponse>;
39
+ /**
40
+ * Streams the account's suppressions as a chunked CSV (server-side cursor; never
41
+ * materialized). Content-type `text/csv`, header
42
+ * `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
43
+ *
44
+ * Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
45
+ * `filter[created_before]`) are the only params that affect output. `sort` and
46
+ * `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
47
+ * stream `ORDER BY created_at ASC, id ASC` with no pagination.
48
+ *
49
+ * CSV columns:
50
+ * `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
51
+ * The CSV carries the `group_id` column so group-scoped suppressions' group link
52
+ * survives the export (empty for account-scope rows).
53
+ */
54
+ retrieveExport(query?: EmailBlockRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<string>;
55
+ /**
56
+ * Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
57
+ * is appended unless the block was already `removed` (idempotent — returns the
58
+ * existing row with `200` and no new event). Mutates `updated_at`.
59
+ */
60
+ delete(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
61
+ /**
62
+ * Retrieve a suppression
63
+ */
64
+ retrieve(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
65
+ /**
66
+ * Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
67
+ * max 100). No `sort`, no `filter`, no cursor — ordering is fixed
68
+ * `desc occurred_at, desc id`. Verifies the block belongs to the account first
69
+ * (cross-account → 404).
70
+ */
71
+ retrieveEvents(id: string, query?: EmailBlockRetrieveEventsParams | null | undefined, options?: RequestOptions): APIPromise<EmailBlockRetrieveEventsResponse>;
72
+ }
73
+ export type EmailBlocksDefaultFlatPagination = DefaultFlatPagination<EmailBlock>;
74
+ /**
75
+ * Suppression record. Schema fields hidden by the view: `account_id`,
76
+ * `bounce_category`, `dsn_code`, `meta`.
77
+ */
78
+ export interface EmailBlock {
79
+ id: string;
80
+ created_at: string;
81
+ reason: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
82
+ /**
83
+ * View-only discriminator.
84
+ */
85
+ record_type: 'email_block';
86
+ /**
87
+ * Derived server-side from `domain_id`/`from`; never trusted from the caller.
88
+ */
89
+ scope: 'account' | 'domain' | 'address';
90
+ source: 'feedback' | 'manual' | 'import' | 'system';
91
+ status: 'active' | 'expired' | 'removed';
92
+ /**
93
+ * Normalized recipient. (schema: to_address)
94
+ */
95
+ to: string;
96
+ updated_at: string;
97
+ /**
98
+ * `null` ⇒ account scope. Stored on the row; exposed here.
99
+ */
100
+ domain_id?: string | null;
101
+ expires_at?: string | null;
102
+ /**
103
+ * `null` ⇒ not address-scope. (schema: from_address)
104
+ */
105
+ from?: string | null;
106
+ /**
107
+ * `null` ⇒ global; set ⇒ group-scoped opt-out.
108
+ */
109
+ group_id?: string | null;
110
+ }
111
+ export interface EmailBlockResponse {
112
+ /**
113
+ * Suppression record. Schema fields hidden by the view: `account_id`,
114
+ * `bounce_category`, `dsn_code`, `meta`.
115
+ */
116
+ data: EmailBlock;
117
+ }
118
+ export interface OffsetMeta {
119
+ page_number: number;
120
+ page_size: number;
121
+ total_pages: number;
122
+ total_results: number;
123
+ }
124
+ export interface EmailBlockRetrieveEventsResponse {
125
+ data: Array<EmailBlockRetrieveEventsResponse.Data>;
126
+ meta: OffsetMeta;
127
+ }
128
+ export declare namespace EmailBlockRetrieveEventsResponse {
129
+ interface Data {
130
+ id: string;
131
+ /**
132
+ * Free-text (`user_id`/`org_id`/`api_key`/`dev_bypass`/`system`/`manual`).
133
+ */
134
+ actor: string;
135
+ event_type: 'created' | 'removed' | 'expired' | 'override_used';
136
+ occurred_at: string;
137
+ /**
138
+ * Free-text snapshot of the block's reason at event time.
139
+ */
140
+ reason: string;
141
+ /**
142
+ * View-only.
143
+ */
144
+ record_type: 'email_block_event';
145
+ /**
146
+ * Free-text snapshot of the block's source at event time.
147
+ */
148
+ source: string;
149
+ /**
150
+ * `null` when the schema field is nil (the context usually sets it to `{}`).
151
+ */
152
+ meta?: {
153
+ [key: string]: unknown;
154
+ } | null;
155
+ }
156
+ }
157
+ /**
158
+ * CSV with header row
159
+ * `id,to,from,reason,source,scope,status,domain_id,created_at,updated_at,expires_at,group_id`.
160
+ */
161
+ export type EmailBlockRetrieveExportResponse = string;
162
+ export interface EmailBlockListParams extends DefaultFlatPaginationParams {
163
+ /**
164
+ * `created_at > value` (ISO 8601).
165
+ */
166
+ 'filter[created_after]'?: string;
167
+ /**
168
+ * `created_at < value` (ISO 8601).
169
+ */
170
+ 'filter[created_before]'?: string;
171
+ /**
172
+ * Exact-match filter on domain_id (UUID).
173
+ */
174
+ 'filter[domain_id]'?: string;
175
+ /**
176
+ * Exact-match filter on reason.
177
+ */
178
+ 'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
179
+ /**
180
+ * Opaque cursor (`Base.url_encode64` of `{"created_at","id"}`). Cursor mode;
181
+ * mutually exclusive with `page[number]` and `page[before]`.
182
+ */
183
+ 'page[after]'?: string;
184
+ /**
185
+ * Opaque cursor (see `page[after]`). Mutually exclusive with `page[after]` and
186
+ * `page[number]`.
187
+ */
188
+ 'page[before]'?: string;
189
+ /**
190
+ * Sort field. Leading `-` = desc; only `created_at` is sortable. Default
191
+ * `-created_at`. `--` is an error.
192
+ */
193
+ sort?: 'created_at' | '-created_at';
194
+ }
195
+ export interface EmailBlockCreateParams {
196
+ /**
197
+ * Recipient address (normalized: trim + lower-case).
198
+ */
199
+ to: string;
200
+ /**
201
+ * `null` ⇒ account scope.
202
+ */
203
+ domain_id?: string | null;
204
+ expires_at?: string | null;
205
+ /**
206
+ * Sender address (normalized). `null` ⇒ account/domain scope.
207
+ */
208
+ from?: string | null;
209
+ }
210
+ export interface EmailBlockRetrieveExportParams {
211
+ /**
212
+ * `created_at > value` (ISO 8601).
213
+ */
214
+ 'filter[created_after]'?: string;
215
+ /**
216
+ * `created_at < value` (ISO 8601).
217
+ */
218
+ 'filter[created_before]'?: string;
219
+ /**
220
+ * Exact-match filter on domain_id (UUID).
221
+ */
222
+ 'filter[domain_id]'?: string;
223
+ /**
224
+ * Exact-match filter on reason.
225
+ */
226
+ 'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
227
+ /**
228
+ * Offset page number (≥1, default 1).
229
+ */
230
+ 'page[number]'?: number;
231
+ /**
232
+ * Page size (1–100, default 25).
233
+ */
234
+ 'page[size]'?: number;
235
+ /**
236
+ * Sort field. Leading `-` = desc; only `created_at` is sortable. Default
237
+ * `-created_at`. `--` is an error.
238
+ */
239
+ sort?: 'created_at' | '-created_at';
240
+ }
241
+ export interface EmailBlockRetrieveEventsParams {
242
+ /**
243
+ * Offset page number (≥1, default 1).
244
+ */
245
+ 'page[number]'?: number;
246
+ /**
247
+ * Page size (default 50, max 100).
248
+ */
249
+ 'page[size]'?: number;
250
+ }
251
+ export declare namespace EmailBlocks {
252
+ export { type EmailBlock as EmailBlock, type EmailBlockResponse as EmailBlockResponse, type OffsetMeta as OffsetMeta, type EmailBlockRetrieveEventsResponse as EmailBlockRetrieveEventsResponse, type EmailBlockRetrieveExportResponse as EmailBlockRetrieveExportResponse, type EmailBlocksDefaultFlatPagination as EmailBlocksDefaultFlatPagination, type EmailBlockListParams as EmailBlockListParams, type EmailBlockCreateParams as EmailBlockCreateParams, type EmailBlockRetrieveExportParams as EmailBlockRetrieveExportParams, type EmailBlockRetrieveEventsParams as EmailBlockRetrieveEventsParams, };
253
+ export { Import as Import, type EmailBlockImportResponse as EmailBlockImportResponse, type ImportCreateParams as ImportCreateParams, };
254
+ }
255
+ //# sourceMappingURL=email-blocks.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-blocks.d.mts","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,kBAAkB,EAAE,qBAAiB;AAChF,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,WAAW,EAAE,kCAA8B;AAE7G,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,UAAU,CAAC;IAI5D;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI9F;;;;;;;;;;;;;;OAcG;IACH,cAAc,CACZ,KAAK,GAAE,8BAA8B,GAAG,IAAI,GAAG,SAAc,EAC7D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAQrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI5E;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC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Resource } from "../../core/resource.js";
2
+ import * as ImportAPI from "./import.js";
3
+ import { EmailBlockImportResponse, Import, ImportCreateParams } from "./import.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { DefaultFlatPagination, type DefaultFlatPaginationParams, PagePromise } from "../../core/pagination.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ /**
8
+ * Recipient suppression records (`/v2/email_blocks`).
9
+ */
10
+ export declare class EmailBlocks extends APIResource {
11
+ import: ImportAPI.Import;
12
+ /**
13
+ * Account-scoped list. Two mutually exclusive pagination modes:
14
+ *
15
+ * - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
16
+ * `meta` contains `total_pages`.
17
+ * - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
18
+ * `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
19
+ * together is an error. `meta` contains `next_cursor` / `previous_cursor`
20
+ * (omitted when their flag is false).
21
+ *
22
+ * Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
23
+ * prefix is an error. `nil`/empty filter values are silently dropped.
24
+ */
25
+ list(query?: EmailBlockListParams | null | undefined, options?: RequestOptions): PagePromise<EmailBlocksDefaultFlatPagination, EmailBlock>;
26
+ /**
27
+ * Creates a suppression with `reason: manual_block` and `source: manual`.
28
+ * Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
29
+ * server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
30
+ * matching row already exists (NULL-safe dedupe key: account_id, scope, to,
31
+ * reason, domain_id, from), returns the existing record with `200` (no new audit
32
+ * event).
33
+ *
34
+ * `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
35
+ * the public surface. Use the unsubscribe-group suppression endpoint or the
36
+ * internal create surface for those.
37
+ */
38
+ create(body: EmailBlockCreateParams, options?: RequestOptions): APIPromise<EmailBlockResponse>;
39
+ /**
40
+ * Streams the account's suppressions as a chunked CSV (server-side cursor; never
41
+ * materialized). Content-type `text/csv`, header
42
+ * `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
43
+ *
44
+ * Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
45
+ * `filter[created_before]`) are the only params that affect output. `sort` and
46
+ * `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
47
+ * stream `ORDER BY created_at ASC, id ASC` with no pagination.
48
+ *
49
+ * CSV columns:
50
+ * `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
51
+ * The CSV carries the `group_id` column so group-scoped suppressions' group link
52
+ * survives the export (empty for account-scope rows).
53
+ */
54
+ retrieveExport(query?: EmailBlockRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<string>;
55
+ /**
56
+ * Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
57
+ * is appended unless the block was already `removed` (idempotent — returns the
58
+ * existing row with `200` and no new event). Mutates `updated_at`.
59
+ */
60
+ delete(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
61
+ /**
62
+ * Retrieve a suppression
63
+ */
64
+ retrieve(id: string, options?: RequestOptions): APIPromise<EmailBlockResponse>;
65
+ /**
66
+ * Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
67
+ * max 100). No `sort`, no `filter`, no cursor — ordering is fixed
68
+ * `desc occurred_at, desc id`. Verifies the block belongs to the account first
69
+ * (cross-account → 404).
70
+ */
71
+ retrieveEvents(id: string, query?: EmailBlockRetrieveEventsParams | null | undefined, options?: RequestOptions): APIPromise<EmailBlockRetrieveEventsResponse>;
72
+ }
73
+ export type EmailBlocksDefaultFlatPagination = DefaultFlatPagination<EmailBlock>;
74
+ /**
75
+ * Suppression record. Schema fields hidden by the view: `account_id`,
76
+ * `bounce_category`, `dsn_code`, `meta`.
77
+ */
78
+ export interface EmailBlock {
79
+ id: string;
80
+ created_at: string;
81
+ reason: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
82
+ /**
83
+ * View-only discriminator.
84
+ */
85
+ record_type: 'email_block';
86
+ /**
87
+ * Derived server-side from `domain_id`/`from`; never trusted from the caller.
88
+ */
89
+ scope: 'account' | 'domain' | 'address';
90
+ source: 'feedback' | 'manual' | 'import' | 'system';
91
+ status: 'active' | 'expired' | 'removed';
92
+ /**
93
+ * Normalized recipient. (schema: to_address)
94
+ */
95
+ to: string;
96
+ updated_at: string;
97
+ /**
98
+ * `null` ⇒ account scope. Stored on the row; exposed here.
99
+ */
100
+ domain_id?: string | null;
101
+ expires_at?: string | null;
102
+ /**
103
+ * `null` ⇒ not address-scope. (schema: from_address)
104
+ */
105
+ from?: string | null;
106
+ /**
107
+ * `null` ⇒ global; set ⇒ group-scoped opt-out.
108
+ */
109
+ group_id?: string | null;
110
+ }
111
+ export interface EmailBlockResponse {
112
+ /**
113
+ * Suppression record. Schema fields hidden by the view: `account_id`,
114
+ * `bounce_category`, `dsn_code`, `meta`.
115
+ */
116
+ data: EmailBlock;
117
+ }
118
+ export interface OffsetMeta {
119
+ page_number: number;
120
+ page_size: number;
121
+ total_pages: number;
122
+ total_results: number;
123
+ }
124
+ export interface EmailBlockRetrieveEventsResponse {
125
+ data: Array<EmailBlockRetrieveEventsResponse.Data>;
126
+ meta: OffsetMeta;
127
+ }
128
+ export declare namespace EmailBlockRetrieveEventsResponse {
129
+ interface Data {
130
+ id: string;
131
+ /**
132
+ * Free-text (`user_id`/`org_id`/`api_key`/`dev_bypass`/`system`/`manual`).
133
+ */
134
+ actor: string;
135
+ event_type: 'created' | 'removed' | 'expired' | 'override_used';
136
+ occurred_at: string;
137
+ /**
138
+ * Free-text snapshot of the block's reason at event time.
139
+ */
140
+ reason: string;
141
+ /**
142
+ * View-only.
143
+ */
144
+ record_type: 'email_block_event';
145
+ /**
146
+ * Free-text snapshot of the block's source at event time.
147
+ */
148
+ source: string;
149
+ /**
150
+ * `null` when the schema field is nil (the context usually sets it to `{}`).
151
+ */
152
+ meta?: {
153
+ [key: string]: unknown;
154
+ } | null;
155
+ }
156
+ }
157
+ /**
158
+ * CSV with header row
159
+ * `id,to,from,reason,source,scope,status,domain_id,created_at,updated_at,expires_at,group_id`.
160
+ */
161
+ export type EmailBlockRetrieveExportResponse = string;
162
+ export interface EmailBlockListParams extends DefaultFlatPaginationParams {
163
+ /**
164
+ * `created_at > value` (ISO 8601).
165
+ */
166
+ 'filter[created_after]'?: string;
167
+ /**
168
+ * `created_at < value` (ISO 8601).
169
+ */
170
+ 'filter[created_before]'?: string;
171
+ /**
172
+ * Exact-match filter on domain_id (UUID).
173
+ */
174
+ 'filter[domain_id]'?: string;
175
+ /**
176
+ * Exact-match filter on reason.
177
+ */
178
+ 'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
179
+ /**
180
+ * Opaque cursor (`Base.url_encode64` of `{"created_at","id"}`). Cursor mode;
181
+ * mutually exclusive with `page[number]` and `page[before]`.
182
+ */
183
+ 'page[after]'?: string;
184
+ /**
185
+ * Opaque cursor (see `page[after]`). Mutually exclusive with `page[after]` and
186
+ * `page[number]`.
187
+ */
188
+ 'page[before]'?: string;
189
+ /**
190
+ * Sort field. Leading `-` = desc; only `created_at` is sortable. Default
191
+ * `-created_at`. `--` is an error.
192
+ */
193
+ sort?: 'created_at' | '-created_at';
194
+ }
195
+ export interface EmailBlockCreateParams {
196
+ /**
197
+ * Recipient address (normalized: trim + lower-case).
198
+ */
199
+ to: string;
200
+ /**
201
+ * `null` ⇒ account scope.
202
+ */
203
+ domain_id?: string | null;
204
+ expires_at?: string | null;
205
+ /**
206
+ * Sender address (normalized). `null` ⇒ account/domain scope.
207
+ */
208
+ from?: string | null;
209
+ }
210
+ export interface EmailBlockRetrieveExportParams {
211
+ /**
212
+ * `created_at > value` (ISO 8601).
213
+ */
214
+ 'filter[created_after]'?: string;
215
+ /**
216
+ * `created_at < value` (ISO 8601).
217
+ */
218
+ 'filter[created_before]'?: string;
219
+ /**
220
+ * Exact-match filter on domain_id (UUID).
221
+ */
222
+ 'filter[domain_id]'?: string;
223
+ /**
224
+ * Exact-match filter on reason.
225
+ */
226
+ 'filter[reason]'?: 'hard_bounce' | 'spam_complaint' | 'unsubscribe' | 'invalid' | 'manual_block';
227
+ /**
228
+ * Offset page number (≥1, default 1).
229
+ */
230
+ 'page[number]'?: number;
231
+ /**
232
+ * Page size (1–100, default 25).
233
+ */
234
+ 'page[size]'?: number;
235
+ /**
236
+ * Sort field. Leading `-` = desc; only `created_at` is sortable. Default
237
+ * `-created_at`. `--` is an error.
238
+ */
239
+ sort?: 'created_at' | '-created_at';
240
+ }
241
+ export interface EmailBlockRetrieveEventsParams {
242
+ /**
243
+ * Offset page number (≥1, default 1).
244
+ */
245
+ 'page[number]'?: number;
246
+ /**
247
+ * Page size (default 50, max 100).
248
+ */
249
+ 'page[size]'?: number;
250
+ }
251
+ export declare namespace EmailBlocks {
252
+ export { type EmailBlock as EmailBlock, type EmailBlockResponse as EmailBlockResponse, type OffsetMeta as OffsetMeta, type EmailBlockRetrieveEventsResponse as EmailBlockRetrieveEventsResponse, type EmailBlockRetrieveExportResponse as EmailBlockRetrieveExportResponse, type EmailBlocksDefaultFlatPagination as EmailBlocksDefaultFlatPagination, type EmailBlockListParams as EmailBlockListParams, type EmailBlockCreateParams as EmailBlockCreateParams, type EmailBlockRetrieveExportParams as EmailBlockRetrieveExportParams, type EmailBlockRetrieveEventsParams as EmailBlockRetrieveEventsParams, };
253
+ export { Import as Import, type EmailBlockImportResponse as EmailBlockImportResponse, type ImportCreateParams as ImportCreateParams, };
254
+ }
255
+ //# sourceMappingURL=email-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-blocks.d.ts","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,SAAS,oBAAiB;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,kBAAkB,EAAE,oBAAiB;AAChF,OAAO,E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,aAAa,GAAG,SAAS,GAAG,cAAc,CAAC;IAEjG;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CACrC;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,8BAA8B,IAAI,8BAA8B,GACtE,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EmailBlocks = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const ImportAPI = tslib_1.__importStar(require("./import.js"));
8
+ const import_1 = require("./import.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const headers_1 = require("../../internal/headers.js");
11
+ const path_1 = require("../../internal/utils/path.js");
12
+ /**
13
+ * Recipient suppression records (`/v2/email_blocks`).
14
+ */
15
+ class EmailBlocks extends resource_1.APIResource {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.import = new ImportAPI.Import(this._client);
19
+ }
20
+ /**
21
+ * Account-scoped list. Two mutually exclusive pagination modes:
22
+ *
23
+ * - **Offset**: `page[number]` (default 1) + `page[size]` (default 25, max 100).
24
+ * `meta` contains `total_pages`.
25
+ * - **Cursor**: `page[after]` and/or `page[before]` (opaque `Base.url_encode64` of
26
+ * `{"created_at","id"}`). Cannot combine with `page[number]`; `after`+`before`
27
+ * together is an error. `meta` contains `next_cursor` / `previous_cursor`
28
+ * (omitted when their flag is false).
29
+ *
30
+ * Sort defaults to `-created_at` (desc); only `created_at` is sortable. A `--`
31
+ * prefix is an error. `nil`/empty filter values are silently dropped.
32
+ */
33
+ list(query = {}, options) {
34
+ return this._client.getAPIList('/email_blocks', (pagination_1.DefaultFlatPagination), { query, ...options });
35
+ }
36
+ /**
37
+ * Creates a suppression with `reason: manual_block` and `source: manual`.
38
+ * Caller-supplied `reason` / `source` are **ignored**; `scope` is **derived**
39
+ * server-side from `domain_id` / `from` and is never trusted. Idempotent: if a
40
+ * matching row already exists (NULL-safe dedupe key: account_id, scope, to,
41
+ * reason, domain_id, from), returns the existing record with `200` (no new audit
42
+ * event).
43
+ *
44
+ * `bounce_category`, `dsn_code`, `meta`, and `group_id` are **not accepted** on
45
+ * the public surface. Use the unsubscribe-group suppression endpoint or the
46
+ * internal create surface for those.
47
+ */
48
+ create(body, options) {
49
+ return this._client.post('/email_blocks', { body, ...options });
50
+ }
51
+ /**
52
+ * Streams the account's suppressions as a chunked CSV (server-side cursor; never
53
+ * materialized). Content-type `text/csv`, header
54
+ * `Content-Disposition: attachment; filename="email_blocks_export.csv"`.
55
+ *
56
+ * Filters (`filter[reason]`, `filter[domain_id]`, `filter[created_after]`,
57
+ * `filter[created_before]`) are the only params that affect output. `sort` and
58
+ * `page[*]` are **parsed** (bad values still produce `400`) but **ignored** — rows
59
+ * stream `ORDER BY created_at ASC, id ASC` with no pagination.
60
+ *
61
+ * CSV columns:
62
+ * `id,to,from,reason,source,scope,status,domain_id, created_at,updated_at,expires_at,group_id`.
63
+ * The CSV carries the `group_id` column so group-scoped suppressions' group link
64
+ * survives the export (empty for account-scope rows).
65
+ */
66
+ retrieveExport(query = {}, options) {
67
+ return this._client.get('/email_blocks/export', {
68
+ query,
69
+ ...options,
70
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/csv' }, options?.headers]),
71
+ });
72
+ }
73
+ /**
74
+ * Soft-deletes (status → `removed`; tombstone retained). A `removed` audit event
75
+ * is appended unless the block was already `removed` (idempotent — returns the
76
+ * existing row with `200` and no new event). Mutates `updated_at`.
77
+ */
78
+ delete(id, options) {
79
+ return this._client.delete((0, path_1.path) `/email_blocks/${id}`, options);
80
+ }
81
+ /**
82
+ * Retrieve a suppression
83
+ */
84
+ retrieve(id, options) {
85
+ return this._client.get((0, path_1.path) `/email_blocks/${id}`, options);
86
+ }
87
+ /**
88
+ * Offset pagination only (`page[number]` default 1, `page[size]` default **50**,
89
+ * max 100). No `sort`, no `filter`, no cursor — ordering is fixed
90
+ * `desc occurred_at, desc id`. Verifies the block belongs to the account first
91
+ * (cross-account → 404).
92
+ */
93
+ retrieveEvents(id, query = {}, options) {
94
+ return this._client.get((0, path_1.path) `/email_blocks/${id}/events`, { query, ...options });
95
+ }
96
+ }
97
+ exports.EmailBlocks = EmailBlocks;
98
+ EmailBlocks.Import = import_1.Import;
99
+ //# sourceMappingURL=email-blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-blocks.js","sourceRoot":"","sources":["../../src/resources/email-blocks/email-blocks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,+DAAsC;AACtC,wCAAgF;AAEhF,yDAA6G;AAC7G,uDAAsD;AAEtD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,WAAM,GAAqB,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