resend 6.4.2 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +902 -0
- package/dist/index.d.cts +1453 -0
- package/dist/index.d.mts +1076 -977
- package/dist/index.mjs +821 -1127
- package/package.json +15 -9
- package/dist/index.d.ts +0 -1354
- package/dist/index.js +0 -1242
package/dist/index.d.ts
DELETED
|
@@ -1,1354 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
|
|
3
|
-
interface ApiKey {
|
|
4
|
-
created_at: string;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface DomainApiOptions {
|
|
10
|
-
name: string;
|
|
11
|
-
region?: string;
|
|
12
|
-
custom_return_path?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare const RESEND_ERROR_CODES_BY_KEY: {
|
|
16
|
-
readonly missing_required_field: 422;
|
|
17
|
-
readonly invalid_idempotency_key: 400;
|
|
18
|
-
readonly invalid_idempotent_request: 409;
|
|
19
|
-
readonly concurrent_idempotent_requests: 409;
|
|
20
|
-
readonly invalid_access: 422;
|
|
21
|
-
readonly invalid_parameter: 422;
|
|
22
|
-
readonly invalid_region: 422;
|
|
23
|
-
readonly rate_limit_exceeded: 429;
|
|
24
|
-
readonly missing_api_key: 401;
|
|
25
|
-
readonly invalid_api_key: 403;
|
|
26
|
-
readonly suspended_api_key: 403;
|
|
27
|
-
readonly invalid_from_address: 403;
|
|
28
|
-
readonly validation_error: 403;
|
|
29
|
-
readonly not_found: 404;
|
|
30
|
-
readonly method_not_allowed: 405;
|
|
31
|
-
readonly application_error: 500;
|
|
32
|
-
readonly internal_server_error: 500;
|
|
33
|
-
};
|
|
34
|
-
type RESEND_ERROR_CODE_KEY = keyof typeof RESEND_ERROR_CODES_BY_KEY;
|
|
35
|
-
type Response<T> = ({
|
|
36
|
-
data: T;
|
|
37
|
-
error: null;
|
|
38
|
-
} | {
|
|
39
|
-
error: ErrorResponse;
|
|
40
|
-
data: null;
|
|
41
|
-
}) & {
|
|
42
|
-
headers: Record<string, string> | null;
|
|
43
|
-
};
|
|
44
|
-
type ErrorResponse = {
|
|
45
|
-
message: string;
|
|
46
|
-
statusCode: number | null;
|
|
47
|
-
name: RESEND_ERROR_CODE_KEY;
|
|
48
|
-
};
|
|
49
|
-
type Tag$1 = {
|
|
50
|
-
name: string;
|
|
51
|
-
value: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
interface EmailApiAttachment {
|
|
55
|
-
content?: string | Buffer;
|
|
56
|
-
filename?: string | false | undefined;
|
|
57
|
-
path?: string;
|
|
58
|
-
content_type?: string;
|
|
59
|
-
content_id?: string;
|
|
60
|
-
}
|
|
61
|
-
interface EmailApiOptions {
|
|
62
|
-
from?: string;
|
|
63
|
-
to: string | string[];
|
|
64
|
-
subject?: string;
|
|
65
|
-
region?: string;
|
|
66
|
-
headers?: Record<string, string>;
|
|
67
|
-
html?: string;
|
|
68
|
-
text?: string;
|
|
69
|
-
bcc?: string | string[];
|
|
70
|
-
cc?: string | string[];
|
|
71
|
-
reply_to?: string | string[];
|
|
72
|
-
topic_id?: string | null;
|
|
73
|
-
scheduled_at?: string;
|
|
74
|
-
tags?: Tag$1[];
|
|
75
|
-
attachments?: EmailApiAttachment[];
|
|
76
|
-
template?: {
|
|
77
|
-
id: string;
|
|
78
|
-
variables?: Record<string, string | number>;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
interface GetOptions {
|
|
83
|
-
query?: Record<string, unknown>;
|
|
84
|
-
headers?: HeadersInit;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface IdempotentRequest {
|
|
88
|
-
/**
|
|
89
|
-
* Unique key that ensures the same operation is not processed multiple times.
|
|
90
|
-
* Allows for safe retries without duplicating operations.
|
|
91
|
-
* If provided, will be sent as the `Idempotency-Key` header.
|
|
92
|
-
*/
|
|
93
|
-
idempotencyKey?: string;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
type PaginationOptions = {
|
|
97
|
-
/**
|
|
98
|
-
* Maximum number of items to return (1-100, default: 20)
|
|
99
|
-
*/
|
|
100
|
-
limit?: number;
|
|
101
|
-
} & ({
|
|
102
|
-
/**
|
|
103
|
-
* Get items after this cursor (cannot be used with 'before')
|
|
104
|
-
*/
|
|
105
|
-
after?: string;
|
|
106
|
-
before?: never;
|
|
107
|
-
} | {
|
|
108
|
-
/**
|
|
109
|
-
* Get items before this cursor (cannot be used with 'after')
|
|
110
|
-
*/
|
|
111
|
-
before?: string;
|
|
112
|
-
after?: never;
|
|
113
|
-
});
|
|
114
|
-
type PaginatedData<Data> = {
|
|
115
|
-
object: 'list';
|
|
116
|
-
data: Data;
|
|
117
|
-
has_more: boolean;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
interface PatchOptions {
|
|
121
|
-
query?: {
|
|
122
|
-
[key: string]: unknown;
|
|
123
|
-
};
|
|
124
|
-
headers?: HeadersInit;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
interface PostOptions {
|
|
128
|
-
query?: {
|
|
129
|
-
[key: string]: unknown;
|
|
130
|
-
};
|
|
131
|
-
headers?: HeadersInit;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
interface PutOptions {
|
|
135
|
-
query?: {
|
|
136
|
-
[key: string]: unknown;
|
|
137
|
-
};
|
|
138
|
-
headers?: HeadersInit;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
type RequireAtLeastOne<T> = {
|
|
142
|
-
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
143
|
-
}[keyof T];
|
|
144
|
-
|
|
145
|
-
interface CreateApiKeyOptions {
|
|
146
|
-
name: string;
|
|
147
|
-
permission?: 'full_access' | 'sending_access';
|
|
148
|
-
domain_id?: string;
|
|
149
|
-
}
|
|
150
|
-
interface CreateApiKeyRequestOptions extends PostOptions {
|
|
151
|
-
}
|
|
152
|
-
interface CreateApiKeyResponseSuccess {
|
|
153
|
-
token: string;
|
|
154
|
-
id: string;
|
|
155
|
-
}
|
|
156
|
-
type CreateApiKeyResponse = Response<CreateApiKeyResponseSuccess>;
|
|
157
|
-
|
|
158
|
-
type ListApiKeysOptions = PaginationOptions;
|
|
159
|
-
type ListApiKeysResponseSuccess = {
|
|
160
|
-
object: 'list';
|
|
161
|
-
has_more: boolean;
|
|
162
|
-
data: Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
|
|
163
|
-
};
|
|
164
|
-
type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
|
|
165
|
-
|
|
166
|
-
type RemoveApiKeyResponseSuccess = {};
|
|
167
|
-
type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
|
|
168
|
-
|
|
169
|
-
interface EmailRenderOptions$1 {
|
|
170
|
-
/**
|
|
171
|
-
* The React component used to write the message.
|
|
172
|
-
*
|
|
173
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
174
|
-
*/
|
|
175
|
-
react: React$1.ReactNode;
|
|
176
|
-
/**
|
|
177
|
-
* The HTML version of the message.
|
|
178
|
-
*
|
|
179
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
180
|
-
*/
|
|
181
|
-
html: string;
|
|
182
|
-
/**
|
|
183
|
-
* The plain text version of the message.
|
|
184
|
-
*
|
|
185
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
186
|
-
*/
|
|
187
|
-
text: string;
|
|
188
|
-
}
|
|
189
|
-
interface EmailTemplateOptions {
|
|
190
|
-
template: {
|
|
191
|
-
id: string;
|
|
192
|
-
variables?: Record<string, string | number>;
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
interface CreateEmailBaseOptionsWithTemplate extends Omit<CreateEmailBaseOptions, 'from' | 'subject'> {
|
|
196
|
-
from?: string;
|
|
197
|
-
subject?: string;
|
|
198
|
-
}
|
|
199
|
-
interface CreateEmailBaseOptions {
|
|
200
|
-
/**
|
|
201
|
-
* Filename and content of attachments (max 40mb per email)
|
|
202
|
-
*
|
|
203
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
204
|
-
*/
|
|
205
|
-
attachments?: Attachment$1[];
|
|
206
|
-
/**
|
|
207
|
-
* Blind carbon copy recipient email address. For multiple addresses, send as an array of strings.
|
|
208
|
-
*
|
|
209
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
210
|
-
*/
|
|
211
|
-
bcc?: string | string[];
|
|
212
|
-
/**
|
|
213
|
-
* Carbon copy recipient email address. For multiple addresses, send as an array of strings.
|
|
214
|
-
*
|
|
215
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
216
|
-
*/
|
|
217
|
-
cc?: string | string[];
|
|
218
|
-
/**
|
|
219
|
-
* Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
|
|
220
|
-
*
|
|
221
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
222
|
-
*/
|
|
223
|
-
from: string;
|
|
224
|
-
/**
|
|
225
|
-
* Custom headers to add to the email.
|
|
226
|
-
*
|
|
227
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
228
|
-
*/
|
|
229
|
-
headers?: Record<string, string>;
|
|
230
|
-
/**
|
|
231
|
-
* Reply-to email address. For multiple addresses, send as an array of strings.
|
|
232
|
-
*
|
|
233
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
234
|
-
*/
|
|
235
|
-
replyTo?: string | string[];
|
|
236
|
-
/**
|
|
237
|
-
* Email subject.
|
|
238
|
-
*
|
|
239
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
240
|
-
*/
|
|
241
|
-
subject: string;
|
|
242
|
-
/**
|
|
243
|
-
* Email tags
|
|
244
|
-
*
|
|
245
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
246
|
-
*/
|
|
247
|
-
tags?: Tag[];
|
|
248
|
-
/**
|
|
249
|
-
* Recipient email address. For multiple addresses, send as an array of strings. Max 50.
|
|
250
|
-
*
|
|
251
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
252
|
-
*/
|
|
253
|
-
to: string | string[];
|
|
254
|
-
/**
|
|
255
|
-
* The id of the topic you want to send to
|
|
256
|
-
*
|
|
257
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
258
|
-
*/
|
|
259
|
-
topicId?: string | null;
|
|
260
|
-
/**
|
|
261
|
-
* Schedule email to be sent later.
|
|
262
|
-
* The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
|
|
263
|
-
*
|
|
264
|
-
* @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
|
|
265
|
-
*/
|
|
266
|
-
scheduledAt?: string;
|
|
267
|
-
}
|
|
268
|
-
type CreateEmailOptions = ((RequireAtLeastOne<EmailRenderOptions$1> & CreateEmailBaseOptions) & {
|
|
269
|
-
template?: never;
|
|
270
|
-
}) | ((EmailTemplateOptions & CreateEmailBaseOptionsWithTemplate) & {
|
|
271
|
-
react?: never;
|
|
272
|
-
html?: never;
|
|
273
|
-
text?: never;
|
|
274
|
-
});
|
|
275
|
-
interface CreateEmailRequestOptions extends PostOptions, IdempotentRequest {
|
|
276
|
-
}
|
|
277
|
-
interface CreateEmailResponseSuccess {
|
|
278
|
-
/** The ID of the newly created email. */
|
|
279
|
-
id: string;
|
|
280
|
-
}
|
|
281
|
-
type CreateEmailResponse = Response<CreateEmailResponseSuccess>;
|
|
282
|
-
interface Attachment$1 {
|
|
283
|
-
/** Content of an attached file. */
|
|
284
|
-
content?: string | Buffer;
|
|
285
|
-
/** Name of attached file. */
|
|
286
|
-
filename?: string | false | undefined;
|
|
287
|
-
/** Path where the attachment file is hosted */
|
|
288
|
-
path?: string;
|
|
289
|
-
/** Optional content type for the attachment, if not set will be derived from the filename property */
|
|
290
|
-
contentType?: string;
|
|
291
|
-
/**
|
|
292
|
-
* Optional content ID for the attachment, to be used as a reference in the HTML content.
|
|
293
|
-
* If set, this attachment will be sent as an inline attachment and you can reference it in the HTML content using the `cid:` prefix.
|
|
294
|
-
*/
|
|
295
|
-
contentId?: string;
|
|
296
|
-
}
|
|
297
|
-
type Tag = {
|
|
298
|
-
/**
|
|
299
|
-
* The name of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
|
|
300
|
-
*/
|
|
301
|
-
name: string;
|
|
302
|
-
/**
|
|
303
|
-
* The value of the email tag. It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_), or dashes (-). It can contain no more than 256 characters.
|
|
304
|
-
*/
|
|
305
|
-
value: string;
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
type CreateBatchOptions = CreateEmailOptions[];
|
|
309
|
-
interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
|
|
310
|
-
/**
|
|
311
|
-
* @default 'strict'
|
|
312
|
-
*/
|
|
313
|
-
batchValidation?: 'strict' | 'permissive';
|
|
314
|
-
}
|
|
315
|
-
type CreateBatchSuccessResponse<Options extends CreateBatchRequestOptions = CreateBatchRequestOptions> = {
|
|
316
|
-
data: {
|
|
317
|
-
/** The ID of the newly created email. */
|
|
318
|
-
id: string;
|
|
319
|
-
}[];
|
|
320
|
-
} & (Options['batchValidation'] extends 'permissive' ? {
|
|
321
|
-
/**
|
|
322
|
-
* Only present when header "x-batch-validation" is set to 'permissive'.
|
|
323
|
-
*/
|
|
324
|
-
errors: {
|
|
325
|
-
/**
|
|
326
|
-
* The index of the failed email in the batch
|
|
327
|
-
*/
|
|
328
|
-
index: number;
|
|
329
|
-
/**
|
|
330
|
-
* The error message for the failed email
|
|
331
|
-
*/
|
|
332
|
-
message: string;
|
|
333
|
-
}[];
|
|
334
|
-
} : Record<string, never>);
|
|
335
|
-
type CreateBatchResponse<Options extends CreateBatchRequestOptions> = Response<CreateBatchSuccessResponse<Options>>;
|
|
336
|
-
|
|
337
|
-
interface Broadcast {
|
|
338
|
-
id: string;
|
|
339
|
-
name: string;
|
|
340
|
-
segment_id: string | null;
|
|
341
|
-
audience_id: string | null;
|
|
342
|
-
from: string | null;
|
|
343
|
-
subject: string | null;
|
|
344
|
-
reply_to: string[] | null;
|
|
345
|
-
preview_text: string | null;
|
|
346
|
-
status: 'draft' | 'sent' | 'queued';
|
|
347
|
-
created_at: string;
|
|
348
|
-
scheduled_at: string | null;
|
|
349
|
-
sent_at: string | null;
|
|
350
|
-
topic_id?: string | null;
|
|
351
|
-
html: string | null;
|
|
352
|
-
text: string | null;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
interface EmailRenderOptions {
|
|
356
|
-
/**
|
|
357
|
-
* The React component used to write the message.
|
|
358
|
-
*
|
|
359
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
360
|
-
*/
|
|
361
|
-
react: React$1.ReactNode;
|
|
362
|
-
/**
|
|
363
|
-
* The HTML version of the message.
|
|
364
|
-
*
|
|
365
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
366
|
-
*/
|
|
367
|
-
html: string;
|
|
368
|
-
/**
|
|
369
|
-
* The plain text version of the message.
|
|
370
|
-
*
|
|
371
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
372
|
-
*/
|
|
373
|
-
text: string;
|
|
374
|
-
}
|
|
375
|
-
interface SegmentOptions {
|
|
376
|
-
/**
|
|
377
|
-
* The id of the segment you want to send to
|
|
378
|
-
*
|
|
379
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
380
|
-
*/
|
|
381
|
-
segmentId: string;
|
|
382
|
-
/**
|
|
383
|
-
* @deprecated Use segmentId instead
|
|
384
|
-
*/
|
|
385
|
-
audienceId: string;
|
|
386
|
-
}
|
|
387
|
-
interface CreateBroadcastBaseOptions {
|
|
388
|
-
/**
|
|
389
|
-
* The name of the broadcast
|
|
390
|
-
*
|
|
391
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
392
|
-
*/
|
|
393
|
-
name?: string;
|
|
394
|
-
/**
|
|
395
|
-
* A short snippet of text displayed as a preview in recipients' inboxes, often shown below or beside the subject line.
|
|
396
|
-
*
|
|
397
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
398
|
-
*/
|
|
399
|
-
previewText?: string;
|
|
400
|
-
/**
|
|
401
|
-
* Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
|
|
402
|
-
*
|
|
403
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
404
|
-
*/
|
|
405
|
-
from: string;
|
|
406
|
-
/**
|
|
407
|
-
* Reply-to email address. For multiple addresses, send as an array of strings.
|
|
408
|
-
*
|
|
409
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
410
|
-
*/
|
|
411
|
-
replyTo?: string | string[];
|
|
412
|
-
/**
|
|
413
|
-
* Email subject.
|
|
414
|
-
*
|
|
415
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
416
|
-
*/
|
|
417
|
-
subject: string;
|
|
418
|
-
/**
|
|
419
|
-
* The id of the topic you want to send to
|
|
420
|
-
*
|
|
421
|
-
* @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
|
|
422
|
-
*/
|
|
423
|
-
topicId?: string | null;
|
|
424
|
-
}
|
|
425
|
-
type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & RequireAtLeastOne<SegmentOptions> & CreateBroadcastBaseOptions;
|
|
426
|
-
interface CreateBroadcastRequestOptions extends PostOptions {
|
|
427
|
-
}
|
|
428
|
-
interface CreateBroadcastResponseSuccess {
|
|
429
|
-
/** The ID of the newly sent broadcasts. */
|
|
430
|
-
id: string;
|
|
431
|
-
}
|
|
432
|
-
type CreateBroadcastResponse = Response<CreateBroadcastResponseSuccess>;
|
|
433
|
-
|
|
434
|
-
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
435
|
-
object: 'broadcast';
|
|
436
|
-
}
|
|
437
|
-
type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
|
|
438
|
-
|
|
439
|
-
type ListBroadcastsOptions = PaginationOptions;
|
|
440
|
-
type ListBroadcastsResponseSuccess = {
|
|
441
|
-
object: 'list';
|
|
442
|
-
has_more: boolean;
|
|
443
|
-
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'segment_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
444
|
-
};
|
|
445
|
-
type ListBroadcastsResponse = Response<ListBroadcastsResponseSuccess>;
|
|
446
|
-
|
|
447
|
-
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
448
|
-
object: 'broadcast';
|
|
449
|
-
deleted: boolean;
|
|
450
|
-
}
|
|
451
|
-
type RemoveBroadcastResponse = Response<RemoveBroadcastResponseSuccess>;
|
|
452
|
-
|
|
453
|
-
interface SendBroadcastBaseOptions {
|
|
454
|
-
/**
|
|
455
|
-
* Schedule email to be sent later.
|
|
456
|
-
* The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
|
|
457
|
-
* or relative time (eg: in 2 days).
|
|
458
|
-
*
|
|
459
|
-
* @link https://resend.com/docs/api-reference/broadcasts/send#body-parameters
|
|
460
|
-
*/
|
|
461
|
-
scheduledAt?: string;
|
|
462
|
-
}
|
|
463
|
-
type SendBroadcastOptions = SendBroadcastBaseOptions;
|
|
464
|
-
interface SendBroadcastRequestOptions extends PostOptions {
|
|
465
|
-
}
|
|
466
|
-
interface SendBroadcastResponseSuccess {
|
|
467
|
-
/** The ID of the sent broadcast. */
|
|
468
|
-
id: string;
|
|
469
|
-
}
|
|
470
|
-
type SendBroadcastResponse = Response<SendBroadcastResponseSuccess>;
|
|
471
|
-
|
|
472
|
-
interface UpdateBroadcastResponseSuccess {
|
|
473
|
-
id: string;
|
|
474
|
-
}
|
|
475
|
-
type UpdateBroadcastOptions = {
|
|
476
|
-
name?: string;
|
|
477
|
-
segmentId?: string;
|
|
478
|
-
/**
|
|
479
|
-
* @deprecated Use segmentId instead
|
|
480
|
-
*/
|
|
481
|
-
audienceId?: string;
|
|
482
|
-
from?: string;
|
|
483
|
-
html?: string;
|
|
484
|
-
react?: React.ReactNode;
|
|
485
|
-
text?: string;
|
|
486
|
-
subject?: string;
|
|
487
|
-
replyTo?: string[];
|
|
488
|
-
previewText?: string;
|
|
489
|
-
topicId?: string | null;
|
|
490
|
-
};
|
|
491
|
-
type UpdateBroadcastResponse = Response<UpdateBroadcastResponseSuccess>;
|
|
492
|
-
|
|
493
|
-
interface Contact {
|
|
494
|
-
created_at: string;
|
|
495
|
-
id: string;
|
|
496
|
-
email: string;
|
|
497
|
-
first_name?: string;
|
|
498
|
-
last_name?: string;
|
|
499
|
-
unsubscribed: boolean;
|
|
500
|
-
}
|
|
501
|
-
type SelectingField = {
|
|
502
|
-
/**
|
|
503
|
-
* The contact id.
|
|
504
|
-
*
|
|
505
|
-
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
506
|
-
*/
|
|
507
|
-
id: string;
|
|
508
|
-
/**
|
|
509
|
-
* The contact email.
|
|
510
|
-
*
|
|
511
|
-
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
512
|
-
*/
|
|
513
|
-
email?: undefined | null;
|
|
514
|
-
} | {
|
|
515
|
-
/**
|
|
516
|
-
* The contact id.
|
|
517
|
-
*
|
|
518
|
-
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
519
|
-
*/
|
|
520
|
-
id?: undefined | null;
|
|
521
|
-
/**
|
|
522
|
-
* The contact email.
|
|
523
|
-
*
|
|
524
|
-
* @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
|
|
525
|
-
*/
|
|
526
|
-
email: string;
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
interface CreateContactPropertiesOptions {
|
|
530
|
-
[key: string]: string | number | null;
|
|
531
|
-
}
|
|
532
|
-
interface CreateContactOptions {
|
|
533
|
-
audienceId?: string;
|
|
534
|
-
email: string;
|
|
535
|
-
unsubscribed?: boolean;
|
|
536
|
-
firstName?: string;
|
|
537
|
-
lastName?: string;
|
|
538
|
-
properties?: CreateContactPropertiesOptions;
|
|
539
|
-
}
|
|
540
|
-
interface CreateContactRequestOptions extends PostOptions {
|
|
541
|
-
}
|
|
542
|
-
interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
|
|
543
|
-
object: 'contact';
|
|
544
|
-
}
|
|
545
|
-
type CreateContactResponse = Response<CreateContactResponseSuccess>;
|
|
546
|
-
|
|
547
|
-
type GetContactOptions = string | ({
|
|
548
|
-
audienceId?: string;
|
|
549
|
-
} & SelectingField);
|
|
550
|
-
type ContactPropertyValue = {
|
|
551
|
-
type: 'string';
|
|
552
|
-
value: string;
|
|
553
|
-
} | {
|
|
554
|
-
type: 'number';
|
|
555
|
-
value: number;
|
|
556
|
-
};
|
|
557
|
-
interface ContactProperties$1 {
|
|
558
|
-
[key: string]: ContactPropertyValue;
|
|
559
|
-
}
|
|
560
|
-
interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
|
|
561
|
-
object: 'contact';
|
|
562
|
-
properties: ContactProperties$1;
|
|
563
|
-
}
|
|
564
|
-
type GetContactResponse = Response<GetContactResponseSuccess>;
|
|
565
|
-
|
|
566
|
-
type ListContactsOptions = PaginationOptions & {
|
|
567
|
-
segmentId?: string;
|
|
568
|
-
/**
|
|
569
|
-
* @deprecated Use segmentId instead to filter by segment
|
|
570
|
-
*/
|
|
571
|
-
audienceId?: string;
|
|
572
|
-
};
|
|
573
|
-
interface ListContactsResponseSuccess {
|
|
574
|
-
object: 'list';
|
|
575
|
-
data: Contact[];
|
|
576
|
-
has_more: boolean;
|
|
577
|
-
}
|
|
578
|
-
type ListContactsResponse = Response<ListContactsResponseSuccess>;
|
|
579
|
-
|
|
580
|
-
type RemoveContactsResponseSuccess = {
|
|
581
|
-
object: 'contact';
|
|
582
|
-
deleted: boolean;
|
|
583
|
-
contact: string;
|
|
584
|
-
};
|
|
585
|
-
type RemoveContactOptions = string | (SelectingField & {
|
|
586
|
-
audienceId?: string;
|
|
587
|
-
});
|
|
588
|
-
type RemoveContactsResponse = Response<RemoveContactsResponseSuccess>;
|
|
589
|
-
|
|
590
|
-
interface UpdateContactPropertiesOptions {
|
|
591
|
-
[key: string]: string | number | null;
|
|
592
|
-
}
|
|
593
|
-
type UpdateContactOptions = {
|
|
594
|
-
audienceId?: string;
|
|
595
|
-
unsubscribed?: boolean;
|
|
596
|
-
firstName?: string;
|
|
597
|
-
lastName?: string;
|
|
598
|
-
properties?: UpdateContactPropertiesOptions;
|
|
599
|
-
} & SelectingField;
|
|
600
|
-
type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
|
|
601
|
-
object: 'contact';
|
|
602
|
-
};
|
|
603
|
-
type UpdateContactResponse = Response<UpdateContactResponseSuccess>;
|
|
604
|
-
|
|
605
|
-
type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
|
|
606
|
-
type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
|
|
607
|
-
type DomainStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
|
|
608
|
-
type DomainRecords = DomainSpfRecord | DomainDkimRecord | ReceivingRecord;
|
|
609
|
-
interface DomainSpfRecord {
|
|
610
|
-
record: 'SPF';
|
|
611
|
-
name: string;
|
|
612
|
-
value: string;
|
|
613
|
-
type: 'MX' | 'TXT';
|
|
614
|
-
ttl: string;
|
|
615
|
-
status: DomainStatus;
|
|
616
|
-
routing_policy?: string;
|
|
617
|
-
priority?: number;
|
|
618
|
-
proxy_status?: 'enable' | 'disable';
|
|
619
|
-
}
|
|
620
|
-
interface DomainDkimRecord {
|
|
621
|
-
record: 'DKIM';
|
|
622
|
-
name: string;
|
|
623
|
-
value: string;
|
|
624
|
-
type: 'CNAME' | 'TXT';
|
|
625
|
-
ttl: string;
|
|
626
|
-
status: DomainStatus;
|
|
627
|
-
routing_policy?: string;
|
|
628
|
-
priority?: number;
|
|
629
|
-
proxy_status?: 'enable' | 'disable';
|
|
630
|
-
}
|
|
631
|
-
interface ReceivingRecord {
|
|
632
|
-
record: 'Receiving';
|
|
633
|
-
name: string;
|
|
634
|
-
value: string;
|
|
635
|
-
type: 'MX';
|
|
636
|
-
ttl: string;
|
|
637
|
-
status: DomainStatus;
|
|
638
|
-
priority: number;
|
|
639
|
-
}
|
|
640
|
-
interface Domain {
|
|
641
|
-
id: string;
|
|
642
|
-
name: string;
|
|
643
|
-
status: DomainStatus;
|
|
644
|
-
created_at: string;
|
|
645
|
-
region: DomainRegion;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
interface CreateDomainOptions {
|
|
649
|
-
name: string;
|
|
650
|
-
region?: DomainRegion;
|
|
651
|
-
customReturnPath?: string;
|
|
652
|
-
}
|
|
653
|
-
interface CreateDomainRequestOptions extends PostOptions {
|
|
654
|
-
}
|
|
655
|
-
interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
|
|
656
|
-
records: DomainRecords[];
|
|
657
|
-
}
|
|
658
|
-
type CreateDomainResponse = Response<CreateDomainResponseSuccess>;
|
|
659
|
-
|
|
660
|
-
interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status'> {
|
|
661
|
-
object: 'domain';
|
|
662
|
-
records: DomainRecords[];
|
|
663
|
-
}
|
|
664
|
-
type GetDomainResponse = Response<GetDomainResponseSuccess>;
|
|
665
|
-
|
|
666
|
-
type ListDomainsOptions = PaginationOptions;
|
|
667
|
-
type ListDomainsResponseSuccess = {
|
|
668
|
-
data: Domain[];
|
|
669
|
-
object: 'list';
|
|
670
|
-
has_more: boolean;
|
|
671
|
-
};
|
|
672
|
-
type ListDomainsResponse = Response<ListDomainsResponseSuccess>;
|
|
673
|
-
|
|
674
|
-
type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
675
|
-
object: 'domain';
|
|
676
|
-
deleted: boolean;
|
|
677
|
-
};
|
|
678
|
-
type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
|
|
679
|
-
|
|
680
|
-
interface UpdateDomainsOptions {
|
|
681
|
-
id: string;
|
|
682
|
-
clickTracking?: boolean;
|
|
683
|
-
openTracking?: boolean;
|
|
684
|
-
tls?: 'enforced' | 'opportunistic';
|
|
685
|
-
}
|
|
686
|
-
type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
687
|
-
object: 'domain';
|
|
688
|
-
};
|
|
689
|
-
type UpdateDomainsResponse = Response<UpdateDomainsResponseSuccess>;
|
|
690
|
-
|
|
691
|
-
type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
|
|
692
|
-
object: 'domain';
|
|
693
|
-
};
|
|
694
|
-
type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
|
|
695
|
-
|
|
696
|
-
interface Attachment {
|
|
697
|
-
id: string;
|
|
698
|
-
filename?: string;
|
|
699
|
-
size: number;
|
|
700
|
-
content_type: string;
|
|
701
|
-
content_disposition: 'inline' | 'attachment';
|
|
702
|
-
content_id?: string;
|
|
703
|
-
download_url: string;
|
|
704
|
-
expires_at: string;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
interface GetAttachmentOptions {
|
|
708
|
-
emailId: string;
|
|
709
|
-
id: string;
|
|
710
|
-
}
|
|
711
|
-
type GetAttachmentResponseSuccess = {
|
|
712
|
-
object: 'attachment';
|
|
713
|
-
} & Attachment;
|
|
714
|
-
type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
|
|
715
|
-
|
|
716
|
-
type ListAttachmentsOptions = PaginationOptions & {
|
|
717
|
-
emailId: string;
|
|
718
|
-
};
|
|
719
|
-
interface ListAttachmentsApiResponse {
|
|
720
|
-
object: 'list';
|
|
721
|
-
has_more: boolean;
|
|
722
|
-
data: Attachment[];
|
|
723
|
-
}
|
|
724
|
-
interface ListAttachmentsResponseSuccess {
|
|
725
|
-
object: 'list';
|
|
726
|
-
has_more: boolean;
|
|
727
|
-
data: Attachment[];
|
|
728
|
-
}
|
|
729
|
-
type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
|
|
730
|
-
|
|
731
|
-
interface CancelEmailResponseSuccess {
|
|
732
|
-
object: 'email';
|
|
733
|
-
id: string;
|
|
734
|
-
}
|
|
735
|
-
type CancelEmailResponse = Response<CancelEmailResponseSuccess>;
|
|
736
|
-
|
|
737
|
-
interface GetEmailResponseSuccess {
|
|
738
|
-
bcc: string[] | null;
|
|
739
|
-
cc: string[] | null;
|
|
740
|
-
created_at: string;
|
|
741
|
-
from: string;
|
|
742
|
-
html: string | null;
|
|
743
|
-
id: string;
|
|
744
|
-
last_event: 'bounced' | 'canceled' | 'clicked' | 'complained' | 'delivered' | 'delivery_delayed' | 'failed' | 'opened' | 'queued' | 'scheduled' | 'sent';
|
|
745
|
-
reply_to: string[] | null;
|
|
746
|
-
subject: string;
|
|
747
|
-
text: string | null;
|
|
748
|
-
tags?: {
|
|
749
|
-
name: string;
|
|
750
|
-
value: string;
|
|
751
|
-
}[];
|
|
752
|
-
to: string[];
|
|
753
|
-
topic_id?: string | null;
|
|
754
|
-
scheduled_at: string | null;
|
|
755
|
-
object: 'email';
|
|
756
|
-
}
|
|
757
|
-
type GetEmailResponse = Response<GetEmailResponseSuccess>;
|
|
758
|
-
|
|
759
|
-
interface UpdateEmailOptions {
|
|
760
|
-
id: string;
|
|
761
|
-
scheduledAt: string;
|
|
762
|
-
}
|
|
763
|
-
interface UpdateEmailResponseSuccess {
|
|
764
|
-
id: string;
|
|
765
|
-
object: 'email';
|
|
766
|
-
}
|
|
767
|
-
type UpdateEmailResponse = Response<UpdateEmailResponseSuccess>;
|
|
768
|
-
|
|
769
|
-
interface GetReceivingEmailResponseSuccess {
|
|
770
|
-
object: 'email';
|
|
771
|
-
id: string;
|
|
772
|
-
to: string[];
|
|
773
|
-
from: string;
|
|
774
|
-
created_at: string;
|
|
775
|
-
subject: string;
|
|
776
|
-
bcc: string[] | null;
|
|
777
|
-
cc: string[] | null;
|
|
778
|
-
reply_to: string[] | null;
|
|
779
|
-
html: string | null;
|
|
780
|
-
text: string | null;
|
|
781
|
-
headers: Record<string, string>;
|
|
782
|
-
message_id: string;
|
|
783
|
-
attachments: Array<{
|
|
784
|
-
id: string;
|
|
785
|
-
filename: string;
|
|
786
|
-
size: number;
|
|
787
|
-
content_type: string;
|
|
788
|
-
content_id: string;
|
|
789
|
-
content_disposition: string;
|
|
790
|
-
}>;
|
|
791
|
-
}
|
|
792
|
-
type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
|
|
793
|
-
|
|
794
|
-
type ListReceivingEmailsOptions = PaginationOptions;
|
|
795
|
-
type ListReceivingEmail = Omit<GetReceivingEmailResponseSuccess, 'html' | 'text' | 'headers' | 'object'>;
|
|
796
|
-
interface ListReceivingEmailsResponseSuccess {
|
|
797
|
-
object: 'list';
|
|
798
|
-
has_more: boolean;
|
|
799
|
-
data: ListReceivingEmail[];
|
|
800
|
-
}
|
|
801
|
-
type ListReceivingEmailsResponse = {
|
|
802
|
-
data: ListReceivingEmailsResponseSuccess;
|
|
803
|
-
error: null;
|
|
804
|
-
} | {
|
|
805
|
-
data: null;
|
|
806
|
-
error: ErrorResponse;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
declare class ApiKeys {
|
|
810
|
-
private readonly resend;
|
|
811
|
-
constructor(resend: Resend);
|
|
812
|
-
create(payload: CreateApiKeyOptions, options?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
|
|
813
|
-
list(options?: ListApiKeysOptions): Promise<ListApiKeysResponse>;
|
|
814
|
-
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
declare class Batch {
|
|
818
|
-
private readonly resend;
|
|
819
|
-
constructor(resend: Resend);
|
|
820
|
-
send<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
|
|
821
|
-
create<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
declare class Broadcasts {
|
|
825
|
-
private readonly resend;
|
|
826
|
-
constructor(resend: Resend);
|
|
827
|
-
create(payload: CreateBroadcastOptions, options?: CreateBroadcastRequestOptions): Promise<SendBroadcastResponse>;
|
|
828
|
-
send(id: string, payload?: SendBroadcastOptions): Promise<SendBroadcastResponse>;
|
|
829
|
-
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
830
|
-
get(id: string): Promise<GetBroadcastResponse>;
|
|
831
|
-
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
832
|
-
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
type StringBaseContactProperty = {
|
|
836
|
-
type: 'string';
|
|
837
|
-
fallbackValue: string | null;
|
|
838
|
-
};
|
|
839
|
-
type NumberBaseContactProperty = {
|
|
840
|
-
type: 'number';
|
|
841
|
-
fallbackValue: number | null;
|
|
842
|
-
};
|
|
843
|
-
type ContactProperty = {
|
|
844
|
-
id: string;
|
|
845
|
-
createdAt: string;
|
|
846
|
-
key: string;
|
|
847
|
-
} & (StringBaseContactProperty | NumberBaseContactProperty);
|
|
848
|
-
|
|
849
|
-
type StringBaseContactPropertyOptions = {
|
|
850
|
-
type: 'string';
|
|
851
|
-
fallbackValue?: string | null;
|
|
852
|
-
};
|
|
853
|
-
type NumberBaseContactPropertyOptions = {
|
|
854
|
-
type: 'number';
|
|
855
|
-
fallbackValue?: number | null;
|
|
856
|
-
};
|
|
857
|
-
type CreateContactPropertyOptions = {
|
|
858
|
-
key: string;
|
|
859
|
-
} & (StringBaseContactPropertyOptions | NumberBaseContactPropertyOptions);
|
|
860
|
-
type CreateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
861
|
-
object: 'contact_property';
|
|
862
|
-
};
|
|
863
|
-
type CreateContactPropertyResponse = Response<CreateContactPropertyResponseSuccess>;
|
|
864
|
-
|
|
865
|
-
type RemoveContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
866
|
-
object: 'contact_property';
|
|
867
|
-
deleted: boolean;
|
|
868
|
-
};
|
|
869
|
-
type RemoveContactPropertyResponse = Response<RemoveContactPropertyResponseSuccess>;
|
|
870
|
-
|
|
871
|
-
type GetContactPropertyResponse = Response<ContactProperty & {
|
|
872
|
-
object: 'contact_property';
|
|
873
|
-
}>;
|
|
874
|
-
|
|
875
|
-
type ListContactPropertiesOptions = PaginationOptions;
|
|
876
|
-
type ListContactPropertiesResponse = Response<{
|
|
877
|
-
object: 'list';
|
|
878
|
-
has_more: boolean;
|
|
879
|
-
data: ContactProperty[];
|
|
880
|
-
}>;
|
|
881
|
-
|
|
882
|
-
type UpdateContactPropertyOptions = {
|
|
883
|
-
id: string;
|
|
884
|
-
fallbackValue?: string | number | null;
|
|
885
|
-
};
|
|
886
|
-
type UpdateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
|
|
887
|
-
object: 'contact_property';
|
|
888
|
-
};
|
|
889
|
-
type UpdateContactPropertyResponse = Response<UpdateContactPropertyResponseSuccess>;
|
|
890
|
-
|
|
891
|
-
declare class ContactProperties {
|
|
892
|
-
private readonly resend;
|
|
893
|
-
constructor(resend: Resend);
|
|
894
|
-
create(options: CreateContactPropertyOptions): Promise<CreateContactPropertyResponse>;
|
|
895
|
-
list(options?: ListContactPropertiesOptions): Promise<ListContactPropertiesResponse>;
|
|
896
|
-
get(id: string): Promise<GetContactPropertyResponse>;
|
|
897
|
-
update(payload: UpdateContactPropertyOptions): Promise<UpdateContactPropertyResponse>;
|
|
898
|
-
remove(id: string): Promise<RemoveContactPropertyResponse>;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
type ContactSegmentsBaseOptions = {
|
|
902
|
-
contactId: string;
|
|
903
|
-
email?: never;
|
|
904
|
-
} | {
|
|
905
|
-
contactId?: never;
|
|
906
|
-
email: string;
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
type AddContactSegmentOptions = ContactSegmentsBaseOptions & {
|
|
910
|
-
segmentId: string;
|
|
911
|
-
};
|
|
912
|
-
interface AddContactSegmentResponseSuccess {
|
|
913
|
-
id: string;
|
|
914
|
-
}
|
|
915
|
-
type AddContactSegmentResponse = Response<AddContactSegmentResponseSuccess>;
|
|
916
|
-
|
|
917
|
-
interface Segment {
|
|
918
|
-
created_at: string;
|
|
919
|
-
id: string;
|
|
920
|
-
name: string;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
type ListContactSegmentsOptions = PaginationOptions & ContactSegmentsBaseOptions;
|
|
924
|
-
type ListContactSegmentsResponseSuccess = PaginatedData<Segment[]>;
|
|
925
|
-
type ListContactSegmentsResponse = Response<ListContactSegmentsResponseSuccess>;
|
|
926
|
-
|
|
927
|
-
type RemoveContactSegmentOptions = ContactSegmentsBaseOptions & {
|
|
928
|
-
segmentId: string;
|
|
929
|
-
};
|
|
930
|
-
interface RemoveContactSegmentResponseSuccess {
|
|
931
|
-
id: string;
|
|
932
|
-
deleted: boolean;
|
|
933
|
-
}
|
|
934
|
-
type RemoveContactSegmentResponse = Response<RemoveContactSegmentResponseSuccess>;
|
|
935
|
-
|
|
936
|
-
declare class ContactSegments {
|
|
937
|
-
private readonly resend;
|
|
938
|
-
constructor(resend: Resend);
|
|
939
|
-
list(options: ListContactSegmentsOptions): Promise<ListContactSegmentsResponse>;
|
|
940
|
-
add(options: AddContactSegmentOptions): Promise<AddContactSegmentResponse>;
|
|
941
|
-
remove(options: RemoveContactSegmentOptions): Promise<RemoveContactSegmentResponse>;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
interface ListContactTopicsBaseOptions {
|
|
945
|
-
id?: string;
|
|
946
|
-
email?: string;
|
|
947
|
-
}
|
|
948
|
-
type ListContactTopicsOptions = ListContactTopicsBaseOptions & PaginationOptions;
|
|
949
|
-
interface ContactTopic {
|
|
950
|
-
id: string;
|
|
951
|
-
name: string;
|
|
952
|
-
description: string | null;
|
|
953
|
-
subscription: 'opt_in' | 'opt_out';
|
|
954
|
-
}
|
|
955
|
-
type ListContactTopicsResponseSuccess = PaginatedData<ContactTopic[]>;
|
|
956
|
-
type ListContactTopicsResponse = Response<ListContactTopicsResponseSuccess>;
|
|
957
|
-
|
|
958
|
-
interface UpdateContactTopicsBaseOptions {
|
|
959
|
-
id?: string;
|
|
960
|
-
email?: string;
|
|
961
|
-
}
|
|
962
|
-
interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
|
|
963
|
-
topics: {
|
|
964
|
-
id: string;
|
|
965
|
-
subscription: 'opt_in' | 'opt_out';
|
|
966
|
-
}[];
|
|
967
|
-
}
|
|
968
|
-
interface UpdateContactTopicsResponseSuccess {
|
|
969
|
-
id: string;
|
|
970
|
-
}
|
|
971
|
-
type UpdateContactTopicsResponse = Response<UpdateContactTopicsResponseSuccess>;
|
|
972
|
-
|
|
973
|
-
declare class ContactTopics {
|
|
974
|
-
private readonly resend;
|
|
975
|
-
constructor(resend: Resend);
|
|
976
|
-
update(payload: UpdateContactTopicsOptions): Promise<UpdateContactTopicsResponse>;
|
|
977
|
-
list(options: ListContactTopicsOptions): Promise<ListContactTopicsResponse>;
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
declare class Contacts {
|
|
981
|
-
private readonly resend;
|
|
982
|
-
readonly topics: ContactTopics;
|
|
983
|
-
readonly segments: ContactSegments;
|
|
984
|
-
constructor(resend: Resend);
|
|
985
|
-
create(payload: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
|
|
986
|
-
list(options?: ListContactsOptions): Promise<ListContactsResponse>;
|
|
987
|
-
get(options: GetContactOptions): Promise<GetContactResponse>;
|
|
988
|
-
update(options: UpdateContactOptions): Promise<UpdateContactResponse>;
|
|
989
|
-
remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
declare class Domains {
|
|
993
|
-
private readonly resend;
|
|
994
|
-
constructor(resend: Resend);
|
|
995
|
-
create(payload: CreateDomainOptions, options?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
|
|
996
|
-
list(options?: ListDomainsOptions): Promise<ListDomainsResponse>;
|
|
997
|
-
get(id: string): Promise<GetDomainResponse>;
|
|
998
|
-
update(payload: UpdateDomainsOptions): Promise<UpdateDomainsResponse>;
|
|
999
|
-
remove(id: string): Promise<RemoveDomainsResponse>;
|
|
1000
|
-
verify(id: string): Promise<VerifyDomainsResponse>;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
declare class Attachments$1 {
|
|
1004
|
-
private readonly resend;
|
|
1005
|
-
constructor(resend: Resend);
|
|
1006
|
-
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
1007
|
-
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
type ListEmailsOptions = PaginationOptions;
|
|
1011
|
-
type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
|
|
1012
|
-
type ListEmailsResponseSuccess = {
|
|
1013
|
-
object: 'list';
|
|
1014
|
-
has_more: boolean;
|
|
1015
|
-
data: ListEmail[];
|
|
1016
|
-
};
|
|
1017
|
-
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1018
|
-
|
|
1019
|
-
declare class Attachments {
|
|
1020
|
-
private readonly resend;
|
|
1021
|
-
constructor(resend: Resend);
|
|
1022
|
-
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
1023
|
-
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
declare class Receiving {
|
|
1027
|
-
private readonly resend;
|
|
1028
|
-
readonly attachments: Attachments;
|
|
1029
|
-
constructor(resend: Resend);
|
|
1030
|
-
get(id: string): Promise<GetReceivingEmailResponse>;
|
|
1031
|
-
list(options?: ListReceivingEmailsOptions): Promise<ListReceivingEmailsResponse>;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
declare class Emails {
|
|
1035
|
-
private readonly resend;
|
|
1036
|
-
readonly attachments: Attachments$1;
|
|
1037
|
-
readonly receiving: Receiving;
|
|
1038
|
-
constructor(resend: Resend);
|
|
1039
|
-
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1040
|
-
create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1041
|
-
get(id: string): Promise<GetEmailResponse>;
|
|
1042
|
-
list(options?: ListEmailsOptions): Promise<ListEmailsResponse>;
|
|
1043
|
-
update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
|
|
1044
|
-
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
interface CreateSegmentOptions {
|
|
1048
|
-
name: string;
|
|
1049
|
-
}
|
|
1050
|
-
interface CreateSegmentRequestOptions extends PostOptions {
|
|
1051
|
-
}
|
|
1052
|
-
interface CreateSegmentResponseSuccess extends Pick<Segment, 'name' | 'id'> {
|
|
1053
|
-
object: 'segment';
|
|
1054
|
-
}
|
|
1055
|
-
type CreateSegmentResponse = Response<CreateSegmentResponseSuccess>;
|
|
1056
|
-
|
|
1057
|
-
interface GetSegmentResponseSuccess extends Pick<Segment, 'id' | 'name' | 'created_at'> {
|
|
1058
|
-
object: 'segment';
|
|
1059
|
-
}
|
|
1060
|
-
type GetSegmentResponse = Response<GetSegmentResponseSuccess>;
|
|
1061
|
-
|
|
1062
|
-
type ListSegmentsOptions = PaginationOptions;
|
|
1063
|
-
type ListSegmentsResponseSuccess = {
|
|
1064
|
-
object: 'list';
|
|
1065
|
-
data: Segment[];
|
|
1066
|
-
has_more: boolean;
|
|
1067
|
-
};
|
|
1068
|
-
type ListSegmentsResponse = Response<ListSegmentsResponseSuccess>;
|
|
1069
|
-
|
|
1070
|
-
interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
1071
|
-
object: 'segment';
|
|
1072
|
-
deleted: boolean;
|
|
1073
|
-
}
|
|
1074
|
-
type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
|
|
1075
|
-
|
|
1076
|
-
declare class Segments {
|
|
1077
|
-
private readonly resend;
|
|
1078
|
-
constructor(resend: Resend);
|
|
1079
|
-
create(payload: CreateSegmentOptions, options?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
|
|
1080
|
-
list(options?: ListSegmentsOptions): Promise<ListSegmentsResponse>;
|
|
1081
|
-
get(id: string): Promise<GetSegmentResponse>;
|
|
1082
|
-
remove(id: string): Promise<RemoveSegmentResponse>;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
interface Template {
|
|
1086
|
-
id: string;
|
|
1087
|
-
name: string;
|
|
1088
|
-
subject: string | null;
|
|
1089
|
-
html: string;
|
|
1090
|
-
text: string | null;
|
|
1091
|
-
status: 'draft' | 'published';
|
|
1092
|
-
variables: TemplateVariable[] | null;
|
|
1093
|
-
alias: string | null;
|
|
1094
|
-
from: string | null;
|
|
1095
|
-
reply_to: string[] | null;
|
|
1096
|
-
published_at: string | null;
|
|
1097
|
-
created_at: string;
|
|
1098
|
-
updated_at: string;
|
|
1099
|
-
has_unpublished_versions: boolean;
|
|
1100
|
-
current_version_id: string;
|
|
1101
|
-
}
|
|
1102
|
-
interface TemplateVariable {
|
|
1103
|
-
key: string;
|
|
1104
|
-
fallback_value: string | number | null;
|
|
1105
|
-
type: 'string' | 'number';
|
|
1106
|
-
created_at: string;
|
|
1107
|
-
updated_at: string;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
type TemplateContentCreationOptions = RequireAtLeastOne<{
|
|
1111
|
-
html: string;
|
|
1112
|
-
react: React.ReactNode;
|
|
1113
|
-
}>;
|
|
1114
|
-
type TemplateVariableCreationOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
|
|
1115
|
-
type: 'string';
|
|
1116
|
-
fallbackValue?: string | null;
|
|
1117
|
-
} | {
|
|
1118
|
-
type: 'number';
|
|
1119
|
-
fallbackValue?: number | null;
|
|
1120
|
-
});
|
|
1121
|
-
type TemplateOptionalFieldsForCreation = Partial<Pick<Template, 'subject' | 'text' | 'alias' | 'from'>> & {
|
|
1122
|
-
replyTo?: string[] | string;
|
|
1123
|
-
variables?: TemplateVariableCreationOptions[];
|
|
1124
|
-
};
|
|
1125
|
-
type CreateTemplateOptions = Pick<Template, 'name'> & TemplateOptionalFieldsForCreation & TemplateContentCreationOptions;
|
|
1126
|
-
interface CreateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1127
|
-
object: 'template';
|
|
1128
|
-
}
|
|
1129
|
-
type CreateTemplateResponse = Response<CreateTemplateResponseSuccess>;
|
|
1130
|
-
|
|
1131
|
-
interface DuplicateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1132
|
-
object: 'template';
|
|
1133
|
-
}
|
|
1134
|
-
type DuplicateTemplateResponse = Response<DuplicateTemplateResponseSuccess>;
|
|
1135
|
-
|
|
1136
|
-
interface PublishTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1137
|
-
object: 'template';
|
|
1138
|
-
}
|
|
1139
|
-
type PublishTemplateResponse = Response<PublishTemplateResponseSuccess>;
|
|
1140
|
-
|
|
1141
|
-
declare class ChainableTemplateResult<T extends CreateTemplateResponse | DuplicateTemplateResponse> implements PromiseLike<T> {
|
|
1142
|
-
private readonly promise;
|
|
1143
|
-
private readonly publishFn;
|
|
1144
|
-
constructor(promise: Promise<T>, publishFn: (id: string) => Promise<PublishTemplateResponse>);
|
|
1145
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
1146
|
-
publish(): Promise<PublishTemplateResponse>;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
interface GetTemplateResponseSuccess extends Template {
|
|
1150
|
-
object: 'template';
|
|
1151
|
-
}
|
|
1152
|
-
type GetTemplateResponse = Response<GetTemplateResponseSuccess>;
|
|
1153
|
-
|
|
1154
|
-
interface TemplateListItem extends Pick<Template, 'id' | 'name' | 'created_at' | 'updated_at' | 'status' | 'published_at' | 'alias'> {
|
|
1155
|
-
}
|
|
1156
|
-
interface ListTemplatesResponseSuccess {
|
|
1157
|
-
object: 'list';
|
|
1158
|
-
data: TemplateListItem[];
|
|
1159
|
-
has_more: boolean;
|
|
1160
|
-
}
|
|
1161
|
-
type ListTemplatesResponse = Response<ListTemplatesResponseSuccess>;
|
|
1162
|
-
|
|
1163
|
-
interface RemoveTemplateResponseSuccess {
|
|
1164
|
-
object: 'template';
|
|
1165
|
-
id: string;
|
|
1166
|
-
deleted: boolean;
|
|
1167
|
-
}
|
|
1168
|
-
type RemoveTemplateResponse = Response<RemoveTemplateResponseSuccess>;
|
|
1169
|
-
|
|
1170
|
-
type TemplateVariableUpdateOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
|
|
1171
|
-
type: 'string';
|
|
1172
|
-
fallbackValue?: string | null;
|
|
1173
|
-
} | {
|
|
1174
|
-
type: 'number';
|
|
1175
|
-
fallbackValue?: number | null;
|
|
1176
|
-
});
|
|
1177
|
-
interface UpdateTemplateOptions extends Partial<Pick<Template, 'name' | 'subject' | 'html' | 'text' | 'from' | 'alias'>> {
|
|
1178
|
-
variables?: TemplateVariableUpdateOptions[];
|
|
1179
|
-
replyTo?: string[] | string;
|
|
1180
|
-
}
|
|
1181
|
-
interface UpdateTemplateResponseSuccess extends Pick<Template, 'id'> {
|
|
1182
|
-
object: 'template';
|
|
1183
|
-
}
|
|
1184
|
-
type UpdateTemplateResponse = Response<UpdateTemplateResponseSuccess>;
|
|
1185
|
-
|
|
1186
|
-
declare class Templates {
|
|
1187
|
-
private readonly resend;
|
|
1188
|
-
private renderAsync?;
|
|
1189
|
-
constructor(resend: Resend);
|
|
1190
|
-
create(payload: CreateTemplateOptions): ChainableTemplateResult<CreateTemplateResponse>;
|
|
1191
|
-
private performCreate;
|
|
1192
|
-
remove(identifier: string): Promise<RemoveTemplateResponse>;
|
|
1193
|
-
get(identifier: string): Promise<GetTemplateResponse>;
|
|
1194
|
-
list(options?: PaginationOptions): Promise<ListTemplatesResponse>;
|
|
1195
|
-
duplicate(identifier: string): ChainableTemplateResult<DuplicateTemplateResponse>;
|
|
1196
|
-
publish(identifier: string): Promise<PublishTemplateResponse>;
|
|
1197
|
-
update(identifier: string, payload: UpdateTemplateOptions): Promise<UpdateTemplateResponse>;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
interface Topic {
|
|
1201
|
-
id: string;
|
|
1202
|
-
name: string;
|
|
1203
|
-
description?: string;
|
|
1204
|
-
defaultSubscription: 'opt_in' | 'opt_out';
|
|
1205
|
-
created_at: string;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
interface CreateTopicOptions {
|
|
1209
|
-
name: string;
|
|
1210
|
-
description?: string;
|
|
1211
|
-
defaultSubscription: 'opt_in' | 'opt_out';
|
|
1212
|
-
}
|
|
1213
|
-
type CreateTopicResponseSuccess = Pick<Topic, 'id'>;
|
|
1214
|
-
type CreateTopicResponse = Response<CreateTopicResponseSuccess>;
|
|
1215
|
-
|
|
1216
|
-
type GetTopicResponseSuccess = Topic;
|
|
1217
|
-
type GetTopicResponse = Response<GetTopicResponseSuccess>;
|
|
1218
|
-
|
|
1219
|
-
interface ListTopicsResponseSuccess {
|
|
1220
|
-
data: Topic[];
|
|
1221
|
-
}
|
|
1222
|
-
type ListTopicsResponse = Response<ListTopicsResponseSuccess>;
|
|
1223
|
-
|
|
1224
|
-
type RemoveTopicResponseSuccess = Pick<Topic, 'id'> & {
|
|
1225
|
-
object: 'topic';
|
|
1226
|
-
deleted: boolean;
|
|
1227
|
-
};
|
|
1228
|
-
type RemoveTopicResponse = Response<RemoveTopicResponseSuccess>;
|
|
1229
|
-
|
|
1230
|
-
interface UpdateTopicOptions {
|
|
1231
|
-
id: string;
|
|
1232
|
-
name?: string;
|
|
1233
|
-
description?: string;
|
|
1234
|
-
}
|
|
1235
|
-
type UpdateTopicResponseSuccess = Pick<Topic, 'id'>;
|
|
1236
|
-
type UpdateTopicResponse = Response<UpdateTopicResponseSuccess>;
|
|
1237
|
-
|
|
1238
|
-
declare class Topics {
|
|
1239
|
-
private readonly resend;
|
|
1240
|
-
constructor(resend: Resend);
|
|
1241
|
-
create(payload: CreateTopicOptions): Promise<CreateTopicResponse>;
|
|
1242
|
-
list(): Promise<ListTopicsResponse>;
|
|
1243
|
-
get(id: string): Promise<GetTopicResponse>;
|
|
1244
|
-
update(payload: UpdateTopicOptions): Promise<UpdateTopicResponse>;
|
|
1245
|
-
remove(id: string): Promise<RemoveTopicResponse>;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
|
|
1249
|
-
|
|
1250
|
-
interface CreateWebhookOptions {
|
|
1251
|
-
endpoint: string;
|
|
1252
|
-
events: WebhookEvent[];
|
|
1253
|
-
}
|
|
1254
|
-
interface CreateWebhookRequestOptions extends PostOptions {
|
|
1255
|
-
}
|
|
1256
|
-
interface CreateWebhookResponseSuccess {
|
|
1257
|
-
object: 'webhook';
|
|
1258
|
-
id: string;
|
|
1259
|
-
signing_secret: string;
|
|
1260
|
-
}
|
|
1261
|
-
type CreateWebhookResponse = Response<CreateWebhookResponseSuccess>;
|
|
1262
|
-
|
|
1263
|
-
interface GetWebhookResponseSuccess {
|
|
1264
|
-
object: 'webhook';
|
|
1265
|
-
id: string;
|
|
1266
|
-
created_at: string;
|
|
1267
|
-
status: 'enabled' | 'disabled';
|
|
1268
|
-
endpoint: string;
|
|
1269
|
-
events: WebhookEvent[] | null;
|
|
1270
|
-
signing_secret: string;
|
|
1271
|
-
}
|
|
1272
|
-
type GetWebhookResponse = Response<GetWebhookResponseSuccess>;
|
|
1273
|
-
|
|
1274
|
-
type ListWebhooksOptions = PaginationOptions;
|
|
1275
|
-
interface Webhook {
|
|
1276
|
-
id: string;
|
|
1277
|
-
endpoint: string;
|
|
1278
|
-
created_at: string;
|
|
1279
|
-
status: 'enabled' | 'disabled';
|
|
1280
|
-
events: WebhookEvent[] | null;
|
|
1281
|
-
}
|
|
1282
|
-
type ListWebhooksResponseSuccess = {
|
|
1283
|
-
object: 'list';
|
|
1284
|
-
has_more: boolean;
|
|
1285
|
-
data: Webhook[];
|
|
1286
|
-
};
|
|
1287
|
-
type ListWebhooksResponse = Response<ListWebhooksResponseSuccess>;
|
|
1288
|
-
|
|
1289
|
-
type RemoveWebhookResponseSuccess = Pick<Webhook, 'id'> & {
|
|
1290
|
-
object: 'webhook';
|
|
1291
|
-
deleted: boolean;
|
|
1292
|
-
};
|
|
1293
|
-
type RemoveWebhookResponse = Response<RemoveWebhookResponseSuccess>;
|
|
1294
|
-
|
|
1295
|
-
interface UpdateWebhookOptions {
|
|
1296
|
-
endpoint?: string;
|
|
1297
|
-
events?: WebhookEvent[];
|
|
1298
|
-
status?: 'enabled' | 'disabled';
|
|
1299
|
-
}
|
|
1300
|
-
interface UpdateWebhookResponseSuccess {
|
|
1301
|
-
object: 'webhook';
|
|
1302
|
-
id: string;
|
|
1303
|
-
}
|
|
1304
|
-
type UpdateWebhookResponse = Response<UpdateWebhookResponseSuccess>;
|
|
1305
|
-
|
|
1306
|
-
interface Headers {
|
|
1307
|
-
id: string;
|
|
1308
|
-
timestamp: string;
|
|
1309
|
-
signature: string;
|
|
1310
|
-
}
|
|
1311
|
-
interface VerifyWebhookOptions {
|
|
1312
|
-
payload: string;
|
|
1313
|
-
headers: Headers;
|
|
1314
|
-
webhookSecret: string;
|
|
1315
|
-
}
|
|
1316
|
-
declare class Webhooks {
|
|
1317
|
-
private readonly resend;
|
|
1318
|
-
constructor(resend: Resend);
|
|
1319
|
-
create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
|
|
1320
|
-
get(id: string): Promise<GetWebhookResponse>;
|
|
1321
|
-
list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
|
|
1322
|
-
update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
|
|
1323
|
-
remove(id: string): Promise<RemoveWebhookResponse>;
|
|
1324
|
-
verify(payload: VerifyWebhookOptions): unknown;
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
declare class Resend {
|
|
1328
|
-
readonly key?: string | undefined;
|
|
1329
|
-
private readonly headers;
|
|
1330
|
-
readonly apiKeys: ApiKeys;
|
|
1331
|
-
readonly segments: Segments;
|
|
1332
|
-
/**
|
|
1333
|
-
* @deprecated Use segments instead
|
|
1334
|
-
*/
|
|
1335
|
-
readonly audiences: Segments;
|
|
1336
|
-
readonly batch: Batch;
|
|
1337
|
-
readonly broadcasts: Broadcasts;
|
|
1338
|
-
readonly contacts: Contacts;
|
|
1339
|
-
readonly contactProperties: ContactProperties;
|
|
1340
|
-
readonly domains: Domains;
|
|
1341
|
-
readonly emails: Emails;
|
|
1342
|
-
readonly webhooks: Webhooks;
|
|
1343
|
-
readonly templates: Templates;
|
|
1344
|
-
readonly topics: Topics;
|
|
1345
|
-
constructor(key?: string | undefined);
|
|
1346
|
-
fetchRequest<T>(path: string, options?: {}): Promise<Response<T>>;
|
|
1347
|
-
post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<Response<T>>;
|
|
1348
|
-
get<T>(path: string, options?: GetOptions): Promise<Response<T>>;
|
|
1349
|
-
put<T>(path: string, entity: unknown, options?: PutOptions): Promise<Response<T>>;
|
|
1350
|
-
patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<Response<T>>;
|
|
1351
|
-
delete<T>(path: string, query?: unknown): Promise<Response<T>>;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
export { type ApiKey, type Attachment$1 as Attachment, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateBatchOptions, type CreateBatchRequestOptions, type CreateBatchResponse, type CreateBatchSuccessResponse, type CreateBroadcastOptions, type CreateBroadcastRequestOptions, type CreateBroadcastResponse, type CreateBroadcastResponseSuccess, type CreateContactOptions, type CreateContactRequestOptions, type CreateContactResponse, type CreateContactResponseSuccess, type CreateDomainOptions, type CreateDomainRequestOptions, type CreateDomainResponse, type CreateDomainResponseSuccess, type CreateEmailOptions, type CreateEmailRequestOptions, type CreateEmailResponse, type CreateEmailResponseSuccess, type CreateSegmentOptions, type CreateSegmentRequestOptions, type CreateSegmentResponse, type CreateSegmentResponseSuccess, type CreateWebhookOptions, type CreateWebhookRequestOptions, type CreateWebhookResponse, type CreateWebhookResponseSuccess, type Domain, type DomainApiOptions, type DomainDkimRecord, type DomainNameservers, type DomainRecords, type DomainRegion, type DomainSpfRecord, type DomainStatus, type EmailApiAttachment, type EmailApiOptions, type ErrorResponse, type GetAttachmentOptions, type GetAttachmentResponse, type GetAttachmentResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetOptions, type GetReceivingEmailResponse, type GetReceivingEmailResponseSuccess, type GetSegmentResponse, type GetSegmentResponseSuccess, type GetWebhookResponse, type GetWebhookResponseSuccess, type IdempotentRequest, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsApiResponse, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAttachmentsResponseSuccess, type ListBroadcastsOptions, type ListBroadcastsResponse, type ListBroadcastsResponseSuccess, type ListContactsOptions, type ListContactsResponse, type ListContactsResponseSuccess, type ListDomainsOptions, type ListDomainsResponse, type ListDomainsResponseSuccess, type ListReceivingEmail, type ListReceivingEmailsOptions, type ListReceivingEmailsResponse, type ListReceivingEmailsResponseSuccess, type ListSegmentsOptions, type ListSegmentsResponse, type ListSegmentsResponseSuccess, type ListWebhooksOptions, type ListWebhooksResponse, type ListWebhooksResponseSuccess, type PaginatedData, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type ReceivingRecord, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RemoveSegmentResponse, type RemoveSegmentResponseSuccess, type RemoveWebhookResponse, type RemoveWebhookResponseSuccess, type RequireAtLeastOne, Resend, type Segment, type SelectingField, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateBroadcastOptions, type UpdateBroadcastResponse, type UpdateBroadcastResponseSuccess, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type UpdateEmailOptions, type UpdateEmailResponse, type UpdateEmailResponseSuccess, type UpdateWebhookOptions, type UpdateWebhookResponse, type UpdateWebhookResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess, type Webhook, type WebhookEvent };
|