@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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Shared from './shared';
|
|
4
|
+
|
|
5
|
+
export type Alignment = 'center' | 'left' | 'right' | 'full';
|
|
6
|
+
|
|
7
|
+
export type ChannelClassification = 'direct_message' | 'email' | 'push' | 'sms' | 'webhook' | 'inbox';
|
|
8
|
+
|
|
9
|
+
export interface ChannelPreference {
|
|
10
|
+
channel: ChannelClassification;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ElementalActionNodeWithType extends ElementalBaseNode {
|
|
14
|
+
type?: 'action';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ElementalBaseNode {
|
|
18
|
+
channels?: Array<string> | null;
|
|
19
|
+
|
|
20
|
+
if?: string | null;
|
|
21
|
+
|
|
22
|
+
loop?: string | null;
|
|
23
|
+
|
|
24
|
+
ref?: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The channel element allows a notification to be customized based on which
|
|
29
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
30
|
+
* message when the notification is sent through email, and a more concise message
|
|
31
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
32
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
33
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
34
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
35
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
36
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
37
|
+
* for more details.
|
|
38
|
+
*/
|
|
39
|
+
export interface ElementalChannelNode extends ElementalBaseNode {
|
|
40
|
+
/**
|
|
41
|
+
* The channel the contents of this element should be applied to. Can be `email`,
|
|
42
|
+
* `push`, `direct_message`, `sms` or a provider such as slack
|
|
43
|
+
*/
|
|
44
|
+
channel: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Raw data to apply to the channel. If `elements` has not been specified, `raw` is
|
|
48
|
+
* `required`.
|
|
49
|
+
*/
|
|
50
|
+
raw?: { [key: string]: unknown } | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The channel element allows a notification to be customized based on which
|
|
55
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
56
|
+
* message when the notification is sent through email, and a more concise message
|
|
57
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
58
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
59
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
60
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
61
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
62
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
63
|
+
* for more details.
|
|
64
|
+
*/
|
|
65
|
+
export interface ElementalChannelNodeWithType extends ElementalChannelNode {
|
|
66
|
+
type?: 'channel';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ElementalContent {
|
|
70
|
+
elements: Array<ElementalNode>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* For example, "2022-01-01"
|
|
74
|
+
*/
|
|
75
|
+
version: string;
|
|
76
|
+
|
|
77
|
+
brand?: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
|
|
82
|
+
*/
|
|
83
|
+
export interface ElementalContentSugar {
|
|
84
|
+
/**
|
|
85
|
+
* The text content displayed in the notification.
|
|
86
|
+
*/
|
|
87
|
+
body: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Title/subject displayed by supported channels.
|
|
91
|
+
*/
|
|
92
|
+
title: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ElementalDividerNodeWithType extends ElementalBaseNode {
|
|
96
|
+
type?: 'divider';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ElementalImageNodeWithType extends ElementalBaseNode {
|
|
100
|
+
type?: 'image';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface ElementalMetaNodeWithType extends ElementalBaseNode {
|
|
104
|
+
type?: 'meta';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The channel element allows a notification to be customized based on which
|
|
109
|
+
* channel it is sent through. For example, you may want to display a detailed
|
|
110
|
+
* message when the notification is sent through email, and a more concise message
|
|
111
|
+
* in a push notification. Channel elements are only valid as top-level elements;
|
|
112
|
+
* you cannot nest channel elements. If there is a channel element specified at the
|
|
113
|
+
* top-level of the document, all sibling elements must be channel elements. Note:
|
|
114
|
+
* As an alternative, most elements support a `channel` property. Which allows you
|
|
115
|
+
* to selectively display an individual element on a per channel basis. See the
|
|
116
|
+
* [control flow docs](https://www.courier.com/docs/platform/content/elemental/control-flow/)
|
|
117
|
+
* for more details.
|
|
118
|
+
*/
|
|
119
|
+
export type ElementalNode =
|
|
120
|
+
| ElementalTextNodeWithType
|
|
121
|
+
| ElementalMetaNodeWithType
|
|
122
|
+
| ElementalChannelNodeWithType
|
|
123
|
+
| ElementalImageNodeWithType
|
|
124
|
+
| ElementalActionNodeWithType
|
|
125
|
+
| ElementalDividerNodeWithType
|
|
126
|
+
| ElementalQuoteNodeWithType;
|
|
127
|
+
|
|
128
|
+
export interface ElementalQuoteNodeWithType extends ElementalBaseNode {
|
|
129
|
+
type?: 'quote';
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ElementalTextNodeWithType extends ElementalBaseNode {
|
|
133
|
+
type?: 'text';
|
|
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
|
+
|
|
143
|
+
export interface MessageRouting {
|
|
144
|
+
channels: Array<MessageRoutingChannel>;
|
|
145
|
+
|
|
146
|
+
method: 'all' | 'single';
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export type MessageRoutingChannel = string | MessageRouting;
|
|
150
|
+
|
|
151
|
+
export interface NotificationPreferenceDetails {
|
|
152
|
+
status: PreferenceStatus;
|
|
153
|
+
|
|
154
|
+
channel_preferences?: Array<ChannelPreference> | null;
|
|
155
|
+
|
|
156
|
+
rules?: Array<Rule> | null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface Paging {
|
|
160
|
+
more: boolean;
|
|
161
|
+
|
|
162
|
+
cursor?: string | null;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface Preference {
|
|
166
|
+
status: PreferenceStatus;
|
|
167
|
+
|
|
168
|
+
channel_preferences?: Array<ChannelPreference> | null;
|
|
169
|
+
|
|
170
|
+
rules?: Array<Rule> | null;
|
|
171
|
+
|
|
172
|
+
source?: 'subscription' | 'list' | 'recipient' | null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type PreferenceStatus = 'OPTED_IN' | 'OPTED_OUT' | 'REQUIRED';
|
|
176
|
+
|
|
177
|
+
export interface Recipient {
|
|
178
|
+
/**
|
|
179
|
+
* Deprecated - Use `tenant_id` instead.
|
|
180
|
+
*/
|
|
181
|
+
account_id?: string | null;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Context such as tenant_id to send the notification with.
|
|
185
|
+
*/
|
|
186
|
+
context?: MessageContext | null;
|
|
187
|
+
|
|
188
|
+
data?: { [key: string]: unknown } | null;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The user's email address.
|
|
192
|
+
*/
|
|
193
|
+
email?: string | null;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The user's preferred ISO 639-1 language code.
|
|
197
|
+
*/
|
|
198
|
+
locale?: string | null;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The user's phone number.
|
|
202
|
+
*/
|
|
203
|
+
phone_number?: string | null;
|
|
204
|
+
|
|
205
|
+
preferences?: Recipient.Preferences | null;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The id of the tenant the user is associated with.
|
|
209
|
+
*/
|
|
210
|
+
tenant_id?: string | null;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The user's unique identifier. Typically, this will match the user id of a user
|
|
214
|
+
* in your system.
|
|
215
|
+
*/
|
|
216
|
+
user_id?: string | null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export namespace Recipient {
|
|
220
|
+
export interface Preferences {
|
|
221
|
+
notifications: { [key: string]: Shared.Preference };
|
|
222
|
+
|
|
223
|
+
categories?: { [key: string]: Shared.Preference } | null;
|
|
224
|
+
|
|
225
|
+
templateId?: string | null;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export interface RecipientPreferences {
|
|
230
|
+
categories?: { [key: string]: NotificationPreferenceDetails } | null;
|
|
231
|
+
|
|
232
|
+
notifications?: { [key: string]: NotificationPreferenceDetails } | null;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface Rule {
|
|
236
|
+
until: string;
|
|
237
|
+
|
|
238
|
+
start?: string | null;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type TextStyle = 'text' | 'h1' | 'h2' | 'subtext';
|
|
242
|
+
|
|
243
|
+
export interface UserRecipient {
|
|
244
|
+
/**
|
|
245
|
+
* Deprecated - Use `tenant_id` instead.
|
|
246
|
+
*/
|
|
247
|
+
account_id?: string | null;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Context such as tenant_id to send the notification with.
|
|
251
|
+
*/
|
|
252
|
+
context?: MessageContext | null;
|
|
253
|
+
|
|
254
|
+
data?: { [key: string]: unknown } | null;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The user's email address.
|
|
258
|
+
*/
|
|
259
|
+
email?: string | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* The user's preferred ISO 639-1 language code.
|
|
263
|
+
*/
|
|
264
|
+
locale?: string | null;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The user's phone number.
|
|
268
|
+
*/
|
|
269
|
+
phone_number?: string | null;
|
|
270
|
+
|
|
271
|
+
preferences?: UserRecipient.Preferences | null;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The id of the tenant the user is associated with.
|
|
275
|
+
*/
|
|
276
|
+
tenant_id?: string | null;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* The user's unique identifier. Typically, this will match the user id of a user
|
|
280
|
+
* in your system.
|
|
281
|
+
*/
|
|
282
|
+
user_id?: string | null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export namespace UserRecipient {
|
|
286
|
+
export interface Preferences {
|
|
287
|
+
notifications: { [key: string]: Shared.Preference };
|
|
288
|
+
|
|
289
|
+
categories?: { [key: string]: Shared.Preference } | null;
|
|
290
|
+
|
|
291
|
+
templateId?: string | null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface Utm {
|
|
296
|
+
campaign?: string | null;
|
|
297
|
+
|
|
298
|
+
content?: string | null;
|
|
299
|
+
|
|
300
|
+
medium?: string | null;
|
|
301
|
+
|
|
302
|
+
source?: string | null;
|
|
303
|
+
|
|
304
|
+
term?: string | null;
|
|
305
|
+
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
Templates,
|
|
5
|
+
type TemplateListResponse,
|
|
6
|
+
type TemplateRetrieveParams,
|
|
7
|
+
type TemplateListParams,
|
|
8
|
+
} from './templates';
|
|
9
|
+
export { TenantDefaultPreferences } from './tenant-default-preferences/index';
|
|
3
10
|
export {
|
|
4
11
|
Tenants,
|
|
12
|
+
type BaseTemplateTenantAssociation,
|
|
5
13
|
type DefaultPreferences,
|
|
14
|
+
type SubscriptionTopicNew,
|
|
6
15
|
type Tenant,
|
|
16
|
+
type TenantAssociation,
|
|
7
17
|
type TenantListResponse,
|
|
8
18
|
type TenantListUsersResponse,
|
|
9
19
|
type TenantUpdateParams,
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as Shared from '../shared';
|
|
5
|
+
import * as TenantsAPI from './tenants';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Templates extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Get a Template in Tenant
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const baseTemplateTenantAssociation =
|
|
17
|
+
* await client.tenants.templates.retrieve('template_id', {
|
|
18
|
+
* tenant_id: 'tenant_id',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
retrieve(
|
|
23
|
+
templateID: string,
|
|
24
|
+
params: TemplateRetrieveParams,
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<TenantsAPI.BaseTemplateTenantAssociation> {
|
|
27
|
+
const { tenant_id } = params;
|
|
28
|
+
return this._client.get(path`/tenants/${tenant_id}/templates/${templateID}`, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List Templates in Tenant
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const templates = await client.tenants.templates.list(
|
|
37
|
+
* 'tenant_id',
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
list(
|
|
42
|
+
tenantID: string,
|
|
43
|
+
query: TemplateListParams | null | undefined = {},
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<TemplateListResponse> {
|
|
46
|
+
return this._client.get(path`/tenants/${tenantID}/templates`, { query, ...options });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface TemplateListResponse {
|
|
51
|
+
/**
|
|
52
|
+
* Set to true when there are more pages that can be retrieved.
|
|
53
|
+
*/
|
|
54
|
+
has_more: boolean;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Always set to `list`. Represents the type of this object.
|
|
58
|
+
*/
|
|
59
|
+
type: 'list';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A url that may be used to generate these results.
|
|
63
|
+
*/
|
|
64
|
+
url: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A pointer to the next page of results. Defined only when `has_more` is set to
|
|
68
|
+
* true
|
|
69
|
+
*/
|
|
70
|
+
cursor?: string | null;
|
|
71
|
+
|
|
72
|
+
items?: Array<TemplateListResponse.Item> | null;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A url that may be used to generate fetch the next set of results. Defined only
|
|
76
|
+
* when `has_more` is set to true
|
|
77
|
+
*/
|
|
78
|
+
next_url?: string | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export namespace TemplateListResponse {
|
|
82
|
+
export interface Item extends TenantsAPI.BaseTemplateTenantAssociation {
|
|
83
|
+
/**
|
|
84
|
+
* The template's data containing it's routing configs
|
|
85
|
+
*/
|
|
86
|
+
data: Item.Data;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export namespace Item {
|
|
90
|
+
/**
|
|
91
|
+
* The template's data containing it's routing configs
|
|
92
|
+
*/
|
|
93
|
+
export interface Data {
|
|
94
|
+
routing: Shared.MessageRouting;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface TemplateRetrieveParams {
|
|
100
|
+
/**
|
|
101
|
+
* Id of the tenant for which to retrieve the template.
|
|
102
|
+
*/
|
|
103
|
+
tenant_id: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface TemplateListParams {
|
|
107
|
+
/**
|
|
108
|
+
* Continue the pagination with the next cursor
|
|
109
|
+
*/
|
|
110
|
+
cursor?: string | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The number of templates to return (defaults to 20, maximum value of 100)
|
|
114
|
+
*/
|
|
115
|
+
limit?: number | null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export declare namespace Templates {
|
|
119
|
+
export {
|
|
120
|
+
type TemplateListResponse as TemplateListResponse,
|
|
121
|
+
type TemplateRetrieveParams as TemplateRetrieveParams,
|
|
122
|
+
type TemplateListParams as TemplateListParams,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
4
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
6
|
import { buildHeaders } from '../../../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../../../internal/request-options';
|
|
@@ -12,7 +13,7 @@ export class Items extends APIResource {
|
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```ts
|
|
15
|
-
* await client.tenants.
|
|
16
|
+
* await client.tenants.tenantDefaultPreferences.items.update(
|
|
16
17
|
* 'topic_id',
|
|
17
18
|
* {
|
|
18
19
|
* tenant_id: 'tenant_id',
|
|
@@ -37,7 +38,7 @@ export class Items extends APIResource {
|
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```ts
|
|
40
|
-
* await client.tenants.
|
|
41
|
+
* await client.tenants.tenantDefaultPreferences.items.delete(
|
|
41
42
|
* 'topic_id',
|
|
42
43
|
* { tenant_id: 'tenant_id' },
|
|
43
44
|
* );
|
|
@@ -52,24 +53,6 @@ export class Items extends APIResource {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
export type ChannelClassification = 'direct_message' | 'email' | 'push' | 'sms' | 'webhook' | 'inbox';
|
|
56
|
-
|
|
57
|
-
export interface SubscriptionTopicNew {
|
|
58
|
-
status: 'OPTED_OUT' | 'OPTED_IN' | 'REQUIRED';
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* The default channels to send to this tenant when has_custom_routing is enabled
|
|
62
|
-
*/
|
|
63
|
-
custom_routing?: Array<ChannelClassification> | null;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Override channel routing with custom preferences. This will override any
|
|
67
|
-
* template prefernces that are set, but a user can still customize their
|
|
68
|
-
* preferences
|
|
69
|
-
*/
|
|
70
|
-
has_custom_routing?: boolean | null;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
56
|
export interface ItemUpdateParams {
|
|
74
57
|
/**
|
|
75
58
|
* Path param: Id of the tenant to update the default preferences for.
|
|
@@ -85,7 +68,7 @@ export interface ItemUpdateParams {
|
|
|
85
68
|
* Body param: The default channels to send to this tenant when has_custom_routing
|
|
86
69
|
* is enabled
|
|
87
70
|
*/
|
|
88
|
-
custom_routing?: Array<ChannelClassification> | null;
|
|
71
|
+
custom_routing?: Array<Shared.ChannelClassification> | null;
|
|
89
72
|
|
|
90
73
|
/**
|
|
91
74
|
* Body param: Override channel routing with custom preferences. This will override
|
|
@@ -103,10 +86,5 @@ export interface ItemDeleteParams {
|
|
|
103
86
|
}
|
|
104
87
|
|
|
105
88
|
export declare namespace Items {
|
|
106
|
-
export {
|
|
107
|
-
type ChannelClassification as ChannelClassification,
|
|
108
|
-
type SubscriptionTopicNew as SubscriptionTopicNew,
|
|
109
|
-
type ItemUpdateParams as ItemUpdateParams,
|
|
110
|
-
type ItemDeleteParams as ItemDeleteParams,
|
|
111
|
-
};
|
|
89
|
+
export { type ItemUpdateParams as ItemUpdateParams, type ItemDeleteParams as ItemDeleteParams };
|
|
112
90
|
}
|
|
@@ -2,25 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as ItemsAPI from './items';
|
|
5
|
-
import {
|
|
6
|
-
ChannelClassification,
|
|
7
|
-
ItemDeleteParams,
|
|
8
|
-
ItemUpdateParams,
|
|
9
|
-
Items,
|
|
10
|
-
SubscriptionTopicNew,
|
|
11
|
-
} from './items';
|
|
5
|
+
import { ItemDeleteParams, ItemUpdateParams, Items } from './items';
|
|
12
6
|
|
|
13
|
-
export class
|
|
7
|
+
export class TenantDefaultPreferences extends APIResource {
|
|
14
8
|
items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
|
|
15
9
|
}
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
TenantDefaultPreferences.Items = Items;
|
|
18
12
|
|
|
19
|
-
export declare namespace
|
|
13
|
+
export declare namespace TenantDefaultPreferences {
|
|
20
14
|
export {
|
|
21
15
|
Items as Items,
|
|
22
|
-
type ChannelClassification as ChannelClassification,
|
|
23
|
-
type SubscriptionTopicNew as SubscriptionTopicNew,
|
|
24
16
|
type ItemUpdateParams as ItemUpdateParams,
|
|
25
17
|
type ItemDeleteParams as ItemDeleteParams,
|
|
26
18
|
};
|