@trycourier/courier 6.6.1-alpha0 → 6.7.0-alpha10

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 (312) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +11 -11
  3. package/client.d.mts +48 -20
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +48 -20
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/to-file.d.mts +1 -1
  11. package/internal/to-file.d.ts +1 -1
  12. package/internal/to-file.js +1 -1
  13. package/internal/to-file.mjs +1 -1
  14. package/internal/tslib.js +6 -6
  15. package/package.json +1 -1
  16. package/resources/audiences.d.mts +30 -52
  17. package/resources/audiences.d.mts.map +1 -1
  18. package/resources/audiences.d.ts +30 -52
  19. package/resources/audiences.d.ts.map +1 -1
  20. package/resources/audiences.js.map +1 -1
  21. package/resources/audiences.mjs.map +1 -1
  22. package/resources/audit-events.d.mts +5 -9
  23. package/resources/audit-events.d.mts.map +1 -1
  24. package/resources/audit-events.d.ts +5 -9
  25. package/resources/audit-events.d.ts.map +1 -1
  26. package/resources/auth.d.mts +2 -2
  27. package/resources/auth.d.mts.map +1 -1
  28. package/resources/auth.d.ts +2 -2
  29. package/resources/auth.d.ts.map +1 -1
  30. package/resources/automations/automations.d.mts +5 -252
  31. package/resources/automations/automations.d.mts.map +1 -1
  32. package/resources/automations/automations.d.ts +5 -252
  33. package/resources/automations/automations.d.ts.map +1 -1
  34. package/resources/automations/automations.js +0 -42
  35. package/resources/automations/automations.js.map +1 -1
  36. package/resources/automations/automations.mjs +1 -43
  37. package/resources/automations/automations.mjs.map +1 -1
  38. package/resources/automations/index.d.mts +2 -2
  39. package/resources/automations/index.d.mts.map +1 -1
  40. package/resources/automations/index.d.ts +2 -2
  41. package/resources/automations/index.d.ts.map +1 -1
  42. package/resources/automations/index.js.map +1 -1
  43. package/resources/automations/index.mjs +2 -2
  44. package/resources/automations/index.mjs.map +1 -1
  45. package/resources/automations/invoke.d.mts +122 -9
  46. package/resources/automations/invoke.d.mts.map +1 -1
  47. package/resources/automations/invoke.d.ts +122 -9
  48. package/resources/automations/invoke.d.ts.map +1 -1
  49. package/resources/automations/invoke.js +45 -0
  50. package/resources/automations/invoke.js.map +1 -1
  51. package/resources/automations/invoke.mjs +45 -0
  52. package/resources/automations/invoke.mjs.map +1 -1
  53. package/resources/brands.d.mts +76 -52
  54. package/resources/brands.d.mts.map +1 -1
  55. package/resources/brands.d.ts +76 -52
  56. package/resources/brands.d.ts.map +1 -1
  57. package/resources/brands.js.map +1 -1
  58. package/resources/brands.mjs.map +1 -1
  59. package/resources/bulk.d.mts +36 -127
  60. package/resources/bulk.d.mts.map +1 -1
  61. package/resources/bulk.d.ts +36 -127
  62. package/resources/bulk.d.ts.map +1 -1
  63. package/resources/bulk.js.map +1 -1
  64. package/resources/bulk.mjs.map +1 -1
  65. package/resources/inbound.d.mts +1 -1
  66. package/resources/inbound.d.ts +1 -1
  67. package/resources/index.d.mts +11 -10
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +11 -10
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js +2 -0
  72. package/resources/index.js.map +1 -1
  73. package/resources/index.mjs +3 -2
  74. package/resources/index.mjs.map +1 -1
  75. package/resources/lists/index.d.mts +2 -2
  76. package/resources/lists/index.d.mts.map +1 -1
  77. package/resources/lists/index.d.ts +2 -2
  78. package/resources/lists/index.d.ts.map +1 -1
  79. package/resources/lists/index.js.map +1 -1
  80. package/resources/lists/index.mjs +1 -1
  81. package/resources/lists/index.mjs.map +1 -1
  82. package/resources/lists/lists.d.mts +19 -13
  83. package/resources/lists/lists.d.mts.map +1 -1
  84. package/resources/lists/lists.d.ts +19 -13
  85. package/resources/lists/lists.d.ts.map +1 -1
  86. package/resources/lists/lists.js +7 -2
  87. package/resources/lists/lists.js.map +1 -1
  88. package/resources/lists/lists.mjs +7 -2
  89. package/resources/lists/lists.mjs.map +1 -1
  90. package/resources/lists/subscriptions.d.mts +8 -52
  91. package/resources/lists/subscriptions.d.mts.map +1 -1
  92. package/resources/lists/subscriptions.d.ts +8 -52
  93. package/resources/lists/subscriptions.d.ts.map +1 -1
  94. package/resources/lists/subscriptions.js.map +1 -1
  95. package/resources/lists/subscriptions.mjs.map +1 -1
  96. package/resources/messages.d.mts +8 -8
  97. package/resources/messages.d.mts.map +1 -1
  98. package/resources/messages.d.ts +8 -8
  99. package/resources/messages.d.ts.map +1 -1
  100. package/resources/messages.js +1 -1
  101. package/resources/messages.js.map +1 -1
  102. package/resources/messages.mjs +1 -1
  103. package/resources/messages.mjs.map +1 -1
  104. package/resources/notifications/checks.d.mts +5 -12
  105. package/resources/notifications/checks.d.mts.map +1 -1
  106. package/resources/notifications/checks.d.ts +5 -12
  107. package/resources/notifications/checks.d.ts.map +1 -1
  108. package/resources/notifications/checks.js.map +1 -1
  109. package/resources/notifications/checks.mjs.map +1 -1
  110. package/resources/notifications/index.d.mts +2 -2
  111. package/resources/notifications/index.d.mts.map +1 -1
  112. package/resources/notifications/index.d.ts +2 -2
  113. package/resources/notifications/index.d.ts.map +1 -1
  114. package/resources/notifications/index.js.map +1 -1
  115. package/resources/notifications/index.mjs.map +1 -1
  116. package/resources/notifications/notifications.d.mts +13 -11
  117. package/resources/notifications/notifications.d.mts.map +1 -1
  118. package/resources/notifications/notifications.d.ts +13 -11
  119. package/resources/notifications/notifications.d.ts.map +1 -1
  120. package/resources/notifications/notifications.js.map +1 -1
  121. package/resources/notifications/notifications.mjs.map +1 -1
  122. package/resources/profiles/index.d.mts +1 -1
  123. package/resources/profiles/index.d.mts.map +1 -1
  124. package/resources/profiles/index.d.ts +1 -1
  125. package/resources/profiles/index.d.ts.map +1 -1
  126. package/resources/profiles/index.js.map +1 -1
  127. package/resources/profiles/index.mjs.map +1 -1
  128. package/resources/profiles/lists.d.mts +5 -11
  129. package/resources/profiles/lists.d.mts.map +1 -1
  130. package/resources/profiles/lists.d.ts +5 -11
  131. package/resources/profiles/lists.d.ts.map +1 -1
  132. package/resources/profiles/profiles.d.mts +7 -3
  133. package/resources/profiles/profiles.d.mts.map +1 -1
  134. package/resources/profiles/profiles.d.ts +7 -3
  135. package/resources/profiles/profiles.d.ts.map +1 -1
  136. package/resources/profiles/profiles.js.map +1 -1
  137. package/resources/profiles/profiles.mjs.map +1 -1
  138. package/resources/send.d.mts +127 -745
  139. package/resources/send.d.mts.map +1 -1
  140. package/resources/send.d.ts +127 -745
  141. package/resources/send.d.ts.map +1 -1
  142. package/resources/send.js +12 -1
  143. package/resources/send.js.map +1 -1
  144. package/resources/send.mjs +12 -1
  145. package/resources/send.mjs.map +1 -1
  146. package/resources/shared.d.mts +245 -0
  147. package/resources/shared.d.mts.map +1 -0
  148. package/resources/shared.d.ts +245 -0
  149. package/resources/shared.d.ts.map +1 -0
  150. package/resources/shared.js +4 -0
  151. package/resources/shared.js.map +1 -0
  152. package/{src/resources/tenants/default-preferences.ts → resources/shared.mjs} +2 -2
  153. package/resources/shared.mjs.map +1 -0
  154. package/resources/tenants/index.d.mts +3 -1
  155. package/resources/tenants/index.d.mts.map +1 -1
  156. package/resources/tenants/index.d.ts +3 -1
  157. package/resources/tenants/index.d.ts.map +1 -1
  158. package/resources/tenants/index.js +5 -1
  159. package/resources/tenants/index.js.map +1 -1
  160. package/resources/tenants/index.mjs +2 -0
  161. package/resources/tenants/index.mjs.map +1 -1
  162. package/resources/tenants/templates.d.mts +91 -0
  163. package/resources/tenants/templates.d.mts.map +1 -0
  164. package/resources/tenants/templates.d.ts +91 -0
  165. package/resources/tenants/templates.d.ts.map +1 -0
  166. package/resources/tenants/templates.js +38 -0
  167. package/resources/tenants/templates.js.map +1 -0
  168. package/resources/tenants/templates.mjs +34 -0
  169. package/resources/tenants/templates.mjs.map +1 -0
  170. package/resources/tenants/tenant-default-preferences/index.d.mts +3 -0
  171. package/resources/tenants/tenant-default-preferences/index.d.mts.map +1 -0
  172. package/resources/tenants/tenant-default-preferences/index.d.ts +3 -0
  173. package/resources/tenants/tenant-default-preferences/index.d.ts.map +1 -0
  174. package/resources/tenants/tenant-default-preferences/index.js +9 -0
  175. package/resources/tenants/tenant-default-preferences/index.js.map +1 -0
  176. package/resources/tenants/tenant-default-preferences/index.mjs +4 -0
  177. package/resources/tenants/tenant-default-preferences/index.mjs.map +1 -0
  178. package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.mts +5 -18
  179. package/resources/tenants/tenant-default-preferences/items.d.mts.map +1 -0
  180. package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.ts +5 -18
  181. package/resources/tenants/tenant-default-preferences/items.d.ts.map +1 -0
  182. package/resources/tenants/{default-preferences → tenant-default-preferences}/items.js +2 -2
  183. package/resources/tenants/tenant-default-preferences/items.js.map +1 -0
  184. package/resources/tenants/{default-preferences → tenant-default-preferences}/items.mjs +2 -2
  185. package/resources/tenants/tenant-default-preferences/items.mjs.map +1 -0
  186. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts +10 -0
  187. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts.map +1 -0
  188. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts +10 -0
  189. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts.map +1 -0
  190. package/resources/tenants/{default-preferences/default-preferences.js → tenant-default-preferences/tenant-default-preferences.js} +5 -5
  191. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.js.map +1 -0
  192. package/resources/tenants/{default-preferences/default-preferences.mjs → tenant-default-preferences/tenant-default-preferences.mjs} +4 -4
  193. package/resources/tenants/tenant-default-preferences/tenant-default-preferences.mjs.map +1 -0
  194. package/resources/tenants/tenant-default-preferences.d.mts +2 -0
  195. package/resources/tenants/tenant-default-preferences.d.mts.map +1 -0
  196. package/resources/tenants/tenant-default-preferences.d.ts +2 -0
  197. package/resources/tenants/tenant-default-preferences.d.ts.map +1 -0
  198. package/resources/tenants/{default-preferences.js → tenant-default-preferences.js} +2 -2
  199. package/resources/tenants/tenant-default-preferences.js.map +1 -0
  200. package/resources/tenants/tenant-default-preferences.mjs +3 -0
  201. package/resources/tenants/tenant-default-preferences.mjs.map +1 -0
  202. package/resources/tenants/tenants.d.mts +66 -7
  203. package/resources/tenants/tenants.d.mts.map +1 -1
  204. package/resources/tenants/tenants.d.ts +66 -7
  205. package/resources/tenants/tenants.d.ts.map +1 -1
  206. package/resources/tenants/tenants.js +8 -2
  207. package/resources/tenants/tenants.js.map +1 -1
  208. package/resources/tenants/tenants.mjs +8 -2
  209. package/resources/tenants/tenants.mjs.map +1 -1
  210. package/resources/users/index.d.mts +3 -3
  211. package/resources/users/index.d.mts.map +1 -1
  212. package/resources/users/index.d.ts +3 -3
  213. package/resources/users/index.d.ts.map +1 -1
  214. package/resources/users/index.js.map +1 -1
  215. package/resources/users/index.mjs.map +1 -1
  216. package/resources/users/preferences.d.mts +8 -11
  217. package/resources/users/preferences.d.mts.map +1 -1
  218. package/resources/users/preferences.d.ts +8 -11
  219. package/resources/users/preferences.d.ts.map +1 -1
  220. package/resources/users/preferences.js.map +1 -1
  221. package/resources/users/preferences.mjs.map +1 -1
  222. package/resources/users/tenants.d.mts +4 -21
  223. package/resources/users/tenants.d.mts.map +1 -1
  224. package/resources/users/tenants.d.ts +4 -21
  225. package/resources/users/tenants.d.ts.map +1 -1
  226. package/resources/users/tenants.js.map +1 -1
  227. package/resources/users/tenants.mjs.map +1 -1
  228. package/resources/users/tokens.d.mts +22 -23
  229. package/resources/users/tokens.d.mts.map +1 -1
  230. package/resources/users/tokens.d.ts +22 -23
  231. package/resources/users/tokens.d.ts.map +1 -1
  232. package/resources/users/tokens.js +14 -15
  233. package/resources/users/tokens.js.map +1 -1
  234. package/resources/users/tokens.mjs +14 -15
  235. package/resources/users/tokens.mjs.map +1 -1
  236. package/resources/users/users.d.mts +6 -6
  237. package/resources/users/users.d.mts.map +1 -1
  238. package/resources/users/users.d.ts +6 -6
  239. package/resources/users/users.d.ts.map +1 -1
  240. package/resources/users/users.js.map +1 -1
  241. package/resources/users/users.mjs.map +1 -1
  242. package/src/client.ts +81 -56
  243. package/src/internal/to-file.ts +1 -1
  244. package/src/resources/audiences.ts +45 -90
  245. package/src/resources/audit-events.ts +7 -13
  246. package/src/resources/auth.ts +2 -16
  247. package/src/resources/automations/automations.ts +6 -342
  248. package/src/resources/automations/index.ts +2 -12
  249. package/src/resources/automations/invoke.ts +163 -14
  250. package/src/resources/brands.ts +119 -53
  251. package/src/resources/bulk.ts +28 -148
  252. package/src/resources/inbound.ts +1 -1
  253. package/src/resources/index.ts +24 -30
  254. package/src/resources/lists/index.ts +9 -3
  255. package/src/resources/lists/lists.ts +27 -16
  256. package/src/resources/lists/subscriptions.ts +7 -65
  257. package/src/resources/messages.ts +10 -7
  258. package/src/resources/notifications/checks.ts +4 -17
  259. package/src/resources/notifications/index.ts +2 -4
  260. package/src/resources/notifications/notifications.ts +13 -14
  261. package/src/resources/profiles/index.ts +1 -0
  262. package/src/resources/profiles/lists.ts +5 -13
  263. package/src/resources/profiles/profiles.ts +9 -2
  264. package/src/resources/send.ts +122 -928
  265. package/src/resources/shared.ts +305 -0
  266. package/src/resources/tenants/index.ts +10 -0
  267. package/src/resources/tenants/templates.ts +124 -0
  268. package/src/resources/tenants/tenant-default-preferences/index.ts +4 -0
  269. package/src/resources/tenants/{default-preferences → tenant-default-preferences}/items.ts +5 -27
  270. package/src/resources/tenants/{default-preferences/default-preferences.ts → tenant-default-preferences/tenant-default-preferences.ts} +4 -12
  271. package/src/resources/tenants/tenant-default-preferences.ts +3 -0
  272. package/src/resources/tenants/tenants.ts +89 -8
  273. package/src/resources/users/index.ts +2 -4
  274. package/src/resources/users/preferences.ts +7 -12
  275. package/src/resources/users/tenants.ts +3 -23
  276. package/src/resources/users/tokens.ts +33 -34
  277. package/src/resources/users/users.ts +4 -8
  278. package/src/version.ts +1 -1
  279. package/version.d.mts +1 -1
  280. package/version.d.mts.map +1 -1
  281. package/version.d.ts +1 -1
  282. package/version.d.ts.map +1 -1
  283. package/version.js +1 -1
  284. package/version.js.map +1 -1
  285. package/version.mjs +1 -1
  286. package/version.mjs.map +1 -1
  287. package/resources/tenants/default-preferences/default-preferences.d.mts +0 -10
  288. package/resources/tenants/default-preferences/default-preferences.d.mts.map +0 -1
  289. package/resources/tenants/default-preferences/default-preferences.d.ts +0 -10
  290. package/resources/tenants/default-preferences/default-preferences.d.ts.map +0 -1
  291. package/resources/tenants/default-preferences/default-preferences.js.map +0 -1
  292. package/resources/tenants/default-preferences/default-preferences.mjs.map +0 -1
  293. package/resources/tenants/default-preferences/index.d.mts +0 -3
  294. package/resources/tenants/default-preferences/index.d.mts.map +0 -1
  295. package/resources/tenants/default-preferences/index.d.ts +0 -3
  296. package/resources/tenants/default-preferences/index.d.ts.map +0 -1
  297. package/resources/tenants/default-preferences/index.js +0 -9
  298. package/resources/tenants/default-preferences/index.js.map +0 -1
  299. package/resources/tenants/default-preferences/index.mjs +0 -4
  300. package/resources/tenants/default-preferences/index.mjs.map +0 -1
  301. package/resources/tenants/default-preferences/items.d.mts.map +0 -1
  302. package/resources/tenants/default-preferences/items.d.ts.map +0 -1
  303. package/resources/tenants/default-preferences/items.js.map +0 -1
  304. package/resources/tenants/default-preferences/items.mjs.map +0 -1
  305. package/resources/tenants/default-preferences.d.mts +0 -2
  306. package/resources/tenants/default-preferences.d.mts.map +0 -1
  307. package/resources/tenants/default-preferences.d.ts +0 -2
  308. package/resources/tenants/default-preferences.d.ts.map +0 -1
  309. package/resources/tenants/default-preferences.js.map +0 -1
  310. package/resources/tenants/default-preferences.mjs +0 -3
  311. package/resources/tenants/default-preferences.mjs.map +0 -1
  312. package/src/resources/tenants/default-preferences/index.ts +0 -10
