@trycourier/courier 7.20.0 → 7.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +57 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +57 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +57 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +57 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/audiences.d.mts +13 -5
  12. package/resources/audiences.d.mts.map +1 -1
  13. package/resources/audiences.d.ts +13 -5
  14. package/resources/audiences.d.ts.map +1 -1
  15. package/resources/audiences.js +13 -5
  16. package/resources/audiences.js.map +1 -1
  17. package/resources/audiences.mjs +13 -5
  18. package/resources/audiences.mjs.map +1 -1
  19. package/resources/audit-events.d.mts +7 -2
  20. package/resources/audit-events.d.mts.map +1 -1
  21. package/resources/audit-events.d.ts +7 -2
  22. package/resources/audit-events.d.ts.map +1 -1
  23. package/resources/audit-events.js +7 -2
  24. package/resources/audit-events.js.map +1 -1
  25. package/resources/audit-events.mjs +7 -2
  26. package/resources/audit-events.mjs.map +1 -1
  27. package/resources/auth.d.mts +5 -1
  28. package/resources/auth.d.mts.map +1 -1
  29. package/resources/auth.d.ts +5 -1
  30. package/resources/auth.d.ts.map +1 -1
  31. package/resources/auth.js +5 -1
  32. package/resources/auth.js.map +1 -1
  33. package/resources/auth.mjs +5 -1
  34. package/resources/auth.mjs.map +1 -1
  35. package/resources/automations/automations.d.mts +5 -1
  36. package/resources/automations/automations.d.mts.map +1 -1
  37. package/resources/automations/automations.d.ts +5 -1
  38. package/resources/automations/automations.d.ts.map +1 -1
  39. package/resources/automations/automations.js +5 -1
  40. package/resources/automations/automations.js.map +1 -1
  41. package/resources/automations/automations.mjs +5 -1
  42. package/resources/automations/automations.mjs.map +1 -1
  43. package/resources/automations/invoke.d.mts +74 -7
  44. package/resources/automations/invoke.d.mts.map +1 -1
  45. package/resources/automations/invoke.d.ts +74 -7
  46. package/resources/automations/invoke.d.ts.map +1 -1
  47. package/resources/automations/invoke.js +38 -9
  48. package/resources/automations/invoke.js.map +1 -1
  49. package/resources/automations/invoke.mjs +38 -9
  50. package/resources/automations/invoke.mjs.map +1 -1
  51. package/resources/brands.d.mts +42 -7
  52. package/resources/brands.d.mts.map +1 -1
  53. package/resources/brands.d.ts +42 -7
  54. package/resources/brands.d.ts.map +1 -1
  55. package/resources/brands.js +28 -8
  56. package/resources/brands.js.map +1 -1
  57. package/resources/brands.mjs +28 -8
  58. package/resources/brands.mjs.map +1 -1
  59. package/resources/digests/schedules.d.mts +5 -3
  60. package/resources/digests/schedules.d.mts.map +1 -1
  61. package/resources/digests/schedules.d.ts +5 -3
  62. package/resources/digests/schedules.d.ts.map +1 -1
  63. package/resources/digests/schedules.js +5 -3
  64. package/resources/digests/schedules.js.map +1 -1
  65. package/resources/digests/schedules.mjs +5 -3
  66. package/resources/digests/schedules.mjs.map +1 -1
  67. package/resources/inbound.d.mts +5 -1
  68. package/resources/inbound.d.mts.map +1 -1
  69. package/resources/inbound.d.ts +5 -1
  70. package/resources/inbound.d.ts.map +1 -1
  71. package/resources/inbound.js +5 -1
  72. package/resources/inbound.js.map +1 -1
  73. package/resources/inbound.mjs +5 -1
  74. package/resources/inbound.mjs.map +1 -1
  75. package/resources/inbox/inbox.d.mts +10 -0
  76. package/resources/inbox/inbox.d.mts.map +1 -0
  77. package/resources/inbox/inbox.d.ts +10 -0
  78. package/resources/inbox/inbox.d.ts.map +1 -0
  79. package/resources/inbox/inbox.js +17 -0
  80. package/resources/inbox/inbox.js.map +1 -0
  81. package/resources/inbox/inbox.mjs +12 -0
  82. package/resources/inbox/inbox.mjs.map +1 -0
  83. package/resources/inbox/index.d.mts +3 -0
  84. package/resources/inbox/index.d.mts.map +1 -0
  85. package/resources/inbox/index.d.ts +3 -0
  86. package/resources/inbox/index.d.ts.map +1 -0
  87. package/resources/inbox/index.js +9 -0
  88. package/resources/inbox/index.js.map +1 -0
  89. package/resources/inbox/index.mjs +4 -0
  90. package/resources/inbox/index.mjs.map +1 -0
  91. package/resources/inbox/messages.d.mts +23 -0
  92. package/resources/inbox/messages.d.mts.map +1 -0
  93. package/resources/inbox/messages.d.ts +23 -0
  94. package/resources/inbox/messages.d.ts.map +1 -0
  95. package/resources/inbox/messages.js +34 -0
  96. package/resources/inbox/messages.js.map +1 -0
  97. package/resources/inbox/messages.mjs +30 -0
  98. package/resources/inbox/messages.mjs.map +1 -0
  99. package/resources/inbox.d.mts +2 -0
  100. package/resources/inbox.d.mts.map +1 -0
  101. package/resources/inbox.d.ts +2 -0
  102. package/resources/inbox.d.ts.map +1 -0
  103. package/resources/inbox.js +6 -0
  104. package/resources/inbox.js.map +1 -0
  105. package/resources/inbox.mjs +3 -0
  106. package/resources/inbox.mjs.map +1 -0
  107. package/resources/index.d.mts +1 -1
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +1 -1
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +3 -3
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +1 -1
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/journeys/journeys.d.mts +130 -39
  116. package/resources/journeys/journeys.d.mts.map +1 -1
  117. package/resources/journeys/journeys.d.ts +130 -39
  118. package/resources/journeys/journeys.d.ts.map +1 -1
  119. package/resources/journeys/journeys.js +79 -34
  120. package/resources/journeys/journeys.js.map +1 -1
  121. package/resources/journeys/journeys.mjs +79 -34
  122. package/resources/journeys/journeys.mjs.map +1 -1
  123. package/resources/journeys/templates.d.mts +60 -17
  124. package/resources/journeys/templates.d.mts.map +1 -1
  125. package/resources/journeys/templates.d.ts +60 -17
  126. package/resources/journeys/templates.d.ts.map +1 -1
  127. package/resources/journeys/templates.js +41 -20
  128. package/resources/journeys/templates.js.map +1 -1
  129. package/resources/journeys/templates.mjs +41 -20
  130. package/resources/journeys/templates.mjs.map +1 -1
  131. package/resources/lists/lists.d.mts +40 -5
  132. package/resources/lists/lists.d.mts.map +1 -1
  133. package/resources/lists/lists.d.ts +40 -5
  134. package/resources/lists/lists.d.ts.map +1 -1
  135. package/resources/lists/lists.js +40 -5
  136. package/resources/lists/lists.js.map +1 -1
  137. package/resources/lists/lists.mjs +40 -5
  138. package/resources/lists/lists.mjs.map +1 -1
  139. package/resources/lists/subscriptions.d.mts +65 -5
  140. package/resources/lists/subscriptions.d.mts.map +1 -1
  141. package/resources/lists/subscriptions.d.ts +65 -5
  142. package/resources/lists/subscriptions.d.ts.map +1 -1
  143. package/resources/lists/subscriptions.js +57 -6
  144. package/resources/lists/subscriptions.js.map +1 -1
  145. package/resources/lists/subscriptions.mjs +57 -6
  146. package/resources/lists/subscriptions.mjs.map +1 -1
  147. package/resources/messages.d.mts +15 -14
  148. package/resources/messages.d.mts.map +1 -1
  149. package/resources/messages.d.ts +15 -14
  150. package/resources/messages.d.ts.map +1 -1
  151. package/resources/messages.js +15 -14
  152. package/resources/messages.js.map +1 -1
  153. package/resources/messages.mjs +15 -14
  154. package/resources/messages.mjs.map +1 -1
  155. package/resources/notifications/checks.d.mts +9 -3
  156. package/resources/notifications/checks.d.mts.map +1 -1
  157. package/resources/notifications/checks.d.ts +9 -3
  158. package/resources/notifications/checks.d.ts.map +1 -1
  159. package/resources/notifications/checks.js +9 -3
  160. package/resources/notifications/checks.js.map +1 -1
  161. package/resources/notifications/checks.mjs +9 -3
  162. package/resources/notifications/checks.mjs.map +1 -1
  163. package/resources/notifications/notifications.d.mts +62 -29
  164. package/resources/notifications/notifications.d.mts.map +1 -1
  165. package/resources/notifications/notifications.d.ts +62 -29
  166. package/resources/notifications/notifications.d.ts.map +1 -1
  167. package/resources/notifications/notifications.js +49 -26
  168. package/resources/notifications/notifications.js.map +1 -1
  169. package/resources/notifications/notifications.mjs +49 -26
  170. package/resources/notifications/notifications.mjs.map +1 -1
  171. package/resources/profiles/lists.d.mts +49 -5
  172. package/resources/profiles/lists.d.mts.map +1 -1
  173. package/resources/profiles/lists.d.ts +49 -5
  174. package/resources/profiles/lists.d.ts.map +1 -1
  175. package/resources/profiles/lists.js +45 -6
  176. package/resources/profiles/lists.js.map +1 -1
  177. package/resources/profiles/lists.mjs +45 -6
  178. package/resources/profiles/lists.mjs.map +1 -1
  179. package/resources/profiles/profiles.d.mts +70 -11
  180. package/resources/profiles/profiles.d.mts.map +1 -1
  181. package/resources/profiles/profiles.d.ts +70 -11
  182. package/resources/profiles/profiles.d.ts.map +1 -1
  183. package/resources/profiles/profiles.js +65 -12
  184. package/resources/profiles/profiles.js.map +1 -1
  185. package/resources/profiles/profiles.mjs +65 -12
  186. package/resources/profiles/profiles.mjs.map +1 -1
  187. package/resources/providers/catalog.d.mts +10 -4
  188. package/resources/providers/catalog.d.mts.map +1 -1
  189. package/resources/providers/catalog.d.ts +10 -4
  190. package/resources/providers/catalog.d.ts.map +1 -1
  191. package/resources/providers/catalog.js +10 -4
  192. package/resources/providers/catalog.js.map +1 -1
  193. package/resources/providers/catalog.mjs +10 -4
  194. package/resources/providers/catalog.mjs.map +1 -1
  195. package/resources/providers/providers.d.mts +68 -22
  196. package/resources/providers/providers.d.mts.map +1 -1
  197. package/resources/providers/providers.d.ts +68 -22
  198. package/resources/providers/providers.d.ts.map +1 -1
  199. package/resources/providers/providers.js +57 -14
  200. package/resources/providers/providers.js.map +1 -1
  201. package/resources/providers/providers.mjs +57 -14
  202. package/resources/providers/providers.mjs.map +1 -1
  203. package/resources/requests.d.mts +5 -1
  204. package/resources/requests.d.mts.map +1 -1
  205. package/resources/requests.d.ts +5 -1
  206. package/resources/requests.d.ts.map +1 -1
  207. package/resources/requests.js +5 -1
  208. package/resources/requests.js.map +1 -1
  209. package/resources/requests.mjs +5 -1
  210. package/resources/requests.mjs.map +1 -1
  211. package/resources/routing-strategies.d.mts +30 -11
  212. package/resources/routing-strategies.d.mts.map +1 -1
  213. package/resources/routing-strategies.d.ts +30 -11
  214. package/resources/routing-strategies.d.ts.map +1 -1
  215. package/resources/routing-strategies.js +22 -6
  216. package/resources/routing-strategies.js.map +1 -1
  217. package/resources/routing-strategies.mjs +22 -6
  218. package/resources/routing-strategies.mjs.map +1 -1
  219. package/resources/send.d.mts +24 -4
  220. package/resources/send.d.mts.map +1 -1
  221. package/resources/send.d.ts +24 -4
  222. package/resources/send.d.ts.map +1 -1
  223. package/resources/send.js +21 -3
  224. package/resources/send.js.map +1 -1
  225. package/resources/send.mjs +21 -3
  226. package/resources/send.mjs.map +1 -1
  227. package/resources/tenants/preferences/items.d.mts +7 -2
  228. package/resources/tenants/preferences/items.d.mts.map +1 -1
  229. package/resources/tenants/preferences/items.d.ts +7 -2
  230. package/resources/tenants/preferences/items.d.ts.map +1 -1
  231. package/resources/tenants/preferences/items.js +7 -2
  232. package/resources/tenants/preferences/items.js.map +1 -1
  233. package/resources/tenants/preferences/items.mjs +7 -2
  234. package/resources/tenants/preferences/items.mjs.map +1 -1
  235. package/resources/tenants/templates/templates.d.mts +13 -19
  236. package/resources/tenants/templates/templates.d.mts.map +1 -1
  237. package/resources/tenants/templates/templates.d.ts +13 -19
  238. package/resources/tenants/templates/templates.d.ts.map +1 -1
  239. package/resources/tenants/templates/templates.js +13 -19
  240. package/resources/tenants/templates/templates.js.map +1 -1
  241. package/resources/tenants/templates/templates.mjs +13 -19
  242. package/resources/tenants/templates/templates.mjs.map +1 -1
  243. package/resources/tenants/templates/versions.d.mts +5 -7
  244. package/resources/tenants/templates/versions.d.mts.map +1 -1
  245. package/resources/tenants/templates/versions.d.ts +5 -7
  246. package/resources/tenants/templates/versions.d.ts.map +1 -1
  247. package/resources/tenants/templates/versions.js +5 -7
  248. package/resources/tenants/templates/versions.js.map +1 -1
  249. package/resources/tenants/templates/versions.mjs +5 -7
  250. package/resources/tenants/templates/versions.mjs.map +1 -1
  251. package/resources/tenants/tenants.d.mts +13 -5
  252. package/resources/tenants/tenants.d.mts.map +1 -1
  253. package/resources/tenants/tenants.d.ts +13 -5
  254. package/resources/tenants/tenants.d.ts.map +1 -1
  255. package/resources/tenants/tenants.js +13 -5
  256. package/resources/tenants/tenants.js.map +1 -1
  257. package/resources/tenants/tenants.mjs +13 -5
  258. package/resources/tenants/tenants.mjs.map +1 -1
  259. package/resources/translations.d.mts +7 -2
  260. package/resources/translations.d.mts.map +1 -1
  261. package/resources/translations.d.ts +7 -2
  262. package/resources/translations.d.ts.map +1 -1
  263. package/resources/translations.js +7 -2
  264. package/resources/translations.js.map +1 -1
  265. package/resources/translations.mjs +7 -2
  266. package/resources/translations.mjs.map +1 -1
  267. package/resources/users/preferences.d.mts +64 -42
  268. package/resources/users/preferences.d.mts.map +1 -1
  269. package/resources/users/preferences.d.ts +64 -42
  270. package/resources/users/preferences.d.ts.map +1 -1
  271. package/resources/users/preferences.js +30 -42
  272. package/resources/users/preferences.js.map +1 -1
  273. package/resources/users/preferences.mjs +30 -42
  274. package/resources/users/preferences.mjs.map +1 -1
  275. package/resources/users/tenants.d.mts +13 -10
  276. package/resources/users/tenants.d.mts.map +1 -1
  277. package/resources/users/tenants.d.ts +13 -10
  278. package/resources/users/tenants.d.ts.map +1 -1
  279. package/resources/users/tenants.js +13 -10
  280. package/resources/users/tenants.js.map +1 -1
  281. package/resources/users/tenants.mjs +13 -10
  282. package/resources/users/tenants.mjs.map +1 -1
  283. package/resources/users/tokens.d.mts +15 -6
  284. package/resources/users/tokens.d.mts.map +1 -1
  285. package/resources/users/tokens.d.ts +15 -6
  286. package/resources/users/tokens.d.ts.map +1 -1
  287. package/resources/users/tokens.js +15 -6
  288. package/resources/users/tokens.js.map +1 -1
  289. package/resources/users/tokens.mjs +15 -6
  290. package/resources/users/tokens.mjs.map +1 -1
  291. package/resources/workspace-preferences/topics.d.mts +40 -18
  292. package/resources/workspace-preferences/topics.d.mts.map +1 -1
  293. package/resources/workspace-preferences/topics.d.ts +40 -18
  294. package/resources/workspace-preferences/topics.d.ts.map +1 -1
  295. package/resources/workspace-preferences/topics.js +26 -11
  296. package/resources/workspace-preferences/topics.js.map +1 -1
  297. package/resources/workspace-preferences/topics.mjs +26 -11
  298. package/resources/workspace-preferences/topics.mjs.map +1 -1
  299. package/resources/workspace-preferences/workspace-preferences.d.mts +56 -19
  300. package/resources/workspace-preferences/workspace-preferences.d.mts.map +1 -1
  301. package/resources/workspace-preferences/workspace-preferences.d.ts +56 -19
  302. package/resources/workspace-preferences/workspace-preferences.d.ts.map +1 -1
  303. package/resources/workspace-preferences/workspace-preferences.js +41 -13
  304. package/resources/workspace-preferences/workspace-preferences.js.map +1 -1
  305. package/resources/workspace-preferences/workspace-preferences.mjs +41 -13
  306. package/resources/workspace-preferences/workspace-preferences.mjs.map +1 -1
  307. package/src/client.ts +59 -25
  308. package/src/resources/audiences.ts +13 -5
  309. package/src/resources/audit-events.ts +7 -2
  310. package/src/resources/auth.ts +5 -1
  311. package/src/resources/automations/automations.ts +5 -1
  312. package/src/resources/automations/invoke.ts +115 -9
  313. package/src/resources/brands.ts +62 -8
  314. package/src/resources/digests/schedules.ts +5 -3
  315. package/src/resources/inbound.ts +5 -1
  316. package/src/resources/inbox/inbox.ts +15 -0
  317. package/src/resources/inbox/index.ts +4 -0
  318. package/src/resources/inbox/messages.ts +40 -0
  319. package/src/resources/inbox.ts +3 -0
  320. package/src/resources/index.ts +1 -11
  321. package/src/resources/journeys/journeys.ts +212 -43
  322. package/src/resources/journeys/templates.ts +98 -20
  323. package/src/resources/lists/lists.ts +40 -5
  324. package/src/resources/lists/subscriptions.ts +82 -6
  325. package/src/resources/messages.ts +15 -14
  326. package/src/resources/notifications/checks.ts +9 -3
  327. package/src/resources/notifications/notifications.ts +102 -31
  328. package/src/resources/profiles/lists.ts +70 -6
  329. package/src/resources/profiles/profiles.ts +90 -12
  330. package/src/resources/providers/catalog.ts +10 -4
  331. package/src/resources/providers/providers.ts +86 -21
  332. package/src/resources/requests.ts +5 -1
  333. package/src/resources/routing-strategies.ts +50 -12
  334. package/src/resources/send.ts +45 -5
  335. package/src/resources/tenants/preferences/items.ts +7 -2
  336. package/src/resources/tenants/templates/templates.ts +13 -19
  337. package/src/resources/tenants/templates/versions.ts +5 -7
  338. package/src/resources/tenants/tenants.ts +13 -5
  339. package/src/resources/translations.ts +7 -2
  340. package/src/resources/users/preferences.ts +86 -44
  341. package/src/resources/users/tenants.ts +13 -10
  342. package/src/resources/users/tokens.ts +15 -6
  343. package/src/resources/workspace-preferences/topics.ts +60 -19
  344. package/src/resources/workspace-preferences/workspace-preferences.ts +96 -21
  345. package/src/version.ts +1 -1
  346. package/version.d.mts +1 -1
  347. package/version.d.ts +1 -1
  348. package/version.js +1 -1
  349. package/version.mjs +1 -1
  350. package/resources/bulk.d.mts +0 -155
  351. package/resources/bulk.d.mts.map +0 -1
  352. package/resources/bulk.d.ts +0 -155
  353. package/resources/bulk.d.ts.map +0 -1
  354. package/resources/bulk.js +0 -58
  355. package/resources/bulk.js.map +0 -1
  356. package/resources/bulk.mjs +0 -54
  357. package/resources/bulk.mjs.map +0 -1
  358. package/src/resources/bulk.ts +0 -210
