@trycourier/courier 7.10.2 → 7.19.1

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 (423) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +1 -0
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +10 -4
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +10 -4
  12. package/client.d.ts.map +1 -1
  13. package/client.js +27 -2
  14. package/client.js.map +1 -1
  15. package/client.mjs +27 -2
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/qs/formats.d.mts.map +1 -1
  41. package/internal/qs/formats.d.ts.map +1 -1
  42. package/internal/qs/index.d.mts +2 -2
  43. package/internal/qs/index.d.mts.map +1 -1
  44. package/internal/qs/index.d.ts +2 -2
  45. package/internal/qs/index.d.ts.map +1 -1
  46. package/internal/qs/index.mjs.map +1 -1
  47. package/internal/qs/stringify.d.mts.map +1 -1
  48. package/internal/qs/stringify.d.ts.map +1 -1
  49. package/internal/qs/stringify.mjs.map +1 -1
  50. package/internal/qs/utils.d.mts.map +1 -1
  51. package/internal/qs/utils.d.ts.map +1 -1
  52. package/internal/qs/utils.mjs.map +1 -1
  53. package/internal/request-options.d.mts.map +1 -1
  54. package/internal/request-options.d.ts.map +1 -1
  55. package/internal/shims.d.mts +6 -0
  56. package/internal/shims.d.mts.map +1 -1
  57. package/internal/shims.d.ts +6 -0
  58. package/internal/shims.d.ts.map +1 -1
  59. package/internal/to-file.d.mts.map +1 -1
  60. package/internal/to-file.d.ts.map +1 -1
  61. package/internal/to-file.mjs.map +1 -1
  62. package/internal/types.d.mts +10 -10
  63. package/internal/types.d.mts.map +1 -1
  64. package/internal/types.d.ts +10 -10
  65. package/internal/types.d.ts.map +1 -1
  66. package/internal/uploads.d.mts.map +1 -1
  67. package/internal/uploads.d.ts.map +1 -1
  68. package/internal/uploads.mjs.map +1 -1
  69. package/internal/utils/base64.mjs.map +1 -1
  70. package/internal/utils/log.d.mts.map +1 -1
  71. package/internal/utils/log.d.ts.map +1 -1
  72. package/internal/utils/log.js +2 -0
  73. package/internal/utils/log.js.map +1 -1
  74. package/internal/utils/log.mjs +2 -0
  75. package/internal/utils/log.mjs.map +1 -1
  76. package/internal/utils/path.mjs.map +1 -1
  77. package/internal/utils/query.mjs.map +1 -1
  78. package/internal/utils/values.mjs.map +1 -1
  79. package/internal/utils.d.mts.map +1 -1
  80. package/internal/utils.d.ts.map +1 -1
  81. package/internal/utils.mjs.map +1 -1
  82. package/package.json +1 -1
  83. package/resource.d.mts +1 -0
  84. package/resource.d.mts.map +1 -1
  85. package/resource.d.ts +1 -0
  86. package/resource.d.ts.map +1 -1
  87. package/resource.mjs +1 -0
  88. package/resource.mjs.map +1 -1
  89. package/resources/audiences.d.mts +5 -2
  90. package/resources/audiences.d.mts.map +1 -1
  91. package/resources/audiences.d.ts +5 -2
  92. package/resources/audiences.d.ts.map +1 -1
  93. package/resources/audiences.mjs.map +1 -1
  94. package/resources/audit-events.d.mts.map +1 -1
  95. package/resources/audit-events.d.ts.map +1 -1
  96. package/resources/audit-events.mjs.map +1 -1
  97. package/resources/auth.d.mts.map +1 -1
  98. package/resources/auth.d.ts.map +1 -1
  99. package/resources/auth.mjs.map +1 -1
  100. package/resources/automations/automations.d.mts.map +1 -1
  101. package/resources/automations/automations.d.ts.map +1 -1
  102. package/resources/automations/automations.mjs.map +1 -1
  103. package/resources/automations/index.d.mts.map +1 -1
  104. package/resources/automations/index.d.ts.map +1 -1
  105. package/resources/automations/index.mjs.map +1 -1
  106. package/resources/automations/invoke.d.mts.map +1 -1
  107. package/resources/automations/invoke.d.ts.map +1 -1
  108. package/resources/automations/invoke.mjs.map +1 -1
  109. package/resources/automations.d.mts.map +1 -1
  110. package/resources/automations.d.ts.map +1 -1
  111. package/resources/automations.mjs.map +1 -1
  112. package/resources/brands.d.mts +35 -2
  113. package/resources/brands.d.mts.map +1 -1
  114. package/resources/brands.d.ts +35 -2
  115. package/resources/brands.d.ts.map +1 -1
  116. package/resources/brands.js +34 -1
  117. package/resources/brands.js.map +1 -1
  118. package/resources/brands.mjs +34 -1
  119. package/resources/brands.mjs.map +1 -1
  120. package/resources/bulk.d.mts.map +1 -1
  121. package/resources/bulk.d.ts.map +1 -1
  122. package/resources/bulk.mjs.map +1 -1
  123. package/resources/digests/digests.d.mts +94 -0
  124. package/resources/digests/digests.d.mts.map +1 -0
  125. package/resources/digests/digests.d.ts +94 -0
  126. package/resources/digests/digests.d.ts.map +1 -0
  127. package/resources/digests/digests.js +17 -0
  128. package/resources/digests/digests.js.map +1 -0
  129. package/resources/digests/digests.mjs +12 -0
  130. package/resources/digests/digests.mjs.map +1 -0
  131. package/resources/digests/index.d.mts +3 -0
  132. package/resources/digests/index.d.mts.map +1 -0
  133. package/resources/digests/index.d.ts +3 -0
  134. package/resources/digests/index.d.ts.map +1 -0
  135. package/resources/digests/index.js +9 -0
  136. package/resources/digests/index.js.map +1 -0
  137. package/resources/digests/index.mjs +4 -0
  138. package/resources/digests/index.mjs.map +1 -0
  139. package/resources/digests/schedules.d.mts +32 -0
  140. package/resources/digests/schedules.d.mts.map +1 -0
  141. package/resources/digests/schedules.d.ts +32 -0
  142. package/resources/digests/schedules.d.ts.map +1 -0
  143. package/resources/digests/schedules.js +29 -0
  144. package/resources/digests/schedules.js.map +1 -0
  145. package/resources/digests/schedules.mjs +25 -0
  146. package/resources/digests/schedules.mjs.map +1 -0
  147. package/resources/digests.d.mts +2 -0
  148. package/resources/digests.d.mts.map +1 -0
  149. package/resources/digests.d.ts +2 -0
  150. package/resources/digests.d.ts.map +1 -0
  151. package/resources/digests.js +6 -0
  152. package/resources/digests.js.map +1 -0
  153. package/resources/digests.mjs +3 -0
  154. package/resources/digests.mjs.map +1 -0
  155. package/resources/inbound.d.mts.map +1 -1
  156. package/resources/inbound.d.ts.map +1 -1
  157. package/resources/inbound.mjs.map +1 -1
  158. package/resources/index.d.mts +4 -2
  159. package/resources/index.d.mts.map +1 -1
  160. package/resources/index.d.ts +4 -2
  161. package/resources/index.d.ts.map +1 -1
  162. package/resources/index.js +6 -2
  163. package/resources/index.js.map +1 -1
  164. package/resources/index.mjs +3 -1
  165. package/resources/index.mjs.map +1 -1
  166. package/resources/journeys/index.d.mts +3 -0
  167. package/resources/journeys/index.d.mts.map +1 -0
  168. package/resources/journeys/index.d.ts +3 -0
  169. package/resources/journeys/index.d.ts.map +1 -0
  170. package/resources/journeys/index.js +9 -0
  171. package/resources/journeys/index.js.map +1 -0
  172. package/resources/journeys/index.mjs +4 -0
  173. package/resources/journeys/index.mjs.map +1 -0
  174. package/resources/journeys/journeys.d.mts +943 -0
  175. package/resources/journeys/journeys.d.mts.map +1 -0
  176. package/resources/journeys/journeys.d.ts +943 -0
  177. package/resources/journeys/journeys.d.ts.map +1 -0
  178. package/resources/journeys/journeys.js +166 -0
  179. package/resources/journeys/journeys.js.map +1 -0
  180. package/resources/journeys/journeys.mjs +161 -0
  181. package/resources/journeys/journeys.mjs.map +1 -0
  182. package/resources/journeys/templates.d.mts +338 -0
  183. package/resources/journeys/templates.d.mts.map +1 -0
  184. package/resources/journeys/templates.d.ts +338 -0
  185. package/resources/journeys/templates.d.ts.map +1 -0
  186. package/resources/journeys/templates.js +213 -0
  187. package/resources/journeys/templates.js.map +1 -0
  188. package/resources/journeys/templates.mjs +209 -0
  189. package/resources/journeys/templates.mjs.map +1 -0
  190. package/resources/journeys.d.mts +1 -142
  191. package/resources/journeys.d.mts.map +1 -1
  192. package/resources/journeys.d.ts +1 -142
  193. package/resources/journeys.d.ts.map +1 -1
  194. package/resources/journeys.js +2 -34
  195. package/resources/journeys.js.map +1 -1
  196. package/resources/journeys.mjs +1 -32
  197. package/resources/journeys.mjs.map +1 -1
  198. package/resources/lists/index.d.mts.map +1 -1
  199. package/resources/lists/index.d.ts.map +1 -1
  200. package/resources/lists/index.mjs.map +1 -1
  201. package/resources/lists/lists.d.mts.map +1 -1
  202. package/resources/lists/lists.d.ts.map +1 -1
  203. package/resources/lists/lists.mjs.map +1 -1
  204. package/resources/lists/subscriptions.d.mts.map +1 -1
  205. package/resources/lists/subscriptions.d.ts.map +1 -1
  206. package/resources/lists/subscriptions.mjs.map +1 -1
  207. package/resources/lists.d.mts.map +1 -1
  208. package/resources/lists.d.ts.map +1 -1
  209. package/resources/lists.mjs.map +1 -1
  210. package/resources/messages.d.mts +16 -1
  211. package/resources/messages.d.mts.map +1 -1
  212. package/resources/messages.d.ts +16 -1
  213. package/resources/messages.d.ts.map +1 -1
  214. package/resources/messages.js +10 -0
  215. package/resources/messages.js.map +1 -1
  216. package/resources/messages.mjs +10 -0
  217. package/resources/messages.mjs.map +1 -1
  218. package/resources/notifications/checks.d.mts +3 -3
  219. package/resources/notifications/checks.d.mts.map +1 -1
  220. package/resources/notifications/checks.d.ts +3 -3
  221. package/resources/notifications/checks.d.ts.map +1 -1
  222. package/resources/notifications/checks.js +3 -3
  223. package/resources/notifications/checks.mjs +3 -3
  224. package/resources/notifications/checks.mjs.map +1 -1
  225. package/resources/notifications/index.d.mts.map +1 -1
  226. package/resources/notifications/index.d.ts.map +1 -1
  227. package/resources/notifications/index.mjs.map +1 -1
  228. package/resources/notifications/notifications.d.mts.map +1 -1
  229. package/resources/notifications/notifications.d.ts.map +1 -1
  230. package/resources/notifications/notifications.mjs.map +1 -1
  231. package/resources/notifications.d.mts.map +1 -1
  232. package/resources/notifications.d.ts.map +1 -1
  233. package/resources/notifications.mjs.map +1 -1
  234. package/resources/profiles/index.d.mts.map +1 -1
  235. package/resources/profiles/index.d.ts.map +1 -1
  236. package/resources/profiles/index.mjs.map +1 -1
  237. package/resources/profiles/lists.d.mts.map +1 -1
  238. package/resources/profiles/lists.d.ts.map +1 -1
  239. package/resources/profiles/lists.mjs.map +1 -1
  240. package/resources/profiles/profiles.d.mts.map +1 -1
  241. package/resources/profiles/profiles.d.ts.map +1 -1
  242. package/resources/profiles/profiles.mjs.map +1 -1
  243. package/resources/profiles.d.mts.map +1 -1
  244. package/resources/profiles.d.ts.map +1 -1
  245. package/resources/profiles.mjs.map +1 -1
  246. package/resources/providers/catalog.d.mts.map +1 -1
  247. package/resources/providers/catalog.d.ts.map +1 -1
  248. package/resources/providers/catalog.mjs.map +1 -1
  249. package/resources/providers/index.d.mts.map +1 -1
  250. package/resources/providers/index.d.ts.map +1 -1
  251. package/resources/providers/index.mjs.map +1 -1
  252. package/resources/providers/providers.d.mts.map +1 -1
  253. package/resources/providers/providers.d.ts.map +1 -1
  254. package/resources/providers/providers.mjs.map +1 -1
  255. package/resources/providers.d.mts.map +1 -1
  256. package/resources/providers.d.ts.map +1 -1
  257. package/resources/providers.mjs.map +1 -1
  258. package/resources/requests.d.mts.map +1 -1
  259. package/resources/requests.d.ts.map +1 -1
  260. package/resources/requests.mjs.map +1 -1
  261. package/resources/routing-strategies.d.mts.map +1 -1
  262. package/resources/routing-strategies.d.ts.map +1 -1
  263. package/resources/routing-strategies.mjs.map +1 -1
  264. package/resources/send.d.mts.map +1 -1
  265. package/resources/send.d.ts.map +1 -1
  266. package/resources/send.mjs.map +1 -1
  267. package/resources/shared.d.mts +6 -0
  268. package/resources/shared.d.mts.map +1 -1
  269. package/resources/shared.d.ts +6 -0
  270. package/resources/shared.d.ts.map +1 -1
  271. package/resources/tenants/index.d.mts +1 -1
  272. package/resources/tenants/index.d.mts.map +1 -1
  273. package/resources/tenants/index.d.ts +1 -1
  274. package/resources/tenants/index.d.ts.map +1 -1
  275. package/resources/tenants/index.js.map +1 -1
  276. package/resources/tenants/index.mjs.map +1 -1
  277. package/resources/tenants/preferences/index.d.mts.map +1 -1
  278. package/resources/tenants/preferences/index.d.ts.map +1 -1
  279. package/resources/tenants/preferences/index.mjs.map +1 -1
  280. package/resources/tenants/preferences/items.d.mts.map +1 -1
  281. package/resources/tenants/preferences/items.d.ts.map +1 -1
  282. package/resources/tenants/preferences/items.mjs.map +1 -1
  283. package/resources/tenants/preferences/preferences.d.mts.map +1 -1
  284. package/resources/tenants/preferences/preferences.d.ts.map +1 -1
  285. package/resources/tenants/preferences/preferences.mjs.map +1 -1
  286. package/resources/tenants/preferences.d.mts.map +1 -1
  287. package/resources/tenants/preferences.d.ts.map +1 -1
  288. package/resources/tenants/preferences.mjs.map +1 -1
  289. package/resources/tenants/templates/index.d.mts +1 -1
  290. package/resources/tenants/templates/index.d.mts.map +1 -1
  291. package/resources/tenants/templates/index.d.ts +1 -1
  292. package/resources/tenants/templates/index.d.ts.map +1 -1
  293. package/resources/tenants/templates/index.js.map +1 -1
  294. package/resources/tenants/templates/index.mjs.map +1 -1
  295. package/resources/tenants/templates/templates.d.mts +23 -1
  296. package/resources/tenants/templates/templates.d.mts.map +1 -1
  297. package/resources/tenants/templates/templates.d.ts +23 -1
  298. package/resources/tenants/templates/templates.d.ts.map +1 -1
  299. package/resources/tenants/templates/templates.js +23 -0
  300. package/resources/tenants/templates/templates.js.map +1 -1
  301. package/resources/tenants/templates/templates.mjs +23 -0
  302. package/resources/tenants/templates/templates.mjs.map +1 -1
  303. package/resources/tenants/templates/versions.d.mts.map +1 -1
  304. package/resources/tenants/templates/versions.d.ts.map +1 -1
  305. package/resources/tenants/templates/versions.mjs.map +1 -1
  306. package/resources/tenants/templates.d.mts.map +1 -1
  307. package/resources/tenants/templates.d.ts.map +1 -1
  308. package/resources/tenants/templates.mjs.map +1 -1
  309. package/resources/tenants/tenants.d.mts +2 -2
  310. package/resources/tenants/tenants.d.mts.map +1 -1
  311. package/resources/tenants/tenants.d.ts +2 -2
  312. package/resources/tenants/tenants.d.ts.map +1 -1
  313. package/resources/tenants/tenants.js.map +1 -1
  314. package/resources/tenants/tenants.mjs.map +1 -1
  315. package/resources/tenants.d.mts.map +1 -1
  316. package/resources/tenants.d.ts.map +1 -1
  317. package/resources/tenants.mjs.map +1 -1
  318. package/resources/translations.d.mts.map +1 -1
  319. package/resources/translations.d.ts.map +1 -1
  320. package/resources/translations.mjs.map +1 -1
  321. package/resources/users/index.d.mts +1 -1
  322. package/resources/users/index.d.mts.map +1 -1
  323. package/resources/users/index.d.ts +1 -1
  324. package/resources/users/index.d.ts.map +1 -1
  325. package/resources/users/index.js.map +1 -1
  326. package/resources/users/index.mjs.map +1 -1
  327. package/resources/users/preferences.d.mts +211 -1
  328. package/resources/users/preferences.d.mts.map +1 -1
  329. package/resources/users/preferences.d.ts +211 -1
  330. package/resources/users/preferences.d.ts.map +1 -1
  331. package/resources/users/preferences.js +105 -0
  332. package/resources/users/preferences.js.map +1 -1
  333. package/resources/users/preferences.mjs +105 -0
  334. package/resources/users/preferences.mjs.map +1 -1
  335. package/resources/users/tenants.d.mts.map +1 -1
  336. package/resources/users/tenants.d.ts.map +1 -1
  337. package/resources/users/tenants.mjs.map +1 -1
  338. package/resources/users/tokens.d.mts.map +1 -1
  339. package/resources/users/tokens.d.ts.map +1 -1
  340. package/resources/users/tokens.mjs.map +1 -1
  341. package/resources/users/users.d.mts +2 -2
  342. package/resources/users/users.d.mts.map +1 -1
  343. package/resources/users/users.d.ts +2 -2
  344. package/resources/users/users.d.ts.map +1 -1
  345. package/resources/users/users.js.map +1 -1
  346. package/resources/users/users.mjs.map +1 -1
  347. package/resources/users.d.mts.map +1 -1
  348. package/resources/users.d.ts.map +1 -1
  349. package/resources/users.mjs.map +1 -1
  350. package/resources/workspace-preferences/index.d.mts +3 -0
  351. package/resources/workspace-preferences/index.d.mts.map +1 -0
  352. package/resources/workspace-preferences/index.d.ts +3 -0
  353. package/resources/workspace-preferences/index.d.ts.map +1 -0
  354. package/resources/workspace-preferences/index.js +9 -0
  355. package/resources/workspace-preferences/index.js.map +1 -0
  356. package/resources/workspace-preferences/index.mjs +4 -0
  357. package/resources/workspace-preferences/index.mjs.map +1 -0
  358. package/resources/workspace-preferences/topics.d.mts +168 -0
  359. package/resources/workspace-preferences/topics.d.mts.map +1 -0
  360. package/resources/workspace-preferences/topics.d.ts +168 -0
  361. package/resources/workspace-preferences/topics.d.ts.map +1 -0
  362. package/resources/workspace-preferences/topics.js +103 -0
  363. package/resources/workspace-preferences/topics.js.map +1 -0
  364. package/resources/workspace-preferences/topics.mjs +99 -0
  365. package/resources/workspace-preferences/topics.mjs.map +1 -0
  366. package/resources/workspace-preferences/workspace-preferences.d.mts +410 -0
  367. package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -0
  368. package/resources/workspace-preferences/workspace-preferences.d.ts +410 -0
  369. package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -0
  370. package/resources/workspace-preferences/workspace-preferences.js +104 -0
  371. package/resources/workspace-preferences/workspace-preferences.js.map +1 -0
  372. package/resources/workspace-preferences/workspace-preferences.mjs +99 -0
  373. package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -0
  374. package/resources/workspace-preferences.d.mts +2 -0
  375. package/resources/workspace-preferences.d.mts.map +1 -0
  376. package/resources/workspace-preferences.d.ts +2 -0
  377. package/resources/workspace-preferences.d.ts.map +1 -0
  378. package/resources/workspace-preferences.js +6 -0
  379. package/resources/workspace-preferences.js.map +1 -0
  380. package/resources/workspace-preferences.mjs +3 -0
  381. package/resources/workspace-preferences.mjs.map +1 -0
  382. package/resources.d.mts.map +1 -1
  383. package/resources.d.ts.map +1 -1
  384. package/resources.mjs.map +1 -1
  385. package/src/client.ts +158 -10
  386. package/src/internal/types.ts +6 -8
  387. package/src/internal/utils/log.ts +2 -0
  388. package/src/resources/audiences.ts +5 -2
  389. package/src/resources/brands.ts +36 -3
  390. package/src/resources/digests/digests.ts +120 -0
  391. package/src/resources/digests/index.ts +9 -0
  392. package/src/resources/digests/schedules.ts +51 -0
  393. package/src/resources/digests.ts +3 -0
  394. package/src/resources/index.ts +62 -1
  395. package/src/resources/journeys/index.ts +62 -0
  396. package/src/resources/journeys/journeys.ts +1289 -0
  397. package/src/resources/journeys/templates.ts +486 -0
  398. package/src/resources/journeys.ts +1 -172
  399. package/src/resources/messages.ts +20 -0
  400. package/src/resources/notifications/checks.ts +3 -3
  401. package/src/resources/shared.ts +7 -0
  402. package/src/resources/tenants/index.ts +1 -0
  403. package/src/resources/tenants/templates/index.ts +1 -0
  404. package/src/resources/tenants/templates/templates.ts +32 -0
  405. package/src/resources/tenants/tenants.ts +2 -0
  406. package/src/resources/users/index.ts +6 -0
  407. package/src/resources/users/preferences.ts +269 -0
  408. package/src/resources/users/users.ts +12 -0
  409. package/src/resources/workspace-preferences/index.ts +25 -0
  410. package/src/resources/workspace-preferences/topics.ts +229 -0
  411. package/src/resources/workspace-preferences/workspace-preferences.ts +534 -0
  412. package/src/resources/workspace-preferences.ts +3 -0
  413. package/src/version.ts +1 -1
  414. package/uploads.d.mts +1 -0
  415. package/uploads.d.mts.map +1 -1
  416. package/uploads.d.ts +1 -0
  417. package/uploads.d.ts.map +1 -1
  418. package/uploads.mjs +1 -0
  419. package/uploads.mjs.map +1 -1
  420. package/version.d.mts +1 -1
  421. package/version.d.ts +1 -1
  422. package/version.js +1 -1
  423. package/version.mjs +1 -1
