@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,943 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as JourneysAPI from "./journeys.js";
3
+ import * as Shared from "../shared.js";
4
+ import * as TemplatesAPI from "./templates.js";
5
+ import { TemplateArchiveParams, TemplateCreateParams, TemplateListParams, TemplateListVersionsParams, TemplatePublishParams, TemplatePutContentParams, TemplatePutLocaleParams, TemplateReplaceParams, TemplateRetrieveContentParams, TemplateRetrieveParams, Templates } from "./templates.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { RequestOptions } from "../../internal/request-options.js";
8
+ export declare class Journeys extends APIResource {
9
+ templates: TemplatesAPI.Templates;
10
+ /**
11
+ * Create a journey. Defaults to `DRAFT` state; pass `state: "PUBLISHED"` to
12
+ * publish on create. Send nodes are not allowed on `POST`. The standard flow is:
13
+ * create the journey shell here, add notification templates with
14
+ * `POST /journeys/{templateId}/templates`, then wire them into the journey with
15
+ * `PUT /journeys/{templateId}`. Call `POST /journeys/{templateId}/publish` to
16
+ * publish a draft after the fact.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const journeyResponse = await client.journeys.create({
21
+ * name: 'Welcome Journey',
22
+ * nodes: [
23
+ * {
24
+ * id: 'trigger-1',
25
+ * type: 'trigger',
26
+ * trigger_type: 'api',
27
+ * },
28
+ * { id: 'send-1', type: 'send' },
29
+ * ],
30
+ * enabled: true,
31
+ * state: 'DRAFT',
32
+ * });
33
+ * ```
34
+ */
35
+ create(body: JourneyCreateParams, options?: RequestOptions): APIPromise<JourneyResponse>;
36
+ /**
37
+ * Fetch a journey by id. Pass `?version=draft` (default `published`) to retrieve
38
+ * the working draft, or `?version=vN` to retrieve a historical version.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const journeyResponse = await client.journeys.retrieve('x');
43
+ * ```
44
+ */
45
+ retrieve(templateID: string, query?: JourneyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<JourneyResponse>;
46
+ /**
47
+ * Get the list of journeys.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const journeysListResponse = await client.journeys.list();
52
+ * ```
53
+ */
54
+ list(query?: JourneyListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysListResponse>;
55
+ /**
56
+ * Archive a journey. Archived journeys cannot be invoked. Existing journey runs
57
+ * continue to completion.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * await client.journeys.archive('x');
62
+ * ```
63
+ */
64
+ archive(templateID: string, options?: RequestOptions): APIPromise<void>;
65
+ /**
66
+ * Cancel journey runs. The request body must include EXACTLY ONE of
67
+ * `cancelation_token` (cancels every run associated with the token) or `run_id`
68
+ * (cancels a single tenant-scoped run). Supplying both or neither returns a `400`.
69
+ * A `run_id` that does not match a run for the tenant returns `404`. Cancelation
70
+ * is idempotent: a run that has already finished (`PROCESSED`/`ERROR`) or was
71
+ * already `CANCELED` is left unchanged and its current status is returned.
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const cancelJourneyResponse = await client.journeys.cancel({
76
+ * cancelation_token: 'order-1234',
77
+ * });
78
+ * ```
79
+ */
80
+ cancel(body: JourneyCancelParams, options?: RequestOptions): APIPromise<CancelJourneyResponse>;
81
+ /**
82
+ * Invoke a journey by id or alias to start a new run. The response includes a
83
+ * `runId` identifying the run.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const journeysInvokeResponse = await client.journeys.invoke(
88
+ * 'templateId',
89
+ * {
90
+ * data: { order_id: 'order-456', amount: 99.99 },
91
+ * user_id: 'user-123',
92
+ * },
93
+ * );
94
+ * ```
95
+ */
96
+ invoke(templateID: string, body: JourneyInvokeParams, options?: RequestOptions): APIPromise<JourneysInvokeResponse>;
97
+ /**
98
+ * List published versions of a journey, ordered most recent first.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const journeyVersionsListResponse =
103
+ * await client.journeys.listVersions('x');
104
+ * ```
105
+ */
106
+ listVersions(templateID: string, options?: RequestOptions): APIPromise<JourneyVersionsListResponse>;
107
+ /**
108
+ * Publish the current draft as a new version. Body is optional; pass
109
+ * `{ "version": "vN" }` to roll back to a prior version instead. Returns 404 if
110
+ * the journey has no draft to publish.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const journeyResponse = await client.journeys.publish('x');
115
+ * ```
116
+ */
117
+ publish(templateID: string, body?: JourneyPublishParams | null | undefined, options?: RequestOptions): APIPromise<JourneyResponse>;
118
+ /**
119
+ * Replace the journey draft. Updates the working draft only; call
120
+ * `POST /journeys/{templateId}/publish` to make it live, or pass
121
+ * `state: "PUBLISHED"` in this request to publish immediately. Send-node
122
+ * `template` ids must already exist and be scoped to this journey, and node ids
123
+ * must not be claimed by another journey.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * const journeyResponse = await client.journeys.replace('x', {
128
+ * name: 'Welcome Journey v2',
129
+ * nodes: [],
130
+ * enabled: true,
131
+ * state: 'DRAFT',
132
+ * });
133
+ * ```
134
+ */
135
+ replace(templateID: string, body: JourneyReplaceParams, options?: RequestOptions): APIPromise<JourneyResponse>;
136
+ }
137
+ /**
138
+ * Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of
139
+ * `cancelation_token` (cancels every run associated with the token) or `run_id`
140
+ * (cancels a single tenant-scoped run).
141
+ */
142
+ export type CancelJourneyRequest = CancelJourneyRequest.ByCancelationToken | CancelJourneyRequest.ByRunID;
143
+ export declare namespace CancelJourneyRequest {
144
+ interface ByCancelationToken {
145
+ cancelation_token: string;
146
+ }
147
+ interface ByRunID {
148
+ run_id: string;
149
+ }
150
+ }
151
+ /**
152
+ * `202 Accepted` body for `POST /journeys/cancel`, returning the submitted
153
+ * identifier. When called with `cancelation_token`, returns
154
+ * `{ cancelation_token }`; when called with `run_id`, returns
155
+ * `{ run_id, status }`.
156
+ */
157
+ export type CancelJourneyResponse = CancelJourneyResponse.TokenBranch | CancelJourneyResponse.RunIDBranch;
158
+ export declare namespace CancelJourneyResponse {
159
+ interface TokenBranch {
160
+ cancelation_token: string;
161
+ }
162
+ interface RunIDBranch {
163
+ run_id: string;
164
+ /**
165
+ * The run's resulting status. `CANCELED` when the run was active and has been
166
+ * canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
167
+ * unchanged; `CANCELED` for an already-canceled run.
168
+ */
169
+ status: string;
170
+ }
171
+ }
172
+ /**
173
+ * Request body for creating a journey.
174
+ */
175
+ export interface CreateJourneyRequest {
176
+ name: string;
177
+ nodes: Array<JourneyNode>;
178
+ enabled?: boolean;
179
+ /**
180
+ * Lifecycle state of a journey.
181
+ */
182
+ state?: JourneyState;
183
+ }
184
+ /**
185
+ * A journey template representing an automation workflow.
186
+ */
187
+ export interface Journey {
188
+ /**
189
+ * The unique identifier of the journey.
190
+ */
191
+ id: string;
192
+ /**
193
+ * The name of the journey.
194
+ */
195
+ name: string;
196
+ /**
197
+ * The version of the journey (published or draft).
198
+ */
199
+ version: 'published' | 'draft';
200
+ /**
201
+ * ISO 8601 timestamp when the journey was created.
202
+ */
203
+ createdAt?: string;
204
+ /**
205
+ * ISO 8601 timestamp when the journey was last updated.
206
+ */
207
+ updatedAt?: string;
208
+ }
209
+ /**
210
+ * Invoke an AI step with `user_prompt` and optional `web_search`. Returns a
211
+ * structured response conforming to `output_schema`.
212
+ */
213
+ export interface JourneyAINode {
214
+ /**
215
+ * A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
216
+ */
217
+ output_schema: {
218
+ [key: string]: unknown;
219
+ };
220
+ type: 'ai';
221
+ id?: string;
222
+ /**
223
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
224
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
225
+ * express "no conditions".
226
+ */
227
+ conditions?: JourneyConditionsField;
228
+ model?: string;
229
+ user_prompt?: string;
230
+ web_search?: boolean;
231
+ }
232
+ /**
233
+ * Trigger fired when the journey is invoked via the API. The optional `schema`
234
+ * field is a JSON Schema that validates the invocation payload.
235
+ */
236
+ export interface JourneyAPIInvokeTriggerNode {
237
+ trigger_type: 'api-invoke';
238
+ type: 'trigger';
239
+ id?: string;
240
+ /**
241
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
242
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
243
+ * express "no conditions".
244
+ */
245
+ conditions?: JourneyConditionsField;
246
+ /**
247
+ * A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
248
+ */
249
+ schema?: {
250
+ [key: string]: unknown;
251
+ };
252
+ }
253
+ /**
254
+ * A single condition expressed as a positional tuple of strings.
255
+ *
256
+ * - Binary form (3 elements): `[path, operator, value]` where `operator` is one of
257
+ * `is equal`, `is not equal`, `contains`, `does not contain`, `starts with`,
258
+ * `ends with`, `greater than`, `greater than or equal`, `less than`,
259
+ * `less than or equal`.
260
+ *
261
+ * Example: `["user.tier", "is equal", "gold"]`.
262
+ *
263
+ * - Unary form (2 elements): `[path, operator]` where `operator` is one of
264
+ * `exists`, `does not exist`.
265
+ *
266
+ * Example: `["user.email", "exists"]`.
267
+ *
268
+ * The first element is a non-empty dot-path. The second element is the operator
269
+ * (must come from one of the two operator sets above). For the binary form, the
270
+ * third element is the comparison value (string). Runtime validation of the
271
+ * operator value and arity is performed by the backend; SDKs surface this as a
272
+ * string list.
273
+ */
274
+ export type JourneyConditionAtom = Array<string>;
275
+ /**
276
+ * A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime;
277
+ * each is a list of `JourneyConditionAtom` tuples.
278
+ */
279
+ export interface JourneyConditionGroup {
280
+ AND?: Array<JourneyConditionAtom>;
281
+ OR?: Array<JourneyConditionAtom>;
282
+ }
283
+ /**
284
+ * A nested condition group. Exactly one of `AND` or `OR` must be present at
285
+ * runtime; each is a list of `JourneyConditionGroup` items.
286
+ */
287
+ export interface JourneyConditionNestedGroup {
288
+ AND?: Array<JourneyConditionGroup>;
289
+ OR?: Array<JourneyConditionGroup>;
290
+ }
291
+ /**
292
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
293
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
294
+ * express "no conditions".
295
+ */
296
+ export type JourneyConditionsField = JourneyConditionAtom | JourneyConditionGroup | JourneyConditionNestedGroup;
297
+ /**
298
+ * Pause the journey run for a fixed `duration`.
299
+ */
300
+ export interface JourneyDelayDurationNode {
301
+ duration: string;
302
+ mode: 'duration';
303
+ type: 'delay';
304
+ id?: string;
305
+ /**
306
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
307
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
308
+ * express "no conditions".
309
+ */
310
+ conditions?: JourneyConditionsField;
311
+ }
312
+ /**
313
+ * Pause the journey run `until` a specific time.
314
+ */
315
+ export interface JourneyDelayUntilNode {
316
+ mode: 'until';
317
+ type: 'delay';
318
+ until: string;
319
+ id?: string;
320
+ /**
321
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
322
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
323
+ * express "no conditions".
324
+ */
325
+ conditions?: JourneyConditionsField;
326
+ }
327
+ /**
328
+ * Terminate the journey run.
329
+ */
330
+ export interface JourneyExitNode {
331
+ type: 'exit';
332
+ id?: string;
333
+ }
334
+ /**
335
+ * A/B experiment config for a send node. The recipient is deterministically
336
+ * bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
337
+ * its `weight`. Present on a send node INSTEAD OF `message.template`.
338
+ */
339
+ export interface JourneyExperiment {
340
+ /**
341
+ * The value used to deterministically assign a recipient to a variant. Must be
342
+ * non-empty with no leading or trailing whitespace.
343
+ */
344
+ bucketingKey: string;
345
+ /**
346
+ * Between 2 and 10 weighted template variants.
347
+ */
348
+ variants: Array<JourneyExperimentVariant>;
349
+ /**
350
+ * Unique experiment id (prefixed `exp_`). Omit to have one generated
351
+ * automatically; when supplied it must be a valid `exp_` id.
352
+ */
353
+ id?: string;
354
+ /**
355
+ * Optional display name for the experiment.
356
+ */
357
+ name?: string;
358
+ }
359
+ /**
360
+ * A single weighted variant of an experiment. Variant ids must be unique within
361
+ * the experiment and the sum of all variant weights must be greater than 0.
362
+ * Weights are relative (no sum-to-100 requirement) — routing normalizes them
363
+ * proportionally.
364
+ */
365
+ export interface JourneyExperimentVariant {
366
+ id: string;
367
+ /**
368
+ * The notification template sent for this variant.
369
+ */
370
+ templateId: string;
371
+ /**
372
+ * Relative routing weight. Must be non-negative.
373
+ */
374
+ weight: number;
375
+ /**
376
+ * Optional display name for the variant.
377
+ */
378
+ name?: string;
379
+ }
380
+ /**
381
+ * Issue an HTTP GET or DELETE request and merge the response into the journey
382
+ * state per `merge_strategy`.
383
+ */
384
+ export interface JourneyFetchGetDeleteNode {
385
+ /**
386
+ * Strategy for merging a fetch response into the journey run state.
387
+ */
388
+ merge_strategy: JourneyMergeStrategy;
389
+ method: 'get' | 'delete';
390
+ type: 'fetch';
391
+ url: string;
392
+ id?: string;
393
+ /**
394
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
395
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
396
+ * express "no conditions".
397
+ */
398
+ conditions?: JourneyConditionsField;
399
+ headers?: {
400
+ [key: string]: string;
401
+ };
402
+ query_params?: {
403
+ [key: string]: string;
404
+ };
405
+ /**
406
+ * A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
407
+ */
408
+ response_schema?: {
409
+ [key: string]: unknown;
410
+ };
411
+ }
412
+ /**
413
+ * Issue an HTTP POST or PUT request with a `body` and merge the response into the
414
+ * journey state per `merge_strategy`.
415
+ */
416
+ export interface JourneyFetchPostPutNode {
417
+ /**
418
+ * Strategy for merging a fetch response into the journey run state.
419
+ */
420
+ merge_strategy: JourneyMergeStrategy;
421
+ method: 'post' | 'put';
422
+ type: 'fetch';
423
+ url: string;
424
+ id?: string;
425
+ body?: string;
426
+ /**
427
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
428
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
429
+ * express "no conditions".
430
+ */
431
+ conditions?: JourneyConditionsField;
432
+ headers?: {
433
+ [key: string]: string;
434
+ };
435
+ query_params?: {
436
+ [key: string]: string;
437
+ };
438
+ /**
439
+ * A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
440
+ */
441
+ response_schema?: {
442
+ [key: string]: unknown;
443
+ };
444
+ }
445
+ /**
446
+ * Strategy for merging a fetch response into the journey run state.
447
+ */
448
+ export type JourneyMergeStrategy = 'overwrite' | 'soft-merge' | 'replace' | 'none';
449
+ /**
450
+ * A single node in a journey DAG. Discriminated by `type`, with a secondary
451
+ * discriminator on some variants (`trigger_type` for trigger, `mode` for delay,
452
+ * `method` for fetch, `scope` for throttle).
453
+ */
454
+ export type JourneyNode = JourneyAPIInvokeTriggerNode | JourneySegmentTriggerNode | JourneySendNode | JourneyDelayDurationNode | JourneyDelayUntilNode | JourneyFetchGetDeleteNode | JourneyFetchPostPutNode | JourneyAINode | JourneyThrottleStaticNode | JourneyThrottleDynamicNode | JourneyNode.JourneyBatchNode | JourneyNode.JourneyAddToDigestNode | JourneyExitNode | JourneyNode.JourneyBranchNode;
455
+ export declare namespace JourneyNode {
456
+ /**
457
+ * Collect events arriving at the node into a single batch and fire one downstream
458
+ * step with the aggregated payload. The first event into a batch owns the run;
459
+ * later contributing events terminate at the batch step. The batch releases when
460
+ * any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
461
+ * `max_wait_period` ceiling hits.
462
+ */
463
+ interface JourneyBatchNode {
464
+ /**
465
+ * ISO 8601 duration. Hard ceiling from the first event into the batch; releases
466
+ * the batch unconditionally when it elapses.
467
+ */
468
+ max_wait_period: string;
469
+ /**
470
+ * How to select which collected events to retain in the aggregated payload when
471
+ * the batch releases.
472
+ */
473
+ retain: JourneyBatchNode.Retain;
474
+ scope: 'user';
475
+ type: 'batch';
476
+ /**
477
+ * ISO 8601 duration. Quiet window that releases the batch when it elapses with no
478
+ * new contributing events. Must be less than `max_wait_period`.
479
+ */
480
+ wait_period: string;
481
+ id?: string;
482
+ /**
483
+ * Optional partition key. Events with the same `category_key` are batched
484
+ * together; events with different values are batched separately.
485
+ */
486
+ category_key?: string;
487
+ /**
488
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
489
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
490
+ * express "no conditions".
491
+ */
492
+ conditions?: JourneysAPI.JourneyConditionsField;
493
+ /**
494
+ * Releases the batch once this many events have been collected.
495
+ */
496
+ max_items?: number;
497
+ }
498
+ namespace JourneyBatchNode {
499
+ /**
500
+ * How to select which collected events to retain in the aggregated payload when
501
+ * the batch releases.
502
+ */
503
+ interface Retain {
504
+ count: number;
505
+ type: 'first' | 'last' | 'highest' | 'lowest';
506
+ /**
507
+ * Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
508
+ * `highest` or `lowest`.
509
+ */
510
+ sort_key?: string;
511
+ }
512
+ }
513
+ /**
514
+ * Add the current event to a digest keyed by the given subscription topic. The
515
+ * digest accumulates events and releases them on the schedule configured for the
516
+ * topic.
517
+ */
518
+ interface JourneyAddToDigestNode {
519
+ /**
520
+ * The subscription topic that owns the digest the event is added to.
521
+ */
522
+ subscription_topic_id: string;
523
+ type: 'add-to-digest';
524
+ id?: string;
525
+ /**
526
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
527
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
528
+ * express "no conditions".
529
+ */
530
+ conditions?: JourneysAPI.JourneyConditionsField;
531
+ }
532
+ /**
533
+ * Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
534
+ * else falls through to `default.nodes`.
535
+ */
536
+ interface JourneyBranchNode {
537
+ default: JourneyBranchNode.Default;
538
+ paths: Array<JourneyBranchNode.Path>;
539
+ type: 'branch';
540
+ id?: string;
541
+ }
542
+ namespace JourneyBranchNode {
543
+ interface Default {
544
+ nodes: Array<JourneysAPI.JourneyNode>;
545
+ label?: string;
546
+ }
547
+ interface Path {
548
+ /**
549
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
550
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
551
+ * express "no conditions".
552
+ */
553
+ conditions: JourneysAPI.JourneyConditionsField;
554
+ nodes: Array<JourneysAPI.JourneyNode>;
555
+ label?: string;
556
+ }
557
+ }
558
+ }
559
+ /**
560
+ * Request body for publishing a journey. Pass `version` to roll back to a prior
561
+ * version; omit to publish the current draft.
562
+ */
563
+ export interface JourneyPublishRequest {
564
+ version?: string;
565
+ }
566
+ /**
567
+ * A journey, with its current draft or published nodes and metadata.
568
+ */
569
+ export interface JourneyResponse {
570
+ id: string;
571
+ created: number | null;
572
+ creator: string | null;
573
+ enabled: boolean;
574
+ name: string;
575
+ nodes: Array<JourneyNode>;
576
+ published: number | null;
577
+ /**
578
+ * Lifecycle state of a journey.
579
+ */
580
+ state: JourneyState;
581
+ updated: number | null;
582
+ updater: string | null;
583
+ }
584
+ /**
585
+ * Trigger fired by a segment event (`identify`, `group`, or `track`).
586
+ */
587
+ export interface JourneySegmentTriggerNode {
588
+ request_type: 'identify' | 'group' | 'track';
589
+ trigger_type: 'segment';
590
+ type: 'trigger';
591
+ id?: string;
592
+ /**
593
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
594
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
595
+ * express "no conditions".
596
+ */
597
+ conditions?: JourneyConditionsField;
598
+ event_id?: string;
599
+ }
600
+ /**
601
+ * Send to the recipient. A send node sources its content from EXACTLY ONE of
602
+ * `message.template` (a single notification template) or `experiment` (an A/B
603
+ * split across weighted template variants) — supplying both, or neither, is
604
+ * rejected. Optionally override the recipient address, delay the send, or attach
605
+ * `data`.
606
+ */
607
+ export interface JourneySendNode {
608
+ message: JourneySendNode.Message;
609
+ type: 'send';
610
+ id?: string;
611
+ /**
612
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
613
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
614
+ * express "no conditions".
615
+ */
616
+ conditions?: JourneyConditionsField;
617
+ /**
618
+ * A/B experiment config for a send node. The recipient is deterministically
619
+ * bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
620
+ * its `weight`. Present on a send node INSTEAD OF `message.template`.
621
+ */
622
+ experiment?: JourneyExperiment;
623
+ }
624
+ export declare namespace JourneySendNode {
625
+ interface Message {
626
+ data?: {
627
+ [key: string]: unknown;
628
+ };
629
+ delay?: Message.Delay;
630
+ template?: string;
631
+ to?: Message.To;
632
+ }
633
+ namespace Message {
634
+ interface Delay {
635
+ until: string;
636
+ timezone?: string;
637
+ }
638
+ interface To {
639
+ email_override?: string;
640
+ phone_number_override?: string;
641
+ user_id_override?: string;
642
+ }
643
+ }
644
+ }
645
+ /**
646
+ * Lifecycle state of a journey.
647
+ */
648
+ export type JourneyState = 'DRAFT' | 'PUBLISHED';
649
+ /**
650
+ * Request body for creating a notification template scoped to a journey.
651
+ */
652
+ export interface JourneyTemplateCreateRequest {
653
+ channel: string;
654
+ notification: JourneyTemplateCreateRequest.Notification;
655
+ providerKey?: string;
656
+ state?: string;
657
+ }
658
+ export declare namespace JourneyTemplateCreateRequest {
659
+ interface Notification {
660
+ brand: Notification.Brand | null;
661
+ content: Notification.Content;
662
+ name: string;
663
+ subscription: Notification.Subscription | null;
664
+ tags: Array<string>;
665
+ }
666
+ namespace Notification {
667
+ interface Brand {
668
+ id: string;
669
+ }
670
+ interface Content {
671
+ elements: Array<Shared.ElementalNode>;
672
+ version: '2022-01-01';
673
+ scope?: 'default' | 'strict';
674
+ }
675
+ interface Subscription {
676
+ topic_id: string;
677
+ }
678
+ }
679
+ }
680
+ /**
681
+ * A journey-scoped notification template.
682
+ */
683
+ export interface JourneyTemplateGetResponse {
684
+ id: string;
685
+ brand: JourneyTemplateGetResponse.Brand | null;
686
+ content: JourneyTemplateGetResponse.Content;
687
+ created: number;
688
+ creator: string;
689
+ name: string;
690
+ state: 'DRAFT' | 'PUBLISHED';
691
+ subscription: JourneyTemplateGetResponse.Subscription | null;
692
+ tags: Array<string>;
693
+ updated?: number;
694
+ updater?: string;
695
+ }
696
+ export declare namespace JourneyTemplateGetResponse {
697
+ interface Brand {
698
+ id: string;
699
+ }
700
+ interface Content {
701
+ elements: Array<Shared.ElementalNode>;
702
+ version: '2022-01-01';
703
+ scope?: 'default' | 'strict';
704
+ }
705
+ interface Subscription {
706
+ topic_id: string;
707
+ }
708
+ }
709
+ /**
710
+ * Paged list of journey-scoped notification templates.
711
+ */
712
+ export interface JourneyTemplateListResponse {
713
+ paging: Shared.Paging;
714
+ results: Array<JourneyTemplateSummary>;
715
+ }
716
+ /**
717
+ * Request body for publishing a journey-scoped notification template. Pass
718
+ * `version` to roll back to a prior version; omit to publish the current draft.
719
+ */
720
+ export interface JourneyTemplatePublishRequest {
721
+ version?: string;
722
+ }
723
+ /**
724
+ * Request body for replacing a journey-scoped notification template draft.
725
+ */
726
+ export interface JourneyTemplateReplaceRequest {
727
+ notification: JourneyTemplateReplaceRequest.Notification;
728
+ state?: string;
729
+ }
730
+ export declare namespace JourneyTemplateReplaceRequest {
731
+ interface Notification {
732
+ brand: Notification.Brand | null;
733
+ content: Notification.Content;
734
+ name: string;
735
+ subscription: Notification.Subscription | null;
736
+ tags: Array<string>;
737
+ }
738
+ namespace Notification {
739
+ interface Brand {
740
+ id: string;
741
+ }
742
+ interface Content {
743
+ elements: Array<Shared.ElementalNode>;
744
+ version: '2022-01-01';
745
+ scope?: 'default' | 'strict';
746
+ }
747
+ interface Subscription {
748
+ topic_id: string;
749
+ }
750
+ }
751
+ }
752
+ /**
753
+ * Summary fields of a journey-scoped notification template returned in list
754
+ * responses.
755
+ */
756
+ export interface JourneyTemplateSummary {
757
+ id: string;
758
+ created: number;
759
+ creator: string;
760
+ name: string;
761
+ state: string;
762
+ tags: Array<string>;
763
+ updated?: number;
764
+ updater?: string;
765
+ }
766
+ /**
767
+ * Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed`
768
+ * invocations per `period`.
769
+ */
770
+ export interface JourneyThrottleDynamicNode {
771
+ max_allowed: number;
772
+ period: string;
773
+ scope: 'dynamic';
774
+ throttle_key: string;
775
+ type: 'throttle';
776
+ id?: string;
777
+ /**
778
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
779
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
780
+ * express "no conditions".
781
+ */
782
+ conditions?: JourneyConditionsField;
783
+ }
784
+ /**
785
+ * Throttle the journey by a static `scope` (`user` or `global`), allowing at most
786
+ * `max_allowed` invocations per `period`.
787
+ */
788
+ export interface JourneyThrottleStaticNode {
789
+ max_allowed: number;
790
+ period: string;
791
+ scope: 'user' | 'global';
792
+ type: 'throttle';
793
+ id?: string;
794
+ /**
795
+ * Condition spec for a journey node. Accepts a single condition atom, an AND/OR
796
+ * group, or an AND/OR nested group. Omit the `conditions` property entirely to
797
+ * express "no conditions".
798
+ */
799
+ conditions?: JourneyConditionsField;
800
+ }
801
+ /**
802
+ * A published version of a journey.
803
+ */
804
+ export interface JourneyVersionItem {
805
+ created: number | null;
806
+ creator: string | null;
807
+ name: string;
808
+ published: number | null;
809
+ version: string;
810
+ }
811
+ /**
812
+ * Paged list of published journey versions, most recent first.
813
+ */
814
+ export interface JourneyVersionsListResponse {
815
+ paging: Shared.Paging;
816
+ results: Array<JourneyVersionItem>;
817
+ }
818
+ /**
819
+ * Request body for invoking a journey. Requires either a user identifier or a
820
+ * profile with contact information. User identifiers can be provided via user_id
821
+ * field, or resolved from profile/data objects (user_id, userId, or anonymousId
822
+ * fields).
823
+ */
824
+ export interface JourneysInvokeRequest {
825
+ /**
826
+ * Data payload passed to the journey. The expected shape can be predefined using
827
+ * the schema builder in the journey editor. This data is available in journey
828
+ * steps for condition evaluation and template variable interpolation. Can also
829
+ * contain user identifiers (user_id, userId, anonymousId) if not provided
830
+ * elsewhere.
831
+ */
832
+ data?: {
833
+ [key: string]: unknown;
834
+ };
835
+ /**
836
+ * Profile data for the user. Can contain contact information (email,
837
+ * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
838
+ * profile fields. Profile fields are merged with any existing stored profile for
839
+ * the user. Include context.tenant_id to load a tenant-scoped profile for
840
+ * multi-tenant scenarios.
841
+ */
842
+ profile?: {
843
+ [key: string]: unknown;
844
+ };
845
+ /**
846
+ * A unique identifier for the user. If not provided, the system will attempt to
847
+ * resolve the user identifier from profile or data objects.
848
+ */
849
+ user_id?: string;
850
+ }
851
+ export interface JourneysInvokeResponse {
852
+ /**
853
+ * A unique identifier for the journey run that was created.
854
+ */
855
+ runId: string;
856
+ }
857
+ export interface JourneysListResponse {
858
+ /**
859
+ * A cursor token for pagination. Present when there are more results available.
860
+ */
861
+ cursor?: string;
862
+ templates?: Array<Journey>;
863
+ }
864
+ export interface JourneyCreateParams {
865
+ name: string;
866
+ nodes: Array<JourneyNode>;
867
+ enabled?: boolean;
868
+ /**
869
+ * Lifecycle state of a journey.
870
+ */
871
+ state?: JourneyState;
872
+ }
873
+ export interface JourneyRetrieveParams {
874
+ /**
875
+ * Version selector: `draft`, `published` (default), or `vN`.
876
+ */
877
+ version?: string;
878
+ }
879
+ export interface JourneyListParams {
880
+ /**
881
+ * A cursor token for pagination. Use the cursor from the previous response to
882
+ * fetch the next page of results.
883
+ */
884
+ cursor?: string;
885
+ /**
886
+ * The version of journeys to retrieve. Accepted values are published (for
887
+ * published journeys) or draft (for draft journeys). Defaults to published.
888
+ */
889
+ version?: 'published' | 'draft';
890
+ }
891
+ export type JourneyCancelParams = JourneyCancelParams.ByCancelationToken | JourneyCancelParams.ByRunID;
892
+ export declare namespace JourneyCancelParams {
893
+ interface ByCancelationToken {
894
+ cancelation_token: string;
895
+ }
896
+ interface ByRunID {
897
+ run_id: string;
898
+ }
899
+ }
900
+ export interface JourneyInvokeParams {
901
+ /**
902
+ * Data payload passed to the journey. The expected shape can be predefined using
903
+ * the schema builder in the journey editor. This data is available in journey
904
+ * steps for condition evaluation and template variable interpolation. Can also
905
+ * contain user identifiers (user_id, userId, anonymousId) if not provided
906
+ * elsewhere.
907
+ */
908
+ data?: {
909
+ [key: string]: unknown;
910
+ };
911
+ /**
912
+ * Profile data for the user. Can contain contact information (email,
913
+ * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
914
+ * profile fields. Profile fields are merged with any existing stored profile for
915
+ * the user. Include context.tenant_id to load a tenant-scoped profile for
916
+ * multi-tenant scenarios.
917
+ */
918
+ profile?: {
919
+ [key: string]: unknown;
920
+ };
921
+ /**
922
+ * A unique identifier for the user. If not provided, the system will attempt to
923
+ * resolve the user identifier from profile or data objects.
924
+ */
925
+ user_id?: string;
926
+ }
927
+ export interface JourneyPublishParams {
928
+ version?: string;
929
+ }
930
+ export interface JourneyReplaceParams {
931
+ name: string;
932
+ nodes: Array<JourneyNode>;
933
+ enabled?: boolean;
934
+ /**
935
+ * Lifecycle state of a journey.
936
+ */
937
+ state?: JourneyState;
938
+ }
939
+ export declare namespace Journeys {
940
+ export { type CancelJourneyRequest as CancelJourneyRequest, type CancelJourneyResponse as CancelJourneyResponse, type CreateJourneyRequest as CreateJourneyRequest, type Journey as Journey, type JourneyAINode as JourneyAINode, type JourneyAPIInvokeTriggerNode as JourneyAPIInvokeTriggerNode, type JourneyConditionAtom as JourneyConditionAtom, type JourneyConditionGroup as JourneyConditionGroup, type JourneyConditionNestedGroup as JourneyConditionNestedGroup, type JourneyConditionsField as JourneyConditionsField, type JourneyDelayDurationNode as JourneyDelayDurationNode, type JourneyDelayUntilNode as JourneyDelayUntilNode, type JourneyExitNode as JourneyExitNode, type JourneyExperiment as JourneyExperiment, type JourneyExperimentVariant as JourneyExperimentVariant, type JourneyFetchGetDeleteNode as JourneyFetchGetDeleteNode, type JourneyFetchPostPutNode as JourneyFetchPostPutNode, type JourneyMergeStrategy as JourneyMergeStrategy, type JourneyNode as JourneyNode, type JourneyPublishRequest as JourneyPublishRequest, type JourneyResponse as JourneyResponse, type JourneySegmentTriggerNode as JourneySegmentTriggerNode, type JourneySendNode as JourneySendNode, type JourneyState as JourneyState, type JourneyTemplateCreateRequest as JourneyTemplateCreateRequest, type JourneyTemplateGetResponse as JourneyTemplateGetResponse, type JourneyTemplateListResponse as JourneyTemplateListResponse, type JourneyTemplatePublishRequest as JourneyTemplatePublishRequest, type JourneyTemplateReplaceRequest as JourneyTemplateReplaceRequest, type JourneyTemplateSummary as JourneyTemplateSummary, type JourneyThrottleDynamicNode as JourneyThrottleDynamicNode, type JourneyThrottleStaticNode as JourneyThrottleStaticNode, type JourneyVersionItem as JourneyVersionItem, type JourneyVersionsListResponse as JourneyVersionsListResponse, type JourneysInvokeRequest as JourneysInvokeRequest, type JourneysInvokeResponse as JourneysInvokeResponse, type JourneysListResponse as JourneysListResponse, type JourneyCreateParams as JourneyCreateParams, type JourneyRetrieveParams as JourneyRetrieveParams, type JourneyListParams as JourneyListParams, type JourneyCancelParams as JourneyCancelParams, type JourneyInvokeParams as JourneyInvokeParams, type JourneyPublishParams as JourneyPublishParams, type JourneyReplaceParams as JourneyReplaceParams, };
941
+ export { Templates as Templates, type TemplateCreateParams as TemplateCreateParams, type TemplateRetrieveParams as TemplateRetrieveParams, type TemplateListParams as TemplateListParams, type TemplateArchiveParams as TemplateArchiveParams, type TemplateListVersionsParams as TemplateListVersionsParams, type TemplatePublishParams as TemplatePublishParams, type TemplatePutContentParams as TemplatePutContentParams, type TemplatePutLocaleParams as TemplatePutLocaleParams, type TemplateReplaceParams as TemplateReplaceParams, type TemplateRetrieveContentParams as TemplateRetrieveContentParams, };
942
+ }
943
+ //# sourceMappingURL=journeys.d.ts.map