@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,213 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Templates = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const headers_1 = require("../../internal/headers.js");
7
+ const path_1 = require("../../internal/utils/path.js");
8
+ class Templates extends resource_1.APIResource {
9
+ /**
10
+ * Create a notification template scoped to this journey. Defaults to `DRAFT`
11
+ * state; pass `state: "PUBLISHED"` to publish on create.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const journeyTemplateGetResponse =
16
+ * await client.journeys.templates.create('x', {
17
+ * channel: 'email',
18
+ * notification: {
19
+ * name: 'Welcome email',
20
+ * tags: [],
21
+ * brand: null,
22
+ * subscription: null,
23
+ * content: {
24
+ * version: '2022-01-01',
25
+ * elements: [{ type: 'text' }],
26
+ * },
27
+ * },
28
+ * });
29
+ * ```
30
+ */
31
+ create(templateID, body, options) {
32
+ return this._client.post((0, path_1.path) `/journeys/${templateID}/templates`, { body, ...options });
33
+ }
34
+ /**
35
+ * Fetch a journey-scoped notification template by id. Pass `?version=draft`
36
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
37
+ * historical version.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const journeyTemplateGetResponse =
42
+ * await client.journeys.templates.retrieve('x', {
43
+ * templateId: 'x',
44
+ * });
45
+ * ```
46
+ */
47
+ retrieve(notificationID, params, options) {
48
+ const { templateId } = params;
49
+ return this._client.get((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}`, options);
50
+ }
51
+ /**
52
+ * List notification templates scoped to this journey. Journey-scoped notification
53
+ * templates can only be referenced from `send` nodes within the same journey.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const journeyTemplateListResponse =
58
+ * await client.journeys.templates.list('x');
59
+ * ```
60
+ */
61
+ list(templateID, query = {}, options) {
62
+ return this._client.get((0, path_1.path) `/journeys/${templateID}/templates`, { query, ...options });
63
+ }
64
+ /**
65
+ * Archive the journey-scoped notification template. Archived templates cannot be
66
+ * sent.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * await client.journeys.templates.archive('x', {
71
+ * templateId: 'x',
72
+ * });
73
+ * ```
74
+ */
75
+ archive(notificationID, params, options) {
76
+ const { templateId } = params;
77
+ return this._client.delete((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}`, {
78
+ ...options,
79
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
80
+ });
81
+ }
82
+ /**
83
+ * List published versions of the journey-scoped notification template, ordered
84
+ * most recent first.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const notificationTemplateVersionListResponse =
89
+ * await client.journeys.templates.listVersions('x', {
90
+ * templateId: 'x',
91
+ * });
92
+ * ```
93
+ */
94
+ listVersions(notificationID, params, options) {
95
+ const { templateId } = params;
96
+ return this._client.get((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/versions`, options);
97
+ }
98
+ /**
99
+ * Publish the current draft of the journey-scoped notification template as a new
100
+ * version. Optionally roll back to a prior version by passing
101
+ * `{ "version": "vN" }`.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * await client.journeys.templates.publish('x', {
106
+ * templateId: 'x',
107
+ * });
108
+ * ```
109
+ */
110
+ publish(notificationID, params, options) {
111
+ const { templateId, ...body } = params;
112
+ return this._client.post((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/publish`, {
113
+ body,
114
+ ...options,
115
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
116
+ });
117
+ }
118
+ /**
119
+ * Replace the elemental content of a journey-scoped notification template.
120
+ * Overwrites all elements in the template draft with the provided content.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * const notificationContentMutationResponse =
125
+ * await client.journeys.templates.putContent('x', {
126
+ * templateId: 'x',
127
+ * content: {
128
+ * version: '2022-01-01',
129
+ * elements: [{ type: 'channel' }],
130
+ * },
131
+ * state: 'DRAFT',
132
+ * });
133
+ * ```
134
+ */
135
+ putContent(notificationID, params, options) {
136
+ const { templateId, ...body } = params;
137
+ return this._client.put((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/content`, {
138
+ body,
139
+ ...options,
140
+ });
141
+ }
142
+ /**
143
+ * Set locale-specific content overrides for a journey-scoped notification
144
+ * template. Each element override must reference an existing element by ID.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * const notificationContentMutationResponse =
149
+ * await client.journeys.templates.putLocale('x', {
150
+ * templateId: 'x',
151
+ * notificationId: 'x',
152
+ * elements: [
153
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
154
+ * { id: 'elem_2', title: 'Bienvenido!' },
155
+ * ],
156
+ * state: 'DRAFT',
157
+ * });
158
+ * ```
159
+ */
160
+ putLocale(localeID, params, options) {
161
+ const { templateId, notificationId, ...body } = params;
162
+ return this._client.put((0, path_1.path) `/journeys/${templateId}/templates/${notificationId}/locales/${localeID}`, {
163
+ body,
164
+ ...options,
165
+ });
166
+ }
167
+ /**
168
+ * Replace the journey-scoped notification template draft.
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * const journeyTemplateGetResponse =
173
+ * await client.journeys.templates.replace('x', {
174
+ * templateId: 'x',
175
+ * notification: {
176
+ * brand: { id: 'id' },
177
+ * content: { elements: [{}], version: '2022-01-01' },
178
+ * name: 'name',
179
+ * subscription: { topic_id: 'topic_id' },
180
+ * tags: ['string'],
181
+ * },
182
+ * });
183
+ * ```
184
+ */
185
+ replace(notificationID, params, options) {
186
+ const { templateId, ...body } = params;
187
+ return this._client.put((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}`, { body, ...options });
188
+ }
189
+ /**
190
+ * Retrieve the elemental content of a journey-scoped notification template. The
191
+ * response contains the versioned elements along with their content checksums,
192
+ * which can be used to detect changes between versions. Pass `?version=draft`
193
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
194
+ * historical version.
195
+ *
196
+ * @example
197
+ * ```ts
198
+ * const notificationContentGetResponse =
199
+ * await client.journeys.templates.retrieveContent('x', {
200
+ * templateId: 'x',
201
+ * });
202
+ * ```
203
+ */
204
+ retrieveContent(notificationID, params, options) {
205
+ const { templateId, ...query } = params;
206
+ return this._client.get((0, path_1.path) `/journeys/${templateId}/templates/${notificationID}/content`, {
207
+ query,
208
+ ...options,
209
+ });
210
+ }
211
+ }
212
+ exports.Templates = Templates;
213
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAkB,EAClB,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,cAAsB,EACtB,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,cAAc,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,UAAkB,EAClB,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAA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,cAAc,cAAc,UAAU,EAAE;YACzF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CACP,QAAgB,EAChB,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,cAAc,cAAc,YAAY,QAAQ,EAAE,EAAE;YACrG,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CACL,cAAsB,EACtB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,cAAc,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,eAAe,CACb,cAAsB,EACtB,MAAqC,EACrC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,UAAU,cAAc,cAAc,UAAU,EAAE;YACzF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AApPD,8BAoPC"}
@@ -0,0 +1,209 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { buildHeaders } from "../../internal/headers.mjs";
4
+ import { path } from "../../internal/utils/path.mjs";
5
+ export class Templates extends APIResource {
6
+ /**
7
+ * Create a notification template scoped to this journey. Defaults to `DRAFT`
8
+ * state; pass `state: "PUBLISHED"` to publish on create.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const journeyTemplateGetResponse =
13
+ * await client.journeys.templates.create('x', {
14
+ * channel: 'email',
15
+ * notification: {
16
+ * name: 'Welcome email',
17
+ * tags: [],
18
+ * brand: null,
19
+ * subscription: null,
20
+ * content: {
21
+ * version: '2022-01-01',
22
+ * elements: [{ type: 'text' }],
23
+ * },
24
+ * },
25
+ * });
26
+ * ```
27
+ */
28
+ create(templateID, body, options) {
29
+ return this._client.post(path `/journeys/${templateID}/templates`, { body, ...options });
30
+ }
31
+ /**
32
+ * Fetch a journey-scoped notification template by id. Pass `?version=draft`
33
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
34
+ * historical version.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const journeyTemplateGetResponse =
39
+ * await client.journeys.templates.retrieve('x', {
40
+ * templateId: 'x',
41
+ * });
42
+ * ```
43
+ */
44
+ retrieve(notificationID, params, options) {
45
+ const { templateId } = params;
46
+ return this._client.get(path `/journeys/${templateId}/templates/${notificationID}`, options);
47
+ }
48
+ /**
49
+ * List notification templates scoped to this journey. Journey-scoped notification
50
+ * templates can only be referenced from `send` nodes within the same journey.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const journeyTemplateListResponse =
55
+ * await client.journeys.templates.list('x');
56
+ * ```
57
+ */
58
+ list(templateID, query = {}, options) {
59
+ return this._client.get(path `/journeys/${templateID}/templates`, { query, ...options });
60
+ }
61
+ /**
62
+ * Archive the journey-scoped notification template. Archived templates cannot be
63
+ * sent.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * await client.journeys.templates.archive('x', {
68
+ * templateId: 'x',
69
+ * });
70
+ * ```
71
+ */
72
+ archive(notificationID, params, options) {
73
+ const { templateId } = params;
74
+ return this._client.delete(path `/journeys/${templateId}/templates/${notificationID}`, {
75
+ ...options,
76
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
77
+ });
78
+ }
79
+ /**
80
+ * List published versions of the journey-scoped notification template, ordered
81
+ * most recent first.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const notificationTemplateVersionListResponse =
86
+ * await client.journeys.templates.listVersions('x', {
87
+ * templateId: 'x',
88
+ * });
89
+ * ```
90
+ */
91
+ listVersions(notificationID, params, options) {
92
+ const { templateId } = params;
93
+ return this._client.get(path `/journeys/${templateId}/templates/${notificationID}/versions`, options);
94
+ }
95
+ /**
96
+ * Publish the current draft of the journey-scoped notification template as a new
97
+ * version. Optionally roll back to a prior version by passing
98
+ * `{ "version": "vN" }`.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * await client.journeys.templates.publish('x', {
103
+ * templateId: 'x',
104
+ * });
105
+ * ```
106
+ */
107
+ publish(notificationID, params, options) {
108
+ const { templateId, ...body } = params;
109
+ return this._client.post(path `/journeys/${templateId}/templates/${notificationID}/publish`, {
110
+ body,
111
+ ...options,
112
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
113
+ });
114
+ }
115
+ /**
116
+ * Replace the elemental content of a journey-scoped notification template.
117
+ * Overwrites all elements in the template draft with the provided content.
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * const notificationContentMutationResponse =
122
+ * await client.journeys.templates.putContent('x', {
123
+ * templateId: 'x',
124
+ * content: {
125
+ * version: '2022-01-01',
126
+ * elements: [{ type: 'channel' }],
127
+ * },
128
+ * state: 'DRAFT',
129
+ * });
130
+ * ```
131
+ */
132
+ putContent(notificationID, params, options) {
133
+ const { templateId, ...body } = params;
134
+ return this._client.put(path `/journeys/${templateId}/templates/${notificationID}/content`, {
135
+ body,
136
+ ...options,
137
+ });
138
+ }
139
+ /**
140
+ * Set locale-specific content overrides for a journey-scoped notification
141
+ * template. Each element override must reference an existing element by ID.
142
+ *
143
+ * @example
144
+ * ```ts
145
+ * const notificationContentMutationResponse =
146
+ * await client.journeys.templates.putLocale('x', {
147
+ * templateId: 'x',
148
+ * notificationId: 'x',
149
+ * elements: [
150
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
151
+ * { id: 'elem_2', title: 'Bienvenido!' },
152
+ * ],
153
+ * state: 'DRAFT',
154
+ * });
155
+ * ```
156
+ */
157
+ putLocale(localeID, params, options) {
158
+ const { templateId, notificationId, ...body } = params;
159
+ return this._client.put(path `/journeys/${templateId}/templates/${notificationId}/locales/${localeID}`, {
160
+ body,
161
+ ...options,
162
+ });
163
+ }
164
+ /**
165
+ * Replace the journey-scoped notification template draft.
166
+ *
167
+ * @example
168
+ * ```ts
169
+ * const journeyTemplateGetResponse =
170
+ * await client.journeys.templates.replace('x', {
171
+ * templateId: 'x',
172
+ * notification: {
173
+ * brand: { id: 'id' },
174
+ * content: { elements: [{}], version: '2022-01-01' },
175
+ * name: 'name',
176
+ * subscription: { topic_id: 'topic_id' },
177
+ * tags: ['string'],
178
+ * },
179
+ * });
180
+ * ```
181
+ */
182
+ replace(notificationID, params, options) {
183
+ const { templateId, ...body } = params;
184
+ return this._client.put(path `/journeys/${templateId}/templates/${notificationID}`, { body, ...options });
185
+ }
186
+ /**
187
+ * Retrieve the elemental content of a journey-scoped notification template. The
188
+ * response contains the versioned elements along with their content checksums,
189
+ * which can be used to detect changes between versions. Pass `?version=draft`
190
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
191
+ * historical version.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * const notificationContentGetResponse =
196
+ * await client.journeys.templates.retrieveContent('x', {
197
+ * templateId: 'x',
198
+ * });
199
+ * ```
200
+ */
201
+ retrieveContent(notificationID, params, options) {
202
+ const { templateId, ...query } = params;
203
+ return this._client.get(path `/journeys/${templateId}/templates/${notificationID}/content`, {
204
+ query,
205
+ ...options,
206
+ });
207
+ }
208
+ }
209
+ //# sourceMappingURL=templates.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.mjs","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mapp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;YACrG,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CACL,cAAsB,EACtB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,UAAU,cAAc,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,eAAe,CACb,cAAsB,EACtB,MAAqC,EACrC,OAAwB;QAExB,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,UAAU,cAAc,cAAc,UAAU,EAAE;YACzF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,143 +1,2 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import { APIPromise } from "../core/api-promise.mjs";
3
- import { RequestOptions } from "../internal/request-options.mjs";
4
- export declare class Journeys extends APIResource {
5
- /**
6
- * Get the list of journeys.
7
- *
8
- * @example
9
- * ```ts
10
- * const journeysListResponse = await client.journeys.list();
11
- * ```
12
- */
13
- list(query?: JourneyListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysListResponse>;
14
- /**
15
- * Invoke a journey run from a journey template.
16
- *
17
- * @example
18
- * ```ts
19
- * const journeysInvokeResponse = await client.journeys.invoke(
20
- * 'templateId',
21
- * {
22
- * data: { order_id: 'order-456', amount: 99.99 },
23
- * user_id: 'user-123',
24
- * },
25
- * );
26
- * ```
27
- */
28
- invoke(templateID: string, body: JourneyInvokeParams, options?: RequestOptions): APIPromise<JourneysInvokeResponse>;
29
- }
30
- /**
31
- * A journey template representing an automation workflow.
32
- */
33
- export interface Journey {
34
- /**
35
- * The unique identifier of the journey.
36
- */
37
- id: string;
38
- /**
39
- * The name of the journey.
40
- */
41
- name: string;
42
- /**
43
- * The version of the journey (published or draft).
44
- */
45
- version: 'published' | 'draft';
46
- /**
47
- * ISO 8601 timestamp when the journey was created.
48
- */
49
- createdAt?: string;
50
- /**
51
- * ISO 8601 timestamp when the journey was last updated.
52
- */
53
- updatedAt?: string;
54
- }
55
- /**
56
- * Request body for invoking a journey. Requires either a user identifier or a
57
- * profile with contact information. User identifiers can be provided via user_id
58
- * field, or resolved from profile/data objects (user_id, userId, or anonymousId
59
- * fields).
60
- */
61
- export interface JourneysInvokeRequest {
62
- /**
63
- * Data payload passed to the journey. The expected shape can be predefined using
64
- * the schema builder in the journey editor. This data is available in journey
65
- * steps for condition evaluation and template variable interpolation. Can also
66
- * contain user identifiers (user_id, userId, anonymousId) if not provided
67
- * elsewhere.
68
- */
69
- data?: {
70
- [key: string]: unknown;
71
- };
72
- /**
73
- * Profile data for the user. Can contain contact information (email,
74
- * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
75
- * profile fields. Profile fields are merged with any existing stored profile for
76
- * the user. Include context.tenant_id to load a tenant-scoped profile for
77
- * multi-tenant scenarios.
78
- */
79
- profile?: {
80
- [key: string]: unknown;
81
- };
82
- /**
83
- * A unique identifier for the user. If not provided, the system will attempt to
84
- * resolve the user identifier from profile or data objects.
85
- */
86
- user_id?: string;
87
- }
88
- export interface JourneysInvokeResponse {
89
- /**
90
- * A unique identifier for the journey run that was created.
91
- */
92
- runId: string;
93
- }
94
- export interface JourneysListResponse {
95
- /**
96
- * A cursor token for pagination. Present when there are more results available.
97
- */
98
- cursor?: string;
99
- templates?: Array<Journey>;
100
- }
101
- export interface JourneyListParams {
102
- /**
103
- * A cursor token for pagination. Use the cursor from the previous response to
104
- * fetch the next page of results.
105
- */
106
- cursor?: string;
107
- /**
108
- * The version of journeys to retrieve. Accepted values are published (for
109
- * published journeys) or draft (for draft journeys). Defaults to published.
110
- */
111
- version?: 'published' | 'draft';
112
- }
113
- export interface JourneyInvokeParams {
114
- /**
115
- * Data payload passed to the journey. The expected shape can be predefined using
116
- * the schema builder in the journey editor. This data is available in journey
117
- * steps for condition evaluation and template variable interpolation. Can also
118
- * contain user identifiers (user_id, userId, anonymousId) if not provided
119
- * elsewhere.
120
- */
121
- data?: {
122
- [key: string]: unknown;
123
- };
124
- /**
125
- * Profile data for the user. Can contain contact information (email,
126
- * phone_number), user identifiers (user_id, userId, anonymousId), or any custom
127
- * profile fields. Profile fields are merged with any existing stored profile for
128
- * the user. Include context.tenant_id to load a tenant-scoped profile for
129
- * multi-tenant scenarios.
130
- */
131
- profile?: {
132
- [key: string]: unknown;
133
- };
134
- /**
135
- * A unique identifier for the user. If not provided, the system will attempt to
136
- * resolve the user identifier from profile or data objects.
137
- */
138
- user_id?: string;
139
- }
140
- export declare namespace Journeys {
141
- export { type Journey as Journey, type JourneysInvokeRequest as JourneysInvokeRequest, type JourneysInvokeResponse as JourneysInvokeResponse, type JourneysListResponse as JourneysListResponse, type JourneyListParams as JourneyListParams, type JourneyInvokeParams as JourneyInvokeParams, };
142
- }
1
+ export * from "./journeys/index.mjs";
143
2
  //# sourceMappingURL=journeys.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"journeys.d.mts","sourceRoot":"","sources":["../src/resources/journeys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,mBAAmB,EACzB,OAAO,CAAC,EAAE,cAA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