@@ -15,13 +15,15 @@ import { buildHeaders } from '../../internal/headers';
15
15
  import { RequestOptions } from '../../internal/request-options';
16
16
  import { path } from '../../internal/utils/path';
17
17
 
18
+ /**
19
+ * Manage the workspace catalog of subscription topics, the sections that group them, and publishing the preference page.
20
+ */
18
21
  export class WorkspacePreferences extends APIResource {
19
22
  topics: TopicsAPI.Topics = new TopicsAPI.Topics(this._client);
20
23
 
21
24
  /**
22
- * Create a workspace preference. The workspace preference id is generated and
23
- * returned. Topics are created inside a workspace preference via POST
24
- * /preferences/sections/{section_id}/topics.
25
+ * Creates a workspace preference and returns its generated id. Add subscription
26
+ * topics to it afterwards with the topics endpoint.
25
27
  *
26
28
  * @example
27
29
  * ```ts
@@ -32,14 +34,32 @@ export class WorkspacePreferences extends APIResource {
32
34
  * ```
33
35
  */
34
36
  create(
35
- body: WorkspacePreferenceCreateParams,
37
+ params: WorkspacePreferenceCreateParams,
36
38
  options?: RequestOptions,
37
39
  ): APIPromise<WorkspacePreferenceGetResponse> {
38
- return this._client.post('/preferences/sections', { body, ...options });
40
+ const {
41
+ 'Idempotency-Key': idempotencyKey,
42
+ 'x-idempotency-expiration': xIdempotencyExpiration,
43
+ ...body
44
+ } = params;
45
+ return this._client.post('/preferences/sections', {
46
+ body,
47
+ ...options,
48
+ headers: buildHeaders([
49
+ {
50
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
51
+ ...(xIdempotencyExpiration != null ?
52
+ { 'x-idempotency-expiration': xIdempotencyExpiration }
53
+ : undefined),
54
+ },
55
+ options?.headers,
56
+ ]),
57
+ });
39
58
  }
40
59
 
41
60
  /**
42
- * Retrieve a workspace preference by id, including its topics.
61
+ * Returns one workspace preference by id, including its subscription topics,
62
+ * routing options, and custom routing flag.
43
63
  *
44
64
  * @example
45
65
  * ```ts
@@ -52,8 +72,8 @@ export class WorkspacePreferences extends APIResource {
52
72
  }
53
73
 
54
74
  /**
55
- * List the workspace's preferences. Each workspace preference embeds its topics.
56
- * Scoped to the workspace of the API key.
75
+ * Returns the workspace's preferences, each embedding its subscription topics,
76
+ * routing options, and whether custom routing is allowed.
57
77
  *
58
78
  * @example
59
79
  * ```ts
@@ -82,9 +102,8 @@ export class WorkspacePreferences extends APIResource {
82
102
  }
83
103
 
84
104
  /**
85
- * Publish the workspace's preferences page. Takes a snapshot of every workspace
86
- * preference with its topics under a new published version, making the current
87
- * state visible on the hosted preferences page (non-draft).
105
+ * Publishes the workspace preference page, snapshotting every preference and
106
+ * topic, and returns the page id and a preview URL.
88
107
  *
89
108
  * @example
90
109
  * ```ts
@@ -93,10 +112,27 @@ export class WorkspacePreferences extends APIResource {
93
112
  * ```
94
113
  */
95
114
  publish(
96
- body: WorkspacePreferencePublishParams | null | undefined = {},
115
+ params: WorkspacePreferencePublishParams | null | undefined = {},
97
116
  options?: RequestOptions,
98
117
  ): APIPromise<PublishPreferencesResponse> {
99
- return this._client.post('/preferences/publish', { body, ...options });
118
+ const {
119
+ 'Idempotency-Key': idempotencyKey,
120
+ 'x-idempotency-expiration': xIdempotencyExpiration,
121
+ ...body
122
+ } = params ?? {};
123
+ return this._client.post('/preferences/publish', {
124
+ body,
125
+ ...options,
126
+ headers: buildHeaders([
127
+ {
128
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
129
+ ...(xIdempotencyExpiration != null ?
130
+ { 'x-idempotency-expiration': xIdempotencyExpiration }
131
+ : undefined),
132
+ },
133
+ options?.headers,
134
+ ]),
135
+ });
100
136
  }
101
137
 
102
138
  /**
@@ -444,42 +480,81 @@ export interface WorkspacePreferenceTopicReplaceRequest {
444
480
 
445
481
  export interface WorkspacePreferenceCreateParams {
446
482
  /**
447
- * Human-readable name for the workspace preference.
483
+ * Body param: Human-readable name for the workspace preference.
448
484
  */
449
485
  name: string;
450
486
 
451
487
  /**
452
- * Optional description shown under the section on the hosted preferences page.
488
+ * Body param: Optional description shown under the section on the hosted
489
+ * preferences page.
453
490
  */
454
491
  description?: string | null;
455
492
 
456
493
  /**
457
- * Whether the workspace preference defines custom routing for its topics.
494
+ * Body param: Whether the workspace preference defines custom routing for its
495
+ * topics.
458
496
  */
459
497
  has_custom_routing?: boolean | null;
460
498
 
461
499
  /**
462
- * Default channels for the workspace preference. Defaults to empty if omitted.
500
+ * Body param: Default channels for the workspace preference. Defaults to empty if
501
+ * omitted.
463
502
  */
464
503
  routing_options?: Array<Shared.ChannelClassification> | null;
504
+
505
+ /**
506
+ * Header param: A unique key that makes this request idempotent. If Courier
507
+ * receives another request with the same `Idempotency-Key`, it returns the stored
508
+ * response from the first request without performing the operation again
509
+ * (including the original status code and any error). Use it to safely retry
510
+ * `POST` requests after network failures without risking duplicate sends. The key
511
+ * is scoped to this endpoint.
512
+ */
513
+ 'Idempotency-Key'?: string;
514
+
515
+ /**
516
+ * Header param: How long the idempotency key remains valid, as a Unix epoch
517
+ * timestamp in seconds or an ISO 8601 date string. Only applies when
518
+ * `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
519
+ * maximum is 1 year.
520
+ */
521
+ 'x-idempotency-expiration'?: string;
465
522
  }