@@ -0,0 +1,486 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
5
+ import * as JourneysAPI from './journeys';
6
+ import * as NotificationsAPI from '../notifications/notifications';
7
+ import { APIPromise } from '../../core/api-promise';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ export class Templates extends APIResource {
13
+ /**
14
+ * Create a notification template scoped to this journey. Defaults to `DRAFT`
15
+ * state; pass `state: "PUBLISHED"` to publish on create.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const journeyTemplateGetResponse =
20
+ * await client.journeys.templates.create('x', {
21
+ * channel: 'email',
22
+ * notification: {
23
+ * name: 'Welcome email',
24
+ * tags: [],
25
+ * brand: null,
26
+ * subscription: null,
27
+ * content: {
28
+ * version: '2022-01-01',
29
+ * elements: [{ type: 'text' }],
30
+ * },
31
+ * },
32
+ * });
33
+ * ```
34
+ */
35
+ create(
36
+ templateID: string,
37
+ body: TemplateCreateParams,
38
+ options?: RequestOptions,
39
+ ): APIPromise<JourneysAPI.JourneyTemplateGetResponse> {
40
+ return this._client.post(path`/journeys/${templateID}/templates`, { body, ...options });
41
+ }
42
+
43
+ /**
44
+ * Fetch a journey-scoped notification template by id. Pass `?version=draft`
45
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
46
+ * historical version.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const journeyTemplateGetResponse =
51
+ * await client.journeys.templates.retrieve('x', {
52
+ * templateId: 'x',
53
+ * });
54
+ * ```
55
+ */
56
+ retrieve(
57
+ notificationID: string,
58
+ params: TemplateRetrieveParams,
59
+ options?: RequestOptions,
60
+ ): APIPromise<JourneysAPI.JourneyTemplateGetResponse> {
61
+ const { templateId } = params;
62
+ return this._client.get(path`/journeys/${templateId}/templates/${notificationID}`, options);
63
+ }
64
+
65
+ /**
66
+ * List notification templates scoped to this journey. Journey-scoped notification
67
+ * templates can only be referenced from `send` nodes within the same journey.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const journeyTemplateListResponse =
72
+ * await client.journeys.templates.list('x');
73
+ * ```
74
+ */
75
+ list(
76
+ templateID: string,
77
+ query: TemplateListParams | null | undefined = {},
78
+ options?: RequestOptions,
79
+ ): APIPromise<JourneysAPI.JourneyTemplateListResponse> {
80
+ return this._client.get(path`/journeys/${templateID}/templates`, { query, ...options });
81
+ }
82
+
83
+ /**
84
+ * Archive the journey-scoped notification template. Archived templates cannot be
85
+ * sent.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * await client.journeys.templates.archive('x', {
90
+ * templateId: 'x',
91
+ * });
92
+ * ```
93
+ */
94
+ archive(notificationID: string, params: TemplateArchiveParams, options?: RequestOptions): APIPromise<void> {
95
+ const { templateId } = params;
96
+ return this._client.delete(path`/journeys/${templateId}/templates/${notificationID}`, {
97
+ ...options,
98
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
99
+ });
100
+ }
101
+
102
+ /**
103
+ * List published versions of the journey-scoped notification template, ordered
104
+ * most recent first.
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const notificationTemplateVersionListResponse =
109
+ * await client.journeys.templates.listVersions('x', {
110
+ * templateId: 'x',
111
+ * });
112
+ * ```
113
+ */
114
+ listVersions(
115
+ notificationID: string,
116
+ params: TemplateListVersionsParams,
117
+ options?: RequestOptions,
118
+ ): APIPromise<NotificationsAPI.NotificationTemplateVersionListResponse> {
119
+ const { templateId } = params;
120
+ return this._client.get(path`/journeys/${templateId}/templates/${notificationID}/versions`, options);
121
+ }
122
+
123
+ /**
124
+ * Publish the current draft of the journey-scoped notification template as a new
125
+ * version. Optionally roll back to a prior version by passing
126
+ * `{ "version": "vN" }`.
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * await client.journeys.templates.publish('x', {
131
+ * templateId: 'x',
132
+ * });
133
+ * ```
134
+ */
135
+ publish(notificationID: string, params: TemplatePublishParams, options?: RequestOptions): APIPromise<void> {
136
+ const { templateId, ...body } = params;
137
+ return this._client.post(path`/journeys/${templateId}/templates/${notificationID}/publish`, {
138
+ body,
139
+ ...options,
140
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
141
+ });
142
+ }
143
+
144
+ /**
145
+ * Replace the elemental content of a journey-scoped notification template.
146
+ * Overwrites all elements in the template draft with the provided content.
147
+ *
148
+ * @example
149
+ * ```ts
150
+ * const notificationContentMutationResponse =
151
+ * await client.journeys.templates.putContent('x', {
152
+ * templateId: 'x',
153
+ * content: {
154
+ * version: '2022-01-01',
155
+ * elements: [{ type: 'channel' }],
156
+ * },
157
+ * state: 'DRAFT',
158
+ * });
159
+ * ```
160
+ */
161
+ putContent(
162
+ notificationID: string,
163
+ params: TemplatePutContentParams,
164
+ options?: RequestOptions,
165
+ ): APIPromise<NotificationsAPI.NotificationContentMutationResponse> {
166
+ const { templateId, ...body } = params;
167
+ return this._client.put(path`/journeys/${templateId}/templates/${notificationID}/content`, {
168
+ body,
169
+ ...options,
170
+ });
171
+ }
172
+
173
+ /**
174
+ * Set locale-specific content overrides for a journey-scoped notification
175
+ * template. Each element override must reference an existing element by ID.
176
+ *
177
+ * @example
178
+ * ```ts
179
+ * const notificationContentMutationResponse =
180
+ * await client.journeys.templates.putLocale('x', {
181
+ * templateId: 'x',
182
+ * notificationId: 'x',
183
+ * elements: [
184
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
185
+ * { id: 'elem_2', title: 'Bienvenido!' },
186
+ * ],
187
+ * state: 'DRAFT',
188
+ * });
189
+ * ```
190
+ */
191
+ putLocale(
192
+ localeID: string,
193
+ params: TemplatePutLocaleParams,
194
+ options?: RequestOptions,
195
+ ): APIPromise<NotificationsAPI.NotificationContentMutationResponse> {
196
+ const { templateId, notificationId, ...body } = params;
197
+ return this._client.put(path`/journeys/${templateId}/templates/${notificationId}/locales/${localeID}`, {
198
+ body,
199
+ ...options,
200
+ });
201
+ }
202
+
203
+ /**
204
+ * Replace the journey-scoped notification template draft.
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * const journeyTemplateGetResponse =
209
+ * await client.journeys.templates.replace('x', {
210
+ * templateId: 'x',
211
+ * notification: {
212
+ * brand: { id: 'id' },
213
+ * content: { elements: [{}], version: '2022-01-01' },
214
+ * name: 'name',
215
+ * subscription: { topic_id: 'topic_id' },
216
+ * tags: ['string'],
217
+ * },
218
+ * });
219
+ * ```
220
+ */
221
+ replace(
222
+ notificationID: string,
223
+ params: TemplateReplaceParams,
224
+ options?: RequestOptions,
225
+ ): APIPromise<JourneysAPI.JourneyTemplateGetResponse> {
226
+ const { templateId, ...body } = params;
227
+ return this._client.put(path`/journeys/${templateId}/templates/${notificationID}`, { body, ...options });
228
+ }
229
+
230
+ /**
231
+ * Retrieve the elemental content of a journey-scoped notification template. The
232
+ * response contains the versioned elements along with their content checksums,
233
+ * which can be used to detect changes between versions. Pass `?version=draft`
234
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
235
+ * historical version.
236
+ *
237
+ * @example
238
+ * ```ts
239
+ * const notificationContentGetResponse =
240
+ * await client.journeys.templates.retrieveContent('x', {
241
+ * templateId: 'x',
242
+ * });
243
+ * ```
244
+ */
245
+ retrieveContent(
246
+ notificationID: string,
247
+ params: TemplateRetrieveContentParams,
248
+ options?: RequestOptions,
249
+ ): APIPromise<NotificationsAPI.NotificationContentGetResponse> {
250
+ const { templateId, ...query } = params;
251
+ return this._client.get(path`/journeys/${templateId}/templates/${notificationID}/content`, {
252
+ query,
253
+ ...options,
254
+ });
255
+ }
256
+ }
257
+
258
+ export interface TemplateCreateParams {
259
+ channel: string;
260
+
261
+ notification: TemplateCreateParams.Notification;
262
+
263
+ providerKey?: string;
264
+
265
+ state?: string;
266
+ }
267
+
268
+ export namespace TemplateCreateParams {
269
+ export interface Notification {
270
+ brand: Notification.Brand | null;
271
+
272
+ content: Notification.Content;
273
+
274
+ name: string;
275
+
276
+ subscription: Notification.Subscription | null;
277
+
278
+ tags: Array<string>;
279
+ }
280
+
281
+ export namespace Notification {
282
+ export interface Brand {
283
+ id: string;
284
+ }
285
+
286
+ export interface Content {
287
+ elements: Array<Shared.ElementalNode>;
288
+
289
+ version: '2022-01-01';
290
+
291
+ scope?: 'default' | 'strict';
292
+ }
293
+
294
+ export interface Subscription {
295
+ topic_id: string;
296
+ }
297
+ }
298
+ }
299
+
300
+ export interface TemplateRetrieveParams {
301
+ /**
302
+ * Journey id
303
+ */
304
+ templateId: string;
305
+ }
306
+
307
+ export interface TemplateListParams {
308
+ /**
309
+ * Pagination cursor from a prior response.
310
+ */
311
+ cursor?: string;
312
+
313
+ /**
314
+ * Page size. Minimum 1, maximum 100.
315
+ */
316
+ limit?: number;
317
+ }
318
+
319
+ export interface TemplateArchiveParams {
320
+ /**
321
+ * Journey id
322
+ */
323
+ templateId: string;
324
+ }
325
+
326
+ export interface TemplateListVersionsParams {
327
+ /**
328
+ * Journey id
329
+ */
330
+ templateId: string;
331
+ }
332
+
333
+ export interface TemplatePublishParams {
334
+ /**
335
+ * Path param: Journey id
336
+ */
337
+ templateId: string;
338
+
339
+ /**
340
+ * Body param
341
+ */
342
+ version?: string;
343
+ }
344
+
345
+ export interface TemplatePutContentParams {
346
+ /**
347
+ * Path param: Journey id
348
+ */
349
+ templateId: string;
350
+
351
+ /**
352
+ * Body param: Elemental content payload. The server defaults `version` when
353
+ * omitted.
354
+ */
355
+ content: TemplatePutContentParams.Content;
356
+
357
+ /**
358
+ * Body param: Template state. Defaults to `DRAFT`.
359
+ */
360
+ state?: NotificationsAPI.NotificationTemplateState;
361
+ }
362
+
363
+ export namespace TemplatePutContentParams {
364
+ /**
365
+ * Elemental content payload. The server defaults `version` when omitted.
366
+ */
367
+ export interface Content {
368
+ elements: Array<Shared.ElementalNode>;
369
+
370
+ /**
371
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
372
+ * omitted.
373
+ */
374
+ version?: string;
375
+ }
376
+ }
377
+
378
+ export interface TemplatePutLocaleParams {
379
+ /**
380
+ * Path param: Journey id
381
+ */
382
+ templateId: string;
383
+
384
+ /**
385
+ * Path param: Notification template id
386
+ */
387
+ notificationId: string;
388
+
389
+ /**
390
+ * Body param: Elements with locale-specific content overrides.
391
+ */
392
+ elements: Array<TemplatePutLocaleParams.Element>;
393
+
394
+ /**
395
+ * Body param: Template state. Defaults to `DRAFT`.
396
+ */
397
+ state?: NotificationsAPI.NotificationTemplateState;
398
+ }
399
+
400
+ export namespace TemplatePutLocaleParams {
401
+ export interface Element {
402
+ /**
403
+ * Target element ID.
404
+ */
405
+ id: string;
406
+
407
+ [k: string]: unknown;
408
+ }
409
+ }
410
+
411
+ export interface TemplateReplaceParams {
412
+ /**
413
+ * Path param: Journey id
414
+ */
415
+ templateId: string;
416
+
417
+ /**
418
+ * Body param
419
+ */
420
+ notification: TemplateReplaceParams.Notification;
421
+
422
+ /**
423
+ * Body param
424
+ */
425
+ state?: string;
426
+ }
427
+
428
+ export namespace TemplateReplaceParams {
429
+ export interface Notification {
430
+ brand: Notification.Brand | null;
431
+
432
+ content: Notification.Content;
433
+
434
+ name: string;
435
+
436
+ subscription: Notification.Subscription | null;
437
+
438
+ tags: Array<string>;
439
+ }
440
+
441
+ export namespace Notification {
442
+ export interface Brand {
443
+ id: string;
444
+ }
445
+
446
+ export interface Content {
447
+ elements: Array<Shared.ElementalNode>;
448
+
449
+ version: '2022-01-01';
450
+
451
+ scope?: 'default' | 'strict';
452
+ }
453
+
454
+ export interface Subscription {
455
+ topic_id: string;
456
+ }
457
+ }
458
+ }
459
+
460
+ export interface TemplateRetrieveContentParams {
461
+ /**
462
+ * Path param: Journey id
463
+ */
464
+ templateId: string;
465
+
466
+ /**
467
+ * Query param: Accepts `draft`, `published`, or a version string (e.g., `v001`).
468
+ * Defaults to `published`.
469
+ */
470
+ version?: string;
471
+ }
472
+
473
+ export declare namespace Templates {
474
+ export {
475
+ type TemplateCreateParams as TemplateCreateParams,
476
+ type TemplateRetrieveParams as TemplateRetrieveParams,
477
+ type TemplateListParams as TemplateListParams,
478
+ type TemplateArchiveParams as TemplateArchiveParams,
479
+ type TemplateListVersionsParams as TemplateListVersionsParams,
480
+ type TemplatePublishParams as TemplatePublishParams,
481
+ type TemplatePutContentParams as TemplatePutContentParams,
482
+ type TemplatePutLocaleParams as TemplatePutLocaleParams,
483
+ type TemplateReplaceParams as TemplateReplaceParams,
484
+ type TemplateRetrieveContentParams as TemplateRetrieveContentParams,
485
+ };
486
+ }
@@ -1,174 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { RequestOptions } from '../internal/request-options';
6
- import { path } from '../internal/utils/path';
7
-
8
- export class Journeys extends APIResource {
9
- /**
10
- * Get the list of journeys.
11
- *
12
- * @example
13
- * ```ts
14
- * const journeysListResponse = await client.journeys.list();
15
- * ```
16
- */
17
- list(
18
- query: JourneyListParams | null | undefined = {},
19
- options?: RequestOptions,
20
- ): APIPromise<JourneysListResponse> {
21
- return this._client.get('/journeys', { query, ...options });
22
- }
23
-
24
- /**
25
- * Invoke a journey run from a journey template.
26
- *
27
- * @example
28
- * ```ts
29
- * const journeysInvokeResponse = await client.journeys.invoke(
30
- * 'templateId',
31
- * {
32
- * data: { order_id: 'order-456', amount: 99.99 },
33
- * user_id: 'user-123',
34
- * },
35
- * );
36
- * ```
37
- */
38
- invoke(
39
- templateID: string,
40
- body: JourneyInvokeParams,
41
- options?: RequestOptions,
42
- ): APIPromise<JourneysInvokeResponse> {
43
- return this._client.post(path`/journeys/${templateID}/invoke`, { body, ...options });
44
- }
45
- }
46
-
47
- /**
48
- * A journey template representing an automation workflow.
49
- */
50
- export interface Journey {
51
- /**
52
- * The unique identifier of the journey.
53
- */
54
- id: string;
55
-
56
- /**
57
- * The name of the journey.
58
- */
59
- name: string;
60
-
61
- /**
62
- * The version of the journey (published or draft).
63
- */
64
- version: 'published' | 'draft';
65
-
66
- /**
67
- * ISO 8601 timestamp when the journey was created.
68
- */
69
- createdAt?: string;
70
-
71
- /**
72
- * ISO 8601 timestamp when the journey was last updated.
73
- */
74
- updatedAt?: string;
75
- }
76
-
77
- /**
78
- * Request body for invoking a journey. Requires either a user identifier or a
79
- * profile with contact information. User identifiers can be provided via user_id
80
- * field, or resolved from profile/data objects (user_id, userId, or anonymousId
81
- * fields).
82
- */
83
- export interface JourneysInvokeRequest {
84
- /**
85
- * Data payload passed to the journey. The expected shape can be predefined using
86
- * the schema builder in the journey editor. This data is available in journey
87
- * steps for condition evaluation and template variable interpolation. Can also
88
- * contain user identifiers (user_id, userId, anonymousId) if not provided
89
- * elsewhere.
90
- */
91
- data?: { [key: string]: unknown };
92
-
93
- /**
94
- * Profile data for the user. Can contain contact information (email,
95
- * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
96
- * profile fields. Profile fields are merged with any existing stored profile for
97
- * the user. Include context.tenant_id to load a tenant-scoped profile for
98
- * multi-tenant scenarios.
99
- */
100
- profile?: { [key: string]: unknown };
101
-
102
- /**
103
- * A unique identifier for the user. If not provided, the system will attempt to
104
- * resolve the user identifier from profile or data objects.
105
- */
106
- user_id?: string;
107
- }
108
-
109
- export interface JourneysInvokeResponse {
110
- /**
111
- * A unique identifier for the journey run that was created.
112
- */
113
- runId: string;
114
- }
115
-
116
- export interface JourneysListResponse {
117
- /**
118
- * A cursor token for pagination. Present when there are more results available.
119
- */
120
- cursor?: string;
121
-
122
- templates?: Array<Journey>;
123
- }
124
-
125
- export interface JourneyListParams {
126
- /**
127
- * A cursor token for pagination. Use the cursor from the previous response to
128
- * fetch the next page of results.
129
- */
130
- cursor?: string;
131
-
132
- /**
133
- * The version of journeys to retrieve. Accepted values are published (for
134
- * published journeys) or draft (for draft journeys). Defaults to published.
135
- */
136
- version?: 'published' | 'draft';
137
- }
138
-
139
- export interface JourneyInvokeParams {
140
- /**
141
- * Data payload passed to the journey. The expected shape can be predefined using
142
- * the schema builder in the journey editor. This data is available in journey
143
- * steps for condition evaluation and template variable interpolation. Can also
144
- * contain user identifiers (user_id, userId, anonymousId) if not provided
145
- * elsewhere.
146
- */
147
- data?: { [key: string]: unknown };
148
-
149
- /**
150
- * Profile data for the user. Can contain contact information (email,
151
- * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
152
- * profile fields. Profile fields are merged with any existing stored profile for
153
- * the user. Include context.tenant_id to load a tenant-scoped profile for
154
- * multi-tenant scenarios.
155
- */
156
- profile?: { [key: string]: unknown };
157
-
158
- /**
159
- * A unique identifier for the user. If not provided, the system will attempt to
160
- * resolve the user identifier from profile or data objects.
161
- */
162
- user_id?: string;
163
- }
164
-
165
- export declare namespace Journeys {
166
- export {
167
- type Journey as Journey,
168
- type JourneysInvokeRequest as JourneysInvokeRequest,
169
- type JourneysInvokeResponse as JourneysInvokeResponse,
170
- type JourneysListResponse as JourneysListResponse,
171
- type JourneyListParams as JourneyListParams,
172
- type JourneyInvokeParams as JourneyInvokeParams,
173
- };
174
- }
3
+ export * from './journeys/index';
@@ -52,6 +52,17 @@ export class Messages extends APIResource {
52
52
  ): APIPromise<MessageHistoryResponse> {
53
53
  return this._client.get(path`/messages/${messageID}/history`, { query, ...options });
54
54
  }