@@ -1,810 +1,192 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
- import * as SendAPI from "./send.mjs";
3
- import * as BulkAPI from "./bulk.mjs";
2
+ import * as Shared from "./shared.mjs";
4
3
  import { APIPromise } from "../core/api-promise.mjs";
5
4
  import { RequestOptions } from "../internal/request-options.mjs";
6
5
  export declare class Send extends APIResource {
7
6
  /**
8
7
  * Use the send API to send a message to one or more recipients.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const response = await client.send.message({
12
+ * message: {
13
+ * to: { user_id: 'example_user' },
14
+ * template: 'template_id',
15
+ * data: { foo: 'bar' },
16
+ * },
17
+ * });
18
+ * ```
9
19
  */
10
- sendMessage(body: SendSendMessageParams, options?: RequestOptions): APIPromise<SendSendMessageResponse>;
20
+ message(body: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse>;
11
21
  }
12
- export interface BaseMessage {
13
- brand_id?: string | null;
14
- /**
15
- * "Define run-time configuration for one or more channels. If you don't specify
16
- * channels, the default configuration for each channel will be used. Valid
17
- * ChannelId's are: email, sms, push, inbox, direct_message, banner, and webhook."
18
- */
19
- channels?: {
20
- [key: string]: BaseMessage.Channels;
21
- } | null;
22
- /**
23
- * Context to load with this recipient. Will override any context set on
24
- * message.context.
25
- */
26
- context?: MessageContext | null;
27
- /**
28
- * An arbitrary object that includes any data you want to pass to the message. The
29
- * data will populate the corresponding template or elements variables.
30
- */
31
- data?: {
32
- [key: string]: unknown;
33
- } | null;
34
- /**
35
- * Defines the time to wait before delivering the message. You can specify one of
36
- * the following options. Duration with the number of milliseconds to delay. Until
37
- * with an ISO 8601 timestamp that specifies when it should be delivered. Until
38
- * with an OpenStreetMap opening_hours-like format that specifies the
39
- * [Delivery Window](https://www.courier.com/docs/platform/sending/failover/#delivery-window)
40
- * (e.g., 'Mo-Fr 08:00-18:00pm')
41
- */
42
- delay?: BaseMessage.Delay | null;
43
- /**
44
- * "Expiry allows you to set an absolute or relative time in which a message
45
- * expires. Note: This is only valid for the Courier Inbox channel as of
46
- * 12-08-2022."
47
- */
48
- expiry?: BaseMessage.Expiry | null;
49
- /**
50
- * Metadata such as utm tracking attached with the notification through this
51
- * channel.
52
- */
53
- metadata?: BaseMessage.Metadata | null;
54
- preferences?: BaseMessage.Preferences | null;
22
+ export interface SendMessageResponse {
55
23
  /**
56
- * An object whose keys are valid provider identifiers which map to an object.
24
+ * A successful call to `POST /send` returns a `202` status code along with a
25
+ * `requestId` in the response body. For single-recipient requests, the `requestId`
26
+ * is the derived message_id. For multiple recipients, Courier assigns a unique
27
+ * message_id to each derived message.
57
28
  */
58
- providers?: {
59
- [key: string]: BaseMessage.Providers;
60
- } | null;
29
+ requestId: string;
30
+ }
31
+ export interface SendMessageParams {
61
32
  /**
62
- * Allows you to customize which channel(s) Courier will potentially deliver the
63
- * message. If no routing key is specified, Courier will use the default routing
64
- * configuration or routing defined by the template.
33
+ * The message property has the following primary top-level properties. They define
34
+ * the destination and content of the message.
65
35
  */
66
- routing?: BaseMessage.Routing | null;
36
+ message: SendMessageParams.Message;
37
+ }
38
+ export declare namespace SendMessageParams {
67
39
  /**
68
- * Time in ms to attempt the channel before failing over to the next available
69
- * channel.
40
+ * The message property has the following primary top-level properties. They define
41
+ * the destination and content of the message.
70
42
  */
71
- timeout?: BaseMessage.Timeout | null;
72
- }
73
- export declare namespace BaseMessage {
74
- interface Channels {
75
- /**
76
- * Id of the brand that should be used for rendering the message. If not specified,
77
- * the brand configured as default brand will be used.
78
- */
43
+ interface Message {
79
44
  brand_id?: string | null;
80
45
  /**
81
- * A JavaScript conditional expression to determine if the message should be sent
82
- * through the channel. Has access to the data and profile object. For example,
83
- * `data.name === profile.name`
46
+ * Define run-time configuration for channels. Valid ChannelId's: email, sms, push,
47
+ * inbox, direct_message, banner, webhook.
84
48
  */
85
- if?: string | null;
86
- metadata?: Channels.Metadata | null;
87
- /**
88
- * Channel specific overrides.
89
- */
90
- override?: {
91
- [key: string]: unknown;
49
+ channels?: {
50
+ [key: string]: Message.Channels;
92
51
  } | null;
93
52
  /**
94
- * A list of providers enabled for this channel. Courier will select one provider
95
- * to send through unless routing_method is set to all.
96
- */
97
- providers?: Array<string> | null;
98
- /**
99
- * The method for selecting the providers to send the message with. Single will
100
- * send to one of the available providers for this channel, all will send the
101
- * message through all channels. Defaults to `single`.
53
+ * Describes content that will work for email, inbox, push, chat, or any channel
54
+ * id.
102
55
  */
103
- routing_method?: SendAPI.RoutingMethod | null;
104
- timeouts?: Channels.Timeouts | null;
105
- }
106
- namespace Channels {
107
- interface Metadata {
108
- utm?: SendAPI.Utm | null;
109
- }
110
- interface Timeouts {
111
- channel?: number | null;
112
- provider?: number | null;
113
- }
114
- }
115
- /**
116
- * Defines the time to wait before delivering the message. You can specify one of
117
- * the following options. Duration with the number of milliseconds to delay. Until
118
- * with an ISO 8601 timestamp that specifies when it should be delivered. Until
119
- * with an OpenStreetMap opening_hours-like format that specifies the
120
- * [Delivery Window](https://www.courier.com/docs/platform/sending/failover/#delivery-window)
121
- * (e.g., 'Mo-Fr 08:00-18:00pm')
122
- */
123
- interface Delay {
124
- /**
125
- * The duration of the delay in milliseconds.
126
- */
127
- duration?: number | null;
128
- /**
129
- * An ISO 8601 timestamp that specifies when it should be delivered or an
130
- * OpenStreetMap opening_hours-like format that specifies the
131
- * [Delivery Window](https://www.courier.com/docs/platform/sending/failover/#delivery-window)
132
- * (e.g., 'Mo-Fr 08:00-18:00pm')
133
- */
134
- until?: string | null;
135
- }
136
- /**
137
- * "Expiry allows you to set an absolute or relative time in which a message
138
- * expires. Note: This is only valid for the Courier Inbox channel as of
139
- * 12-08-2022."
140
- */
141
- interface Expiry {
142
- /**
143
- * A duration in the form of milliseconds or an ISO8601 Duration format (i.e.
144
- * P1DT4H).
145
- */
146
- expires_in: string | number;
147
- /**
148
- * An epoch timestamp or ISO8601 timestamp with timezone
149
- * `(YYYY-MM-DDThh:mm:ss.sTZD)` that describes the time in which a message expires.
150
- */
151
- expires_at?: string | null;
152
- }
153
- /**
154
- * Metadata such as utm tracking attached with the notification through this
155
- * channel.
156
- */
157
- interface Metadata {
158
- /**
159
- * An arbitrary string to tracks the event that generated this request (e.g.
160
- * 'signup').
161
- */
162
- event?: string | null;
163
- /**
164
- * An array of up to 9 tags you wish to associate with this request (and
165
- * corresponding messages) for later analysis. Individual tags cannot be more than
166
- * 30 characters in length.
167
- */
168
- tags?: Array<string> | null;
169
- /**
170
- * A unique ID used to correlate this request to processing on your servers. Note:
171
- * Courier does not verify the uniqueness of this ID.
172
- */
173
- trace_id?: string | null;
174
- /**
175
- * Identify the campaign that refers traffic to a specific website, and attributes
176
- * the browser's website session.
177
- */
178
- utm?: SendAPI.Utm | null;
179
- }
180
- interface Preferences {
181
- /**
182
- * The ID of the subscription topic you want to apply to the message. If this is a
183
- * templated message, it will override the subscription topic if already associated
184
- */
185
- subscription_topic_id: string;
186
- }
187
- interface Providers {
188
- /**
189
- * A JavaScript conditional expression to determine if the message should be sent
190
- * through the channel. Has access to the data and profile object. For example,
191
- * `data.name === profile.name`
192
- */
193
- if?: string | null;
194
- metadata?: Providers.Metadata | null;
195
- /**
196
- * Provider specific overrides.
197
- */
198
- override?: {
56
+ content?: Shared.ElementalContentSugar | Shared.ElementalContent;
57
+ context?: Shared.MessageContext | null;
58
+ data?: {
199
59
  [key: string]: unknown;
200
60
  } | null;
201
- timeouts?: number | null;
202
- }
203
- namespace Providers {
204
- interface Metadata {
205
- utm?: SendAPI.Utm | null;
206
- }
207
- }
208
- /**
209
- * Allows you to customize which channel(s) Courier will potentially deliver the
210
- * message. If no routing key is specified, Courier will use the default routing
211
- * configuration or routing defined by the template.
212
- */
213
- interface Routing {
61
+ delay?: Message.Delay | null;
62
+ expiry?: Message.Expiry | null;
63
+ metadata?: Message.Metadata | null;
64
+ preferences?: Message.Preferences | null;
65
+ providers?: {
66
+ [key: string]: Message.Providers;
67
+ } | null;
214
68
  /**
215
- * A list of channels or providers to send the message through. Can also
216
- * recursively define sub-routing methods, which can be useful for defining
217
- * advanced push notification delivery strategies.
69
+ * Customize which channels/providers Courier may deliver the message through.
218
70
  */
219
- channels: Array<Routing.RoutingStrategyChannel | Routing.RoutingStrategyProvider | string>;
220
- method: SendAPI.RoutingMethod;
221
- }
222
- namespace Routing {
223
- interface RoutingStrategyChannel {
224
- channel: string;
225
- config?: {
226
- [key: string]: unknown;
227
- } | null;
228
- if?: string | null;
229
- method?: SendAPI.RoutingMethod | null;
230
- providers?: {
231
- [key: string]: RoutingStrategyChannel.Providers;
232
- } | null;
233
- }
234
- namespace RoutingStrategyChannel {
235
- interface Providers {
236
- /**
237
- * A JavaScript conditional expression to determine if the message should be sent
238
- * through the channel. Has access to the data and profile object. For example,
239
- * `data.name === profile.name`
240
- */
241
- if?: string | null;
242
- metadata?: Providers.Metadata | null;
243
- /**
244
- * Provider specific overrides.
245
- */
246
- override?: {
247
- [key: string]: unknown;
248
- } | null;
249
- timeouts?: number | null;
250
- }
251
- namespace Providers {
252
- interface Metadata {
253
- utm?: SendAPI.Utm | null;
254
- }
255
- }
256
- }
257
- interface RoutingStrategyProvider {
258
- metadata: RoutingStrategyProvider.Metadata;
259
- name: string;
260
- config?: {
261
- [key: string]: unknown;
262
- } | null;
263
- if?: string | null;
264
- }
265
- namespace RoutingStrategyProvider {
266
- interface Metadata {
267
- utm?: SendAPI.Utm | null;
268
- }
269
- }
270
- }
271
- /**
272
- * Time in ms to attempt the channel before failing over to the next available
273
- * channel.
274
- */
275
- interface Timeout {
276
- channel?: {
277
- [key: string]: number;
278
- } | null;
279
- criteria?: 'no-escalation' | 'delivered' | 'viewed' | 'engaged' | null;
280
- escalation?: number | null;
281
- message?: number | null;
282
- provider?: {
283
- [key: string]: number;
284
- } | null;
285
- }
286
- }
287
- export interface BaseMessageSendTo {
288
- /**
289
- * The recipient or a list of recipients of the message
290
- */
291
- to?: BaseMessageSendTo.AudienceRecipient | BaseMessageSendTo.UnionMember1 | BaseMessageSendTo.UnionMember2 | BulkAPI.UserRecipient | BaseMessageSendTo.SlackRecipient | BaseMessageSendTo.MsTeamsRecipient | {
292
- [key: string]: unknown;
293
- } | BaseMessageSendTo.PagerdutyRecipient | BaseMessageSendTo.WebhookRecipient | Array<Recipient> | null;
294
- }
295
- export declare namespace BaseMessageSendTo {
296
- interface AudienceRecipient {
71
+ routing?: Message.Routing | null;
72
+ template?: string | null;
73
+ timeout?: Message.Timeout | null;
297
74
  /**
298
- * A unique identifier associated with an Audience. A message will be sent to each
299
- * user in the audience.
75
+ * The recipient or a list of recipients of the message
300
76
  */
301
- audience_id: string;
302
- data?: {
303
- [key: string]: unknown;
304
- } | null;
305
- filters?: Array<AudienceRecipient.Filter> | null;
306
- }
307
- namespace AudienceRecipient {
308
- interface Filter {
309
- /**
310
- * Send to users only if they are member of the account
311
- */
312
- operator: 'MEMBER_OF';
313
- path: 'account_id';
314
- value: string;
315
- }
316
- }
317
- interface UnionMember1 {
318
- data?: {
319
- [key: string]: unknown;
320
- } | null;
321
- filters?: Array<UnionMember1.Filter> | null;
322
- list_id?: string | null;
323
- }
324
- namespace UnionMember1 {
325
- interface Filter {
326
- /**
327
- * Send to users only if they are member of the account
328
- */
329
- operator: 'MEMBER_OF';
330
- path: 'account_id';
331
- value: string;
332
- }
333
- }
334
- interface UnionMember2 {
335
- data?: {
336
- [key: string]: unknown;
337
- } | null;
338
- list_pattern?: string | null;
339
- }
340
- interface SlackRecipient {
341
- slack: SlackRecipient.SendToSlackChannel | SlackRecipient.SendToSlackEmail | SlackRecipient.SendToSlackUserID;
342
- }
343
- namespace SlackRecipient {
344
- interface SendToSlackChannel extends SendAPI.SlackBaseProperties {
345
- channel: string;
346
- }
347
- interface SendToSlackEmail extends SendAPI.SlackBaseProperties {
348
- email: string;
349
- }
350
- interface SendToSlackUserID extends SendAPI.SlackBaseProperties {
351
- user_id: string;
352
- }
353
- }
354
- interface MsTeamsRecipient {
355
- ms_teams: MsTeamsRecipient.SendToMsTeamsUserID | MsTeamsRecipient.SendToMsTeamsEmail | MsTeamsRecipient.SendToMsTeamsChannelID | MsTeamsRecipient.SendToMsTeamsConversationID | MsTeamsRecipient.SendToMsTeamsChannelName;
356
- }
357
- namespace MsTeamsRecipient {
358
- interface SendToMsTeamsUserID extends SendAPI.MsTeamsBaseProperties {
359
- user_id: string;
360
- }
361
- interface SendToMsTeamsEmail extends SendAPI.MsTeamsBaseProperties {
362
- email: string;
363
- }
364
- interface SendToMsTeamsChannelID extends SendAPI.MsTeamsBaseProperties {
365
- channel_id: string;
366
- }
367
- interface SendToMsTeamsConversationID extends SendAPI.MsTeamsBaseProperties {
368
- conversation_id: string;
369
- }
370
- interface SendToMsTeamsChannelName extends SendAPI.MsTeamsBaseProperties {
371
- channel_name: string;
372
- team_id: string;
373
- }
374
- }
375
- interface PagerdutyRecipient {
376
- pagerduty: PagerdutyRecipient.Pagerduty;
377
- }
378
- namespace PagerdutyRecipient {
379
- interface Pagerduty {
380
- event_action?: string | null;
381
- routing_key?: string | null;
382
- severity?: string | null;
383
- source?: string | null;
384
- }
385
- }
386
- interface WebhookRecipient {
387
- webhook: WebhookRecipient.Webhook;
77
+ to?: Shared.UserRecipient | Array<Shared.Recipient> | null;
388
78
  }
389
- namespace WebhookRecipient {
390
- interface Webhook {
79
+ namespace Message {
80
+ interface Channels {
391
81
  /**
392
- * The URL to send the webhook request to.
82
+ * Brand id used for rendering.
393
83
  */
394
- url: string;
84
+ brand_id?: string | null;
395
85
  /**
396
- * Authentication configuration for the webhook request.
86
+ * JS conditional with access to data/profile.
397
87
  */
398
- authentication?: Webhook.Authentication | null;
88
+ if?: string | null;
89
+ metadata?: Channels.Metadata | null;
399
90
  /**
400
- * Custom headers to include in the webhook request.
91
+ * Channel specific overrides.
401
92
  */
402
- headers?: {
403
- [key: string]: string;
93
+ override?: {
94
+ [key: string]: unknown;
404
95
  } | null;
405
96
  /**
406
- * The HTTP method to use for the webhook request. Defaults to POST if not
407
- * specified.
97
+ * Providers enabled for this channel.
408
98
  */
409
- method?: 'POST' | 'PUT' | null;
99
+ providers?: Array<string> | null;
410
100
  /**
411
- * Specifies what profile information is included in the request payload. Defaults
412
- * to 'limited' if not specified.
101
+ * Defaults to `single`.
413
102
  */
414
- profile?: 'limited' | 'expanded' | null;
103
+ routing_method?: 'all' | 'single' | null;
104
+ timeouts?: Channels.Timeouts | null;
415
105
  }
416
- namespace Webhook {
417
- /**
418
- * Authentication configuration for the webhook request.
419
- */
420
- interface Authentication {
421
- /**
422
- * The authentication mode to use. Defaults to 'none' if not specified.
423
- */
424
- mode: 'none' | 'basic' | 'bearer';
425
- /**
426
- * Token for bearer authentication.
427
- */
428
- token?: string | null;
429
- /**
430
- * Password for basic authentication.
431
- */
432
- password?: string | null;
433
- /**
434
- * Username for basic authentication.
435
- */
436
- username?: string | null;
106
+ namespace Channels {
107
+ interface Metadata {
108
+ utm?: Shared.Utm | null;
109
+ }
110
+ interface Timeouts {
111
+ channel?: number | null;
112
+ provider?: number | null;
437
113
  }
438
114
  }
439
- }
440
- }
441
- /**
442
- * Syntatic Sugar to provide a fast shorthand for Courier Elemental Blocks.
443
- */
444
- export type Content = Content.ElementalContent | Content.ElementalContentSugar;
445
- export declare namespace Content {
446
- interface ElementalContent {
447
- elements: Array<SendAPI.ElementalNode>;
448
- /**
449
- * For example, "2022-01-01"
450
- */
451
- version: string;
452
- brand?: unknown;
453
- }
454
- /**
455
- * Syntatic Sugar to provide a fast shorthand for Courier Elemental Blocks.
456
- */
457
- interface ElementalContentSugar {
458
- /**
459
- * The text content displayed in the notification.
460
- */
461
- body: string;
462
- /**
463
- * The title to be displayed by supported channels i.e. push, email (as subject)
464
- */
465
- title: string;
466
- }
467
- }
468
- export interface ElementalChannelNode {
469
- /**
470
- * The channel the contents of this element should be applied to. Can be `email`,
471
- * `push`, `direct_message`, `sms` or a provider such as slack
472
- */
473
- channel: string;
474
- channels?: Array<string> | null;
475
- /**
476
- * An array of elements to apply to the channel. If `raw` has not been specified,
477
- * `elements` is `required`.
478
- */
479
- elements?: Array<ElementalNode> | null;
480
- if?: string | null;
481
- loop?: string | null;
482
- /**
483
- * Raw data to apply to the channel. If `elements` has not been specified, `raw` is
484
- * `required`.
485
- */
486
- raw?: {
487
- [key: string]: unknown;
488
- } | null;
489
- ref?: string | null;
490
- }
491
- export interface ElementalGroupNode {
492
- /**
493
- * Sub elements to render.
494
- */
495
- elements: Array<ElementalNode>;
496
- channels?: Array<string> | null;
497
- if?: string | null;
498
- loop?: string | null;
499
- ref?: string | null;
500
- }
501
- /**
502
- * The channel element allows a notification to be customized based on which
503
- * channel it is sent through. For example, you may want to display a detailed
504
- * message when the notification is sent through email, and a more concise message
505
- * in a push notification. Channel elements are only valid as top-level elements;
506
- * you cannot nest channel elements. If there is a channel element specified at the
507
- * top-level of the document, all sibling elements must be channel elements. Note:
508
- * As an alternative, most elements support a `channel` property. Which allows you
509
- * to selectively display an individual element on a per channel basis. See the
510
- * [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
511
- * for more details.
512
- */
513
- export type ElementalNode = ElementalNode.UnionMember0 | ElementalNode.UnionMember1 | ElementalNode.UnionMember2 | ElementalNode.UnionMember3 | ElementalNode.UnionMember4 | ElementalNode.UnionMember5 | ElementalNode.UnionMember6 | ElementalNode.UnionMember7;
514
- export declare namespace ElementalNode {
515
- interface UnionMember0 {
516
- channels?: Array<string> | null;
517
- if?: string | null;
518
- loop?: string | null;
519
- ref?: string | null;
520
- type?: 'text';
521
- }
522
- interface UnionMember1 {
523
- channels?: Array<string> | null;
524
- if?: string | null;
525
- loop?: string | null;
526
- ref?: string | null;
527
- type?: 'meta';
528
- }
529
- /**
530
- * The channel element allows a notification to be customized based on which
531
- * channel it is sent through. For example, you may want to display a detailed
532
- * message when the notification is sent through email, and a more concise message
533
- * in a push notification. Channel elements are only valid as top-level elements;
534
- * you cannot nest channel elements. If there is a channel element specified at the
535
- * top-level of the document, all sibling elements must be channel elements. Note:
536
- * As an alternative, most elements support a `channel` property. Which allows you
537
- * to selectively display an individual element on a per channel basis. See the
538
- * [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
539
- * for more details.
540
- */
541
- interface UnionMember2 extends SendAPI.ElementalChannelNode {
542
- type?: 'channel';
543
- }
544
- interface UnionMember3 {
545
- channels?: Array<string> | null;
546
- if?: string | null;
547
- loop?: string | null;
548
- ref?: string | null;
549
- type?: 'image';
550
- }
551
- interface UnionMember4 {
552
- channels?: Array<string> | null;
553
- if?: string | null;
554
- loop?: string | null;
555
- ref?: string | null;
556
- type?: 'action';
557
- }
558
- interface UnionMember5 {
559
- channels?: Array<string> | null;
560
- if?: string | null;
561
- loop?: string | null;
562
- ref?: string | null;
563
- type?: 'divider';
564
- }
565
- /**
566
- * Allows you to group elements together. This can be useful when used in
567
- * combination with "if" or "loop". See
568
- * [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
569
- * for more details.
570
- */
571
- interface UnionMember6 extends SendAPI.ElementalGroupNode {
572
- type?: 'group';
573
- }
574
- interface UnionMember7 {
575
- channels?: Array<string> | null;
576
- if?: string | null;
577
- loop?: string | null;
578
- ref?: string | null;
579
- type?: 'quote';
580
- }
581
- }
582
- /**
583
- * Describes the content of the message in a way that will work for email, push,
584
- * chat, or any channel.
585
- */
586
- export type Message = Message.ContentMessage | Message.TemplateMessage;
587
- export declare namespace Message {
588
- /**
589
- * Describes the content of the message in a way that will work for email, push,
590
- * chat, or any channel.
591
- */
592
- interface ContentMessage extends SendAPI.BaseMessage, SendAPI.BaseMessageSendTo {
593
- /**
594
- * Describes the content of the message in a way that will work for email, push,
595
- * chat, or any channel. Either this or template must be specified.
596
- */
597
- content: SendAPI.Content;
598
- }
599
- /**
600
- * A template for a type of message that can be sent more than once. For example,
601
- * you might create an "Appointment Reminder" Notification or “Reset Password”
602
- * Notifications.
603
- */
604
- interface TemplateMessage extends SendAPI.BaseMessage, SendAPI.BaseMessageSendTo {
605
- /**
606
- * The id of the notification template to be rendered and sent to the recipient(s).
607
- * This field or the content field must be supplied.
608
- */
609
- template: string;
610
- }
611
- }
612
- export interface MessageContext {
613
- /**
614
- * An id of a tenant, see
615
- * [tenants api docs](https://www.courier.com/docs/reference/tenants/). Will load
616
- * brand, default preferences and any other base context data associated with this
617
- * tenant.
618
- */
619
- tenant_id?: string | null;
620
- }
621
- export interface MsTeamsBaseProperties {
622
- service_url: string;
623
- tenant_id: string;
624
- }
625
- export type Recipient = Recipient.AudienceRecipient | Recipient.UnionMember1 | Recipient.UnionMember2 | BulkAPI.UserRecipient | Recipient.SlackRecipient | Recipient.MsTeamsRecipient | {
626
- [key: string]: unknown;
627
- } | Recipient.PagerdutyRecipient | Recipient.WebhookRecipient;
628
- export declare namespace Recipient {
629
- interface AudienceRecipient {
630
- /**
631
- * A unique identifier associated with an Audience. A message will be sent to each
632
- * user in the audience.
633
- */
634
- audience_id: string;
635
- data?: {
636
- [key: string]: unknown;
637
- } | null;
638
- filters?: Array<AudienceRecipient.Filter> | null;
639
- }
640
- namespace AudienceRecipient {
641
- interface Filter {
115
+ interface Delay {
642
116
  /**
643
- * Send to users only if they are member of the account
117
+ * The duration of the delay in milliseconds.
644
118
  */
645
- operator: 'MEMBER_OF';
646
- path: 'account_id';
647
- value: string;
648
- }
649
- }
650
- interface UnionMember1 {
651
- data?: {
652
- [key: string]: unknown;
653
- } | null;
654
- filters?: Array<UnionMember1.Filter> | null;
655
- list_id?: string | null;
656
- }
657
- namespace UnionMember1 {
658
- interface Filter {
119
+ duration?: number | null;
659
120
  /**
660
- * Send to users only if they are member of the account
121
+ * ISO 8601 timestamp or opening_hours-like format.
661
122
  */
662
- operator: 'MEMBER_OF';
663
- path: 'account_id';
664
- value: string;
665
- }
666
- }
667
- interface UnionMember2 {
668
- data?: {
669
- [key: string]: unknown;
670
- } | null;
671
- list_pattern?: string | null;
672
- }
673
- interface SlackRecipient {
674
- slack: SlackRecipient.SendToSlackChannel | SlackRecipient.SendToSlackEmail | SlackRecipient.SendToSlackUserID;
675
- }
676
- namespace SlackRecipient {
677
- interface SendToSlackChannel extends SendAPI.SlackBaseProperties {
678
- channel: string;
679
- }
680
- interface SendToSlackEmail extends SendAPI.SlackBaseProperties {
681
- email: string;
682
- }
683
- interface SendToSlackUserID extends SendAPI.SlackBaseProperties {
684
- user_id: string;
685
- }
686
- }
687
- interface MsTeamsRecipient {
688
- ms_teams: MsTeamsRecipient.SendToMsTeamsUserID | MsTeamsRecipient.SendToMsTeamsEmail | MsTeamsRecipient.SendToMsTeamsChannelID | MsTeamsRecipient.SendToMsTeamsConversationID | MsTeamsRecipient.SendToMsTeamsChannelName;
689
- }
690
- namespace MsTeamsRecipient {
691
- interface SendToMsTeamsUserID extends SendAPI.MsTeamsBaseProperties {
692
- user_id: string;
693
- }
694
- interface SendToMsTeamsEmail extends SendAPI.MsTeamsBaseProperties {
695
- email: string;
696
- }
697
- interface SendToMsTeamsChannelID extends SendAPI.MsTeamsBaseProperties {
698
- channel_id: string;
699
- }
700
- interface SendToMsTeamsConversationID extends SendAPI.MsTeamsBaseProperties {
701
- conversation_id: string;
702
- }
703
- interface SendToMsTeamsChannelName extends SendAPI.MsTeamsBaseProperties {
704
- channel_name: string;
705
- team_id: string;
706
- }
707
- }
708
- interface PagerdutyRecipient {
709
- pagerduty: PagerdutyRecipient.Pagerduty;
710
- }
711
- namespace PagerdutyRecipient {
712
- interface Pagerduty {
713
- event_action?: string | null;
714
- routing_key?: string | null;
715
- severity?: string | null;
716
- source?: string | null;
123
+ until?: string | null;
717
124
  }
718
- }
719
- interface WebhookRecipient {
720
- webhook: WebhookRecipient.Webhook;
721
- }
722
- namespace WebhookRecipient {
723
- interface Webhook {
125
+ interface Expiry {
724
126
  /**
725
- * The URL to send the webhook request to.
127
+ * Duration in ms or ISO8601 duration (e.g. P1DT4H).
726
128
  */
727
- url: string;
129
+ expires_in: string | number;
728
130
  /**
729
- * Authentication configuration for the webhook request.
131
+ * Epoch or ISO8601 timestamp with timezone.
730
132
  */
731
- authentication?: Webhook.Authentication | null;
133
+ expires_at?: string | null;
134
+ }
135
+ interface Metadata {
136
+ event?: string | null;
137
+ tags?: Array<string> | null;
138
+ trace_id?: string | null;
139
+ utm?: Shared.Utm | null;
140
+ }
141
+ interface Preferences {
732
142
  /**
733
- * Custom headers to include in the webhook request.
143
+ * The subscription topic to apply to the message.
734
144
  */
735
- headers?: {
736
- [key: string]: string;
737
- } | null;
145
+ subscription_topic_id: string;
146
+ }
147
+ interface Providers {
738
148
  /**
739
- * The HTTP method to use for the webhook request. Defaults to POST if not
740
- * specified.
149
+ * JS conditional with access to data/profile.
741
150
  */
742
- method?: 'POST' | 'PUT' | null;
151
+ if?: string | null;
152
+ metadata?: Providers.Metadata | null;
743
153
  /**
744
- * Specifies what profile information is included in the request payload. Defaults
745
- * to 'limited' if not specified.
154
+ * Provider-specific overrides.
746
155
  */
747
- profile?: 'limited' | 'expanded' | null;
156
+ override?: {
157
+ [key: string]: unknown;
158
+ } | null;
159
+ timeouts?: number | null;
160
+ }
161
+ namespace Providers {
162
+ interface Metadata {
163
+ utm?: Shared.Utm | null;
164
+ }
748
165
  }
749
- namespace Webhook {
166
+ /**
167
+ * Customize which channels/providers Courier may deliver the message through.
168
+ */
169
+ interface Routing {
750
170
  /**
751
- * Authentication configuration for the webhook request.
171
+ * A list of channels or providers (or nested routing rules).
752
172
  */
753
- interface Authentication {
754
- /**
755
- * The authentication mode to use. Defaults to 'none' if not specified.
756
- */
757
- mode: 'none' | 'basic' | 'bearer';
758
- /**
759
- * Token for bearer authentication.
760
- */
761
- token?: string | null;
762
- /**
763
- * Password for basic authentication.
764
- */
765
- password?: string | null;
766
- /**
767
- * Username for basic authentication.
768
- */
769
- username?: string | null;
770
- }
173
+ channels: Array<Shared.MessageRoutingChannel>;
174
+ method: 'all' | 'single';
175
+ }
176
+ interface Timeout {
177
+ channel?: {
178
+ [key: string]: number;
179
+ } | null;
180
+ criteria?: 'no-escalation' | 'delivered' | 'viewed' | 'engaged' | null;
181
+ escalation?: number | null;
182
+ message?: number | null;
183
+ provider?: {
184
+ [key: string]: number;
185
+ } | null;
771
186
  }
772
187
  }
773
188
  }
774
- export type RoutingMethod = 'all' | 'single';
775
- export interface SlackBaseProperties {
776
- access_token: string;
777
- }
778
- export interface Utm {
779
- campaign?: string | null;
780
- content?: string | null;
781
- medium?: string | null;
782
- source?: string | null;
783
- term?: string | null;
784
- }
785
- export interface SendSendMessageResponse {
786
- /**
787
- * A successful call to `POST /send` returns a `202` status code along with a
788
- * `requestId` in the response body.
789
- *
790
- * For send requests that have a single recipient, the `requestId` is assigned to
791
- * the derived message as its message_id. Therefore the `requestId` can be supplied
792
- * to the Message's API for single recipient messages.
793
- *
794
- * For send requests that have multiple recipients (accounts, audiences, lists,
795
- * etc.), Courier assigns a unique id to each derived message as its `message_id`.
796
- * Therefore the `requestId` cannot be supplied to the Message's API for
797
- * single-recipient messages.
798
- */
799
- requestId: string;
800
- }
801
- export interface SendSendMessageParams {
802
- /**
803
- * Defines the message to be delivered
804
- */
805
- message: Message;
806
- }
807
189
  export declare namespace Send {
808
- export { type BaseMessage as BaseMessage, type BaseMessageSendTo as BaseMessageSendTo, type Content as Content, type ElementalChannelNode as ElementalChannelNode, type ElementalGroupNode as ElementalGroupNode, type ElementalNode as ElementalNode, type Message as Message, type MessageContext as MessageContext, type MsTeamsBaseProperties as MsTeamsBaseProperties, type Recipient as Recipient, type RoutingMethod as RoutingMethod, type SlackBaseProperties as SlackBaseProperties, type Utm as Utm, type SendSendMessageResponse as SendSendMessageResponse, type SendSendMessageParams as SendSendMessageParams, };
190
+ export { type SendMessageResponse as SendMessageResponse, type SendMessageParams as SendMessageParams };
809
191
  }
810
192
  //# sourceMappingURL=send.d.mts.map