@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.
- package/CHANGELOG.md +124 -0
- package/README.md +11 -11
- package/client.d.mts +48 -20
- package/client.d.mts.map +1 -1
- package/client.d.ts +48 -20
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/internal/tslib.js +6 -6
- package/package.json +1 -1
- package/resources/audiences.d.mts +30 -52
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +30 -52
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs.map +1 -1
- package/resources/audit-events.d.mts +5 -9
- package/resources/audit-events.d.mts.map +1 -1
- package/resources/audit-events.d.ts +5 -9
- package/resources/audit-events.d.ts.map +1 -1
- package/resources/auth.d.mts +2 -2
- package/resources/auth.d.mts.map +1 -1
- package/resources/auth.d.ts +2 -2
- package/resources/auth.d.ts.map +1 -1
- package/resources/automations/automations.d.mts +5 -252
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts +5 -252
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.js +0 -42
- package/resources/automations/automations.js.map +1 -1
- package/resources/automations/automations.mjs +1 -43
- package/resources/automations/automations.mjs.map +1 -1
- package/resources/automations/index.d.mts +2 -2
- package/resources/automations/index.d.mts.map +1 -1
- package/resources/automations/index.d.ts +2 -2
- package/resources/automations/index.d.ts.map +1 -1
- package/resources/automations/index.js.map +1 -1
- package/resources/automations/index.mjs +2 -2
- package/resources/automations/index.mjs.map +1 -1
- package/resources/automations/invoke.d.mts +122 -9
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts +122 -9
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.js +45 -0
- package/resources/automations/invoke.js.map +1 -1
- package/resources/automations/invoke.mjs +45 -0
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/brands.d.mts +76 -52
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +76 -52
- package/resources/brands.d.ts.map +1 -1
- package/resources/brands.js.map +1 -1
- package/resources/brands.mjs.map +1 -1
- package/resources/bulk.d.mts +36 -127
- package/resources/bulk.d.mts.map +1 -1
- package/resources/bulk.d.ts +36 -127
- package/resources/bulk.d.ts.map +1 -1
- package/resources/bulk.js.map +1 -1
- package/resources/bulk.mjs.map +1 -1
- package/resources/inbound.d.mts +1 -1
- package/resources/inbound.d.ts +1 -1
- package/resources/index.d.mts +11 -10
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -10
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -0
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/lists/index.d.mts +2 -2
- package/resources/lists/index.d.mts.map +1 -1
- package/resources/lists/index.d.ts +2 -2
- package/resources/lists/index.d.ts.map +1 -1
- package/resources/lists/index.js.map +1 -1
- package/resources/lists/index.mjs +1 -1
- package/resources/lists/index.mjs.map +1 -1
- package/resources/lists/lists.d.mts +19 -13
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts +19 -13
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.js +7 -2
- package/resources/lists/lists.js.map +1 -1
- package/resources/lists/lists.mjs +7 -2
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +8 -52
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts +8 -52
- package/resources/lists/subscriptions.d.ts.map +1 -1
- package/resources/lists/subscriptions.js.map +1 -1
- package/resources/lists/subscriptions.mjs.map +1 -1
- package/resources/messages.d.mts +8 -8
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +8 -8
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/notifications/checks.d.mts +5 -12
- package/resources/notifications/checks.d.mts.map +1 -1
- package/resources/notifications/checks.d.ts +5 -12
- package/resources/notifications/checks.d.ts.map +1 -1
- package/resources/notifications/checks.js.map +1 -1
- package/resources/notifications/checks.mjs.map +1 -1
- package/resources/notifications/index.d.mts +2 -2
- package/resources/notifications/index.d.mts.map +1 -1
- package/resources/notifications/index.d.ts +2 -2
- package/resources/notifications/index.d.ts.map +1 -1
- package/resources/notifications/index.js.map +1 -1
- package/resources/notifications/index.mjs.map +1 -1
- package/resources/notifications/notifications.d.mts +13 -11
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +13 -11
- package/resources/notifications/notifications.d.ts.map +1 -1
- package/resources/notifications/notifications.js.map +1 -1
- package/resources/notifications/notifications.mjs.map +1 -1
- package/resources/profiles/index.d.mts +1 -1
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts +1 -1
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.js.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/lists.d.mts +5 -11
- package/resources/profiles/lists.d.mts.map +1 -1
- package/resources/profiles/lists.d.ts +5 -11
- package/resources/profiles/lists.d.ts.map +1 -1
- package/resources/profiles/profiles.d.mts +7 -3
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +7 -3
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/send.d.mts +127 -745
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +127 -745
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +12 -1
- package/resources/send.js.map +1 -1
- package/resources/send.mjs +12 -1
- package/resources/send.mjs.map +1 -1
- package/resources/shared.d.mts +245 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +245 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/{src/resources/tenants/default-preferences.ts → resources/shared.mjs} +2 -2
- package/resources/shared.mjs.map +1 -0
- package/resources/tenants/index.d.mts +3 -1
- package/resources/tenants/index.d.mts.map +1 -1
- package/resources/tenants/index.d.ts +3 -1
- package/resources/tenants/index.d.ts.map +1 -1
- package/resources/tenants/index.js +5 -1
- package/resources/tenants/index.js.map +1 -1
- package/resources/tenants/index.mjs +2 -0
- package/resources/tenants/index.mjs.map +1 -1
- package/resources/tenants/templates.d.mts +91 -0
- package/resources/tenants/templates.d.mts.map +1 -0
- package/resources/tenants/templates.d.ts +91 -0
- package/resources/tenants/templates.d.ts.map +1 -0
- package/resources/tenants/templates.js +38 -0
- package/resources/tenants/templates.js.map +1 -0
- package/resources/tenants/templates.mjs +34 -0
- package/resources/tenants/templates.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.d.mts +3 -0
- package/resources/tenants/tenant-default-preferences/index.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.d.ts +3 -0
- package/resources/tenants/tenant-default-preferences/index.d.ts.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.js +9 -0
- package/resources/tenants/tenant-default-preferences/index.js.map +1 -0
- package/resources/tenants/tenant-default-preferences/index.mjs +4 -0
- package/resources/tenants/tenant-default-preferences/index.mjs.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.mts +5 -18
- package/resources/tenants/tenant-default-preferences/items.d.mts.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.d.ts +5 -18
- package/resources/tenants/tenant-default-preferences/items.d.ts.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.js +2 -2
- package/resources/tenants/tenant-default-preferences/items.js.map +1 -0
- package/resources/tenants/{default-preferences → tenant-default-preferences}/items.mjs +2 -2
- package/resources/tenants/tenant-default-preferences/items.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts +10 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts +10 -0
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.js → tenant-default-preferences/tenant-default-preferences.js} +5 -5
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.js.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.mjs → tenant-default-preferences/tenant-default-preferences.mjs} +4 -4
- package/resources/tenants/tenant-default-preferences/tenant-default-preferences.mjs.map +1 -0
- package/resources/tenants/tenant-default-preferences.d.mts +2 -0
- package/resources/tenants/tenant-default-preferences.d.mts.map +1 -0
- package/resources/tenants/tenant-default-preferences.d.ts +2 -0
- package/resources/tenants/tenant-default-preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences.js → tenant-default-preferences.js} +2 -2
- package/resources/tenants/tenant-default-preferences.js.map +1 -0
- package/resources/tenants/tenant-default-preferences.mjs +3 -0
- package/resources/tenants/tenant-default-preferences.mjs.map +1 -0
- package/resources/tenants/tenants.d.mts +66 -7
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +66 -7
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +8 -2
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +8 -2
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/users/index.d.mts +3 -3
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +3 -3
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/preferences.d.mts +8 -11
- package/resources/users/preferences.d.mts.map +1 -1
- package/resources/users/preferences.d.ts +8 -11
- package/resources/users/preferences.d.ts.map +1 -1
- package/resources/users/preferences.js.map +1 -1
- package/resources/users/preferences.mjs.map +1 -1
- package/resources/users/tenants.d.mts +4 -21
- package/resources/users/tenants.d.mts.map +1 -1
- package/resources/users/tenants.d.ts +4 -21
- package/resources/users/tenants.d.ts.map +1 -1
- package/resources/users/tenants.js.map +1 -1
- package/resources/users/tenants.mjs.map +1 -1
- package/resources/users/tokens.d.mts +22 -23
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +22 -23
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +14 -15
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +14 -15
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/users/users.d.mts +6 -6
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +6 -6
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/src/client.ts +81 -56
- package/src/internal/to-file.ts +1 -1
- package/src/resources/audiences.ts +45 -90
- package/src/resources/audit-events.ts +7 -13
- package/src/resources/auth.ts +2 -16
- package/src/resources/automations/automations.ts +6 -342
- package/src/resources/automations/index.ts +2 -12
- package/src/resources/automations/invoke.ts +163 -14
- package/src/resources/brands.ts +119 -53
- package/src/resources/bulk.ts +28 -148
- package/src/resources/inbound.ts +1 -1
- package/src/resources/index.ts +24 -30
- package/src/resources/lists/index.ts +9 -3
- package/src/resources/lists/lists.ts +27 -16
- package/src/resources/lists/subscriptions.ts +7 -65
- package/src/resources/messages.ts +10 -7
- package/src/resources/notifications/checks.ts +4 -17
- package/src/resources/notifications/index.ts +2 -4
- package/src/resources/notifications/notifications.ts +13 -14
- package/src/resources/profiles/index.ts +1 -0
- package/src/resources/profiles/lists.ts +5 -13
- package/src/resources/profiles/profiles.ts +9 -2
- package/src/resources/send.ts +122 -928
- package/src/resources/shared.ts +305 -0
- package/src/resources/tenants/index.ts +10 -0
- package/src/resources/tenants/templates.ts +124 -0
- package/src/resources/tenants/tenant-default-preferences/index.ts +4 -0
- package/src/resources/tenants/{default-preferences → tenant-default-preferences}/items.ts +5 -27
- package/src/resources/tenants/{default-preferences/default-preferences.ts → tenant-default-preferences/tenant-default-preferences.ts} +4 -12
- package/src/resources/tenants/tenant-default-preferences.ts +3 -0
- package/src/resources/tenants/tenants.ts +89 -8
- package/src/resources/users/index.ts +2 -4
- package/src/resources/users/preferences.ts +7 -12
- package/src/resources/users/tenants.ts +3 -23
- package/src/resources/users/tokens.ts +33 -34
- package/src/resources/users/users.ts +4 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/tenants/default-preferences/default-preferences.d.mts +0 -10
- package/resources/tenants/default-preferences/default-preferences.d.mts.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.d.ts +0 -10
- package/resources/tenants/default-preferences/default-preferences.d.ts.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.js.map +0 -1
- package/resources/tenants/default-preferences/default-preferences.mjs.map +0 -1
- package/resources/tenants/default-preferences/index.d.mts +0 -3
- package/resources/tenants/default-preferences/index.d.mts.map +0 -1
- package/resources/tenants/default-preferences/index.d.ts +0 -3
- package/resources/tenants/default-preferences/index.d.ts.map +0 -1
- package/resources/tenants/default-preferences/index.js +0 -9
- package/resources/tenants/default-preferences/index.js.map +0 -1
- package/resources/tenants/default-preferences/index.mjs +0 -4
- package/resources/tenants/default-preferences/index.mjs.map +0 -1
- package/resources/tenants/default-preferences/items.d.mts.map +0 -1
- package/resources/tenants/default-preferences/items.d.ts.map +0 -1
- package/resources/tenants/default-preferences/items.js.map +0 -1
- package/resources/tenants/default-preferences/items.mjs.map +0 -1
- package/resources/tenants/default-preferences.d.mts +0 -2
- package/resources/tenants/default-preferences.d.mts.map +0 -1
- package/resources/tenants/default-preferences.d.ts +0 -2
- package/resources/tenants/default-preferences.d.ts.map +0 -1
- package/resources/tenants/default-preferences.js.map +0 -1
- package/resources/tenants/default-preferences.mjs +0 -3
- package/resources/tenants/default-preferences.mjs.map +0 -1
- package/src/resources/tenants/default-preferences/index.ts +0 -10
package/resources/send.d.mts
CHANGED
|
@@ -1,810 +1,192 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import * as
|
|
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
|
-
|
|
20
|
+
message(body: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse>;
|
|
11
21
|
}
|
|
12
|
-
export interface
|
|
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
|
-
*
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
requestId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SendMessageParams {
|
|
61
32
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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
|
-
|
|
36
|
+
message: SendMessageParams.Message;
|
|
37
|
+
}
|
|
38
|
+
export declare namespace SendMessageParams {
|
|
67
39
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
40
|
+
* The message property has the following primary top-level properties. They define
|
|
41
|
+
* the destination and content of the message.
|
|
70
42
|
*/
|
|
71
|
-
|
|
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
|
-
*
|
|
82
|
-
*
|
|
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
|
-
|
|
86
|
-
|
|
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
|
-
*
|
|
95
|
-
*
|
|
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
|
-
|
|
104
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
220
|
-
|
|
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
|
-
*
|
|
299
|
-
* user in the audience.
|
|
75
|
+
* The recipient or a list of recipients of the message
|
|
300
76
|
*/
|
|
301
|
-
|
|
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
|
|
390
|
-
interface
|
|
79
|
+
namespace Message {
|
|
80
|
+
interface Channels {
|
|
391
81
|
/**
|
|
392
|
-
*
|
|
82
|
+
* Brand id used for rendering.
|
|
393
83
|
*/
|
|
394
|
-
|
|
84
|
+
brand_id?: string | null;
|
|
395
85
|
/**
|
|
396
|
-
*
|
|
86
|
+
* JS conditional with access to data/profile.
|
|
397
87
|
*/
|
|
398
|
-
|
|
88
|
+
if?: string | null;
|
|
89
|
+
metadata?: Channels.Metadata | null;
|
|
399
90
|
/**
|
|
400
|
-
*
|
|
91
|
+
* Channel specific overrides.
|
|
401
92
|
*/
|
|
402
|
-
|
|
403
|
-
[key: string]:
|
|
93
|
+
override?: {
|
|
94
|
+
[key: string]: unknown;
|
|
404
95
|
} | null;
|
|
405
96
|
/**
|
|
406
|
-
*
|
|
407
|
-
* specified.
|
|
97
|
+
* Providers enabled for this channel.
|
|
408
98
|
*/
|
|
409
|
-
|
|
99
|
+
providers?: Array<string> | null;
|
|
410
100
|
/**
|
|
411
|
-
*
|
|
412
|
-
* to 'limited' if not specified.
|
|
101
|
+
* Defaults to `single`.
|
|
413
102
|
*/
|
|
414
|
-
|
|
103
|
+
routing_method?: 'all' | 'single' | null;
|
|
104
|
+
timeouts?: Channels.Timeouts | null;
|
|
415
105
|
}
|
|
416
|
-
namespace
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
interface
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
*
|
|
117
|
+
* The duration of the delay in milliseconds.
|
|
644
118
|
*/
|
|
645
|
-
|
|
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
|
-
*
|
|
121
|
+
* ISO 8601 timestamp or opening_hours-like format.
|
|
661
122
|
*/
|
|
662
|
-
|
|
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
|
-
*
|
|
127
|
+
* Duration in ms or ISO8601 duration (e.g. P1DT4H).
|
|
726
128
|
*/
|
|
727
|
-
|
|
129
|
+
expires_in: string | number;
|
|
728
130
|
/**
|
|
729
|
-
*
|
|
131
|
+
* Epoch or ISO8601 timestamp with timezone.
|
|
730
132
|
*/
|
|
731
|
-
|
|
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
|
-
*
|
|
143
|
+
* The subscription topic to apply to the message.
|
|
734
144
|
*/
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
145
|
+
subscription_topic_id: string;
|
|
146
|
+
}
|
|
147
|
+
interface Providers {
|
|
738
148
|
/**
|
|
739
|
-
*
|
|
740
|
-
* specified.
|
|
149
|
+
* JS conditional with access to data/profile.
|
|
741
150
|
*/
|
|
742
|
-
|
|
151
|
+
if?: string | null;
|
|
152
|
+
metadata?: Providers.Metadata | null;
|
|
743
153
|
/**
|
|
744
|
-
*
|
|
745
|
-
* to 'limited' if not specified.
|
|
154
|
+
* Provider-specific overrides.
|
|
746
155
|
*/
|
|
747
|
-
|
|
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
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Customize which channels/providers Courier may deliver the message through.
|
|
168
|
+
*/
|
|
169
|
+
interface Routing {
|
|
750
170
|
/**
|
|
751
|
-
*
|
|
171
|
+
* A list of channels or providers (or nested routing rules).
|
|
752
172
|
*/
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
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
|
|
190
|
+
export { type SendMessageResponse as SendMessageResponse, type SendMessageParams as SendMessageParams };
|
|
809
191
|
}
|
|
810
192
|
//# sourceMappingURL=send.d.mts.map
|