466
523
 
467
524
  export interface WorkspacePreferencePublishParams {
468
525
  /**
469
- * Brand for the hosted page - "default" (workspace default brand), "none" (no
470
- * brand), or a specific brand id. Defaults to "default".
526
+ * Body param: Brand for the hosted page - "default" (workspace default brand),
527
+ * "none" (no brand), or a specific brand id. Defaults to "default".
471
528
  */
472
529
  brand_id?: string | null;
473
530
 
474
531
  /**
475
- * Description shown under the heading on the hosted preferences page.
532
+ * Body param: Description shown under the heading on the hosted preferences page.
476
533
  */
477
534
  description?: string | null;
478
535
 
479
536
  /**
480
- * Heading shown at the top of the hosted preferences page.
537
+ * Body param: Heading shown at the top of the hosted preferences page.
481
538
  */
482
539
  heading?: string | null;
540
+
541
+ /**
542
+ * Header param: A unique key that makes this request idempotent. If Courier
543
+ * receives another request with the same `Idempotency-Key`, it returns the stored
544
+ * response from the first request without performing the operation again
545
+ * (including the original status code and any error). Use it to safely retry
546
+ * `POST` requests after network failures without risking duplicate sends. The key
547
+ * is scoped to this endpoint.
548
+ */
549
+ 'Idempotency-Key'?: string;
550
+
551
+ /**
552
+ * Header param: How long the idempotency key remains valid, as a Unix epoch
553
+ * timestamp in seconds or an ISO 8601 date string. Only applies when
554
+ * `Idempotency-Key` is provided. If omitted, the key is retained for 25 hours; the
555
+ * maximum is 1 year.
556
+ */
557
+ 'x-idempotency-expiration'?: string;
483
558
  }
