@trycourier/courier 6.7.0-alpha3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +124 -0
- package/README.md +14 -8
- package/client.d.mts +35 -16
- package/client.d.mts.map +1 -1
- package/client.d.ts +35 -16
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/audiences.d.mts +4 -7
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +4 -7
- 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 +2 -2
- package/resources/audit-events.d.mts.map +1 -1
- package/resources/audit-events.d.ts +2 -2
- package/resources/audit-events.d.ts.map +1 -1
- package/resources/automations/automations.d.mts +6 -2
- package/resources/automations/automations.d.mts.map +1 -1
- package/resources/automations/automations.d.ts +6 -2
- package/resources/automations/automations.d.ts.map +1 -1
- package/resources/automations/automations.js.map +1 -1
- package/resources/automations/automations.mjs +1 -1
- 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 +1 -1
- package/resources/automations/index.mjs.map +1 -1
- package/resources/automations/invoke.d.mts +4 -6
- package/resources/automations/invoke.d.mts.map +1 -1
- package/resources/automations/invoke.d.ts +4 -6
- package/resources/automations/invoke.d.ts.map +1 -1
- package/resources/automations/invoke.js.map +1 -1
- package/resources/automations/invoke.mjs.map +1 -1
- package/resources/brands.d.mts +2 -2
- package/resources/brands.d.mts.map +1 -1
- package/resources/brands.d.ts +2 -2
- package/resources/brands.d.ts.map +1 -1
- package/resources/bulk.d.mts +5 -45
- package/resources/bulk.d.mts.map +1 -1
- package/resources/bulk.d.ts +5 -45
- package/resources/bulk.d.ts.map +1 -1
- package/resources/bulk.js.map +1 -1
- package/resources/bulk.mjs.map +1 -1
- package/resources/index.d.mts +8 -8
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -8
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- 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.map +1 -1
- package/resources/lists/lists.d.mts +13 -9
- package/resources/lists/lists.d.mts.map +1 -1
- package/resources/lists/lists.d.ts +13 -9
- package/resources/lists/lists.d.ts.map +1 -1
- package/resources/lists/lists.js.map +1 -1
- package/resources/lists/lists.mjs.map +1 -1
- package/resources/lists/subscriptions.d.mts +7 -26
- package/resources/lists/subscriptions.d.mts.map +1 -1
- package/resources/lists/subscriptions.d.ts +7 -26
- 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 +2 -2
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +2 -2
- package/resources/messages.d.ts.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 +12 -5
- package/resources/notifications/notifications.d.mts.map +1 -1
- package/resources/notifications/notifications.d.ts +12 -5
- 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 +9 -175
- package/resources/send.d.mts.map +1 -1
- package/resources/send.d.ts +9 -175
- package/resources/send.d.ts.map +1 -1
- package/resources/send.js +2 -2
- package/resources/send.js.map +1 -1
- package/resources/send.mjs +2 -2
- package/resources/send.mjs.map +1 -1
- package/resources/shared.d.mts +215 -4
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +215 -4
- package/resources/shared.d.ts.map +1 -1
- package/resources/tenants/index.d.mts +3 -2
- package/resources/tenants/index.d.mts.map +1 -1
- package/resources/tenants/index.d.ts +3 -2
- package/resources/tenants/index.d.ts.map +1 -1
- package/resources/tenants/index.js +3 -1
- package/resources/tenants/index.js.map +1 -1
- package/resources/tenants/index.mjs +1 -0
- package/resources/tenants/index.mjs.map +1 -1
- package/resources/tenants/preferences/index.d.mts +3 -0
- package/resources/tenants/preferences/index.d.mts.map +1 -0
- package/resources/tenants/preferences/index.d.ts +3 -0
- package/resources/tenants/preferences/index.d.ts.map +1 -0
- package/resources/tenants/{default-preferences → preferences}/index.js +3 -3
- package/resources/tenants/preferences/index.js.map +1 -0
- package/resources/tenants/preferences/index.mjs +4 -0
- package/resources/tenants/preferences/index.mjs.map +1 -0
- package/resources/tenants/{default-preferences → preferences}/items.d.mts +12 -29
- package/resources/tenants/preferences/items.d.mts.map +1 -0
- package/resources/tenants/{default-preferences → preferences}/items.d.ts +12 -29
- package/resources/tenants/preferences/items.d.ts.map +1 -0
- package/resources/tenants/{default-preferences → preferences}/items.js +9 -13
- package/resources/tenants/preferences/items.js.map +1 -0
- package/resources/tenants/{default-preferences → preferences}/items.mjs +9 -13
- package/resources/tenants/preferences/items.mjs.map +1 -0
- package/resources/tenants/preferences/preferences.d.mts +10 -0
- package/resources/tenants/preferences/preferences.d.mts.map +1 -0
- package/resources/tenants/preferences/preferences.d.ts +10 -0
- package/resources/tenants/preferences/preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.js → preferences/preferences.js} +5 -5
- package/resources/tenants/preferences/preferences.js.map +1 -0
- package/resources/tenants/{default-preferences/default-preferences.mjs → preferences/preferences.mjs} +4 -4
- package/resources/tenants/preferences/preferences.mjs.map +1 -0
- package/resources/tenants/preferences.d.mts +2 -0
- package/resources/tenants/preferences.d.mts.map +1 -0
- package/resources/tenants/preferences.d.ts +2 -0
- package/resources/tenants/preferences.d.ts.map +1 -0
- package/resources/tenants/{default-preferences.js → preferences.js} +2 -2
- package/resources/tenants/preferences.js.map +1 -0
- package/resources/tenants/preferences.mjs +3 -0
- package/resources/tenants/preferences.mjs.map +1 -0
- package/resources/tenants/templates.d.mts +4 -35
- package/resources/tenants/templates.d.mts.map +1 -1
- package/resources/tenants/templates.d.ts +4 -35
- package/resources/tenants/templates.d.ts.map +1 -1
- package/resources/tenants/templates.js.map +1 -1
- package/resources/tenants/templates.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +64 -9
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +64 -9
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +4 -2
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +5 -3
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/users/index.d.mts +2 -2
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +2 -2
- 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 +18 -17
- package/resources/users/tokens.d.mts.map +1 -1
- package/resources/users/tokens.d.ts +18 -17
- package/resources/users/tokens.d.ts.map +1 -1
- package/resources/users/tokens.js +1 -0
- package/resources/users/tokens.js.map +1 -1
- package/resources/users/tokens.mjs +1 -0
- package/resources/users/tokens.mjs.map +1 -1
- package/resources/users/users.d.mts +4 -4
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +4 -4
- 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 +38 -23
- package/src/resources/audiences.ts +3 -9
- package/src/resources/audit-events.ts +2 -2
- package/src/resources/automations/automations.ts +7 -7
- package/src/resources/automations/index.ts +2 -7
- package/src/resources/automations/invoke.ts +6 -7
- package/src/resources/brands.ts +2 -2
- package/src/resources/bulk.ts +4 -51
- package/src/resources/index.ts +10 -14
- package/src/resources/lists/index.ts +2 -4
- package/src/resources/lists/lists.ts +14 -13
- package/src/resources/lists/subscriptions.ts +6 -31
- package/src/resources/messages.ts +2 -2
- package/src/resources/notifications/checks.ts +4 -17
- package/src/resources/notifications/index.ts +2 -2
- package/src/resources/notifications/notifications.ts +15 -6
- 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 +9 -216
- package/src/resources/shared.ts +258 -4
- package/src/resources/tenants/index.ts +4 -2
- package/src/resources/tenants/preferences/index.ts +4 -0
- package/src/resources/tenants/{default-preferences → preferences}/items.ts +12 -38
- package/src/resources/tenants/{default-preferences/default-preferences.ts → preferences/preferences.ts} +4 -12
- package/src/resources/tenants/{default-preferences.ts → preferences.ts} +1 -1
- package/src/resources/tenants/templates.ts +3 -44
- package/src/resources/tenants/tenants.ts +77 -18
- package/src/resources/users/index.ts +0 -2
- package/src/resources/users/preferences.ts +7 -12
- package/src/resources/users/tenants.ts +3 -23
- package/src/resources/users/tokens.ts +19 -18
- package/src/resources/users/users.ts +0 -4
- 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.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.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
-
import * as SendAPI from "./send.js";
|
|
3
|
-
import * as BulkAPI from "./bulk.js";
|
|
4
2
|
import * as Shared from "./shared.js";
|
|
5
|
-
import * as TemplatesAPI from "./tenants/templates.js";
|
|
6
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
7
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
8
5
|
export declare class Send extends APIResource {
|
|
9
6
|
/**
|
|
10
|
-
*
|
|
7
|
+
* Send a message to one or more recipients.
|
|
11
8
|
*
|
|
12
9
|
* @example
|
|
13
10
|
* ```ts
|
|
@@ -15,173 +12,13 @@ export declare class Send extends APIResource {
|
|
|
15
12
|
* message: {
|
|
16
13
|
* to: { user_id: 'example_user' },
|
|
17
14
|
* template: 'template_id',
|
|
18
|
-
* data: {
|
|
15
|
+
* data: { foo: 'bar' },
|
|
19
16
|
* },
|
|
20
17
|
* });
|
|
21
18
|
* ```
|
|
22
19
|
*/
|
|
23
20
|
message(body: SendMessageParams, options?: RequestOptions): APIPromise<SendMessageResponse>;
|
|
24
21
|
}
|
|
25
|
-
/**
|
|
26
|
-
* The channel element allows a notification to be customized based on which
|
|
27
|
-
* channel it is sent through. For example, you may want to display a detailed
|
|
28
|
-
* message when the notification is sent through email, and a more concise message
|
|
29
|
-
* in a push notification. Channel elements are only valid as top-level elements;
|
|
30
|
-
* you cannot nest channel elements. If there is a channel element specified at the
|
|
31
|
-
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
32
|
-
* As an alternative, most elements support a `channel` property. Which allows you
|
|
33
|
-
* to selectively display an individual element on a per channel basis. See the
|
|
34
|
-
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
35
|
-
* for more details.
|
|
36
|
-
*/
|
|
37
|
-
export interface ElementalChannelNode extends Shared.ElementalBaseNode {
|
|
38
|
-
/**
|
|
39
|
-
* The channel the contents of this element should be applied to. Can be `email`,
|
|
40
|
-
* `push`, `direct_message`, `sms` or a provider such as slack
|
|
41
|
-
*/
|
|
42
|
-
channel: string;
|
|
43
|
-
/**
|
|
44
|
-
* Raw data to apply to the channel. If `elements` has not been specified, `raw` is
|
|
45
|
-
* `required`.
|
|
46
|
-
*/
|
|
47
|
-
raw?: {
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
} | null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The channel element allows a notification to be customized based on which
|
|
53
|
-
* channel it is sent through. For example, you may want to display a detailed
|
|
54
|
-
* message when the notification is sent through email, and a more concise message
|
|
55
|
-
* in a push notification. Channel elements are only valid as top-level elements;
|
|
56
|
-
* you cannot nest channel elements. If there is a channel element specified at the
|
|
57
|
-
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
58
|
-
* As an alternative, most elements support a `channel` property. Which allows you
|
|
59
|
-
* to selectively display an individual element on a per channel basis. See the
|
|
60
|
-
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
61
|
-
* for more details.
|
|
62
|
-
*/
|
|
63
|
-
export type ElementalNode = ElementalNode.UnionMember0 | ElementalNode.UnionMember1 | ElementalNode.UnionMember2 | ElementalNode.UnionMember3 | ElementalNode.UnionMember4 | ElementalNode.UnionMember5 | ElementalNode.UnionMember6;
|
|
64
|
-
export declare namespace ElementalNode {
|
|
65
|
-
interface UnionMember0 extends Shared.ElementalBaseNode {
|
|
66
|
-
type?: 'text';
|
|
67
|
-
}
|
|
68
|
-
interface UnionMember1 extends Shared.ElementalBaseNode {
|
|
69
|
-
type?: 'meta';
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The channel element allows a notification to be customized based on which
|
|
73
|
-
* channel it is sent through. For example, you may want to display a detailed
|
|
74
|
-
* message when the notification is sent through email, and a more concise message
|
|
75
|
-
* in a push notification. Channel elements are only valid as top-level elements;
|
|
76
|
-
* you cannot nest channel elements. If there is a channel element specified at the
|
|
77
|
-
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
78
|
-
* As an alternative, most elements support a `channel` property. Which allows you
|
|
79
|
-
* to selectively display an individual element on a per channel basis. See the
|
|
80
|
-
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
81
|
-
* for more details.
|
|
82
|
-
*/
|
|
83
|
-
interface UnionMember2 extends SendAPI.ElementalChannelNode {
|
|
84
|
-
type?: 'channel';
|
|
85
|
-
}
|
|
86
|
-
interface UnionMember3 extends Shared.ElementalBaseNode {
|
|
87
|
-
type?: 'image';
|
|
88
|
-
}
|
|
89
|
-
interface UnionMember4 {
|
|
90
|
-
/**
|
|
91
|
-
* A unique id used to identify the action when it is executed.
|
|
92
|
-
*/
|
|
93
|
-
action_id?: string | null;
|
|
94
|
-
/**
|
|
95
|
-
* The alignment of the action button. Defaults to "center".
|
|
96
|
-
*/
|
|
97
|
-
align?: Shared.Alignment | null;
|
|
98
|
-
/**
|
|
99
|
-
* The background color of the action button.
|
|
100
|
-
*/
|
|
101
|
-
background_color?: string | null;
|
|
102
|
-
/**
|
|
103
|
-
* The text content of the action shown to the user.
|
|
104
|
-
*/
|
|
105
|
-
content?: string;
|
|
106
|
-
/**
|
|
107
|
-
* The target URL of the action.
|
|
108
|
-
*/
|
|
109
|
-
href?: string;
|
|
110
|
-
/**
|
|
111
|
-
* Region specific content. See
|
|
112
|
-
* [locales docs](https://www.courier.com/docs/platform/content/elemental/locales/)
|
|
113
|
-
* for more details.
|
|
114
|
-
*/
|
|
115
|
-
locales?: {
|
|
116
|
-
[key: string]: UnionMember4.Locales;
|
|
117
|
-
} | null;
|
|
118
|
-
/**
|
|
119
|
-
* Defaults to `button`.
|
|
120
|
-
*/
|
|
121
|
-
style?: 'button' | 'link' | null;
|
|
122
|
-
type?: 'action';
|
|
123
|
-
}
|
|
124
|
-
namespace UnionMember4 {
|
|
125
|
-
interface Locales {
|
|
126
|
-
content: string;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
interface UnionMember5 extends Shared.ElementalBaseNode {
|
|
130
|
-
type?: 'divider';
|
|
131
|
-
}
|
|
132
|
-
interface UnionMember6 extends Shared.ElementalBaseNode {
|
|
133
|
-
type?: 'quote';
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
export interface MessageContext {
|
|
137
|
-
/**
|
|
138
|
-
* Tenant id used to load brand/default preferences/context.
|
|
139
|
-
*/
|
|
140
|
-
tenant_id?: string | null;
|
|
141
|
-
}
|
|
142
|
-
export interface Recipient {
|
|
143
|
-
/**
|
|
144
|
-
* Use `tenant_id` instead.
|
|
145
|
-
*/
|
|
146
|
-
account_id?: string | null;
|
|
147
|
-
/**
|
|
148
|
-
* Context such as tenant_id to send the notification with.
|
|
149
|
-
*/
|
|
150
|
-
context?: MessageContext | null;
|
|
151
|
-
data?: {
|
|
152
|
-
[key: string]: unknown;
|
|
153
|
-
} | null;
|
|
154
|
-
email?: string | null;
|
|
155
|
-
/**
|
|
156
|
-
* The user's preferred ISO 639-1 language code.
|
|
157
|
-
*/
|
|
158
|
-
locale?: string | null;
|
|
159
|
-
phone_number?: string | null;
|
|
160
|
-
preferences?: Recipient.Preferences | null;
|
|
161
|
-
/**
|
|
162
|
-
* Tenant id. Will load brand, default preferences and base context data.
|
|
163
|
-
*/
|
|
164
|
-
tenant_id?: string | null;
|
|
165
|
-
user_id?: string | null;
|
|
166
|
-
}
|
|
167
|
-
export declare namespace Recipient {
|
|
168
|
-
interface Preferences {
|
|
169
|
-
notifications: {
|
|
170
|
-
[key: string]: Shared.Preference;
|
|
171
|
-
};
|
|
172
|
-
categories?: {
|
|
173
|
-
[key: string]: Shared.Preference;
|
|
174
|
-
} | null;
|
|
175
|
-
templateId?: string | null;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
export interface Utm {
|
|
179
|
-
campaign?: string | null;
|
|
180
|
-
content?: string | null;
|
|
181
|
-
medium?: string | null;
|
|
182
|
-
source?: string | null;
|
|
183
|
-
term?: string | null;
|
|
184
|
-
}
|
|
185
22
|
export interface SendMessageResponse {
|
|
186
23
|
/**
|
|
187
24
|
* A successful call to `POST /send` returns a `202` status code along with a
|
|
@@ -216,8 +53,8 @@ export declare namespace SendMessageParams {
|
|
|
216
53
|
* Describes content that will work for email, inbox, push, chat, or any channel
|
|
217
54
|
* id.
|
|
218
55
|
*/
|
|
219
|
-
content?: Shared.ElementalContentSugar |
|
|
220
|
-
context?:
|
|
56
|
+
content?: Shared.ElementalContentSugar | Shared.ElementalContent;
|
|
57
|
+
context?: Shared.MessageContext | null;
|
|
221
58
|
data?: {
|
|
222
59
|
[key: string]: unknown;
|
|
223
60
|
} | null;
|
|
@@ -232,15 +69,12 @@ export declare namespace SendMessageParams {
|
|
|
232
69
|
* Customize which channels/providers Courier may deliver the message through.
|
|
233
70
|
*/
|
|
234
71
|
routing?: Message.Routing | null;
|
|
235
|
-
/**
|
|
236
|
-
* The id of the template you want to send
|
|
237
|
-
*/
|
|
238
72
|
template?: string | null;
|
|
239
73
|
timeout?: Message.Timeout | null;
|
|
240
74
|
/**
|
|
241
75
|
* The recipient or a list of recipients of the message
|
|
242
76
|
*/
|
|
243
|
-
to?:
|
|
77
|
+
to?: Shared.UserRecipient | Array<Shared.Recipient> | null;
|
|
244
78
|
}
|
|
245
79
|
namespace Message {
|
|
246
80
|
interface Channels {
|
|
@@ -271,7 +105,7 @@ export declare namespace SendMessageParams {
|
|
|
271
105
|
}
|
|
272
106
|
namespace Channels {
|
|
273
107
|
interface Metadata {
|
|
274
|
-
utm?:
|
|
108
|
+
utm?: Shared.Utm | null;
|
|
275
109
|
}
|
|
276
110
|
interface Timeouts {
|
|
277
111
|
channel?: number | null;
|
|
@@ -302,7 +136,7 @@ export declare namespace SendMessageParams {
|
|
|
302
136
|
event?: string | null;
|
|
303
137
|
tags?: Array<string> | null;
|
|
304
138
|
trace_id?: string | null;
|
|
305
|
-
utm?:
|
|
139
|
+
utm?: Shared.Utm | null;
|
|
306
140
|
}
|
|
307
141
|
interface Preferences {
|
|
308
142
|
/**
|
|
@@ -326,7 +160,7 @@ export declare namespace SendMessageParams {
|
|
|
326
160
|
}
|
|
327
161
|
namespace Providers {
|
|
328
162
|
interface Metadata {
|
|
329
|
-
utm?:
|
|
163
|
+
utm?: Shared.Utm | null;
|
|
330
164
|
}
|
|
331
165
|
}
|
|
332
166
|
/**
|
|
@@ -353,6 +187,6 @@ export declare namespace SendMessageParams {
|
|
|
353
187
|
}
|
|
354
188
|
}
|
|
355
189
|
export declare namespace Send {
|
|
356
|
-
export { type
|
|
190
|
+
export { type SendMessageResponse as SendMessageResponse, type SendMessageParams as SendMessageParams };
|
|
357
191
|
}
|
|
358
192
|
//# sourceMappingURL=send.d.ts.map
|
package/resources/send.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,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M,GAAG,IAAI,CAAC;YAE3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YAExB,QAAQ,CAAC,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,GAAG,IAAI,CAAC;SAC7C;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACzG"}
|
package/resources/send.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.Send = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class Send extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Send a message to one or more recipients.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```ts
|
|
@@ -13,7 +13,7 @@ class Send extends resource_1.APIResource {
|
|
|
13
13
|
* message: {
|
|
14
14
|
* to: { user_id: 'example_user' },
|
|
15
15
|
* template: 'template_id',
|
|
16
|
-
* data: {
|
|
16
|
+
* data: { foo: 'bar' },
|
|
17
17
|
* },
|
|
18
18
|
* });
|
|
19
19
|
* ```
|
package/resources/send.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAuB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF;AAlBD,oBAkBC"}
|
package/resources/send.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class Send extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Send a message to one or more recipients.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
@@ -10,7 +10,7 @@ export class Send extends APIResource {
|
|
|
10
10
|
* message: {
|
|
11
11
|
* to: { user_id: 'example_user' },
|
|
12
12
|
* template: 'template_id',
|
|
13
|
-
* data: {
|
|
13
|
+
* data: { foo: 'bar' },
|
|
14
14
|
* },
|
|
15
15
|
* });
|
|
16
16
|
* ```
|
package/resources/send.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.mjs","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"send.mjs","sourceRoot":"","sources":["../src/resources/send.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAuB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
package/resources/shared.d.mts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as ItemsAPI from "./tenants/default-preferences/items.mjs";
|
|
1
|
+
import * as Shared from "./shared.mjs";
|
|
3
2
|
export type Alignment = 'center' | 'left' | 'right' | 'full';
|
|
3
|
+
export type ChannelClassification = 'direct_message' | 'email' | 'push' | 'sms' | 'webhook' | 'inbox';
|
|
4
4
|
export interface ChannelPreference {
|
|
5
|
-
channel:
|
|
5
|
+
channel: ChannelClassification;
|
|
6
|
+
}
|
|
7
|
+
export interface ElementalActionNodeWithType extends ElementalBaseNode {
|
|
8
|
+
type?: 'action';
|
|
6
9
|
}
|
|
7
10
|
export interface ElementalBaseNode {
|
|
8
11
|
channels?: Array<string> | null;
|
|
@@ -10,6 +13,55 @@ export interface ElementalBaseNode {
|
|
|
10
13
|
loop?: string | null;
|
|
11
14
|
ref?: string | null;
|
|
12
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* The channel element allows a notification to be customized based on which
|
|
18
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
19
|
+
* message when the notification is sent through email, and a more concise message
|
|
20
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
21
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
22
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
23
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
24
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
25
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
26
|
+
* for more details.
|
|
27
|
+
*/
|
|
28
|
+
export interface ElementalChannelNode extends ElementalBaseNode {
|
|
29
|
+
/**
|
|
30
|
+
* The channel the contents of this element should be applied to. Can be `email`,
|
|
31
|
+
* `push`, `direct_message`, `sms` or a provider such as slack
|
|
32
|
+
*/
|
|
33
|
+
channel: string;
|
|
34
|
+
/**
|
|
35
|
+
* Raw data to apply to the channel. If `elements` has not been specified, `raw` is
|
|
36
|
+
* required.
|
|
37
|
+
*/
|
|
38
|
+
raw?: {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
} | null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The channel element allows a notification to be customized based on which
|
|
44
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
45
|
+
* message when the notification is sent through email, and a more concise message
|
|
46
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
47
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
48
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
49
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
50
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
51
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
52
|
+
* for more details.
|
|
53
|
+
*/
|
|
54
|
+
export interface ElementalChannelNodeWithType extends ElementalChannelNode {
|
|
55
|
+
type?: 'channel';
|
|
56
|
+
}
|
|
57
|
+
export interface ElementalContent {
|
|
58
|
+
elements: Array<ElementalNode>;
|
|
59
|
+
/**
|
|
60
|
+
* For example, "2022-01-01"
|
|
61
|
+
*/
|
|
62
|
+
version: string;
|
|
63
|
+
brand?: string | null;
|
|
64
|
+
}
|
|
13
65
|
/**
|
|
14
66
|
* Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
|
|
15
67
|
*/
|
|
@@ -23,20 +75,179 @@ export interface ElementalContentSugar {
|
|
|
23
75
|
*/
|
|
24
76
|
title: string;
|
|
25
77
|
}
|
|
78
|
+
export interface ElementalDividerNodeWithType extends ElementalBaseNode {
|
|
79
|
+
type?: 'divider';
|
|
80
|
+
}
|
|
81
|
+
export interface ElementalImageNodeWithType extends ElementalBaseNode {
|
|
82
|
+
type?: 'image';
|
|
83
|
+
}
|
|
84
|
+
export interface ElementalMetaNodeWithType extends ElementalBaseNode {
|
|
85
|
+
type?: 'meta';
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The channel element allows a notification to be customized based on which
|
|
89
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
90
|
+
* message when the notification is sent through email, and a more concise message
|
|
91
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
92
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
93
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
94
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
95
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
96
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
97
|
+
* for more details.
|
|
98
|
+
*/
|
|
99
|
+
export type ElementalNode = ElementalTextNodeWithType | ElementalMetaNodeWithType | ElementalChannelNodeWithType | ElementalImageNodeWithType | ElementalActionNodeWithType | ElementalDividerNodeWithType | ElementalQuoteNodeWithType;
|
|
100
|
+
export interface ElementalQuoteNodeWithType extends ElementalBaseNode {
|
|
101
|
+
type?: 'quote';
|
|
102
|
+
}
|
|
103
|
+
export interface ElementalTextNodeWithType extends ElementalBaseNode {
|
|
104
|
+
type?: 'text';
|
|
105
|
+
}
|
|
106
|
+
export interface MessageContext {
|
|
107
|
+
/**
|
|
108
|
+
* Tenant id used to load brand/default preferences/context.
|
|
109
|
+
*/
|
|
110
|
+
tenant_id?: string | null;
|
|
111
|
+
}
|
|
26
112
|
export interface MessageRouting {
|
|
27
113
|
channels: Array<MessageRoutingChannel>;
|
|
28
114
|
method: 'all' | 'single';
|
|
29
115
|
}
|
|
30
116
|
export type MessageRoutingChannel = string | MessageRouting;
|
|
117
|
+
export interface NotificationPreferenceDetails {
|
|
118
|
+
status: PreferenceStatus;
|
|
119
|
+
channel_preferences?: Array<ChannelPreference> | null;
|
|
120
|
+
rules?: Array<Rule> | null;
|
|
121
|
+
}
|
|
122
|
+
export interface Paging {
|
|
123
|
+
more: boolean;
|
|
124
|
+
cursor?: string | null;
|
|
125
|
+
}
|
|
31
126
|
export interface Preference {
|
|
32
|
-
status:
|
|
127
|
+
status: PreferenceStatus;
|
|
33
128
|
channel_preferences?: Array<ChannelPreference> | null;
|
|
34
129
|
rules?: Array<Rule> | null;
|
|
35
130
|
source?: 'subscription' | 'list' | 'recipient' | null;
|
|
36
131
|
}
|
|
132
|
+
export type PreferenceStatus = 'OPTED_IN' | 'OPTED_OUT' | 'REQUIRED';
|
|
133
|
+
export interface Recipient {
|
|
134
|
+
/**
|
|
135
|
+
* Deprecated - Use `tenant_id` instead.
|
|
136
|
+
*/
|
|
137
|
+
account_id?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* Context such as tenant_id to send the notification with.
|
|
140
|
+
*/
|
|
141
|
+
context?: MessageContext | null;
|
|
142
|
+
data?: {
|
|
143
|
+
[key: string]: unknown;
|
|
144
|
+
} | null;
|
|
145
|
+
/**
|
|
146
|
+
* The user's email address.
|
|
147
|
+
*/
|
|
148
|
+
email?: string | null;
|
|
149
|
+
/**
|
|
150
|
+
* The id of the list to send the message to.
|
|
151
|
+
*/
|
|
152
|
+
list_id?: string | null;
|
|
153
|
+
/**
|
|
154
|
+
* The user's preferred ISO 639-1 language code.
|
|
155
|
+
*/
|
|
156
|
+
locale?: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* The user's phone number.
|
|
159
|
+
*/
|
|
160
|
+
phone_number?: string | null;
|
|
161
|
+
preferences?: Recipient.Preferences | null;
|
|
162
|
+
/**
|
|
163
|
+
* The id of the tenant the user is associated with.
|
|
164
|
+
*/
|
|
165
|
+
tenant_id?: string | null;
|
|
166
|
+
/**
|
|
167
|
+
* The user's unique identifier. Typically, this will match the user id of a user
|
|
168
|
+
* in your system.
|
|
169
|
+
*/
|
|
170
|
+
user_id?: string | null;
|
|
171
|
+
}
|
|
172
|
+
export declare namespace Recipient {
|
|
173
|
+
interface Preferences {
|
|
174
|
+
notifications: {
|
|
175
|
+
[key: string]: Shared.Preference;
|
|
176
|
+
};
|
|
177
|
+
categories?: {
|
|
178
|
+
[key: string]: Shared.Preference;
|
|
179
|
+
} | null;
|
|
180
|
+
templateId?: string | null;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export interface RecipientPreferences {
|
|
184
|
+
categories?: {
|
|
185
|
+
[key: string]: NotificationPreferenceDetails;
|
|
186
|
+
} | null;
|
|
187
|
+
notifications?: {
|
|
188
|
+
[key: string]: NotificationPreferenceDetails;
|
|
189
|
+
} | null;
|
|
190
|
+
}
|
|
37
191
|
export interface Rule {
|
|
38
192
|
until: string;
|
|
39
193
|
start?: string | null;
|
|
40
194
|
}
|
|
41
195
|
export type TextStyle = 'text' | 'h1' | 'h2' | 'subtext';
|
|
196
|
+
export interface UserRecipient {
|
|
197
|
+
/**
|
|
198
|
+
* Deprecated - Use `tenant_id` instead.
|
|
199
|
+
*/
|
|
200
|
+
account_id?: string | null;
|
|
201
|
+
/**
|
|
202
|
+
* Context such as tenant_id to send the notification with.
|
|
203
|
+
*/
|
|
204
|
+
context?: MessageContext | null;
|
|
205
|
+
data?: {
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
} | null;
|
|
208
|
+
/**
|
|
209
|
+
* The user's email address.
|
|
210
|
+
*/
|
|
211
|
+
email?: string | null;
|
|
212
|
+
/**
|
|
213
|
+
* The id of the list to send the message to.
|
|
214
|
+
*/
|
|
215
|
+
list_id?: string | null;
|
|
216
|
+
/**
|
|
217
|
+
* The user's preferred ISO 639-1 language code.
|
|
218
|
+
*/
|
|
219
|
+
locale?: string | null;
|
|
220
|
+
/**
|
|
221
|
+
* The user's phone number.
|
|
222
|
+
*/
|
|
223
|
+
phone_number?: string | null;
|
|
224
|
+
preferences?: UserRecipient.Preferences | null;
|
|
225
|
+
/**
|
|
226
|
+
* The id of the tenant the user is associated with.
|
|
227
|
+
*/
|
|
228
|
+
tenant_id?: string | null;
|
|
229
|
+
/**
|
|
230
|
+
* The user's unique identifier. Typically, this will match the user id of a user
|
|
231
|
+
* in your system.
|
|
232
|
+
*/
|
|
233
|
+
user_id?: string | null;
|
|
234
|
+
}
|
|
235
|
+
export declare namespace UserRecipient {
|
|
236
|
+
interface Preferences {
|
|
237
|
+
notifications: {
|
|
238
|
+
[key: string]: Shared.Preference;
|
|
239
|
+
};
|
|
240
|
+
categories?: {
|
|
241
|
+
[key: string]: Shared.Preference;
|
|
242
|
+
} | null;
|
|
243
|
+
templateId?: string | null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
export interface Utm {
|
|
247
|
+
campaign?: string | null;
|
|
248
|
+
content?: string | null;
|
|
249
|
+
medium?: string | null;
|
|
250
|
+
source?: string | null;
|
|
251
|
+
term?: string | null;
|
|
252
|
+
}
|
|
42
253
|
//# sourceMappingURL=shared.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,
|
|
1
|
+
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"OAEO,KAAK,MAAM;AAElB,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtG,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,2BAA4B,SAAQ,iBAAiB;IACpE,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAEhC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACzC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,4BAA6B,SA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