55
+
56
+ /**
57
+ * Resend a previously sent message. The original send request is loaded from
58
+ * storage and a brand-new send is enqueued for the same recipient and content,
59
+ * producing a **new** `messageId` — the original message is not modified.
60
+ * Throttled by a per-message rate limit; a repeat inside the limit window returns
61
+ * `429 Too Many Requests`.
62
+ */
63
+ resend(messageID: string, options?: RequestOptions): APIPromise<MessageResendResponse> {
64
+ return this._client.post(path`/messages/${messageID}/resend`, options);
65
+ }
55
66
  }
56
67
 
57
68
  export interface MessageDetails {
@@ -244,6 +255,14 @@ export interface MessageHistoryResponse {
244
255
  results: Array<{ [key: string]: unknown }>;
245
256
  }
246
257
 
258
+ export interface MessageResendResponse {
259
+ /**
260
+ * The new message id for the resent message. It is distinct from the id of the
261
+ * original message that was resent.
262
+ */
263
+ messageId: string;
264
+ }
265
+
247
266
  export interface MessageListParams {
248
267
  /**
249
268
  * A boolean value that indicates whether archived messages should be included in
@@ -339,6 +358,7 @@ export declare namespace Messages {
339
358
  type MessageListResponse as MessageListResponse,
340
359
  type MessageContentResponse as MessageContentResponse,
341
360
  type MessageHistoryResponse as MessageHistoryResponse,
361
+ type MessageResendResponse as MessageResendResponse,
342
362
  type MessageListParams as MessageListParams,
343
363
  type MessageHistoryParams as MessageHistoryParams,
344
364
  };