484
559
 
485
560
  export interface WorkspacePreferenceReplaceParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '7.20.0'; // x-release-please-version
1
+ export const VERSION = '7.22.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.20.0";
1
+ export declare const VERSION = "7.22.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "7.20.0";
1
+ export declare const VERSION = "7.22.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '7.20.0'; // x-release-please-version
4
+ exports.VERSION = '7.22.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '7.20.0'; // x-release-please-version
1
+ export const VERSION = '7.22.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,155 +0,0 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import * as BulkAPI from "./bulk.mjs";
3
- import * as Shared from "./shared.mjs";
4
- import { APIPromise } from "../core/api-promise.mjs";
5
- import { RequestOptions } from "../internal/request-options.mjs";
6
- export declare class Bulk extends APIResource {
7
- /**
8
- * Ingest user data into a Bulk Job.
9
- *
10
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
11
- * for provider routing to work correctly. The `to.email` field is not sufficient
12
- * for email provider routing.
13
- */
14
- addUsers(jobID: string, body: BulkAddUsersParams, options?: RequestOptions): APIPromise<void>;
15
- /**
16
- * Creates a new bulk job for sending messages to multiple recipients.
17
- *
18
- * **Required**: `message.event` (event ID or notification ID)
19
- *
20
- * **Optional (V2 format)**: `message.template` (notification ID) or
21
- * `message.content` (Elemental content) can be provided to override the
22
- * notification associated with the event.
23
- */
24
- createJob(body: BulkCreateJobParams, options?: RequestOptions): APIPromise<BulkCreateJobResponse>;
25
- /**
26
- * Get Bulk Job Users
27
- */
28
- listUsers(jobID: string, query?: BulkListUsersParams | null | undefined, options?: RequestOptions): APIPromise<BulkListUsersResponse>;
29
- /**
30
- * Get a bulk job
31
- */
32
- retrieveJob(jobID: string, options?: RequestOptions): APIPromise<BulkRetrieveJobResponse>;
33
- /**
34
- * Run a bulk job
35
- */
36
- runJob(jobID: string, options?: RequestOptions): APIPromise<void>;
37
- }
38
- /**
39
- * Bulk message definition. Supports two formats:
40
- *
41
- * - V1 format: Requires `event` field (event ID or notification ID)
42
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
43
- * content) in addition to `event`
44
- */
45
- export interface InboundBulkMessage {
46
- /**
47
- * Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
48
- * "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
49
- * mapped to a notification.
50
- */
51
- event: string;
52
- brand?: string | null;
53
- /**
54
- * Elemental content (optional, for V2 format). When provided, this will be used
55
- * instead of the notification associated with the `event` field.
56
- */
57
- content?: Shared.ElementalContentSugar | Shared.ElementalContent | null;
58
- data?: {
59
- [key: string]: unknown;
60
- } | null;
61
- locale?: {
62
- [key: string]: {
63
- [key: string]: unknown;
64
- };
65
- } | null;
66
- override?: {
67
- [key: string]: unknown;
68
- } | null;
69
- /**
70
- * Notification ID or template ID (optional, for V2 format). When provided, this
71
- * will be used instead of the notification associated with the `event` field.
72
- */
73
- template?: string | null;
74
- }
75
- export interface InboundBulkMessageUser {
76
- /**
77
- * User-specific data that will be merged with message.data
78
- */
79
- data?: unknown;
80
- preferences?: Shared.RecipientPreferences | null;
81
- /**
82
- * User profile information. For email-based bulk jobs, `profile.email` is required
83
- * for provider routing to determine if the message can be delivered. The email
84
- * address should be provided here rather than in `to.email`.
85
- */
86
- profile?: {
87
- [key: string]: unknown;
88
- } | null;
89
- /**
90
- * User ID (legacy field, use profile or to.user_id instead)
91
- */
92
- recipient?: string | null;
93
- /**
94
- * Optional recipient information. Note: For email provider routing, use
95
- * `profile.email` instead of `to.email`. The `to` field is primarily used for
96
- * recipient identification and data merging.
97
- */
98
- to?: Shared.UserRecipient | null;
99
- }
100
- export interface BulkCreateJobResponse {
101
- jobId: string;
102
- }
103
- export interface BulkListUsersResponse {
104
- items: Array<BulkListUsersResponse.Item>;
105
- paging: Shared.Paging;
106
- }
107
- export declare namespace BulkListUsersResponse {
108
- interface Item extends BulkAPI.InboundBulkMessageUser {
109
- status: 'PENDING' | 'ENQUEUED' | 'ERROR';
110
- messageId?: string | null;
111
- }
112
- }
113
- export interface BulkRetrieveJobResponse {
114
- job: BulkRetrieveJobResponse.Job;
115
- }
116
- export declare namespace BulkRetrieveJobResponse {
117
- interface Job {
118
- /**
119
- * Bulk message definition. Supports two formats:
120
- *
121
- * - V1 format: Requires `event` field (event ID or notification ID)
122
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
123
- * content) in addition to `event`
124
- */
125
- definition: BulkAPI.InboundBulkMessage;
126
- enqueued: number;
127
- failures: number;
128
- received: number;
129
- status: 'CREATED' | 'PROCESSING' | 'COMPLETED' | 'ERROR';
130
- }
131
- }
132
- export interface BulkAddUsersParams {
133
- users: Array<InboundBulkMessageUser>;
134
- }
135
- export interface BulkCreateJobParams {
136
- /**
137
- * Bulk message definition. Supports two formats:
138
- *
139
- * - V1 format: Requires `event` field (event ID or notification ID)
140
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
141
- * content) in addition to `event`
142
- */
143
- message: InboundBulkMessage;
144
- }
145
- export interface BulkListUsersParams {
146
- /**
147
- * A unique identifier that allows for fetching the next set of users added to the
148
- * bulk job
149
- */
150
- cursor?: string | null;
151
- }
152
- export declare namespace Bulk {
153
- export { type InboundBulkMessage as InboundBulkMessage, type InboundBulkMessageUser as InboundBulkMessageUser, type BulkCreateJobResponse as BulkCreateJobResponse, type BulkListUsersResponse as BulkListUsersResponse, type BulkRetrieveJobResponse as BulkRetrieveJobResponse, type BulkAddUsersParams as BulkAddUsersParams, type BulkCreateJobParams as BulkCreateJobParams, type BulkListUsersParams as BulkListUsersParams, };
154
- }
155
- //# sourceMappingURL=bulk.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.d.mts","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,OAAO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,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QAEjB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;KAC1D;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -1,155 +0,0 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as BulkAPI from "./bulk.js";
3
- import * as Shared from "./shared.js";
4
- import { APIPromise } from "../core/api-promise.js";
5
- import { RequestOptions } from "../internal/request-options.js";
6
- export declare class Bulk extends APIResource {
7
- /**
8
- * Ingest user data into a Bulk Job.
9
- *
10
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
11
- * for provider routing to work correctly. The `to.email` field is not sufficient
12
- * for email provider routing.
13
- */
14
- addUsers(jobID: string, body: BulkAddUsersParams, options?: RequestOptions): APIPromise<void>;
15
- /**
16
- * Creates a new bulk job for sending messages to multiple recipients.
17
- *
18
- * **Required**: `message.event` (event ID or notification ID)
19
- *
20
- * **Optional (V2 format)**: `message.template` (notification ID) or
21
- * `message.content` (Elemental content) can be provided to override the
22
- * notification associated with the event.
23
- */
24
- createJob(body: BulkCreateJobParams, options?: RequestOptions): APIPromise<BulkCreateJobResponse>;
25
- /**
26
- * Get Bulk Job Users
27
- */
28
- listUsers(jobID: string, query?: BulkListUsersParams | null | undefined, options?: RequestOptions): APIPromise<BulkListUsersResponse>;
29
- /**
30
- * Get a bulk job
31
- */
32
- retrieveJob(jobID: string, options?: RequestOptions): APIPromise<BulkRetrieveJobResponse>;
33
- /**
34
- * Run a bulk job
35
- */
36
- runJob(jobID: string, options?: RequestOptions): APIPromise<void>;
37
- }
38
- /**
39
- * Bulk message definition. Supports two formats:
40
- *
41
- * - V1 format: Requires `event` field (event ID or notification ID)
42
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
43
- * content) in addition to `event`
44
- */
45
- export interface InboundBulkMessage {
46
- /**
47
- * Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
48
- * "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
49
- * mapped to a notification.
50
- */
51
- event: string;
52
- brand?: string | null;
53
- /**
54
- * Elemental content (optional, for V2 format). When provided, this will be used
55
- * instead of the notification associated with the `event` field.
56
- */
57
- content?: Shared.ElementalContentSugar | Shared.ElementalContent | null;
58
- data?: {
59
- [key: string]: unknown;
60
- } | null;
61
- locale?: {
62
- [key: string]: {
63
- [key: string]: unknown;
64
- };
65
- } | null;
66
- override?: {
67
- [key: string]: unknown;
68
- } | null;
69
- /**
70
- * Notification ID or template ID (optional, for V2 format). When provided, this
71
- * will be used instead of the notification associated with the `event` field.
72
- */
73
- template?: string | null;
74
- }
75
- export interface InboundBulkMessageUser {
76
- /**
77
- * User-specific data that will be merged with message.data
78
- */
79
- data?: unknown;
80
- preferences?: Shared.RecipientPreferences | null;
81
- /**
82
- * User profile information. For email-based bulk jobs, `profile.email` is required
83
- * for provider routing to determine if the message can be delivered. The email
84
- * address should be provided here rather than in `to.email`.
85
- */
86
- profile?: {
87
- [key: string]: unknown;
88
- } | null;
89
- /**
90
- * User ID (legacy field, use profile or to.user_id instead)
91
- */
92
- recipient?: string | null;
93
- /**
94
- * Optional recipient information. Note: For email provider routing, use
95
- * `profile.email` instead of `to.email`. The `to` field is primarily used for
96
- * recipient identification and data merging.
97
- */
98
- to?: Shared.UserRecipient | null;
99
- }
100
- export interface BulkCreateJobResponse {
101
- jobId: string;
102
- }
103
- export interface BulkListUsersResponse {
104
- items: Array<BulkListUsersResponse.Item>;
105
- paging: Shared.Paging;
106
- }
107
- export declare namespace BulkListUsersResponse {
108
- interface Item extends BulkAPI.InboundBulkMessageUser {
109
- status: 'PENDING' | 'ENQUEUED' | 'ERROR';
110
- messageId?: string | null;
111
- }
112
- }
113
- export interface BulkRetrieveJobResponse {
114
- job: BulkRetrieveJobResponse.Job;
115
- }
116
- export declare namespace BulkRetrieveJobResponse {
117
- interface Job {
118
- /**
119
- * Bulk message definition. Supports two formats:
120
- *
121
- * - V1 format: Requires `event` field (event ID or notification ID)
122
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
123
- * content) in addition to `event`
124
- */
125
- definition: BulkAPI.InboundBulkMessage;
126
- enqueued: number;
127
- failures: number;
128
- received: number;
129
- status: 'CREATED' | 'PROCESSING' | 'COMPLETED' | 'ERROR';
130
- }
131
- }
132
- export interface BulkAddUsersParams {
133
- users: Array<InboundBulkMessageUser>;
134
- }
135
- export interface BulkCreateJobParams {
136
- /**
137
- * Bulk message definition. Supports two formats:
138
- *
139
- * - V1 format: Requires `event` field (event ID or notification ID)
140
- * - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
141
- * content) in addition to `event`
142
- */
143
- message: InboundBulkMessage;
144
- }
145
- export interface BulkListUsersParams {
146
- /**
147
- * A unique identifier that allows for fetching the next set of users added to the
148
- * bulk job
149
- */
150
- cursor?: string | null;
151
- }
152
- export declare namespace Bulk {
153
- export { type InboundBulkMessage as InboundBulkMessage, type InboundBulkMessageUser as InboundBulkMessageUser, type BulkCreateJobResponse as BulkCreateJobResponse, type BulkListUsersResponse as BulkListUsersResponse, type BulkRetrieveJobResponse as BulkRetrieveJobResponse, type BulkAddUsersParams as BulkAddUsersParams, type BulkCreateJobParams as BulkCreateJobParams, type BulkListUsersParams as BulkListUsersParams, };
154
- }
155
- //# sourceMappingURL=bulk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,OAAO,kBAAe;AAClC,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAQ7F;;;;;;;;OAQG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAIjG;;OAEG;IACH,SAAS,CACP,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAIpC;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIzF;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMlE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,KAAK,EAAE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BAAsB;QAC1D,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;QAEzC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC3B;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,uBAAuB,CAAC,GAAG,CAAC;CAClC;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,GAAG;QAClB;;;;;;WAMG;QACH,UAAU,EAAE,OAAO,CAAC,kBAAkB,CAAC;QAEvC,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,MAAM,CAAC;QAEjB,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;KAC1D;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
package/resources/bulk.js DELETED
@@ -1,58 +0,0 @@
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.Bulk = 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 Bulk extends resource_1.APIResource {
9
- /**
10
- * Ingest user data into a Bulk Job.
11
- *
12
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
13
- * for provider routing to work correctly. The `to.email` field is not sufficient
14
- * for email provider routing.
15
- */
16
- addUsers(jobID, body, options) {
17
- return this._client.post((0, path_1.path) `/bulk/${jobID}`, {
18
- body,
19
- ...options,
20
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
21
- });
22
- }
23
- /**
24
- * Creates a new bulk job for sending messages to multiple recipients.
25
- *
26
- * **Required**: `message.event` (event ID or notification ID)
27
- *
28
- * **Optional (V2 format)**: `message.template` (notification ID) or
29
- * `message.content` (Elemental content) can be provided to override the
30
- * notification associated with the event.
31
- */
32
- createJob(body, options) {
33
- return this._client.post('/bulk', { body, ...options });
34
- }
35
- /**
36
- * Get Bulk Job Users
37
- */
38
- listUsers(jobID, query = {}, options) {
39
- return this._client.get((0, path_1.path) `/bulk/${jobID}/users`, { query, ...options });
40
- }
41
- /**
42
- * Get a bulk job
43
- */
44
- retrieveJob(jobID, options) {
45
- return this._client.get((0, path_1.path) `/bulk/${jobID}`, options);
46
- }
47
- /**
48
- * Run a bulk job
49
- */
50
- runJob(jobID, options) {
51
- return this._client.post((0, path_1.path) `/bulk/${jobID}/run`, {
52
- ...options,
53
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
54
- });
55
- }
56
- }
57
- exports.Bulk = Bulk;
58
- //# sourceMappingURL=bulk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.js","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;OAMG;IACH,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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 Bulk extends APIResource {
6
- /**
7
- * Ingest user data into a Bulk Job.
8
- *
9
- * **Important**: For email-based bulk jobs, each user must include `profile.email`
10
- * for provider routing to work correctly. The `to.email` field is not sufficient
11
- * for email provider routing.
12
- */
13
- addUsers(jobID, body, options) {
14
- return this._client.post(path `/bulk/${jobID}`, {
15
- body,
16
- ...options,
17
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
18
- });
19
- }
20
- /**
21
- * Creates a new bulk job for sending messages to multiple recipients.
22
- *
23
- * **Required**: `message.event` (event ID or notification ID)
24
- *
25
- * **Optional (V2 format)**: `message.template` (notification ID) or
26
- * `message.content` (Elemental content) can be provided to override the
27
- * notification associated with the event.
28
- */
29
- createJob(body, options) {
30
- return this._client.post('/bulk', { body, ...options });
31
- }
32
- /**
33
- * Get Bulk Job Users
34
- */
35
- listUsers(jobID, query = {}, options) {
36
- return this._client.get(path `/bulk/${jobID}/users`, { query, ...options });
37
- }
38
- /**
39
- * Get a bulk job
40
- */
41
- retrieveJob(jobID, options) {
42
- return this._client.get(path `/bulk/${jobID}`, options);
43
- }
44
- /**
45
- * Run a bulk job
46
- */
47
- runJob(jobID, options) {
48
- return this._client.post(path `/bulk/${jobID}/run`, {
49
- ...options,
50
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
51
- });
52
- }
53
- }
54
- //# sourceMappingURL=bulk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk.mjs","sourceRoot":"","sources":["../src/resources/bulk.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAI/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,IAAK,SAAQ,WAAW;IACn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