@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,338 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as Shared from "../shared.mjs";
3
+ import * as JourneysAPI from "./journeys.mjs";
4
+ import * as NotificationsAPI from "../notifications/notifications.mjs";
5
+ import { APIPromise } from "../../core/api-promise.mjs";
6
+ import { RequestOptions } from "../../internal/request-options.mjs";
7
+ export declare class Templates extends APIResource {
8
+ /**
9
+ * Create a notification template scoped to this journey. Defaults to `DRAFT`
10
+ * state; pass `state: "PUBLISHED"` to publish on create.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const journeyTemplateGetResponse =
15
+ * await client.journeys.templates.create('x', {
16
+ * channel: 'email',
17
+ * notification: {
18
+ * name: 'Welcome email',
19
+ * tags: [],
20
+ * brand: null,
21
+ * subscription: null,
22
+ * content: {
23
+ * version: '2022-01-01',
24
+ * elements: [{ type: 'text' }],
25
+ * },
26
+ * },
27
+ * });
28
+ * ```
29
+ */
30
+ create(templateID: string, body: TemplateCreateParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
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: string, params: TemplateRetrieveParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
45
+ /**
46
+ * List notification templates scoped to this journey. Journey-scoped notification
47
+ * templates can only be referenced from `send` nodes within the same journey.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const journeyTemplateListResponse =
52
+ * await client.journeys.templates.list('x');
53
+ * ```
54
+ */
55
+ list(templateID: string, query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateListResponse>;
56
+ /**
57
+ * Archive the journey-scoped notification template. Archived templates cannot be
58
+ * sent.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await client.journeys.templates.archive('x', {
63
+ * templateId: 'x',
64
+ * });
65
+ * ```
66
+ */
67
+ archive(notificationID: string, params: TemplateArchiveParams, options?: RequestOptions): APIPromise<void>;
68
+ /**
69
+ * List published versions of the journey-scoped notification template, ordered
70
+ * most recent first.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const notificationTemplateVersionListResponse =
75
+ * await client.journeys.templates.listVersions('x', {
76
+ * templateId: 'x',
77
+ * });
78
+ * ```
79
+ */
80
+ listVersions(notificationID: string, params: TemplateListVersionsParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationTemplateVersionListResponse>;
81
+ /**
82
+ * Publish the current draft of the journey-scoped notification template as a new
83
+ * version. Optionally roll back to a prior version by passing
84
+ * `{ "version": "vN" }`.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * await client.journeys.templates.publish('x', {
89
+ * templateId: 'x',
90
+ * });
91
+ * ```
92
+ */
93
+ publish(notificationID: string, params: TemplatePublishParams, options?: RequestOptions): APIPromise<void>;
94
+ /**
95
+ * Replace the elemental content of a journey-scoped notification template.
96
+ * Overwrites all elements in the template draft with the provided content.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const notificationContentMutationResponse =
101
+ * await client.journeys.templates.putContent('x', {
102
+ * templateId: 'x',
103
+ * content: {
104
+ * version: '2022-01-01',
105
+ * elements: [{ type: 'channel' }],
106
+ * },
107
+ * state: 'DRAFT',
108
+ * });
109
+ * ```
110
+ */
111
+ putContent(notificationID: string, params: TemplatePutContentParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentMutationResponse>;
112
+ /**
113
+ * Set locale-specific content overrides for a journey-scoped notification
114
+ * template. Each element override must reference an existing element by ID.
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * const notificationContentMutationResponse =
119
+ * await client.journeys.templates.putLocale('x', {
120
+ * templateId: 'x',
121
+ * notificationId: 'x',
122
+ * elements: [
123
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
124
+ * { id: 'elem_2', title: 'Bienvenido!' },
125
+ * ],
126
+ * state: 'DRAFT',
127
+ * });
128
+ * ```
129
+ */
130
+ putLocale(localeID: string, params: TemplatePutLocaleParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentMutationResponse>;
131
+ /**
132
+ * Replace the journey-scoped notification template draft.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * const journeyTemplateGetResponse =
137
+ * await client.journeys.templates.replace('x', {
138
+ * templateId: 'x',
139
+ * notification: {
140
+ * brand: { id: 'id' },
141
+ * content: { elements: [{}], version: '2022-01-01' },
142
+ * name: 'name',
143
+ * subscription: { topic_id: 'topic_id' },
144
+ * tags: ['string'],
145
+ * },
146
+ * });
147
+ * ```
148
+ */
149
+ replace(notificationID: string, params: TemplateReplaceParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
150
+ /**
151
+ * Retrieve the elemental content of a journey-scoped notification template. The
152
+ * response contains the versioned elements along with their content checksums,
153
+ * which can be used to detect changes between versions. Pass `?version=draft`
154
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
155
+ * historical version.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const notificationContentGetResponse =
160
+ * await client.journeys.templates.retrieveContent('x', {
161
+ * templateId: 'x',
162
+ * });
163
+ * ```
164
+ */
165
+ retrieveContent(notificationID: string, params: TemplateRetrieveContentParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentGetResponse>;
166
+ }
167
+ export interface TemplateCreateParams {
168
+ channel: string;
169
+ notification: TemplateCreateParams.Notification;
170
+ providerKey?: string;
171
+ state?: string;
172
+ }
173
+ export declare namespace TemplateCreateParams {
174
+ interface Notification {
175
+ brand: Notification.Brand | null;
176
+ content: Notification.Content;
177
+ name: string;
178
+ subscription: Notification.Subscription | null;
179
+ tags: Array<string>;
180
+ }
181
+ namespace Notification {
182
+ interface Brand {
183
+ id: string;
184
+ }
185
+ interface Content {
186
+ elements: Array<Shared.ElementalNode>;
187
+ version: '2022-01-01';
188
+ scope?: 'default' | 'strict';
189
+ }
190
+ interface Subscription {
191
+ topic_id: string;
192
+ }
193
+ }
194
+ }
195
+ export interface TemplateRetrieveParams {
196
+ /**
197
+ * Journey id
198
+ */
199
+ templateId: string;
200
+ }
201
+ export interface TemplateListParams {
202
+ /**
203
+ * Pagination cursor from a prior response.
204
+ */
205
+ cursor?: string;
206
+ /**
207
+ * Page size. Minimum 1, maximum 100.
208
+ */
209
+ limit?: number;
210
+ }
211
+ export interface TemplateArchiveParams {
212
+ /**
213
+ * Journey id
214
+ */
215
+ templateId: string;
216
+ }
217
+ export interface TemplateListVersionsParams {
218
+ /**
219
+ * Journey id
220
+ */
221
+ templateId: string;
222
+ }
223
+ export interface TemplatePublishParams {
224
+ /**
225
+ * Path param: Journey id
226
+ */
227
+ templateId: string;
228
+ /**
229
+ * Body param
230
+ */
231
+ version?: string;
232
+ }
233
+ export interface TemplatePutContentParams {
234
+ /**
235
+ * Path param: Journey id
236
+ */
237
+ templateId: string;
238
+ /**
239
+ * Body param: Elemental content payload. The server defaults `version` when
240
+ * omitted.
241
+ */
242
+ content: TemplatePutContentParams.Content;
243
+ /**
244
+ * Body param: Template state. Defaults to `DRAFT`.
245
+ */
246
+ state?: NotificationsAPI.NotificationTemplateState;
247
+ }
248
+ export declare namespace TemplatePutContentParams {
249
+ /**
250
+ * Elemental content payload. The server defaults `version` when omitted.
251
+ */
252
+ interface Content {
253
+ elements: Array<Shared.ElementalNode>;
254
+ /**
255
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
256
+ * omitted.
257
+ */
258
+ version?: string;
259
+ }
260
+ }
261
+ export interface TemplatePutLocaleParams {
262
+ /**
263
+ * Path param: Journey id
264
+ */
265
+ templateId: string;
266
+ /**
267
+ * Path param: Notification template id
268
+ */
269
+ notificationId: string;
270
+ /**
271
+ * Body param: Elements with locale-specific content overrides.
272
+ */
273
+ elements: Array<TemplatePutLocaleParams.Element>;
274
+ /**
275
+ * Body param: Template state. Defaults to `DRAFT`.
276
+ */
277
+ state?: NotificationsAPI.NotificationTemplateState;
278
+ }
279
+ export declare namespace TemplatePutLocaleParams {
280
+ interface Element {
281
+ /**
282
+ * Target element ID.
283
+ */
284
+ id: string;
285
+ [k: string]: unknown;
286
+ }
287
+ }
288
+ export interface TemplateReplaceParams {
289
+ /**
290
+ * Path param: Journey id
291
+ */
292
+ templateId: string;
293
+ /**
294
+ * Body param
295
+ */
296
+ notification: TemplateReplaceParams.Notification;
297
+ /**
298
+ * Body param
299
+ */
300
+ state?: string;
301
+ }
302
+ export declare namespace TemplateReplaceParams {
303
+ interface Notification {
304
+ brand: Notification.Brand | null;
305
+ content: Notification.Content;
306
+ name: string;
307
+ subscription: Notification.Subscription | null;
308
+ tags: Array<string>;
309
+ }
310
+ namespace Notification {
311
+ interface Brand {
312
+ id: string;
313
+ }
314
+ interface Content {
315
+ elements: Array<Shared.ElementalNode>;
316
+ version: '2022-01-01';
317
+ scope?: 'default' | 'strict';
318
+ }
319
+ interface Subscription {
320
+ topic_id: string;
321
+ }
322
+ }
323
+ }
324
+ export interface TemplateRetrieveContentParams {
325
+ /**
326
+ * Path param: Journey id
327
+ */
328
+ templateId: string;
329
+ /**
330
+ * Query param: Accepts `draft`, `published`, or a version string (e.g., `v001`).
331
+ * Defaults to `published`.
332
+ */
333
+ version?: string;
334
+ }
335
+ export declare namespace Templates {
336
+ export { 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, };
337
+ }
338
+ //# sourceMappingURL=templates.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.mts","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,KAAK,gBAAgB,2CAAuC;AACnE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAIrD;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAKrD;;;;;;;;;OASG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC,2BAA2B,CAAC;IAItD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ1G;;;;;;;;;;;OAWG;IACH,YAAY,CACV,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,gBAAgB,CAAC,uCAAuC,CAAC;IAKvE;;;;;;;;;;;OAWG;IACH,OAAO,C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;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -0,0 +1,338 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as Shared from "../shared.js";
3
+ import * as JourneysAPI from "./journeys.js";
4
+ import * as NotificationsAPI from "../notifications/notifications.js";
5
+ import { APIPromise } from "../../core/api-promise.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ export declare class Templates extends APIResource {
8
+ /**
9
+ * Create a notification template scoped to this journey. Defaults to `DRAFT`
10
+ * state; pass `state: "PUBLISHED"` to publish on create.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const journeyTemplateGetResponse =
15
+ * await client.journeys.templates.create('x', {
16
+ * channel: 'email',
17
+ * notification: {
18
+ * name: 'Welcome email',
19
+ * tags: [],
20
+ * brand: null,
21
+ * subscription: null,
22
+ * content: {
23
+ * version: '2022-01-01',
24
+ * elements: [{ type: 'text' }],
25
+ * },
26
+ * },
27
+ * });
28
+ * ```
29
+ */
30
+ create(templateID: string, body: TemplateCreateParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
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: string, params: TemplateRetrieveParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
45
+ /**
46
+ * List notification templates scoped to this journey. Journey-scoped notification
47
+ * templates can only be referenced from `send` nodes within the same journey.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const journeyTemplateListResponse =
52
+ * await client.journeys.templates.list('x');
53
+ * ```
54
+ */
55
+ list(templateID: string, query?: TemplateListParams | null | undefined, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateListResponse>;
56
+ /**
57
+ * Archive the journey-scoped notification template. Archived templates cannot be
58
+ * sent.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await client.journeys.templates.archive('x', {
63
+ * templateId: 'x',
64
+ * });
65
+ * ```
66
+ */
67
+ archive(notificationID: string, params: TemplateArchiveParams, options?: RequestOptions): APIPromise<void>;
68
+ /**
69
+ * List published versions of the journey-scoped notification template, ordered
70
+ * most recent first.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const notificationTemplateVersionListResponse =
75
+ * await client.journeys.templates.listVersions('x', {
76
+ * templateId: 'x',
77
+ * });
78
+ * ```
79
+ */
80
+ listVersions(notificationID: string, params: TemplateListVersionsParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationTemplateVersionListResponse>;
81
+ /**
82
+ * Publish the current draft of the journey-scoped notification template as a new
83
+ * version. Optionally roll back to a prior version by passing
84
+ * `{ "version": "vN" }`.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * await client.journeys.templates.publish('x', {
89
+ * templateId: 'x',
90
+ * });
91
+ * ```
92
+ */
93
+ publish(notificationID: string, params: TemplatePublishParams, options?: RequestOptions): APIPromise<void>;
94
+ /**
95
+ * Replace the elemental content of a journey-scoped notification template.
96
+ * Overwrites all elements in the template draft with the provided content.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const notificationContentMutationResponse =
101
+ * await client.journeys.templates.putContent('x', {
102
+ * templateId: 'x',
103
+ * content: {
104
+ * version: '2022-01-01',
105
+ * elements: [{ type: 'channel' }],
106
+ * },
107
+ * state: 'DRAFT',
108
+ * });
109
+ * ```
110
+ */
111
+ putContent(notificationID: string, params: TemplatePutContentParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentMutationResponse>;
112
+ /**
113
+ * Set locale-specific content overrides for a journey-scoped notification
114
+ * template. Each element override must reference an existing element by ID.
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * const notificationContentMutationResponse =
119
+ * await client.journeys.templates.putLocale('x', {
120
+ * templateId: 'x',
121
+ * notificationId: 'x',
122
+ * elements: [
123
+ * { id: 'elem_1', content: 'Hola {{data.name}}.' },
124
+ * { id: 'elem_2', title: 'Bienvenido!' },
125
+ * ],
126
+ * state: 'DRAFT',
127
+ * });
128
+ * ```
129
+ */
130
+ putLocale(localeID: string, params: TemplatePutLocaleParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentMutationResponse>;
131
+ /**
132
+ * Replace the journey-scoped notification template draft.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * const journeyTemplateGetResponse =
137
+ * await client.journeys.templates.replace('x', {
138
+ * templateId: 'x',
139
+ * notification: {
140
+ * brand: { id: 'id' },
141
+ * content: { elements: [{}], version: '2022-01-01' },
142
+ * name: 'name',
143
+ * subscription: { topic_id: 'topic_id' },
144
+ * tags: ['string'],
145
+ * },
146
+ * });
147
+ * ```
148
+ */
149
+ replace(notificationID: string, params: TemplateReplaceParams, options?: RequestOptions): APIPromise<JourneysAPI.JourneyTemplateGetResponse>;
150
+ /**
151
+ * Retrieve the elemental content of a journey-scoped notification template. The
152
+ * response contains the versioned elements along with their content checksums,
153
+ * which can be used to detect changes between versions. Pass `?version=draft`
154
+ * (default `published`) to retrieve the working draft, or `?version=vN` for a
155
+ * historical version.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const notificationContentGetResponse =
160
+ * await client.journeys.templates.retrieveContent('x', {
161
+ * templateId: 'x',
162
+ * });
163
+ * ```
164
+ */
165
+ retrieveContent(notificationID: string, params: TemplateRetrieveContentParams, options?: RequestOptions): APIPromise<NotificationsAPI.NotificationContentGetResponse>;
166
+ }
167
+ export interface TemplateCreateParams {
168
+ channel: string;
169
+ notification: TemplateCreateParams.Notification;
170
+ providerKey?: string;
171
+ state?: string;
172
+ }
173
+ export declare namespace TemplateCreateParams {
174
+ interface Notification {
175
+ brand: Notification.Brand | null;
176
+ content: Notification.Content;
177
+ name: string;
178
+ subscription: Notification.Subscription | null;
179
+ tags: Array<string>;
180
+ }
181
+ namespace Notification {
182
+ interface Brand {
183
+ id: string;
184
+ }
185
+ interface Content {
186
+ elements: Array<Shared.ElementalNode>;
187
+ version: '2022-01-01';
188
+ scope?: 'default' | 'strict';
189
+ }
190
+ interface Subscription {
191
+ topic_id: string;
192
+ }
193
+ }
194
+ }
195
+ export interface TemplateRetrieveParams {
196
+ /**
197
+ * Journey id
198
+ */
199
+ templateId: string;
200
+ }
201
+ export interface TemplateListParams {
202
+ /**
203
+ * Pagination cursor from a prior response.
204
+ */
205
+ cursor?: string;
206
+ /**
207
+ * Page size. Minimum 1, maximum 100.
208
+ */
209
+ limit?: number;
210
+ }
211
+ export interface TemplateArchiveParams {
212
+ /**
213
+ * Journey id
214
+ */
215
+ templateId: string;
216
+ }
217
+ export interface TemplateListVersionsParams {
218
+ /**
219
+ * Journey id
220
+ */
221
+ templateId: string;
222
+ }
223
+ export interface TemplatePublishParams {
224
+ /**
225
+ * Path param: Journey id
226
+ */
227
+ templateId: string;
228
+ /**
229
+ * Body param
230
+ */
231
+ version?: string;
232
+ }
233
+ export interface TemplatePutContentParams {
234
+ /**
235
+ * Path param: Journey id
236
+ */
237
+ templateId: string;
238
+ /**
239
+ * Body param: Elemental content payload. The server defaults `version` when
240
+ * omitted.
241
+ */
242
+ content: TemplatePutContentParams.Content;
243
+ /**
244
+ * Body param: Template state. Defaults to `DRAFT`.
245
+ */
246
+ state?: NotificationsAPI.NotificationTemplateState;
247
+ }
248
+ export declare namespace TemplatePutContentParams {
249
+ /**
250
+ * Elemental content payload. The server defaults `version` when omitted.
251
+ */
252
+ interface Content {
253
+ elements: Array<Shared.ElementalNode>;
254
+ /**
255
+ * Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
256
+ * omitted.
257
+ */
258
+ version?: string;
259
+ }
260
+ }
261
+ export interface TemplatePutLocaleParams {
262
+ /**
263
+ * Path param: Journey id
264
+ */
265
+ templateId: string;
266
+ /**
267
+ * Path param: Notification template id
268
+ */
269
+ notificationId: string;
270
+ /**
271
+ * Body param: Elements with locale-specific content overrides.
272
+ */
273
+ elements: Array<TemplatePutLocaleParams.Element>;
274
+ /**
275
+ * Body param: Template state. Defaults to `DRAFT`.
276
+ */
277
+ state?: NotificationsAPI.NotificationTemplateState;
278
+ }
279
+ export declare namespace TemplatePutLocaleParams {
280
+ interface Element {
281
+ /**
282
+ * Target element ID.
283
+ */
284
+ id: string;
285
+ [k: string]: unknown;
286
+ }
287
+ }
288
+ export interface TemplateReplaceParams {
289
+ /**
290
+ * Path param: Journey id
291
+ */
292
+ templateId: string;
293
+ /**
294
+ * Body param
295
+ */
296
+ notification: TemplateReplaceParams.Notification;
297
+ /**
298
+ * Body param
299
+ */
300
+ state?: string;
301
+ }
302
+ export declare namespace TemplateReplaceParams {
303
+ interface Notification {
304
+ brand: Notification.Brand | null;
305
+ content: Notification.Content;
306
+ name: string;
307
+ subscription: Notification.Subscription | null;
308
+ tags: Array<string>;
309
+ }
310
+ namespace Notification {
311
+ interface Brand {
312
+ id: string;
313
+ }
314
+ interface Content {
315
+ elements: Array<Shared.ElementalNode>;
316
+ version: '2022-01-01';
317
+ scope?: 'default' | 'strict';
318
+ }
319
+ interface Subscription {
320
+ topic_id: string;
321
+ }
322
+ }
323
+ }
324
+ export interface TemplateRetrieveContentParams {
325
+ /**
326
+ * Path param: Journey id
327
+ */
328
+ templateId: string;
329
+ /**
330
+ * Query param: Accepts `draft`, `published`, or a version string (e.g., `v001`).
331
+ * Defaults to `published`.
332
+ */
333
+ version?: string;
334
+ }
335
+ export declare namespace Templates {
336
+ export { 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, };
337
+ }
338
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/resources/journeys/templates.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,KAAK,gBAAgB,0CAAuC;AACnE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAIrD;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,WAAW,CAAC,0BAA0B,CAAC;IAKrD;;;;;;;;;OASG;IACH,IAAI,CACF,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,k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