mailchannels-sdk 0.4.0 → 0.4.2
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/LICENSE +21 -21
- package/README.md +180 -175
- package/dist/mailchannels.d.mts +2 -2
- package/dist/mailchannels.d.ts +2 -2
- package/dist/mailchannels.mjs +3 -0
- package/dist/modules.d.mts +1 -1
- package/dist/modules.d.ts +1 -1
- package/dist/modules.mjs +175 -4
- package/dist/shared/{mailchannels-sdk.DUD1k4jz.d.mts → mailchannels-sdk.ug4M5nbx.d.mts} +1156 -966
- package/dist/shared/{mailchannels-sdk.DUD1k4jz.d.ts → mailchannels-sdk.ug4M5nbx.d.ts} +1156 -966
- package/package.json +18 -19
|
@@ -9,281 +9,404 @@ declare class MailChannelsClient {
|
|
|
9
9
|
get<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
|
|
10
10
|
delete<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
|
|
11
11
|
put<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
|
|
12
|
+
patch<T>(path: string, options?: Omit<FetchOptions<"json">, "method">): Promise<T>;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
interface
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* '
|
|
75
|
-
* @example
|
|
76
|
-
*
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* '
|
|
92
|
-
* @example
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* '
|
|
136
|
-
* @example
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
*
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
*
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* The
|
|
196
|
-
* @example
|
|
197
|
-
* '
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
*
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
*
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
15
|
+
interface SuccessResponse {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the operation was successful.
|
|
18
|
+
*/
|
|
19
|
+
success: boolean;
|
|
20
|
+
error: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface EmailsSendRecipient {
|
|
24
|
+
/**
|
|
25
|
+
* The email address of the recipient.
|
|
26
|
+
*/
|
|
27
|
+
email: string;
|
|
28
|
+
/**
|
|
29
|
+
* The name of the recipient.
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface EmailsSendAttachment {
|
|
35
|
+
/**
|
|
36
|
+
* The attachment data, encoded in base64.
|
|
37
|
+
*/
|
|
38
|
+
content: string;
|
|
39
|
+
/**
|
|
40
|
+
* The name of the attachment file.
|
|
41
|
+
*/
|
|
42
|
+
filename: string;
|
|
43
|
+
/**
|
|
44
|
+
* The MIME type of the attachment.
|
|
45
|
+
*/
|
|
46
|
+
type: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface EmailsSendTracking {
|
|
50
|
+
/**
|
|
51
|
+
* Track when a recipient clicks a link in your email.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
click?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Track when a recipient opens your email. Please note that some email clients may not support open tracking.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
open?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface EmailsSendOptionsBase {
|
|
63
|
+
/**
|
|
64
|
+
* An array of attachments to be sent with the email.
|
|
65
|
+
*/
|
|
66
|
+
attachments?: EmailsSendAttachment[];
|
|
67
|
+
/**
|
|
68
|
+
* The campaign identifier. If specified, this ID will be included in all relevant webhooks. It can be up to 48 UTF-8 characters long and must not contain spaces.
|
|
69
|
+
*/
|
|
70
|
+
campaignId?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The BCC recipients of the email. Can be an array of email addresses or an array of objects with email and name properties or a single email address string or an object with email and name properties.
|
|
73
|
+
* @example
|
|
74
|
+
* [
|
|
75
|
+
* { email: 'email1@example.com', name: 'Example1' },
|
|
76
|
+
* { email: 'email2@example.com', name: 'Example2' }
|
|
77
|
+
* ]
|
|
78
|
+
* @example
|
|
79
|
+
* { email: 'email@example.com', name: 'Example' }
|
|
80
|
+
* @example
|
|
81
|
+
* ['email1@example.com', 'email2@example.com']
|
|
82
|
+
* @example
|
|
83
|
+
* 'email@example.com'
|
|
84
|
+
* @example
|
|
85
|
+
* 'Name <email@example.com>'
|
|
86
|
+
*/
|
|
87
|
+
bcc?: EmailsSendRecipient[] | EmailsSendRecipient | string[] | string;
|
|
88
|
+
/**
|
|
89
|
+
* The CC recipients of the email. Can be an array of email addresses or an array of objects with email and name properties or a single email address string or an object with email and name properties.
|
|
90
|
+
* @example
|
|
91
|
+
* [
|
|
92
|
+
* { email: 'email1@example.com', name: 'Example1' },
|
|
93
|
+
* { email: 'email2@example.com', name: 'Example2' }
|
|
94
|
+
* ]
|
|
95
|
+
* @example
|
|
96
|
+
* { email: 'email@example.com', name: 'Example' }
|
|
97
|
+
* @example
|
|
98
|
+
* ['email1@example.com', 'email2@example.com']
|
|
99
|
+
* @example
|
|
100
|
+
* 'email@example.com'
|
|
101
|
+
* @example
|
|
102
|
+
* 'Name <email@example.com>'
|
|
103
|
+
*/
|
|
104
|
+
cc?: EmailsSendRecipient[] | EmailsSendRecipient | string[] | string;
|
|
105
|
+
/**
|
|
106
|
+
* The DKIM settings for the email.
|
|
107
|
+
*/
|
|
108
|
+
dkim?: {
|
|
109
|
+
/**
|
|
110
|
+
* Domain used for DKIM signing.
|
|
111
|
+
*/
|
|
112
|
+
domain: string;
|
|
113
|
+
/**
|
|
114
|
+
* DKIM private key encoded in Base64.
|
|
115
|
+
*/
|
|
116
|
+
privateKey: string;
|
|
117
|
+
/**
|
|
118
|
+
* DKIM selector in the domain DNS records.
|
|
119
|
+
*/
|
|
120
|
+
selector: string;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* The sender of the email. Can be a string or an object with email and name properties.
|
|
124
|
+
* @example
|
|
125
|
+
* { email: 'email@example.com', name: 'Example' }
|
|
126
|
+
* @example
|
|
127
|
+
* 'email@example.com'
|
|
128
|
+
* @example
|
|
129
|
+
* 'Name <email@example.com>'
|
|
130
|
+
*/
|
|
131
|
+
from: EmailsSendRecipient | string;
|
|
132
|
+
/**
|
|
133
|
+
* The recipient of the email. Can be an array of email addresses or an array of objects with `email` and `name` properties or a single email address string or an object with `email` and `name` properties.
|
|
134
|
+
* @example
|
|
135
|
+
* [
|
|
136
|
+
* { email: 'email1@example.com', name: 'Example1' },
|
|
137
|
+
* { email: 'email2@example.com', name: 'Example2' },
|
|
138
|
+
* ]
|
|
139
|
+
* @example
|
|
140
|
+
* { email: 'email@example.com', name: 'Example' }
|
|
141
|
+
* @example
|
|
142
|
+
* ['email1@example.com', 'email2@example.com']
|
|
143
|
+
* @example
|
|
144
|
+
* 'email@example.com'
|
|
145
|
+
* @example
|
|
146
|
+
* 'Name <email@example.com>'
|
|
147
|
+
*/
|
|
148
|
+
to: EmailsSendRecipient[] | EmailsSendRecipient | string[] | string;
|
|
149
|
+
/**
|
|
150
|
+
* Adjust open and click tracking for the message. Please note that enabling tracking for your messages requires a subscription that supports open and click tracking.
|
|
151
|
+
*/
|
|
152
|
+
tracking?: EmailsSendTracking;
|
|
153
|
+
/**
|
|
154
|
+
* A single `replyTo` recipient object, or a single email address.
|
|
155
|
+
* @example
|
|
156
|
+
* { email: 'email@example.com', name: 'Example' }
|
|
157
|
+
* @example
|
|
158
|
+
* 'email@example.com'
|
|
159
|
+
* @example
|
|
160
|
+
* 'Name <email@example.com>'
|
|
161
|
+
*/
|
|
162
|
+
replyTo?: EmailsSendRecipient | string;
|
|
163
|
+
/**
|
|
164
|
+
* The subject of the email.
|
|
165
|
+
*/
|
|
166
|
+
subject: string;
|
|
167
|
+
/**
|
|
168
|
+
* Data to be used if the email is a mustache template, key-value pairs of variables to set for template rendering. Keys must be strings.
|
|
169
|
+
*
|
|
170
|
+
* the values can be one of the following types:
|
|
171
|
+
* - string
|
|
172
|
+
* - number
|
|
173
|
+
* - boolean
|
|
174
|
+
* - list, whose values are all of permitted types
|
|
175
|
+
* - map, whose keys must be strings, and whose values are all of permitted types
|
|
176
|
+
*/
|
|
177
|
+
mustaches?: Record<string, unknown>;
|
|
178
|
+
/**
|
|
179
|
+
* Mark these messages as transactional or non-transactional. In order for a message to be marked as non-transactional, it must have exactly one recipient per personalization, and it must be DKIM signed. 400 Bad Request will be returned if there are more than one recipient in any personalization for non-transactional messages. If a message is marked as non-transactional, it changes the sending process as follows:
|
|
180
|
+
*
|
|
181
|
+
* List-Unsubscribe headers will be added.
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
184
|
+
transactional?: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
type EmailsSendOptions = EmailsSendOptionsBase & (
|
|
188
|
+
| {
|
|
189
|
+
/**
|
|
190
|
+
* The HTML content of the email
|
|
191
|
+
* @example
|
|
192
|
+
* '<p>Hello World</p>'
|
|
193
|
+
*/
|
|
194
|
+
html: string;
|
|
195
|
+
/**
|
|
196
|
+
* The plain text content of the email (optional when html is provided)
|
|
197
|
+
* @example
|
|
198
|
+
* 'Hello World'
|
|
199
|
+
*/
|
|
200
|
+
text?: string;
|
|
201
|
+
}
|
|
202
|
+
| {
|
|
203
|
+
/**
|
|
204
|
+
* The HTML content of the email (optional when text is provided)
|
|
205
|
+
* @example
|
|
206
|
+
* '<p>Hello World</p>'
|
|
207
|
+
*/
|
|
208
|
+
html?: string;
|
|
209
|
+
/**
|
|
210
|
+
* The plain text content of the email
|
|
211
|
+
* @example
|
|
212
|
+
* 'Hello World'
|
|
213
|
+
*/
|
|
214
|
+
text: string;
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
interface EmailsSendResponse {
|
|
219
|
+
/**
|
|
220
|
+
* Indicates if the email was successfully sent
|
|
221
|
+
*/
|
|
222
|
+
success: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Fully rendered message if `dryRun` was set to `true`
|
|
225
|
+
*/
|
|
226
|
+
data?: string[];
|
|
227
|
+
error: string | null;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface EmailsCheckDomainDkim {
|
|
231
|
+
/**
|
|
232
|
+
* Domain used for DKIM signing.
|
|
233
|
+
*/
|
|
234
|
+
domain: string;
|
|
235
|
+
/**
|
|
236
|
+
* DKIM private key encoded in Base64.
|
|
237
|
+
*/
|
|
238
|
+
privateKey: string;
|
|
239
|
+
/**
|
|
240
|
+
* DKIM selector in the domain DNS records.
|
|
241
|
+
*/
|
|
242
|
+
selector: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
interface EmailsCheckDomainOptions {
|
|
246
|
+
/**
|
|
247
|
+
* Up to 10 DKIM checks are allowed.
|
|
248
|
+
*/
|
|
249
|
+
dkim: EmailsCheckDomainDkim[] | EmailsCheckDomainDkim;
|
|
250
|
+
/**
|
|
251
|
+
* Domain used for sending emails.
|
|
252
|
+
*/
|
|
253
|
+
domain: string;
|
|
254
|
+
/**
|
|
255
|
+
* `X-MailChannels-Sender-Id` header value in emails via MailChannels.
|
|
256
|
+
*/
|
|
257
|
+
senderId: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
type EmailsCheckDomainVerdict = "passed" | "failed" | "soft failed" | "temporary error" | "permanent error" | "neutral" | "none" | "unknown";
|
|
261
|
+
|
|
262
|
+
interface EmailsCheckDomainResponse {
|
|
263
|
+
/**
|
|
264
|
+
* The results of the domain checks.
|
|
265
|
+
*/
|
|
266
|
+
results: {
|
|
267
|
+
dkim: {
|
|
268
|
+
domain: string;
|
|
269
|
+
selector: string;
|
|
270
|
+
/**
|
|
271
|
+
* A human-readable explanation of DKIM check.
|
|
272
|
+
*/
|
|
273
|
+
reason?: string;
|
|
274
|
+
verdict: Extract<EmailsCheckDomainVerdict, "passed" | "failed">;
|
|
275
|
+
}[];
|
|
276
|
+
domainLockdown: {
|
|
277
|
+
/**
|
|
278
|
+
* A human-readable explanation of Domain Lockdown check.
|
|
279
|
+
*/
|
|
280
|
+
reason?: string;
|
|
281
|
+
verdict: Extract<EmailsCheckDomainVerdict, "passed" | "failed">;
|
|
282
|
+
};
|
|
283
|
+
spf: {
|
|
284
|
+
/**
|
|
285
|
+
* A human-readable explanation of SPF check.
|
|
286
|
+
*/
|
|
287
|
+
reason?: string;
|
|
288
|
+
verdict: EmailsCheckDomainVerdict;
|
|
289
|
+
};
|
|
290
|
+
references?: string[];
|
|
291
|
+
} | null;
|
|
292
|
+
/**
|
|
293
|
+
* Link to SPF, Domain Lockdown or DKIM references, displayed if any verdict is not passed.
|
|
294
|
+
*/
|
|
295
|
+
error: string | null;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface EmailsCreateDkimKeyOptions {
|
|
299
|
+
/**
|
|
300
|
+
* Algorithm used for the new key pair Currently, only RSA is supported.
|
|
301
|
+
* @default "rsa"
|
|
302
|
+
*/
|
|
303
|
+
algorithm?: "rsa";
|
|
304
|
+
/**
|
|
305
|
+
* Key length in bits. For RSA, must be a multiple of 1024. Common values: 1024 or 2048.
|
|
306
|
+
* @default 2048
|
|
307
|
+
*/
|
|
308
|
+
length?: 1024 | 2048 | 3072 | 4096;
|
|
309
|
+
/**
|
|
310
|
+
* Selector for the new key pair. Must be a maximum of 63 characters.
|
|
311
|
+
*/
|
|
312
|
+
selector: string;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
interface EmailsDkimKey {
|
|
316
|
+
/**
|
|
317
|
+
* Algorithm used for the key pair.
|
|
318
|
+
*/
|
|
319
|
+
algorithm: string;
|
|
320
|
+
/**
|
|
321
|
+
* Timestamp when the key pair was created.
|
|
322
|
+
*/
|
|
323
|
+
createdAt: string;
|
|
324
|
+
/**
|
|
325
|
+
* Suggested DNS records for the DKIM key.
|
|
326
|
+
*/
|
|
327
|
+
dnsRecords: {
|
|
328
|
+
name: string;
|
|
329
|
+
type: string;
|
|
330
|
+
value: string;
|
|
331
|
+
}[];
|
|
332
|
+
/**
|
|
333
|
+
* Domain associated with the key pair.
|
|
334
|
+
*/
|
|
335
|
+
domain: string;
|
|
336
|
+
/**
|
|
337
|
+
* Key length in bits.
|
|
338
|
+
*/
|
|
339
|
+
length: 1024 | 2048 | 3072 | 4096;
|
|
340
|
+
publicKey: string;
|
|
341
|
+
/**
|
|
342
|
+
* Selector assigned to the key pair.
|
|
343
|
+
*/
|
|
344
|
+
selector: string;
|
|
345
|
+
/**
|
|
346
|
+
* Status of the key.
|
|
347
|
+
*/
|
|
348
|
+
status: "active" | "revoked" | "retired";
|
|
349
|
+
/**
|
|
350
|
+
* Timestamp when the key was last modified.
|
|
351
|
+
*/
|
|
352
|
+
statusModifiedAt: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
interface EmailsCreateDkimKeyResponse {
|
|
356
|
+
/**
|
|
357
|
+
* The created DKIM key information.
|
|
358
|
+
*/
|
|
359
|
+
key: EmailsDkimKey | null;
|
|
360
|
+
error: string | null;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
interface EmailsGetDkimKeysOptions {
|
|
364
|
+
/**
|
|
365
|
+
* Selector to filter keys by. Must be a maximum of 63 characters.
|
|
366
|
+
*/
|
|
367
|
+
selector?: string;
|
|
368
|
+
/**
|
|
369
|
+
* Status to filter keys by.
|
|
370
|
+
*/
|
|
371
|
+
status?: EmailsDkimKey["status"];
|
|
372
|
+
/**
|
|
373
|
+
* Number of keys to skip before returning results.
|
|
374
|
+
* @default 0
|
|
375
|
+
*/
|
|
376
|
+
offset?: number;
|
|
377
|
+
/**
|
|
378
|
+
* Maximum number of keys to return. Maximum is `100` and minimum is `1`.
|
|
379
|
+
* @default 10
|
|
380
|
+
*/
|
|
381
|
+
limit?: number;
|
|
382
|
+
/**
|
|
383
|
+
* If `true`, includes the suggested DKIM DNS record for each returned key.
|
|
384
|
+
* @default false
|
|
385
|
+
*/
|
|
386
|
+
includeDnsRecord?: boolean;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
type Optional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
390
|
+
|
|
391
|
+
interface EmailsGetDkimKeysResponse {
|
|
392
|
+
/**
|
|
393
|
+
* List of keys matching the filter. Empty if no keys match the filter.
|
|
394
|
+
*/
|
|
395
|
+
keys: Optional<EmailsDkimKey, "dnsRecords">[];
|
|
396
|
+
error: string | null;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface EmailsUpdateDkimKeyOptions {
|
|
400
|
+
/**
|
|
401
|
+
* Selector of the DKIM key pair to update. Must be a maximum of 63 characters.
|
|
402
|
+
*/
|
|
403
|
+
selector: string;
|
|
404
|
+
/**
|
|
405
|
+
* New status of the DKIM key pair
|
|
406
|
+
* - `revoked`: Indicates that the key is compromised and should not be used.
|
|
407
|
+
* - `retired`: Indicates that the key has been rotated and is no longer in use.
|
|
408
|
+
*/
|
|
409
|
+
status: Exclude<EmailsDkimKey["status"], "active">;
|
|
287
410
|
}
|
|
288
411
|
|
|
289
412
|
declare class Emails {
|
|
@@ -323,58 +446,89 @@ declare class Emails {
|
|
|
323
446
|
* ```
|
|
324
447
|
*/
|
|
325
448
|
checkDomain(options: EmailsCheckDomainOptions): Promise<EmailsCheckDomainResponse>;
|
|
449
|
+
/**
|
|
450
|
+
* Create a DKIM key pair for a specified domain and selector using the specified algorithm and key length, for the current customer.
|
|
451
|
+
* @param domain - The domain to create the DKIM key for.
|
|
452
|
+
* @param options - DKIM key creation options.
|
|
453
|
+
* @example
|
|
454
|
+
* ```ts
|
|
455
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
456
|
+
* const { key, error } = await mailchannels.emails.createDkimKey('example.com', {
|
|
457
|
+
* selector: 'mailchannels'
|
|
458
|
+
* })
|
|
459
|
+
* ```
|
|
460
|
+
*/
|
|
461
|
+
createDkimKey(domain: string, options: EmailsCreateDkimKeyOptions): Promise<EmailsCreateDkimKeyResponse>;
|
|
462
|
+
/**
|
|
463
|
+
* Search for DKIM keys by customer handle and domain, with optional filters. If selector is provided, at most one key will be returned.
|
|
464
|
+
* @param domain - The domain to search DKIM keys for.
|
|
465
|
+
* @param options - The options to filter DKIM keys by.
|
|
466
|
+
* @example
|
|
467
|
+
* ```ts
|
|
468
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
469
|
+
* const { keys } = await mailchannels.getDkimKeys('example.com', {
|
|
470
|
+
* includeDnsRecord: true
|
|
471
|
+
* })
|
|
472
|
+
* ```
|
|
473
|
+
*/
|
|
474
|
+
getDkimKeys(domain: string, options?: EmailsGetDkimKeysOptions): Promise<EmailsGetDkimKeysResponse>;
|
|
475
|
+
/**
|
|
476
|
+
* Update fields of an existing DKIM key pair for the specified domain and selector, for the current customer. Currently, only the `status` field can be updated.
|
|
477
|
+
* @param domain - The domain the DKIM key belongs to.
|
|
478
|
+
* @param options - The options to update the DKIM key.
|
|
479
|
+
* @example
|
|
480
|
+
* ```ts
|
|
481
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
482
|
+
* const { success } = await mailchannels.emails.updateDkimKey('example.com', {
|
|
483
|
+
* selector: 'mailchannels',
|
|
484
|
+
* status: 'retired'
|
|
485
|
+
* })
|
|
486
|
+
*/
|
|
487
|
+
updateDkimKey(domain: string, options: EmailsUpdateDkimKeyOptions): Promise<SuccessResponse>;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface WebhooksListResponse {
|
|
491
|
+
webhooks: string[];
|
|
492
|
+
error: string | null;
|
|
326
493
|
}
|
|
327
494
|
|
|
328
|
-
interface
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
*/
|
|
366
|
-
response: {
|
|
367
|
-
/**
|
|
368
|
-
* Response body from webhook. Returns an error if unprocessable or too large.
|
|
369
|
-
*/
|
|
370
|
-
body?: string;
|
|
371
|
-
/**
|
|
372
|
-
* HTTP status code returned by the webhook
|
|
373
|
-
*/
|
|
374
|
-
status: number;
|
|
375
|
-
} | null;
|
|
376
|
-
}[];
|
|
377
|
-
error: string | null;
|
|
495
|
+
interface WebhooksSigningKeyResponse {
|
|
496
|
+
key: string | null;
|
|
497
|
+
error: string | null;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
interface WebhooksValidateResponse {
|
|
501
|
+
/**
|
|
502
|
+
* Indicates whether all webhook validations passed
|
|
503
|
+
*/
|
|
504
|
+
allPassed: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Detailed results for each tested webhook, including whether it returned a 2xx status code, along with its response status code and body.
|
|
507
|
+
*/
|
|
508
|
+
results: {
|
|
509
|
+
/**
|
|
510
|
+
* Indicates whether the webhook responded with a 2xx HTTP status code
|
|
511
|
+
*/
|
|
512
|
+
result: "passed" | "failed";
|
|
513
|
+
/**
|
|
514
|
+
* The webhook that was validated
|
|
515
|
+
*/
|
|
516
|
+
webhook: string;
|
|
517
|
+
/**
|
|
518
|
+
* The HTTP response returned by the webhook, including status code and response body. A null value indicates no response was received. Possible reasons include timeouts, connection failures, or other network-related issues.
|
|
519
|
+
*/
|
|
520
|
+
response: {
|
|
521
|
+
/**
|
|
522
|
+
* Response body from webhook. Returns an error if unprocessable or too large.
|
|
523
|
+
*/
|
|
524
|
+
body?: string;
|
|
525
|
+
/**
|
|
526
|
+
* HTTP status code returned by the webhook
|
|
527
|
+
*/
|
|
528
|
+
status: number;
|
|
529
|
+
} | null;
|
|
530
|
+
}[];
|
|
531
|
+
error: string | null;
|
|
378
532
|
}
|
|
379
533
|
|
|
380
534
|
declare class Webhooks {
|
|
@@ -430,119 +584,119 @@ declare class Webhooks {
|
|
|
430
584
|
validate(requestId?: string): Promise<WebhooksValidateResponse>;
|
|
431
585
|
}
|
|
432
586
|
|
|
433
|
-
interface SubAccountsAccount {
|
|
434
|
-
/**
|
|
435
|
-
* The name of the company associated with the sub-account.
|
|
436
|
-
*/
|
|
437
|
-
companyName: string;
|
|
438
|
-
/**
|
|
439
|
-
* If the sub-account is enabled.
|
|
440
|
-
*/
|
|
441
|
-
enabled: boolean;
|
|
442
|
-
/**
|
|
443
|
-
* The handle for the sub-account.
|
|
444
|
-
*/
|
|
445
|
-
handle: string;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
interface SubAccountsCreateResponse {
|
|
449
|
-
account: SubAccountsAccount | null;
|
|
450
|
-
error: string | null;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
interface SubAccountsListOptions {
|
|
454
|
-
/**
|
|
455
|
-
* Possible values are `1` to `1000`.
|
|
456
|
-
* @default 1000
|
|
457
|
-
*/
|
|
458
|
-
limit?: number;
|
|
459
|
-
/**
|
|
460
|
-
* The offset for pagination.
|
|
461
|
-
* @default 0
|
|
462
|
-
*/
|
|
463
|
-
offset?: number;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
interface SubAccountsListResponse {
|
|
467
|
-
accounts: SubAccountsAccount[];
|
|
468
|
-
error: string | null;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
interface SubAccountsApiKey {
|
|
472
|
-
/**
|
|
473
|
-
* The API key ID for the sub-account.
|
|
474
|
-
*/
|
|
475
|
-
id: number;
|
|
476
|
-
/**
|
|
477
|
-
* API key for the sub-account.
|
|
478
|
-
*/
|
|
479
|
-
value: string;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
interface SubAccountsCreateApiKeyResponse {
|
|
483
|
-
key: SubAccountsApiKey | null;
|
|
484
|
-
error: string | null;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
interface SubAccountsListApiKeyResponse {
|
|
488
|
-
keys: SubAccountsApiKey[];
|
|
489
|
-
error: string | null;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
interface SubAccountsSmtpPassword {
|
|
493
|
-
/**
|
|
494
|
-
* Whether the SMTP password is enabled.
|
|
495
|
-
*/
|
|
496
|
-
enabled: boolean;
|
|
497
|
-
/**
|
|
498
|
-
* The SMTP password ID for the sub-account.
|
|
499
|
-
*/
|
|
500
|
-
id: number;
|
|
501
|
-
/**
|
|
502
|
-
* SMTP password for the sub-account.
|
|
503
|
-
*/
|
|
504
|
-
value: string;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
interface SubAccountsCreateSmtpPasswordResponse {
|
|
508
|
-
password: SubAccountsSmtpPassword | null;
|
|
509
|
-
error: string | null;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
interface SubAccountsListSmtpPasswordResponse {
|
|
513
|
-
passwords: SubAccountsSmtpPassword[];
|
|
514
|
-
error: string | null;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
interface SubAccountsLimit {
|
|
518
|
-
sends: number;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
interface SubAccountsLimitResponse {
|
|
522
|
-
limit: SubAccountsLimit | null;
|
|
523
|
-
error: string | null;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
interface SubAccountsUsage {
|
|
527
|
-
/**
|
|
528
|
-
* The end date of the current billing period (ISO 8601 format).
|
|
529
|
-
* @example "2025-04-11"
|
|
530
|
-
*/
|
|
531
|
-
endDate?: string;
|
|
532
|
-
/**
|
|
533
|
-
* The start date of the current billing period (ISO 8601 format).
|
|
534
|
-
* @example "2025-03-12"
|
|
535
|
-
*/
|
|
536
|
-
startDate?: string;
|
|
537
|
-
/**
|
|
538
|
-
* The total usage for the current billing period.
|
|
539
|
-
*/
|
|
540
|
-
total: number;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
interface SubAccountsUsageResponse {
|
|
544
|
-
usage: SubAccountsUsage | null;
|
|
545
|
-
error: string | null;
|
|
587
|
+
interface SubAccountsAccount {
|
|
588
|
+
/**
|
|
589
|
+
* The name of the company associated with the sub-account.
|
|
590
|
+
*/
|
|
591
|
+
companyName: string;
|
|
592
|
+
/**
|
|
593
|
+
* If the sub-account is enabled.
|
|
594
|
+
*/
|
|
595
|
+
enabled: boolean;
|
|
596
|
+
/**
|
|
597
|
+
* The handle for the sub-account.
|
|
598
|
+
*/
|
|
599
|
+
handle: string;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
interface SubAccountsCreateResponse {
|
|
603
|
+
account: SubAccountsAccount | null;
|
|
604
|
+
error: string | null;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
interface SubAccountsListOptions {
|
|
608
|
+
/**
|
|
609
|
+
* Possible values are `1` to `1000`.
|
|
610
|
+
* @default 1000
|
|
611
|
+
*/
|
|
612
|
+
limit?: number;
|
|
613
|
+
/**
|
|
614
|
+
* The offset for pagination.
|
|
615
|
+
* @default 0
|
|
616
|
+
*/
|
|
617
|
+
offset?: number;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
interface SubAccountsListResponse {
|
|
621
|
+
accounts: SubAccountsAccount[];
|
|
622
|
+
error: string | null;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
interface SubAccountsApiKey {
|
|
626
|
+
/**
|
|
627
|
+
* The API key ID for the sub-account.
|
|
628
|
+
*/
|
|
629
|
+
id: number;
|
|
630
|
+
/**
|
|
631
|
+
* API key for the sub-account.
|
|
632
|
+
*/
|
|
633
|
+
value: string;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
interface SubAccountsCreateApiKeyResponse {
|
|
637
|
+
key: SubAccountsApiKey | null;
|
|
638
|
+
error: string | null;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
interface SubAccountsListApiKeyResponse {
|
|
642
|
+
keys: SubAccountsApiKey[];
|
|
643
|
+
error: string | null;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
interface SubAccountsSmtpPassword {
|
|
647
|
+
/**
|
|
648
|
+
* Whether the SMTP password is enabled.
|
|
649
|
+
*/
|
|
650
|
+
enabled: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* The SMTP password ID for the sub-account.
|
|
653
|
+
*/
|
|
654
|
+
id: number;
|
|
655
|
+
/**
|
|
656
|
+
* SMTP password for the sub-account.
|
|
657
|
+
*/
|
|
658
|
+
value: string;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
interface SubAccountsCreateSmtpPasswordResponse {
|
|
662
|
+
password: SubAccountsSmtpPassword | null;
|
|
663
|
+
error: string | null;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
interface SubAccountsListSmtpPasswordResponse {
|
|
667
|
+
passwords: SubAccountsSmtpPassword[];
|
|
668
|
+
error: string | null;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
interface SubAccountsLimit {
|
|
672
|
+
sends: number;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
interface SubAccountsLimitResponse {
|
|
676
|
+
limit: SubAccountsLimit | null;
|
|
677
|
+
error: string | null;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
interface SubAccountsUsage {
|
|
681
|
+
/**
|
|
682
|
+
* The end date of the current billing period (ISO 8601 format).
|
|
683
|
+
* @example "2025-04-11"
|
|
684
|
+
*/
|
|
685
|
+
endDate?: string;
|
|
686
|
+
/**
|
|
687
|
+
* The start date of the current billing period (ISO 8601 format).
|
|
688
|
+
* @example "2025-03-12"
|
|
689
|
+
*/
|
|
690
|
+
startDate?: string;
|
|
691
|
+
/**
|
|
692
|
+
* The total usage for the current billing period.
|
|
693
|
+
*/
|
|
694
|
+
total: number;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
interface SubAccountsUsageResponse {
|
|
698
|
+
usage: SubAccountsUsage | null;
|
|
699
|
+
error: string | null;
|
|
546
700
|
}
|
|
547
701
|
|
|
548
702
|
declare class SubAccounts {
|
|
@@ -705,171 +859,171 @@ declare class SubAccounts {
|
|
|
705
859
|
getUsage(handle: string): Promise<SubAccountsUsageResponse>;
|
|
706
860
|
}
|
|
707
861
|
|
|
708
|
-
interface MetricsEngagement {
|
|
709
|
-
buckets: {
|
|
710
|
-
click: MetricsBucket[];
|
|
711
|
-
clickTrackingDelivered: MetricsBucket[];
|
|
712
|
-
open: MetricsBucket[];
|
|
713
|
-
openTrackingDelivered: MetricsBucket[];
|
|
714
|
-
};
|
|
715
|
-
click: number;
|
|
716
|
-
clickTrackingDelivered: number;
|
|
717
|
-
endTime: string;
|
|
718
|
-
open: number;
|
|
719
|
-
openTrackingDelivered: number;
|
|
720
|
-
startTime: string;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
interface MetricsEngagementResponse {
|
|
724
|
-
engagement: MetricsEngagement | null;
|
|
725
|
-
error: string | null;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
interface MetricsPerformance {
|
|
729
|
-
/**
|
|
730
|
-
* Count of messages bounced during the specified time range.
|
|
731
|
-
*/
|
|
732
|
-
bounced: number;
|
|
733
|
-
buckets: {
|
|
734
|
-
bounced: MetricsBucket[];
|
|
735
|
-
delivered: MetricsBucket[];
|
|
736
|
-
processed: MetricsBucket[];
|
|
737
|
-
};
|
|
738
|
-
/**
|
|
739
|
-
* Count of messages delivered during the specified time range.
|
|
740
|
-
*/
|
|
741
|
-
delivered: number;
|
|
742
|
-
/**
|
|
743
|
-
* The end of the time range for retrieving message performance metrics (exclusive).
|
|
744
|
-
*/
|
|
745
|
-
endTime: string;
|
|
746
|
-
/**
|
|
747
|
-
* Count of messages processed during the specified time range.
|
|
748
|
-
*/
|
|
749
|
-
processed: number;
|
|
750
|
-
/**
|
|
751
|
-
* The beginning of the time range for retrieving message performance metrics (inclusive).
|
|
752
|
-
*/
|
|
753
|
-
startTime: string;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
interface MetricsPerformanceResponse {
|
|
757
|
-
performance: MetricsPerformance | null;
|
|
758
|
-
error: string | null;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
interface MetricsRecipientBehaviour {
|
|
762
|
-
buckets: {
|
|
763
|
-
unsubscribeDelivered: MetricsBucket[];
|
|
764
|
-
unsubscribed: MetricsBucket[];
|
|
765
|
-
};
|
|
766
|
-
/**
|
|
767
|
-
* The end of the time range for retrieving recipient behaviour metrics (exclusive).
|
|
768
|
-
*/
|
|
769
|
-
endTime: string;
|
|
770
|
-
/**
|
|
771
|
-
* The beginning of the time range for retrieving recipient behaviour metrics (inclusive).
|
|
772
|
-
*/
|
|
773
|
-
startTime: string;
|
|
774
|
-
/**
|
|
775
|
-
* Count of recipients of delivered messages that include at least one of the unsubscribe link or unsubscribe headers. Since the unsubscribe feature requires exactly one recipient per message, this count also represents the total number of delivered messages.
|
|
776
|
-
*/
|
|
777
|
-
unsubscribeDelivered: number;
|
|
778
|
-
/**
|
|
779
|
-
* Count of unsubscribed events by recipients.
|
|
780
|
-
*/
|
|
781
|
-
unsubscribed: number;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
interface MetricsRecipientBehaviourResponse {
|
|
785
|
-
behaviour: MetricsRecipientBehaviour | null;
|
|
786
|
-
error: string | null;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
interface MetricsVolume {
|
|
790
|
-
buckets: {
|
|
791
|
-
delivered: MetricsBucket[];
|
|
792
|
-
dropped: MetricsBucket[];
|
|
793
|
-
processed: MetricsBucket[];
|
|
794
|
-
};
|
|
795
|
-
/**
|
|
796
|
-
* Count of messages delivered during the specified time range.
|
|
797
|
-
*/
|
|
798
|
-
delivered: number;
|
|
799
|
-
/**
|
|
800
|
-
* Count of messages dropped during the specified time range.
|
|
801
|
-
*/
|
|
802
|
-
dropped: number;
|
|
803
|
-
/**
|
|
804
|
-
* The end of the time range for retrieving message volume metrics (exclusive).
|
|
805
|
-
*/
|
|
806
|
-
endTime: string;
|
|
807
|
-
/**
|
|
808
|
-
* Count of messages processed during the specified time range.
|
|
809
|
-
*/
|
|
810
|
-
processed: number;
|
|
811
|
-
/**
|
|
812
|
-
* The beginning of the time range for retrieving message volume metrics (inclusive).
|
|
813
|
-
*/
|
|
814
|
-
startTime: string;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
interface MetricsVolumeResponse {
|
|
818
|
-
volume: MetricsVolume | null;
|
|
819
|
-
error: string | null;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
interface MetricsUsageResponse {
|
|
823
|
-
usage: {
|
|
824
|
-
/**
|
|
825
|
-
* The end date of the current billing period (ISO 8601 format).
|
|
826
|
-
* @example "2025-04-11"
|
|
827
|
-
*/
|
|
828
|
-
endDate: string;
|
|
829
|
-
/**
|
|
830
|
-
* The start date of the current billing period (ISO 8601 format).
|
|
831
|
-
* @example "2025-03-12"
|
|
832
|
-
*/
|
|
833
|
-
startDate: string;
|
|
834
|
-
/**
|
|
835
|
-
* The total usage for the current billing period.
|
|
836
|
-
*/
|
|
837
|
-
total: number;
|
|
838
|
-
} | null;
|
|
839
|
-
error: string | null;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
interface MetricsBucket {
|
|
843
|
-
/**
|
|
844
|
-
* The number of events or occurrences aggregated within this time period.
|
|
845
|
-
*/
|
|
846
|
-
count: number;
|
|
847
|
-
/**
|
|
848
|
-
* The starting date and time of the time period this bucket represents.
|
|
849
|
-
*/
|
|
850
|
-
periodStart: string;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
interface MetricsOptions {
|
|
854
|
-
/**
|
|
855
|
-
* The beginning of the time range for retrieving message metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to one month ago if not provided.
|
|
856
|
-
* @example "2025-05-26"
|
|
857
|
-
*/
|
|
858
|
-
startTime?: string;
|
|
859
|
-
/**
|
|
860
|
-
* The end of the time range for retrieving message metrics (exclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to the current time if not provided.
|
|
861
|
-
* @example "2025-05-31T15:16:17Z"
|
|
862
|
-
*/
|
|
863
|
-
endTime?: string;
|
|
864
|
-
/**
|
|
865
|
-
* The ID of the campaign to filter metrics by. If not provided, metrics for all campaigns will be returned.
|
|
866
|
-
*/
|
|
867
|
-
campaignId?: string;
|
|
868
|
-
/**
|
|
869
|
-
* The interval for aggregating metrics data.
|
|
870
|
-
* @default "day"
|
|
871
|
-
*/
|
|
872
|
-
interval?: "hour" | "day" | "week" | "month";
|
|
862
|
+
interface MetricsEngagement {
|
|
863
|
+
buckets: {
|
|
864
|
+
click: MetricsBucket[];
|
|
865
|
+
clickTrackingDelivered: MetricsBucket[];
|
|
866
|
+
open: MetricsBucket[];
|
|
867
|
+
openTrackingDelivered: MetricsBucket[];
|
|
868
|
+
};
|
|
869
|
+
click: number;
|
|
870
|
+
clickTrackingDelivered: number;
|
|
871
|
+
endTime: string;
|
|
872
|
+
open: number;
|
|
873
|
+
openTrackingDelivered: number;
|
|
874
|
+
startTime: string;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
interface MetricsEngagementResponse {
|
|
878
|
+
engagement: MetricsEngagement | null;
|
|
879
|
+
error: string | null;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
interface MetricsPerformance {
|
|
883
|
+
/**
|
|
884
|
+
* Count of messages bounced during the specified time range.
|
|
885
|
+
*/
|
|
886
|
+
bounced: number;
|
|
887
|
+
buckets: {
|
|
888
|
+
bounced: MetricsBucket[];
|
|
889
|
+
delivered: MetricsBucket[];
|
|
890
|
+
processed: MetricsBucket[];
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* Count of messages delivered during the specified time range.
|
|
894
|
+
*/
|
|
895
|
+
delivered: number;
|
|
896
|
+
/**
|
|
897
|
+
* The end of the time range for retrieving message performance metrics (exclusive).
|
|
898
|
+
*/
|
|
899
|
+
endTime: string;
|
|
900
|
+
/**
|
|
901
|
+
* Count of messages processed during the specified time range.
|
|
902
|
+
*/
|
|
903
|
+
processed: number;
|
|
904
|
+
/**
|
|
905
|
+
* The beginning of the time range for retrieving message performance metrics (inclusive).
|
|
906
|
+
*/
|
|
907
|
+
startTime: string;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
interface MetricsPerformanceResponse {
|
|
911
|
+
performance: MetricsPerformance | null;
|
|
912
|
+
error: string | null;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
interface MetricsRecipientBehaviour {
|
|
916
|
+
buckets: {
|
|
917
|
+
unsubscribeDelivered: MetricsBucket[];
|
|
918
|
+
unsubscribed: MetricsBucket[];
|
|
919
|
+
};
|
|
920
|
+
/**
|
|
921
|
+
* The end of the time range for retrieving recipient behaviour metrics (exclusive).
|
|
922
|
+
*/
|
|
923
|
+
endTime: string;
|
|
924
|
+
/**
|
|
925
|
+
* The beginning of the time range for retrieving recipient behaviour metrics (inclusive).
|
|
926
|
+
*/
|
|
927
|
+
startTime: string;
|
|
928
|
+
/**
|
|
929
|
+
* Count of recipients of delivered messages that include at least one of the unsubscribe link or unsubscribe headers. Since the unsubscribe feature requires exactly one recipient per message, this count also represents the total number of delivered messages.
|
|
930
|
+
*/
|
|
931
|
+
unsubscribeDelivered: number;
|
|
932
|
+
/**
|
|
933
|
+
* Count of unsubscribed events by recipients.
|
|
934
|
+
*/
|
|
935
|
+
unsubscribed: number;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
interface MetricsRecipientBehaviourResponse {
|
|
939
|
+
behaviour: MetricsRecipientBehaviour | null;
|
|
940
|
+
error: string | null;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
interface MetricsVolume {
|
|
944
|
+
buckets: {
|
|
945
|
+
delivered: MetricsBucket[];
|
|
946
|
+
dropped: MetricsBucket[];
|
|
947
|
+
processed: MetricsBucket[];
|
|
948
|
+
};
|
|
949
|
+
/**
|
|
950
|
+
* Count of messages delivered during the specified time range.
|
|
951
|
+
*/
|
|
952
|
+
delivered: number;
|
|
953
|
+
/**
|
|
954
|
+
* Count of messages dropped during the specified time range.
|
|
955
|
+
*/
|
|
956
|
+
dropped: number;
|
|
957
|
+
/**
|
|
958
|
+
* The end of the time range for retrieving message volume metrics (exclusive).
|
|
959
|
+
*/
|
|
960
|
+
endTime: string;
|
|
961
|
+
/**
|
|
962
|
+
* Count of messages processed during the specified time range.
|
|
963
|
+
*/
|
|
964
|
+
processed: number;
|
|
965
|
+
/**
|
|
966
|
+
* The beginning of the time range for retrieving message volume metrics (inclusive).
|
|
967
|
+
*/
|
|
968
|
+
startTime: string;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
interface MetricsVolumeResponse {
|
|
972
|
+
volume: MetricsVolume | null;
|
|
973
|
+
error: string | null;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
interface MetricsUsageResponse {
|
|
977
|
+
usage: {
|
|
978
|
+
/**
|
|
979
|
+
* The end date of the current billing period (ISO 8601 format).
|
|
980
|
+
* @example "2025-04-11"
|
|
981
|
+
*/
|
|
982
|
+
endDate: string;
|
|
983
|
+
/**
|
|
984
|
+
* The start date of the current billing period (ISO 8601 format).
|
|
985
|
+
* @example "2025-03-12"
|
|
986
|
+
*/
|
|
987
|
+
startDate: string;
|
|
988
|
+
/**
|
|
989
|
+
* The total usage for the current billing period.
|
|
990
|
+
*/
|
|
991
|
+
total: number;
|
|
992
|
+
} | null;
|
|
993
|
+
error: string | null;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
interface MetricsBucket {
|
|
997
|
+
/**
|
|
998
|
+
* The number of events or occurrences aggregated within this time period.
|
|
999
|
+
*/
|
|
1000
|
+
count: number;
|
|
1001
|
+
/**
|
|
1002
|
+
* The starting date and time of the time period this bucket represents.
|
|
1003
|
+
*/
|
|
1004
|
+
periodStart: string;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
interface MetricsOptions {
|
|
1008
|
+
/**
|
|
1009
|
+
* The beginning of the time range for retrieving message metrics (inclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to one month ago if not provided.
|
|
1010
|
+
* @example "2025-05-26"
|
|
1011
|
+
*/
|
|
1012
|
+
startTime?: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* The end of the time range for retrieving message metrics (exclusive). Formats: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`. Defaults to the current time if not provided.
|
|
1015
|
+
* @example "2025-05-31T15:16:17Z"
|
|
1016
|
+
*/
|
|
1017
|
+
endTime?: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* The ID of the campaign to filter metrics by. If not provided, metrics for all campaigns will be returned.
|
|
1020
|
+
*/
|
|
1021
|
+
campaignId?: string;
|
|
1022
|
+
/**
|
|
1023
|
+
* The interval for aggregating metrics data.
|
|
1024
|
+
* @default "day"
|
|
1025
|
+
*/
|
|
1026
|
+
interval?: "hour" | "day" | "week" | "month";
|
|
873
1027
|
}
|
|
874
1028
|
|
|
875
1029
|
declare class Metrics {
|
|
@@ -926,366 +1080,80 @@ declare class Metrics {
|
|
|
926
1080
|
usage(): Promise<MetricsUsageResponse>;
|
|
927
1081
|
}
|
|
928
1082
|
|
|
929
|
-
type SuppressionsTypes = "transactional" | "non-transactional";
|
|
930
|
-
|
|
931
|
-
interface SuppressionsCreateOptions {
|
|
932
|
-
/**
|
|
933
|
-
* If true, the parent account creates suppression entries for all associated sub-accounts. This field is only applicable to parent accounts. Sub-accounts cannot create entries for other sub-accounts.
|
|
934
|
-
* @default false
|
|
935
|
-
*/
|
|
936
|
-
addToSubAccounts?: boolean;
|
|
937
|
-
/**
|
|
938
|
-
* The total number of suppression entries to create, for the parent and/or its sub-accounts, must not exceed `1000`.
|
|
939
|
-
*/
|
|
940
|
-
entries: {
|
|
941
|
-
/**
|
|
942
|
-
* Must be less than `1024` characters.
|
|
943
|
-
*/
|
|
944
|
-
notes?: string;
|
|
945
|
-
/**
|
|
946
|
-
* The email address to suppress. Must be a valid email address format and less than `255` characters.
|
|
947
|
-
*/
|
|
948
|
-
recipient: string;
|
|
949
|
-
/**
|
|
950
|
-
* An array of types of suppression to apply to the recipient.
|
|
951
|
-
* @default ["non-transactional"]
|
|
952
|
-
*/
|
|
953
|
-
types?: SuppressionsTypes[];
|
|
954
|
-
}[];
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";
|
|
958
|
-
|
|
959
|
-
interface SuppressionsListOptions {
|
|
960
|
-
/**
|
|
961
|
-
* The email address of the suppression entry to search for. If provided, the search will return the suppression entry associated with this recipient. If not provided, the search will return all suppression entries for the account.
|
|
962
|
-
*/
|
|
963
|
-
recipient?: string;
|
|
964
|
-
/**
|
|
965
|
-
* The source of the suppression entries to filter by. If not provided, suppression entries from all sources will be returned.
|
|
966
|
-
*/
|
|
967
|
-
source?: Exclude<SuppressionsSource, "all">;
|
|
968
|
-
/**
|
|
969
|
-
* The date and/or time before which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`
|
|
970
|
-
*/
|
|
971
|
-
createdBefore?: string;
|
|
972
|
-
/**
|
|
973
|
-
* The date and/or time after which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`
|
|
974
|
-
*/
|
|
975
|
-
createdAfter?: string;
|
|
976
|
-
/**
|
|
977
|
-
* The maximum number of suppression entries to return. Must be between `1` and `1000`.
|
|
978
|
-
* @default 1000
|
|
979
|
-
*/
|
|
980
|
-
limit?: number;
|
|
981
|
-
/**
|
|
982
|
-
* The number of suppression entries to skip before returning results.
|
|
983
|
-
* @default 0
|
|
984
|
-
*/
|
|
985
|
-
offset?: number;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
interface SuppressionsListEntry {
|
|
989
|
-
createdAt: string;
|
|
990
|
-
notes?: string;
|
|
991
|
-
/**
|
|
992
|
-
* The email address that is suppressed.
|
|
993
|
-
*/
|
|
994
|
-
recipient: string;
|
|
995
|
-
sender?: string;
|
|
996
|
-
source: SuppressionsSource;
|
|
997
|
-
types: SuppressionsTypes[];
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
interface SuppressionsListResponse {
|
|
1001
|
-
list: SuppressionsListEntry[];
|
|
1002
|
-
error: string | null;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
interface DomainsData {
|
|
1006
|
-
/**
|
|
1007
|
-
* The domain name.
|
|
1008
|
-
*/
|
|
1009
|
-
domain: string;
|
|
1010
|
-
/**
|
|
1011
|
-
* The abuse policy settings for the domain. These settings determine how spam messages are handled.
|
|
1012
|
-
*/
|
|
1013
|
-
settings?: Partial<{
|
|
1014
|
-
/**
|
|
1015
|
-
* The abuse policy.
|
|
1016
|
-
*/
|
|
1017
|
-
abusePolicy: "block" | "flag" | "quarantine";
|
|
1018
|
-
/**
|
|
1019
|
-
* If `true`, this abuse policy overrides the recipient abuse policy.
|
|
1020
|
-
*/
|
|
1021
|
-
abusePolicyOverride: boolean;
|
|
1022
|
-
/**
|
|
1023
|
-
* The spam header name to use if the abuse policy is set to `flag`.
|
|
1024
|
-
*/
|
|
1025
|
-
spamHeaderName: string;
|
|
1026
|
-
/**
|
|
1027
|
-
* The spam header value to use if the abuse policy is set to `flag`.
|
|
1028
|
-
*/
|
|
1029
|
-
spamHeaderValue: string;
|
|
1030
|
-
}>;
|
|
1031
|
-
/**
|
|
1032
|
-
* A list of email addresses that are the domain admins for the domain.
|
|
1033
|
-
*/
|
|
1034
|
-
admins?: string[] | null;
|
|
1035
|
-
/**
|
|
1036
|
-
* The locations of mail servers to which messages will be delivered after filtering.
|
|
1037
|
-
*/
|
|
1038
|
-
downstreamAddresses?: {
|
|
1039
|
-
/**
|
|
1040
|
-
* The priority of the downstream address. Only addresses with the highest priority (the lowest numerical value) are selected.
|
|
1041
|
-
*/
|
|
1042
|
-
priority: number;
|
|
1043
|
-
/**
|
|
1044
|
-
* Downstream addresses are selected in proportion to their weights. For example, if there are two downstream addresses, A with weight 40, and B with weight 10, then A is selected 80% of the time and B is selected 20% of the time.
|
|
1045
|
-
*/
|
|
1046
|
-
weight: number;
|
|
1047
|
-
/**
|
|
1048
|
-
* TCP port on which the downstream mail server is listening.
|
|
1049
|
-
*/
|
|
1050
|
-
port: number;
|
|
1051
|
-
/**
|
|
1052
|
-
* The canonical hostname of the host providing the service, ending in a dot.
|
|
1053
|
-
*/
|
|
1054
|
-
target: string;
|
|
1055
|
-
}[] | null;
|
|
1056
|
-
/**
|
|
1057
|
-
* A list of aliases for the domain. Mail is accepted for these domains and routed to the `downstreamAddresses` defined for the domain. Must be <= 255 characters
|
|
1058
|
-
*/
|
|
1059
|
-
aliases?: string[] | null;
|
|
1060
|
-
/**
|
|
1061
|
-
* The subscription `handle` that identifies the subscription that this domain should be provisioned against. Subscription handles can be retrieved from the `subscriptions` service method.
|
|
1062
|
-
*/
|
|
1063
|
-
subscriptionHandle: string;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
interface DomainsProvisionOptions {
|
|
1067
|
-
/**
|
|
1068
|
-
* If present and set to true, the domain will be associated with the api-key that created it. This means that this api-key must be used for inbound-api actions involving this domain (for example adding safe/block list entries, etc).
|
|
1069
|
-
*/
|
|
1070
|
-
associateKey?: boolean;
|
|
1071
|
-
/**
|
|
1072
|
-
* If present and set to true, the settings (domain settings, downstream addresses, aliases and admins) for the domain will be overwritten with the ones in the request if the domain already exists, unless a section is not included in the request or there is problem updating a setting in which case the previous settings are carried forward.
|
|
1073
|
-
*/
|
|
1074
|
-
overwrite?: boolean;
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
type DomainsBulkProvisionOptions = DomainsProvisionOptions & Pick<DomainsData, "subscriptionHandle">;
|
|
1078
|
-
|
|
1079
|
-
interface DomainsProvisionResponse {
|
|
1080
|
-
data: DomainsData | null;
|
|
1081
|
-
error: string | null;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
interface DomainsBulkProvisionResponse {
|
|
1085
|
-
/**
|
|
1086
|
-
* If the request was processed successfully, this does not necessarily mean all the domains in the request were successfully provisioned.
|
|
1087
|
-
*/
|
|
1088
|
-
results: {
|
|
1089
|
-
/**
|
|
1090
|
-
* Domains that were successfully provisioned or updated.
|
|
1091
|
-
*/
|
|
1092
|
-
successes: {
|
|
1093
|
-
domain: DomainsData;
|
|
1094
|
-
code: number;
|
|
1095
|
-
comment?: string;
|
|
1096
|
-
}[];
|
|
1097
|
-
/**
|
|
1098
|
-
* Domains that were not successfully provisioned.
|
|
1099
|
-
*/
|
|
1100
|
-
errors: {
|
|
1101
|
-
domain: DomainsData;
|
|
1102
|
-
code: number;
|
|
1103
|
-
comment?: string;
|
|
1104
|
-
}[];
|
|
1105
|
-
} | null;
|
|
1106
|
-
error: string | null;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
interface DomainsListOptions {
|
|
1110
|
-
/**
|
|
1111
|
-
* A list of domains to fetch. If this parameter is present, only domains whose name matches an item in this list are returned.
|
|
1112
|
-
*/
|
|
1113
|
-
domains?: string[];
|
|
1114
|
-
/**
|
|
1115
|
-
* The maximum number of domains included in the response. Possible values are 1 to 5000
|
|
1116
|
-
* @default 10
|
|
1117
|
-
*/
|
|
1118
|
-
limit?: number;
|
|
1119
|
-
/**
|
|
1120
|
-
* Offset into the list of domains to return.
|
|
1121
|
-
* @default 0
|
|
1122
|
-
*/
|
|
1123
|
-
offset?: number;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
interface DomainsListResponse {
|
|
1127
|
-
/**
|
|
1128
|
-
* A list of domains
|
|
1129
|
-
*/
|
|
1130
|
-
domains: DomainsData[];
|
|
1131
|
-
/**
|
|
1132
|
-
* The total number of domains that are accessible with the given API key that match the list of domains in the 'domains' parameter. If there is no 'domains' parameter, this field is the total number of domains that are accessible with with this API key. A domain is accessible with a given API key if it is associated with that API key, or if it is not associated with any API key.
|
|
1133
|
-
*/
|
|
1134
|
-
total: number;
|
|
1135
|
-
error: string | null;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
interface DomainsCreateLoginLinkResponse {
|
|
1139
|
-
/**
|
|
1140
|
-
* If a user browses to this URL, they will be automatically logged in as a domain admin.
|
|
1141
|
-
*/
|
|
1142
|
-
link: string | null;
|
|
1143
|
-
error: string | null;
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
interface DomainsListDownstreamAddressesOptions {
|
|
1147
|
-
/**
|
|
1148
|
-
* The number of records to return.
|
|
1149
|
-
* @default 10
|
|
1150
|
-
*/
|
|
1151
|
-
limit?: number;
|
|
1152
|
-
/**
|
|
1153
|
-
* The offset into the records to return.
|
|
1154
|
-
* @default 0
|
|
1155
|
-
*/
|
|
1156
|
-
offset?: number;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
interface DomainsDownstreamAddress {
|
|
1160
|
-
/**
|
|
1161
|
-
* TCP port on which the downstream mail server is listening.
|
|
1162
|
-
*/
|
|
1163
|
-
port: number;
|
|
1164
|
-
/**
|
|
1165
|
-
* The priority of the downstream address. Only addresses with the highest priority (the lowest numerical value) are selected.
|
|
1166
|
-
*/
|
|
1167
|
-
priority: number;
|
|
1168
|
-
/**
|
|
1169
|
-
* The canonical hostname of the host providing the service, ending in a dot.
|
|
1170
|
-
*/
|
|
1171
|
-
target: string;
|
|
1172
|
-
/**
|
|
1173
|
-
* Downstream addresses are selected in proportion to their weights. For example, if there are two downstream addresses, A with weight 40, and B with weight 10, then A is selected 80% of the time and B is selected 20% of the time.
|
|
1174
|
-
*/
|
|
1175
|
-
weight: number;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
interface DomainsListDownstreamAddressesResponse {
|
|
1179
|
-
records: DomainsDownstreamAddress[];
|
|
1180
|
-
error: string | null;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
type ListNames = "blocklist" | "safelist" | "blacklist" | "whitelist";
|
|
1184
|
-
|
|
1185
|
-
interface ListEntryOptions {
|
|
1186
|
-
/**
|
|
1187
|
-
* This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
|
|
1188
|
-
*/
|
|
1189
|
-
listName: ListNames;
|
|
1190
|
-
/**
|
|
1191
|
-
* This can be a domain, email address, or IP address. The type of the entry is automatically determined based on the value.
|
|
1192
|
-
*/
|
|
1193
|
-
item: string;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
interface ListEntry {
|
|
1197
|
-
action: Extract<ListNames, "blocklist" | "safelist">;
|
|
1198
|
-
item: string;
|
|
1199
|
-
type: "domain" | "email_address" | "ip_address";
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
interface ListEntryResponse {
|
|
1203
|
-
entry: ListEntry | null;
|
|
1204
|
-
error: string | null;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
interface ListEntriesResponse {
|
|
1208
|
-
entries: ListEntry[];
|
|
1209
|
-
error: string | null;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
interface UsersCreateOptions {
|
|
1213
|
-
/**
|
|
1214
|
-
* Flag to indicate if the user is a domain admin or a regular user
|
|
1215
|
-
* @default false
|
|
1216
|
-
*/
|
|
1217
|
-
admin?: boolean;
|
|
1218
|
-
/**
|
|
1219
|
-
* Whether or not to filter mail for this recipient. There are three valid values.
|
|
1220
|
-
* - `false` - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, return an error.
|
|
1221
|
-
* - `true` - Filtering policy will not be applied to messages intended for this recipient.
|
|
1222
|
-
* - `compute` - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, filtering policy will not be applied, and no error will be returned.
|
|
1223
|
-
* @default 'compute'
|
|
1224
|
-
*/
|
|
1225
|
-
filter?: boolean | "compute";
|
|
1226
|
-
/**
|
|
1227
|
-
* safelist and blocklist entries to be added
|
|
1228
|
-
*/
|
|
1229
|
-
listEntries?: {
|
|
1230
|
-
blocklist?: string[];
|
|
1231
|
-
safelist?: string[];
|
|
1232
|
-
};
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
interface UsersCreateResponse {
|
|
1236
|
-
user: {
|
|
1237
|
-
email: string;
|
|
1238
|
-
roles: string[];
|
|
1239
|
-
filter?: boolean;
|
|
1240
|
-
listEntries: {
|
|
1241
|
-
item: string;
|
|
1242
|
-
type: "domain" | "email_address" | "ip_address";
|
|
1243
|
-
action: "safelist" | "blocklist";
|
|
1244
|
-
}[];
|
|
1245
|
-
} | null;
|
|
1246
|
-
error: string | null;
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
interface ServiceSubscriptionsResponse {
|
|
1250
|
-
subscriptions: {
|
|
1251
|
-
active: boolean;
|
|
1252
|
-
activeAccountsCount: number;
|
|
1253
|
-
handle: string;
|
|
1254
|
-
limits: {
|
|
1255
|
-
featureHandle: string;
|
|
1256
|
-
value: string;
|
|
1257
|
-
}[];
|
|
1258
|
-
plan: {
|
|
1259
|
-
handle: string;
|
|
1260
|
-
name: string;
|
|
1261
|
-
};
|
|
1262
|
-
}[];
|
|
1263
|
-
error: string | null;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
interface ServiceReportOptions {
|
|
1267
|
-
/**
|
|
1268
|
-
* The report type. It can be either `false_negative` or `false_positive`.
|
|
1269
|
-
*/
|
|
1270
|
-
type: "false_negative" | "false_positive";
|
|
1271
|
-
/**
|
|
1272
|
-
* The full, unaltered message content in accordance with the RFC 2822 specifications without dot stuffing.
|
|
1273
|
-
*/
|
|
1274
|
-
messageContent: string;
|
|
1275
|
-
/**
|
|
1276
|
-
* The SMTP envelope information
|
|
1277
|
-
*/
|
|
1278
|
-
smtpEnvelopeInformation?: {
|
|
1279
|
-
ehlo: string;
|
|
1280
|
-
mailFrom: string;
|
|
1281
|
-
rcptTo: string;
|
|
1282
|
-
};
|
|
1283
|
-
/**
|
|
1284
|
-
* The sending host information.
|
|
1285
|
-
*/
|
|
1286
|
-
sendingHostInformation?: {
|
|
1287
|
-
name: string;
|
|
1288
|
-
};
|
|
1083
|
+
type SuppressionsTypes = "transactional" | "non-transactional";
|
|
1084
|
+
|
|
1085
|
+
interface SuppressionsCreateOptions {
|
|
1086
|
+
/**
|
|
1087
|
+
* If true, the parent account creates suppression entries for all associated sub-accounts. This field is only applicable to parent accounts. Sub-accounts cannot create entries for other sub-accounts.
|
|
1088
|
+
* @default false
|
|
1089
|
+
*/
|
|
1090
|
+
addToSubAccounts?: boolean;
|
|
1091
|
+
/**
|
|
1092
|
+
* The total number of suppression entries to create, for the parent and/or its sub-accounts, must not exceed `1000`.
|
|
1093
|
+
*/
|
|
1094
|
+
entries: {
|
|
1095
|
+
/**
|
|
1096
|
+
* Must be less than `1024` characters.
|
|
1097
|
+
*/
|
|
1098
|
+
notes?: string;
|
|
1099
|
+
/**
|
|
1100
|
+
* The email address to suppress. Must be a valid email address format and less than `255` characters.
|
|
1101
|
+
*/
|
|
1102
|
+
recipient: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* An array of types of suppression to apply to the recipient.
|
|
1105
|
+
* @default ["non-transactional"]
|
|
1106
|
+
*/
|
|
1107
|
+
types?: SuppressionsTypes[];
|
|
1108
|
+
}[];
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
type SuppressionsSource = "api" | "unsubscribe_link" | "list_unsubscribe" | "hard_bounce" | "spam_complaint" | "all";
|
|
1112
|
+
|
|
1113
|
+
interface SuppressionsListOptions {
|
|
1114
|
+
/**
|
|
1115
|
+
* The email address of the suppression entry to search for. If provided, the search will return the suppression entry associated with this recipient. If not provided, the search will return all suppression entries for the account.
|
|
1116
|
+
*/
|
|
1117
|
+
recipient?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The source of the suppression entries to filter by. If not provided, suppression entries from all sources will be returned.
|
|
1120
|
+
*/
|
|
1121
|
+
source?: Exclude<SuppressionsSource, "all">;
|
|
1122
|
+
/**
|
|
1123
|
+
* The date and/or time before which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`
|
|
1124
|
+
*/
|
|
1125
|
+
createdBefore?: string;
|
|
1126
|
+
/**
|
|
1127
|
+
* The date and/or time after which the suppression entries were created. Format: `YYYY-MM-DD` or `YYYY-MM-DDTHH:MM:SSZ`
|
|
1128
|
+
*/
|
|
1129
|
+
createdAfter?: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* The maximum number of suppression entries to return. Must be between `1` and `1000`.
|
|
1132
|
+
* @default 1000
|
|
1133
|
+
*/
|
|
1134
|
+
limit?: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* The number of suppression entries to skip before returning results.
|
|
1137
|
+
* @default 0
|
|
1138
|
+
*/
|
|
1139
|
+
offset?: number;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
interface SuppressionsListEntry {
|
|
1143
|
+
createdAt: string;
|
|
1144
|
+
notes?: string;
|
|
1145
|
+
/**
|
|
1146
|
+
* The email address that is suppressed.
|
|
1147
|
+
*/
|
|
1148
|
+
recipient: string;
|
|
1149
|
+
sender?: string;
|
|
1150
|
+
source: SuppressionsSource;
|
|
1151
|
+
types: SuppressionsTypes[];
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
interface SuppressionsListResponse {
|
|
1155
|
+
list: SuppressionsListEntry[];
|
|
1156
|
+
error: string | null;
|
|
1289
1157
|
}
|
|
1290
1158
|
|
|
1291
1159
|
declare class Suppressions {
|
|
@@ -1297,7 +1165,7 @@ declare class Suppressions {
|
|
|
1297
1165
|
* @example
|
|
1298
1166
|
* ```ts
|
|
1299
1167
|
* const mailchannels = new MailChannels('your-api-key')
|
|
1300
|
-
* const
|
|
1168
|
+
* const { success } = await mailchannels.suppressions.create({
|
|
1301
1169
|
* // ...
|
|
1302
1170
|
* });
|
|
1303
1171
|
*/
|
|
@@ -1309,7 +1177,7 @@ declare class Suppressions {
|
|
|
1309
1177
|
* @example
|
|
1310
1178
|
* ```ts
|
|
1311
1179
|
* const mailchannels = new MailChannels('your-api-key')
|
|
1312
|
-
* const
|
|
1180
|
+
* const { success } = await mailchannels.suppressions.delete('name@example.com', 'api');
|
|
1313
1181
|
* ```
|
|
1314
1182
|
*/
|
|
1315
1183
|
delete(recipient: string, source?: SuppressionsSource): Promise<SuccessResponse>;
|
|
@@ -1318,13 +1186,246 @@ declare class Suppressions {
|
|
|
1318
1186
|
* @example
|
|
1319
1187
|
* ```ts
|
|
1320
1188
|
* const mailchannels = new MailChannels('your-api-key')
|
|
1321
|
-
* const
|
|
1189
|
+
* const { list }= await mailchannels.suppressions.list();
|
|
1322
1190
|
* ```
|
|
1323
1191
|
* @param options - Options to filter and customize the suppression entries retrieval.
|
|
1324
1192
|
*/
|
|
1325
1193
|
list(options?: SuppressionsListOptions): Promise<SuppressionsListResponse>;
|
|
1326
1194
|
}
|
|
1327
1195
|
|
|
1196
|
+
type ListNames = "blocklist" | "safelist" | "blacklist" | "whitelist";
|
|
1197
|
+
|
|
1198
|
+
interface ListEntryOptions {
|
|
1199
|
+
/**
|
|
1200
|
+
* This can be a `blocklist`, `safelist`, `blacklist`, or `whitelist`.
|
|
1201
|
+
*/
|
|
1202
|
+
listName: ListNames;
|
|
1203
|
+
/**
|
|
1204
|
+
* This can be a domain, email address, or IP address. The type of the entry is automatically determined based on the value.
|
|
1205
|
+
*/
|
|
1206
|
+
item: string;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
interface ListEntry {
|
|
1210
|
+
action: Extract<ListNames, "blocklist" | "safelist">;
|
|
1211
|
+
item: string;
|
|
1212
|
+
type: "domain" | "email_address" | "ip_address";
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
interface ListEntryResponse {
|
|
1216
|
+
entry: ListEntry | null;
|
|
1217
|
+
error: string | null;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
interface ListEntriesResponse {
|
|
1221
|
+
entries: ListEntry[];
|
|
1222
|
+
error: string | null;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
interface DomainsData {
|
|
1226
|
+
/**
|
|
1227
|
+
* The domain name.
|
|
1228
|
+
*/
|
|
1229
|
+
domain: string;
|
|
1230
|
+
/**
|
|
1231
|
+
* The abuse policy settings for the domain. These settings determine how spam messages are handled.
|
|
1232
|
+
*/
|
|
1233
|
+
settings?: Partial<{
|
|
1234
|
+
/**
|
|
1235
|
+
* The abuse policy.
|
|
1236
|
+
*/
|
|
1237
|
+
abusePolicy: "block" | "flag" | "quarantine";
|
|
1238
|
+
/**
|
|
1239
|
+
* If `true`, this abuse policy overrides the recipient abuse policy.
|
|
1240
|
+
*/
|
|
1241
|
+
abusePolicyOverride: boolean;
|
|
1242
|
+
/**
|
|
1243
|
+
* The spam header name to use if the abuse policy is set to `flag`.
|
|
1244
|
+
*/
|
|
1245
|
+
spamHeaderName: string;
|
|
1246
|
+
/**
|
|
1247
|
+
* The spam header value to use if the abuse policy is set to `flag`.
|
|
1248
|
+
*/
|
|
1249
|
+
spamHeaderValue: string;
|
|
1250
|
+
}>;
|
|
1251
|
+
/**
|
|
1252
|
+
* A list of email addresses that are the domain admins for the domain.
|
|
1253
|
+
*/
|
|
1254
|
+
admins?: string[] | null;
|
|
1255
|
+
/**
|
|
1256
|
+
* The locations of mail servers to which messages will be delivered after filtering.
|
|
1257
|
+
*/
|
|
1258
|
+
downstreamAddresses?: {
|
|
1259
|
+
/**
|
|
1260
|
+
* The priority of the downstream address. Only addresses with the highest priority (the lowest numerical value) are selected.
|
|
1261
|
+
*/
|
|
1262
|
+
priority: number;
|
|
1263
|
+
/**
|
|
1264
|
+
* Downstream addresses are selected in proportion to their weights. For example, if there are two downstream addresses, A with weight 40, and B with weight 10, then A is selected 80% of the time and B is selected 20% of the time.
|
|
1265
|
+
*/
|
|
1266
|
+
weight: number;
|
|
1267
|
+
/**
|
|
1268
|
+
* TCP port on which the downstream mail server is listening.
|
|
1269
|
+
*/
|
|
1270
|
+
port: number;
|
|
1271
|
+
/**
|
|
1272
|
+
* The canonical hostname of the host providing the service, ending in a dot.
|
|
1273
|
+
*/
|
|
1274
|
+
target: string;
|
|
1275
|
+
}[] | null;
|
|
1276
|
+
/**
|
|
1277
|
+
* A list of aliases for the domain. Mail is accepted for these domains and routed to the `downstreamAddresses` defined for the domain. Must be <= 255 characters
|
|
1278
|
+
*/
|
|
1279
|
+
aliases?: string[] | null;
|
|
1280
|
+
/**
|
|
1281
|
+
* The subscription `handle` that identifies the subscription that this domain should be provisioned against. Subscription handles can be retrieved from the `subscriptions` service method.
|
|
1282
|
+
*/
|
|
1283
|
+
subscriptionHandle: string;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
interface DomainsProvisionOptions {
|
|
1287
|
+
/**
|
|
1288
|
+
* If present and set to true, the domain will be associated with the api-key that created it. This means that this api-key must be used for inbound-api actions involving this domain (for example adding safe/block list entries, etc).
|
|
1289
|
+
*/
|
|
1290
|
+
associateKey?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* If present and set to true, the settings (domain settings, downstream addresses, aliases and admins) for the domain will be overwritten with the ones in the request if the domain already exists, unless a section is not included in the request or there is problem updating a setting in which case the previous settings are carried forward.
|
|
1293
|
+
*/
|
|
1294
|
+
overwrite?: boolean;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
type DomainsBulkProvisionOptions = DomainsProvisionOptions & Pick<DomainsData, "subscriptionHandle">;
|
|
1298
|
+
|
|
1299
|
+
interface DomainsProvisionResponse {
|
|
1300
|
+
data: DomainsData | null;
|
|
1301
|
+
error: string | null;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
interface DomainsBulkProvisionResponse {
|
|
1305
|
+
/**
|
|
1306
|
+
* If the request was processed successfully, this does not necessarily mean all the domains in the request were successfully provisioned.
|
|
1307
|
+
*/
|
|
1308
|
+
results: {
|
|
1309
|
+
/**
|
|
1310
|
+
* Domains that were successfully provisioned or updated.
|
|
1311
|
+
*/
|
|
1312
|
+
successes: {
|
|
1313
|
+
domain: DomainsData;
|
|
1314
|
+
code: number;
|
|
1315
|
+
comment?: string;
|
|
1316
|
+
}[];
|
|
1317
|
+
/**
|
|
1318
|
+
* Domains that were not successfully provisioned.
|
|
1319
|
+
*/
|
|
1320
|
+
errors: {
|
|
1321
|
+
domain: DomainsData;
|
|
1322
|
+
code: number;
|
|
1323
|
+
comment?: string;
|
|
1324
|
+
}[];
|
|
1325
|
+
} | null;
|
|
1326
|
+
error: string | null;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
interface DomainsListOptions {
|
|
1330
|
+
/**
|
|
1331
|
+
* A list of domains to fetch. If this parameter is present, only domains whose name matches an item in this list are returned.
|
|
1332
|
+
*/
|
|
1333
|
+
domains?: string[];
|
|
1334
|
+
/**
|
|
1335
|
+
* The maximum number of domains included in the response. Possible values are 1 to 5000
|
|
1336
|
+
* @default 10
|
|
1337
|
+
*/
|
|
1338
|
+
limit?: number;
|
|
1339
|
+
/**
|
|
1340
|
+
* Offset into the list of domains to return.
|
|
1341
|
+
* @default 0
|
|
1342
|
+
*/
|
|
1343
|
+
offset?: number;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
interface DomainsListResponse {
|
|
1347
|
+
/**
|
|
1348
|
+
* A list of domains
|
|
1349
|
+
*/
|
|
1350
|
+
domains: DomainsData[];
|
|
1351
|
+
/**
|
|
1352
|
+
* The total number of domains that are accessible with the given API key that match the list of domains in the 'domains' parameter. If there is no 'domains' parameter, this field is the total number of domains that are accessible with with this API key. A domain is accessible with a given API key if it is associated with that API key, or if it is not associated with any API key.
|
|
1353
|
+
*/
|
|
1354
|
+
total: number;
|
|
1355
|
+
error: string | null;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
interface DomainsCreateLoginLinkResponse {
|
|
1359
|
+
/**
|
|
1360
|
+
* If a user browses to this URL, they will be automatically logged in as a domain admin.
|
|
1361
|
+
*/
|
|
1362
|
+
link: string | null;
|
|
1363
|
+
error: string | null;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
interface DomainsListDownstreamAddressesOptions {
|
|
1367
|
+
/**
|
|
1368
|
+
* The number of records to return.
|
|
1369
|
+
* @default 10
|
|
1370
|
+
*/
|
|
1371
|
+
limit?: number;
|
|
1372
|
+
/**
|
|
1373
|
+
* The offset into the records to return.
|
|
1374
|
+
* @default 0
|
|
1375
|
+
*/
|
|
1376
|
+
offset?: number;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
interface DomainsDownstreamAddress {
|
|
1380
|
+
/**
|
|
1381
|
+
* TCP port on which the downstream mail server is listening.
|
|
1382
|
+
*/
|
|
1383
|
+
port: number;
|
|
1384
|
+
/**
|
|
1385
|
+
* The priority of the downstream address. Only addresses with the highest priority (the lowest numerical value) are selected.
|
|
1386
|
+
*/
|
|
1387
|
+
priority: number;
|
|
1388
|
+
/**
|
|
1389
|
+
* The canonical hostname of the host providing the service, ending in a dot.
|
|
1390
|
+
*/
|
|
1391
|
+
target: string;
|
|
1392
|
+
/**
|
|
1393
|
+
* Downstream addresses are selected in proportion to their weights. For example, if there are two downstream addresses, A with weight 40, and B with weight 10, then A is selected 80% of the time and B is selected 20% of the time.
|
|
1394
|
+
*/
|
|
1395
|
+
weight: number;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
interface DomainsListDownstreamAddressesResponse {
|
|
1399
|
+
records: DomainsDownstreamAddress[];
|
|
1400
|
+
error: string | null;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
interface DomainsBulkCreateLoginLinkResult {
|
|
1404
|
+
/**
|
|
1405
|
+
* The domain the request was for.
|
|
1406
|
+
*/
|
|
1407
|
+
domain: string;
|
|
1408
|
+
code: 200 | 400 | 401 | 403 | 404 | 500;
|
|
1409
|
+
/**
|
|
1410
|
+
* More information about the result of creating the login link.
|
|
1411
|
+
*/
|
|
1412
|
+
comment?: string;
|
|
1413
|
+
/**
|
|
1414
|
+
* If a user browses to this URL, they will be automatically logged in as a domain admin.
|
|
1415
|
+
*/
|
|
1416
|
+
loginLink: string;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
interface DomainsBulkCreateLoginLinks {
|
|
1420
|
+
successes: DomainsBulkCreateLoginLinkResult[];
|
|
1421
|
+
errors: Omit<DomainsBulkCreateLoginLinkResult, "loginLink">[];
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
interface DomainsBulkCreateLoginLinksResponse {
|
|
1425
|
+
results: DomainsBulkCreateLoginLinks | null;
|
|
1426
|
+
error: string | null;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1328
1429
|
declare class Domains {
|
|
1329
1430
|
protected mailchannels: MailChannelsClient;
|
|
1330
1431
|
constructor(mailchannels: MailChannelsClient);
|
|
@@ -1432,7 +1533,7 @@ declare class Domains {
|
|
|
1432
1533
|
*/
|
|
1433
1534
|
createLoginLink(domain: string): Promise<DomainsCreateLoginLinkResponse>;
|
|
1434
1535
|
/**
|
|
1435
|
-
* Sets the list of downstream
|
|
1536
|
+
* Sets the list of downstream addresses for the domain. This action deletes any existing downstream address for the domain before creating new ones. If the `records` parameter is an empty array, all downstream address records will be deleted.
|
|
1436
1537
|
* @param domain - The domain name.
|
|
1437
1538
|
* @param records - The list of records to set for the domain. A maximum of 10 records can be set.
|
|
1438
1539
|
* @example
|
|
@@ -1471,6 +1572,16 @@ declare class Domains {
|
|
|
1471
1572
|
* ```
|
|
1472
1573
|
*/
|
|
1473
1574
|
updateApiKey(domain: string, key: string): Promise<SuccessResponse>;
|
|
1575
|
+
/**
|
|
1576
|
+
* Generate a batch of links that allow a user to log in as a domain administrator to their different domains.
|
|
1577
|
+
* @param domains - The list of domain names. Maximum of `1000` links per request.
|
|
1578
|
+
* @example
|
|
1579
|
+
* ```ts
|
|
1580
|
+
* const mailchannels = new MailChannels('your-api-key')
|
|
1581
|
+
* const { results } = await mailchannels.domains.bulkCreateLoginLinks(['example.com', 'example2.com'])
|
|
1582
|
+
* ```
|
|
1583
|
+
*/
|
|
1584
|
+
bulkCreateLoginLinks(domains: string[]): Promise<DomainsBulkCreateLoginLinksResponse>;
|
|
1474
1585
|
}
|
|
1475
1586
|
|
|
1476
1587
|
declare class Lists {
|
|
@@ -1514,6 +1625,43 @@ declare class Lists {
|
|
|
1514
1625
|
deleteListEntry(options: ListEntryOptions): Promise<SuccessResponse>;
|
|
1515
1626
|
}
|
|
1516
1627
|
|
|
1628
|
+
interface UsersCreateOptions {
|
|
1629
|
+
/**
|
|
1630
|
+
* Flag to indicate if the user is a domain admin or a regular user
|
|
1631
|
+
* @default false
|
|
1632
|
+
*/
|
|
1633
|
+
admin?: boolean;
|
|
1634
|
+
/**
|
|
1635
|
+
* Whether or not to filter mail for this recipient. There are three valid values.
|
|
1636
|
+
* - `false` - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, return an error.
|
|
1637
|
+
* - `true` - Filtering policy will not be applied to messages intended for this recipient.
|
|
1638
|
+
* - `compute` - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, filtering policy will not be applied, and no error will be returned.
|
|
1639
|
+
* @default 'compute'
|
|
1640
|
+
*/
|
|
1641
|
+
filter?: boolean | "compute";
|
|
1642
|
+
/**
|
|
1643
|
+
* safelist and blocklist entries to be added
|
|
1644
|
+
*/
|
|
1645
|
+
listEntries?: {
|
|
1646
|
+
blocklist?: string[];
|
|
1647
|
+
safelist?: string[];
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
interface UsersCreateResponse {
|
|
1652
|
+
user: {
|
|
1653
|
+
email: string;
|
|
1654
|
+
roles: string[];
|
|
1655
|
+
filter?: boolean;
|
|
1656
|
+
listEntries: {
|
|
1657
|
+
item: string;
|
|
1658
|
+
type: "domain" | "email_address" | "ip_address";
|
|
1659
|
+
action: "safelist" | "blocklist";
|
|
1660
|
+
}[];
|
|
1661
|
+
} | null;
|
|
1662
|
+
error: string | null;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1517
1665
|
declare class Users {
|
|
1518
1666
|
protected mailchannels: MailChannelsClient;
|
|
1519
1667
|
constructor(mailchannels: MailChannelsClient);
|
|
@@ -1571,6 +1719,48 @@ declare class Users {
|
|
|
1571
1719
|
deleteListEntry(email: string, options: ListEntryOptions): Promise<SuccessResponse>;
|
|
1572
1720
|
}
|
|
1573
1721
|
|
|
1722
|
+
interface ServiceSubscriptionsResponse {
|
|
1723
|
+
subscriptions: {
|
|
1724
|
+
active: boolean;
|
|
1725
|
+
activeAccountsCount: number;
|
|
1726
|
+
handle: string;
|
|
1727
|
+
limits: {
|
|
1728
|
+
featureHandle: string;
|
|
1729
|
+
value: string;
|
|
1730
|
+
}[];
|
|
1731
|
+
plan: {
|
|
1732
|
+
handle: string;
|
|
1733
|
+
name: string;
|
|
1734
|
+
};
|
|
1735
|
+
}[];
|
|
1736
|
+
error: string | null;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
interface ServiceReportOptions {
|
|
1740
|
+
/**
|
|
1741
|
+
* The report type. It can be either `false_negative` or `false_positive`.
|
|
1742
|
+
*/
|
|
1743
|
+
type: "false_negative" | "false_positive";
|
|
1744
|
+
/**
|
|
1745
|
+
* The full, unaltered message content in accordance with the RFC 2822 specifications without dot stuffing.
|
|
1746
|
+
*/
|
|
1747
|
+
messageContent: string;
|
|
1748
|
+
/**
|
|
1749
|
+
* The SMTP envelope information
|
|
1750
|
+
*/
|
|
1751
|
+
smtpEnvelopeInformation?: {
|
|
1752
|
+
ehlo: string;
|
|
1753
|
+
mailFrom: string;
|
|
1754
|
+
rcptTo: string;
|
|
1755
|
+
};
|
|
1756
|
+
/**
|
|
1757
|
+
* The sending host information.
|
|
1758
|
+
*/
|
|
1759
|
+
sendingHostInformation?: {
|
|
1760
|
+
name: string;
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1574
1764
|
declare class Service {
|
|
1575
1765
|
protected mailchannels: MailChannelsClient;
|
|
1576
1766
|
constructor(mailchannels: MailChannelsClient);
|
|
@@ -1607,4 +1797,4 @@ declare class Service {
|
|
|
1607
1797
|
}
|
|
1608
1798
|
|
|
1609
1799
|
export { Domains as D, Emails as E, Lists as L, MailChannelsClient as M, SubAccounts as S, Users as U, Webhooks as W, Metrics as a, Suppressions as b, Service as c };
|
|
1610
|
-
export type {
|
|
1800
|
+
export type { MetricsVolumeResponse as $, SubAccountsApiKey as A, SubAccountsCreateApiKeyResponse as B, SubAccountsListApiKeyResponse as C, SubAccountsSmtpPassword as F, SubAccountsCreateSmtpPasswordResponse as G, SubAccountsListSmtpPasswordResponse as H, SubAccountsLimit as I, SubAccountsLimitResponse as J, SubAccountsUsage as K, SubAccountsUsageResponse as N, Optional as O, MetricsBucket as P, MetricsOptions as Q, MetricsEngagement as R, MetricsEngagementResponse as T, MetricsPerformance as V, MetricsPerformanceResponse as X, MetricsRecipientBehaviour as Y, MetricsRecipientBehaviourResponse as Z, MetricsVolume as _, MetricsUsageResponse as a0, SuppressionsTypes as a1, SuppressionsCreateOptions as a2, SuppressionsSource as a3, SuppressionsListOptions as a4, SuppressionsListEntry as a5, SuppressionsListResponse as a6, DomainsData as a7, DomainsProvisionOptions as a8, DomainsBulkProvisionOptions as a9, DomainsProvisionResponse as aa, DomainsBulkProvisionResponse as ab, DomainsListOptions as ac, DomainsListResponse as ad, DomainsCreateLoginLinkResponse as ae, DomainsListDownstreamAddressesOptions as af, DomainsDownstreamAddress as ag, DomainsListDownstreamAddressesResponse as ah, DomainsBulkCreateLoginLinkResult as ai, DomainsBulkCreateLoginLinks as aj, DomainsBulkCreateLoginLinksResponse as ak, ListNames as al, ListEntryOptions as am, ListEntry as an, ListEntryResponse as ao, ListEntriesResponse as ap, UsersCreateOptions as aq, UsersCreateResponse as ar, ServiceSubscriptionsResponse as as, ServiceReportOptions as at, SuccessResponse as au, EmailsSendRecipient as d, EmailsSendAttachment as e, EmailsSendTracking as f, EmailsSendOptionsBase as g, EmailsSendOptions as h, EmailsSendResponse as i, EmailsCheckDomainDkim as j, EmailsCheckDomainOptions as k, EmailsCheckDomainVerdict as l, EmailsCheckDomainResponse as m, EmailsCreateDkimKeyOptions as n, EmailsDkimKey as o, EmailsCreateDkimKeyResponse as p, EmailsGetDkimKeysOptions as q, EmailsGetDkimKeysResponse as r, EmailsUpdateDkimKeyOptions as s, WebhooksListResponse as t, WebhooksSigningKeyResponse as u, WebhooksValidateResponse as v, SubAccountsAccount as w, SubAccountsCreateResponse as x, SubAccountsListOptions as y, SubAccountsListResponse as z };
|