@depup/resend 6.9.4-depup.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.
@@ -0,0 +1,1751 @@
1
+ import * as React$1 from "react";
2
+
3
+ //#region src/api-keys/interfaces/api-key.d.ts
4
+ interface ApiKey {
5
+ created_at: string;
6
+ id: string;
7
+ last_used_at: string | null;
8
+ name: string;
9
+ }
10
+ //#endregion
11
+ //#region src/common/interfaces/attachment.interface.d.ts
12
+ /**
13
+ * Attachment returned by the signed-URL endpoints:
14
+ * - GET /emails/{id}/attachments
15
+ * - GET /emails/{id}/attachments/{id}
16
+ * - GET /emails/receiving/{id}/attachments
17
+ * - GET /emails/receiving/{id}/attachments/{id}
18
+ *
19
+ * Not to be confused with InboundAttachment, which is the raw metadata
20
+ * embedded inside GET /inbounds/{id} — no signed URL, nullable DB columns.
21
+ */
22
+ interface AttachmentData {
23
+ id: string;
24
+ filename?: string;
25
+ size: number;
26
+ content_type: string;
27
+ content_disposition: 'inline' | 'attachment';
28
+ content_id?: string;
29
+ download_url: string;
30
+ expires_at: string;
31
+ }
32
+ //#endregion
33
+ //#region src/domains/interfaces/domain.d.ts
34
+ type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
35
+ type DomainCapabilityStatus = 'enabled' | 'disabled';
36
+ interface DomainCapabilities {
37
+ sending: DomainCapabilityStatus;
38
+ receiving: DomainCapabilityStatus;
39
+ }
40
+ type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
41
+ type DomainStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
42
+ type DomainRecords = DomainSpfRecord | DomainDkimRecord | ReceivingRecord;
43
+ interface DomainSpfRecord {
44
+ record: 'SPF';
45
+ name: string;
46
+ value: string;
47
+ type: 'MX' | 'TXT';
48
+ ttl: string;
49
+ status: DomainStatus;
50
+ routing_policy?: string;
51
+ priority?: number;
52
+ proxy_status?: 'enable' | 'disable';
53
+ }
54
+ interface DomainDkimRecord {
55
+ record: 'DKIM';
56
+ name: string;
57
+ value: string;
58
+ type: 'CNAME' | 'TXT';
59
+ ttl: string;
60
+ status: DomainStatus;
61
+ routing_policy?: string;
62
+ priority?: number;
63
+ proxy_status?: 'enable' | 'disable';
64
+ }
65
+ interface ReceivingRecord {
66
+ record: 'Receiving';
67
+ name: string;
68
+ value: string;
69
+ type: 'MX';
70
+ ttl: string;
71
+ status: DomainStatus;
72
+ priority: number;
73
+ }
74
+ interface Domain {
75
+ id: string;
76
+ name: string;
77
+ status: DomainStatus;
78
+ created_at: string;
79
+ region: DomainRegion;
80
+ capabilities: DomainCapabilities;
81
+ }
82
+ //#endregion
83
+ //#region src/common/interfaces/domain-api-options.interface.d.ts
84
+ interface DomainApiOptions {
85
+ name: string;
86
+ region?: string;
87
+ custom_return_path?: string;
88
+ capabilities?: Partial<DomainCapabilities>;
89
+ open_tracking?: boolean;
90
+ click_tracking?: boolean;
91
+ tls?: 'enforced' | 'opportunistic';
92
+ }
93
+ //#endregion
94
+ //#region src/interfaces.d.ts
95
+ type RESEND_ERROR_CODE_KEY = 'invalid_idempotency_key' | 'validation_error' | 'missing_api_key' | 'restricted_api_key' | 'invalid_api_key' | 'not_found' | 'method_not_allowed' | 'invalid_idempotent_request' | 'concurrent_idempotent_requests' | 'invalid_attachment' | 'invalid_from_address' | 'invalid_access' | 'invalid_parameter' | 'invalid_region' | 'missing_required_field' | 'monthly_quota_exceeded' | 'daily_quota_exceeded' | 'rate_limit_exceeded' | 'security_error' | 'application_error' | 'internal_server_error';
96
+ type Response<T> = ({
97
+ data: T;
98
+ error: null;
99
+ } | {
100
+ error: ErrorResponse;
101
+ data: null;
102
+ }) & {
103
+ headers: Record<string, string> | null;
104
+ };
105
+ type ErrorResponse = {
106
+ message: string;
107
+ statusCode: number | null;
108
+ name: RESEND_ERROR_CODE_KEY;
109
+ };
110
+ type Tag$1 = {
111
+ name: string;
112
+ value: string;
113
+ };
114
+ //#endregion
115
+ //#region src/common/interfaces/email-api-options.interface.d.ts
116
+ interface EmailApiAttachment {
117
+ content?: string | Buffer;
118
+ filename?: string | false | undefined;
119
+ path?: string;
120
+ content_type?: string;
121
+ content_id?: string;
122
+ }
123
+ interface EmailApiOptions {
124
+ from?: string;
125
+ to: string | string[];
126
+ subject?: string;
127
+ region?: string;
128
+ headers?: Record<string, string>;
129
+ html?: string;
130
+ text?: string;
131
+ bcc?: string | string[];
132
+ cc?: string | string[];
133
+ reply_to?: string | string[];
134
+ topic_id?: string | null;
135
+ scheduled_at?: string;
136
+ tags?: Tag$1[];
137
+ attachments?: EmailApiAttachment[];
138
+ template?: {
139
+ id: string;
140
+ variables?: Record<string, string | number>;
141
+ };
142
+ }
143
+ //#endregion
144
+ //#region src/common/interfaces/get-option.interface.d.ts
145
+ interface GetOptions {
146
+ query?: Record<string, unknown>;
147
+ headers?: HeadersInit;
148
+ }
149
+ //#endregion
150
+ //#region src/common/interfaces/idempotent-request.interface.d.ts
151
+ interface IdempotentRequest {
152
+ /**
153
+ * Unique key that ensures the same operation is not processed multiple times.
154
+ * Allows for safe retries without duplicating operations.
155
+ * If provided, will be sent as the `Idempotency-Key` header.
156
+ */
157
+ idempotencyKey?: string;
158
+ }
159
+ //#endregion
160
+ //#region src/common/interfaces/pagination-options.interface.d.ts
161
+ type PaginationOptions = {
162
+ /**
163
+ * Maximum number of items to return (1-100, default: 20)
164
+ */
165
+ limit?: number;
166
+ } & ({
167
+ /**
168
+ * Get items after this cursor (cannot be used with 'before')
169
+ */
170
+ after?: string;
171
+ before?: never;
172
+ } | {
173
+ /**
174
+ * Get items before this cursor (cannot be used with 'after')
175
+ */
176
+ before?: string;
177
+ after?: never;
178
+ });
179
+ type PaginatedData<Data> = {
180
+ object: 'list';
181
+ data: Data;
182
+ has_more: boolean;
183
+ };
184
+ //#endregion
185
+ //#region src/common/interfaces/patch-option.interface.d.ts
186
+ interface PatchOptions {
187
+ query?: {
188
+ [key: string]: unknown;
189
+ };
190
+ headers?: HeadersInit;
191
+ }
192
+ //#endregion
193
+ //#region src/common/interfaces/post-option.interface.d.ts
194
+ interface PostOptions {
195
+ query?: {
196
+ [key: string]: unknown;
197
+ };
198
+ headers?: HeadersInit;
199
+ }
200
+ //#endregion
201
+ //#region src/common/interfaces/put-option.interface.d.ts
202
+ interface PutOptions {
203
+ query?: {
204
+ [key: string]: unknown;
205
+ };
206
+ headers?: HeadersInit;
207
+ }
208
+ //#endregion
209
+ //#region src/common/interfaces/require-at-least-one.d.ts
210
+ type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>> }[keyof T];
211
+ //#endregion
212
+ //#region src/api-keys/interfaces/create-api-key-options.interface.d.ts
213
+ interface CreateApiKeyOptions {
214
+ name: string;
215
+ permission?: 'full_access' | 'sending_access';
216
+ domain_id?: string;
217
+ }
218
+ interface CreateApiKeyRequestOptions extends PostOptions {}
219
+ interface CreateApiKeyResponseSuccess {
220
+ token: string;
221
+ id: string;
222
+ }
223
+ type CreateApiKeyResponse = Response<CreateApiKeyResponseSuccess>;
224
+ //#endregion
225
+ //#region src/api-keys/interfaces/list-api-keys.interface.d.ts
226
+ type ListApiKeysOptions = PaginationOptions;
227
+ type ListApiKeysResponseSuccess = {
228
+ object: 'list';
229
+ has_more: boolean;
230
+ data: Pick<ApiKey, 'name' | 'id' | 'created_at' | 'last_used_at'>[];
231
+ };
232
+ type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
233
+ //#endregion
234
+ //#region src/api-keys/interfaces/remove-api-keys.interface.d.ts
235
+ type RemoveApiKeyResponseSuccess = {};
236
+ type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
237
+ //#endregion
238
+ //#region src/emails/interfaces/create-email-options.interface.d.ts
239
+ interface EmailRenderOptions$1 {
240
+ /**
241
+ * The React component used to write the message.
242
+ *
243
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
244
+ */
245
+ react: React$1.ReactNode;
246
+ /**
247
+ * The HTML version of the message.
248
+ *
249
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
250
+ */
251
+ html: string;
252
+ /**
253
+ * The plain text version of the message.
254
+ *
255
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
256
+ */
257
+ text: string;
258
+ }
259
+ interface EmailTemplateOptions {
260
+ template: {
261
+ id: string;
262
+ variables?: Record<string, string | number>;
263
+ };
264
+ }
265
+ interface CreateEmailBaseOptionsWithTemplate extends Omit<CreateEmailBaseOptions, 'from' | 'subject'> {
266
+ from?: string;
267
+ subject?: string;
268
+ }
269
+ interface CreateEmailBaseOptions {
270
+ /**
271
+ * Filename and content of attachments (max 40mb per email)
272
+ *
273
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
274
+ */
275
+ attachments?: Attachment[];
276
+ /**
277
+ * Blind carbon copy recipient email address. For multiple addresses, send as an array of strings.
278
+ *
279
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
280
+ */
281
+ bcc?: string | string[];
282
+ /**
283
+ * Carbon copy recipient email address. For multiple addresses, send as an array of strings.
284
+ *
285
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
286
+ */
287
+ cc?: string | string[];
288
+ /**
289
+ * Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
290
+ *
291
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
292
+ */
293
+ from: string;
294
+ /**
295
+ * Custom headers to add to the email.
296
+ *
297
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
298
+ */
299
+ headers?: Record<string, string>;
300
+ /**
301
+ * Reply-to email address. For multiple addresses, send as an array of strings.
302
+ *
303
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
304
+ */
305
+ replyTo?: string | string[];
306
+ /**
307
+ * Email subject.
308
+ *
309
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
310
+ */
311
+ subject: string;
312
+ /**
313
+ * Email tags
314
+ *
315
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
316
+ */
317
+ tags?: Tag[];
318
+ /**
319
+ * Recipient email address. For multiple addresses, send as an array of strings. Max 50.
320
+ *
321
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
322
+ */
323
+ to: string | string[];
324
+ /**
325
+ * The id of the topic you want to send to
326
+ *
327
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
328
+ */
329
+ topicId?: string | null;
330
+ /**
331
+ * Schedule email to be sent later.
332
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
333
+ *
334
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
335
+ */
336
+ scheduledAt?: string;
337
+ }
338
+ type CreateEmailOptions = ((RequireAtLeastOne<EmailRenderOptions$1> & CreateEmailBaseOptions) & {
339
+ template?: never;
340
+ }) | ((EmailTemplateOptions & CreateEmailBaseOptionsWithTemplate) & {
341
+ react?: never;
342
+ html?: never;
343
+ text?: never;
344
+ });
345
+ interface CreateEmailRequestOptions extends PostOptions, IdempotentRequest {}
346
+ interface CreateEmailResponseSuccess {
347
+ /** The ID of the newly created email. */
348
+ id: string;
349
+ }
350
+ type CreateEmailResponse = Response<CreateEmailResponseSuccess>;
351
+ interface Attachment {
352
+ /** Content of an attached file. */
353
+ content?: string | Buffer;
354
+ /** Name of attached file. */
355
+ filename?: string | false | undefined;
356
+ /** Path where the attachment file is hosted */
357
+ path?: string;
358
+ /** Optional content type for the attachment, if not set will be derived from the filename property */
359
+ contentType?: string;
360
+ /**
361
+ * Optional content ID for the attachment, to be used as a reference in the HTML content.
362
+ * If set, this attachment will be sent as an inline attachment and you can reference it in the HTML content using the `cid:` prefix.
363
+ */
364
+ contentId?: string;
365
+ }
366
+ type Tag = {
367
+ /**
368
+ * 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.
369
+ */
370
+ name: string;
371
+ /**
372
+ * 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.
373
+ */
374
+ value: string;
375
+ };
376
+ //#endregion
377
+ //#region src/batch/interfaces/create-batch-options.interface.d.ts
378
+ /**
379
+ * Email options for batch sending. Same as CreateEmailOptions but without attachments
380
+ * and scheduledAt, as these are not supported in the batch API.
381
+ *
382
+ * @link https://resend.com/docs/dashboard/emails/batch-sending#limitations
383
+ */
384
+ type CreateBatchEmailOptions = Omit<CreateEmailOptions, 'attachments' | 'scheduledAt'>;
385
+ type CreateBatchOptions = CreateBatchEmailOptions[];
386
+ interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
387
+ /**
388
+ * @default 'strict'
389
+ */
390
+ batchValidation?: 'strict' | 'permissive';
391
+ }
392
+ type CreateBatchSuccessResponse<Options extends CreateBatchRequestOptions = CreateBatchRequestOptions> = {
393
+ data: {
394
+ /** The ID of the newly created email. */id: string;
395
+ }[];
396
+ } & (Options['batchValidation'] extends 'permissive' ? {
397
+ /**
398
+ * Only present when header "x-batch-validation" is set to 'permissive'.
399
+ */
400
+ errors: {
401
+ /**
402
+ * The index of the failed email in the batch
403
+ */
404
+ index: number;
405
+ /**
406
+ * The error message for the failed email
407
+ */
408
+ message: string;
409
+ }[];
410
+ } : Record<string, never>);
411
+ type CreateBatchResponse<Options extends CreateBatchRequestOptions> = Response<CreateBatchSuccessResponse<Options>>;
412
+ //#endregion
413
+ //#region src/broadcasts/interfaces/broadcast.d.ts
414
+ interface Broadcast {
415
+ id: string;
416
+ name: string;
417
+ segment_id: string | null;
418
+ audience_id: string | null;
419
+ from: string | null;
420
+ subject: string | null;
421
+ reply_to: string[] | null;
422
+ preview_text: string | null;
423
+ status: 'draft' | 'sent' | 'queued';
424
+ created_at: string;
425
+ scheduled_at: string | null;
426
+ sent_at: string | null;
427
+ topic_id?: string | null;
428
+ html: string | null;
429
+ text: string | null;
430
+ }
431
+ //#endregion
432
+ //#region src/broadcasts/interfaces/create-broadcast-options.interface.d.ts
433
+ interface EmailRenderOptions {
434
+ /**
435
+ * The React component used to write the message.
436
+ *
437
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
438
+ */
439
+ react: React$1.ReactNode;
440
+ /**
441
+ * The HTML version of the message.
442
+ *
443
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
444
+ */
445
+ html: string;
446
+ /**
447
+ * The plain text version of the message.
448
+ *
449
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
450
+ */
451
+ text: string;
452
+ }
453
+ interface SegmentOptions {
454
+ /**
455
+ * The id of the segment you want to send to
456
+ *
457
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
458
+ */
459
+ segmentId: string;
460
+ /**
461
+ * @deprecated Use segmentId instead
462
+ */
463
+ audienceId: string;
464
+ }
465
+ type SendBroadcastOnCreationOptions = {
466
+ /**
467
+ * Whether to send the broadcast immediately or keep it as a draft.
468
+ * If not provided or set to false, the broadcast will be created as a draft.
469
+ *
470
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
471
+ */
472
+ send: true;
473
+ /**
474
+ * Schedule time to send the broadcast. Can only be used if `send` is true.
475
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
476
+ * or relative time (eg: in 2 days).
477
+ *
478
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
479
+ */
480
+ scheduledAt?: string;
481
+ } | {
482
+ /**
483
+ * Whether to send the broadcast immediately or keep it as a draft.
484
+ * If not provided or set to false, the broadcast will be created as a draft.
485
+ *
486
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
487
+ */
488
+ send?: false;
489
+ /**
490
+ * Schedule time to send the broadcast. Can only be used if `send` is true.
491
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
492
+ * or relative time (eg: in 2 days).
493
+ *
494
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
495
+ */
496
+ scheduledAt?: never;
497
+ };
498
+ interface CreateBroadcastBaseOptions {
499
+ /**
500
+ * The name of the broadcast
501
+ *
502
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
503
+ */
504
+ name?: string;
505
+ /**
506
+ * A short snippet of text displayed as a preview in recipients' inboxes, often shown below or beside the subject line.
507
+ *
508
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
509
+ */
510
+ previewText?: string;
511
+ /**
512
+ * Sender email address. To include a friendly name, use the format `"Your Name <sender@domain.com>"`
513
+ *
514
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
515
+ */
516
+ from: string;
517
+ /**
518
+ * Reply-to email address. For multiple addresses, send as an array of strings.
519
+ *
520
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
521
+ */
522
+ replyTo?: string | string[];
523
+ /**
524
+ * Email subject.
525
+ *
526
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
527
+ */
528
+ subject: string;
529
+ /**
530
+ * The id of the topic you want to send to
531
+ *
532
+ * @link https://resend.com/docs/api-reference/broadcasts/create#body-parameters
533
+ */
534
+ topicId?: string | null;
535
+ }
536
+ type CreateBroadcastOptions = RequireAtLeastOne<EmailRenderOptions> & RequireAtLeastOne<SegmentOptions> & CreateBroadcastBaseOptions & SendBroadcastOnCreationOptions;
537
+ interface CreateBroadcastRequestOptions extends PostOptions {}
538
+ interface CreateBroadcastResponseSuccess {
539
+ /** The ID of the newly sent broadcasts. */
540
+ id: string;
541
+ }
542
+ type CreateBroadcastResponse = Response<CreateBroadcastResponseSuccess>;
543
+ //#endregion
544
+ //#region src/broadcasts/interfaces/get-broadcast.interface.d.ts
545
+ interface GetBroadcastResponseSuccess extends Broadcast {
546
+ object: 'broadcast';
547
+ }
548
+ type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
549
+ //#endregion
550
+ //#region src/broadcasts/interfaces/list-broadcasts.interface.d.ts
551
+ type ListBroadcastsOptions = PaginationOptions;
552
+ type ListBroadcastsResponseSuccess = {
553
+ object: 'list';
554
+ has_more: boolean;
555
+ data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'segment_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
556
+ };
557
+ type ListBroadcastsResponse = Response<ListBroadcastsResponseSuccess>;
558
+ //#endregion
559
+ //#region src/broadcasts/interfaces/remove-broadcast.interface.d.ts
560
+ interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
561
+ object: 'broadcast';
562
+ deleted: boolean;
563
+ }
564
+ type RemoveBroadcastResponse = Response<RemoveBroadcastResponseSuccess>;
565
+ //#endregion
566
+ //#region src/broadcasts/interfaces/send-broadcast-options.interface.d.ts
567
+ interface SendBroadcastBaseOptions {
568
+ /**
569
+ * Schedule email to be sent later.
570
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z)
571
+ * or relative time (eg: in 2 days).
572
+ *
573
+ * @link https://resend.com/docs/api-reference/broadcasts/send#body-parameters
574
+ */
575
+ scheduledAt?: string;
576
+ }
577
+ type SendBroadcastOptions = SendBroadcastBaseOptions;
578
+ interface SendBroadcastRequestOptions extends PostOptions {}
579
+ interface SendBroadcastResponseSuccess {
580
+ /** The ID of the sent broadcast. */
581
+ id: string;
582
+ }
583
+ type SendBroadcastResponse = Response<SendBroadcastResponseSuccess>;
584
+ //#endregion
585
+ //#region src/broadcasts/interfaces/update-broadcast.interface.d.ts
586
+ interface UpdateBroadcastResponseSuccess {
587
+ id: string;
588
+ }
589
+ type UpdateBroadcastOptions = {
590
+ name?: string;
591
+ segmentId?: string;
592
+ /**
593
+ * @deprecated Use segmentId instead
594
+ */
595
+ audienceId?: string;
596
+ from?: string;
597
+ html?: string;
598
+ react?: React.ReactNode;
599
+ text?: string;
600
+ subject?: string;
601
+ replyTo?: string[];
602
+ previewText?: string;
603
+ topicId?: string | null;
604
+ };
605
+ type UpdateBroadcastResponse = Response<UpdateBroadcastResponseSuccess>;
606
+ //#endregion
607
+ //#region src/contact-properties/interfaces/contact-property.d.ts
608
+ type StringBaseApiContactProperty = {
609
+ type: 'string';
610
+ fallback_value: string | null;
611
+ };
612
+ type NumberBaseApiContactProperty = {
613
+ type: 'number';
614
+ fallback_value: number | null;
615
+ };
616
+ type ApiContactProperty = {
617
+ id: string;
618
+ created_at: string;
619
+ key: string;
620
+ } & (StringBaseApiContactProperty | NumberBaseApiContactProperty);
621
+ type StringBaseContactProperty = {
622
+ type: 'string';
623
+ fallbackValue: string | null;
624
+ };
625
+ type NumberBaseContactProperty = {
626
+ type: 'number';
627
+ fallbackValue: number | null;
628
+ };
629
+ type ContactProperty = {
630
+ id: string;
631
+ createdAt: string;
632
+ key: string;
633
+ } & (StringBaseContactProperty | NumberBaseContactProperty);
634
+ //#endregion
635
+ //#region src/contact-properties/interfaces/create-contact-property-options.interface.d.ts
636
+ type StringBaseContactPropertyOptions = {
637
+ type: 'string';
638
+ fallbackValue?: string | null;
639
+ };
640
+ type NumberBaseContactPropertyOptions = {
641
+ type: 'number';
642
+ fallbackValue?: number | null;
643
+ };
644
+ type CreateContactPropertyOptions = {
645
+ key: string;
646
+ } & (StringBaseContactPropertyOptions | NumberBaseContactPropertyOptions);
647
+ interface CreateContactPropertyApiOptions {
648
+ key: string;
649
+ type: 'string' | 'number';
650
+ fallback_value?: string | number | null;
651
+ }
652
+ type CreateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
653
+ object: 'contact_property';
654
+ };
655
+ type CreateContactPropertyResponse = Response<CreateContactPropertyResponseSuccess>;
656
+ //#endregion
657
+ //#region src/contact-properties/interfaces/delete-contact-property-options.interface.d.ts
658
+ type RemoveContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
659
+ object: 'contact_property';
660
+ deleted: boolean;
661
+ };
662
+ type RemoveContactPropertyResponse = Response<RemoveContactPropertyResponseSuccess>;
663
+ //#endregion
664
+ //#region src/contact-properties/interfaces/get-contact-property.interface.d.ts
665
+ type GetContactPropertyResponseSuccess = ApiContactProperty & {
666
+ object: 'contact_property';
667
+ };
668
+ type GetContactPropertyResponse = Response<ContactProperty & {
669
+ object: 'contact_property';
670
+ }>;
671
+ //#endregion
672
+ //#region src/contact-properties/interfaces/list-contact-properties-options.interface.d.ts
673
+ type ListContactPropertiesOptions = PaginationOptions;
674
+ type ListContactPropertiesResponseSuccess = {
675
+ object: 'list';
676
+ has_more: boolean;
677
+ data: ApiContactProperty[];
678
+ };
679
+ type ListContactPropertiesResponse = Response<{
680
+ object: 'list';
681
+ has_more: boolean;
682
+ data: ContactProperty[];
683
+ }>;
684
+ //#endregion
685
+ //#region src/contact-properties/interfaces/update-contact-property-options.interface.d.ts
686
+ type UpdateContactPropertyOptions = {
687
+ id: string;
688
+ fallbackValue?: string | number | null;
689
+ };
690
+ interface UpdateContactPropertyApiOptions {
691
+ fallback_value?: string | number | null;
692
+ }
693
+ type UpdateContactPropertyResponseSuccess = Pick<ContactProperty, 'id'> & {
694
+ object: 'contact_property';
695
+ };
696
+ type UpdateContactPropertyResponse = Response<UpdateContactPropertyResponseSuccess>;
697
+ //#endregion
698
+ //#region src/contacts/interfaces/contact.d.ts
699
+ interface Contact {
700
+ created_at: string;
701
+ id: string;
702
+ email: string;
703
+ first_name: string | null;
704
+ last_name: string | null;
705
+ unsubscribed: boolean;
706
+ }
707
+ type SelectingField = {
708
+ /**
709
+ * The contact id.
710
+ *
711
+ * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
712
+ */
713
+ id: string;
714
+ /**
715
+ * The contact email.
716
+ *
717
+ * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
718
+ */
719
+ email?: undefined | null;
720
+ } | {
721
+ /**
722
+ * The contact id.
723
+ *
724
+ * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
725
+ */
726
+ id?: undefined | null;
727
+ /**
728
+ * The contact email.
729
+ *
730
+ * @link https://resend.com/docs/api-reference/contacts/delete-contact#body-parameters
731
+ */
732
+ email: string;
733
+ };
734
+ //#endregion
735
+ //#region src/contacts/interfaces/create-contact-options.interface.d.ts
736
+ interface CreateContactPropertiesOptions {
737
+ [key: string]: string | number | null;
738
+ }
739
+ interface LegacyCreateContactOptions {
740
+ /**
741
+ * @deprecated Use `segments` instead to add one or more segments to the new contact
742
+ *
743
+ * @see https://resend.com/docs/dashboard/segments/migrating-from-audiences-to-segments
744
+ */
745
+ audienceId: string;
746
+ email: string;
747
+ unsubscribed?: boolean;
748
+ firstName?: string;
749
+ lastName?: string;
750
+ properties?: CreateContactPropertiesOptions;
751
+ }
752
+ interface CreateContactOptions {
753
+ email: string;
754
+ unsubscribed?: boolean;
755
+ firstName?: string;
756
+ lastName?: string;
757
+ properties?: CreateContactPropertiesOptions;
758
+ segments?: {
759
+ id: string;
760
+ }[];
761
+ topics?: {
762
+ id: string;
763
+ subscription: 'opt_in' | 'opt_out';
764
+ }[];
765
+ }
766
+ interface CreateContactRequestOptions extends PostOptions {}
767
+ interface CreateContactResponseSuccess extends Pick<Contact, 'id'> {
768
+ object: 'contact';
769
+ }
770
+ type CreateContactResponse = Response<CreateContactResponseSuccess>;
771
+ //#endregion
772
+ //#region src/contacts/interfaces/get-contact.interface.d.ts
773
+ type GetContactOptions = string | ({
774
+ audienceId?: string;
775
+ } & SelectingField);
776
+ type ContactPropertyValue = {
777
+ type: 'string';
778
+ value: string;
779
+ } | {
780
+ type: 'number';
781
+ value: number;
782
+ };
783
+ interface ContactProperties$1 {
784
+ [key: string]: ContactPropertyValue;
785
+ }
786
+ interface GetContactResponseSuccess extends Pick<Contact, 'id' | 'email' | 'created_at' | 'first_name' | 'last_name' | 'unsubscribed'> {
787
+ object: 'contact';
788
+ properties: ContactProperties$1;
789
+ }
790
+ type GetContactResponse = Response<GetContactResponseSuccess>;
791
+ //#endregion
792
+ //#region src/contacts/interfaces/list-contacts.interface.d.ts
793
+ type ListContactsOptions = PaginationOptions & {
794
+ segmentId?: string;
795
+ /**
796
+ * @deprecated Use segmentId instead to filter by segment
797
+ */
798
+ audienceId?: string;
799
+ };
800
+ interface ListContactsResponseSuccess {
801
+ object: 'list';
802
+ data: Contact[];
803
+ has_more: boolean;
804
+ }
805
+ type ListContactsResponse = Response<ListContactsResponseSuccess>;
806
+ //#endregion
807
+ //#region src/contacts/interfaces/remove-contact.interface.d.ts
808
+ type RemoveContactsResponseSuccess = {
809
+ object: 'contact';
810
+ deleted: boolean;
811
+ contact: string;
812
+ };
813
+ type RemoveContactOptions = string | (SelectingField & {
814
+ audienceId?: string;
815
+ });
816
+ type RemoveContactsResponse = Response<RemoveContactsResponseSuccess>;
817
+ //#endregion
818
+ //#region src/contacts/interfaces/update-contact.interface.d.ts
819
+ interface UpdateContactPropertiesOptions {
820
+ [key: string]: string | number | null;
821
+ }
822
+ type UpdateContactOptions = {
823
+ audienceId?: string;
824
+ unsubscribed?: boolean;
825
+ /**
826
+ * Use `null` to clear the `firstName`
827
+ */
828
+ firstName?: string | null;
829
+ /**
830
+ * Use `null` to clear the `lastName`
831
+ */
832
+ lastName?: string | null;
833
+ properties?: UpdateContactPropertiesOptions;
834
+ } & SelectingField;
835
+ type UpdateContactResponseSuccess = Pick<Contact, 'id'> & {
836
+ object: 'contact';
837
+ };
838
+ type UpdateContactResponse = Response<UpdateContactResponseSuccess>;
839
+ //#endregion
840
+ //#region src/contacts/segments/interfaces/contact-segments.interface.d.ts
841
+ type ContactSegmentsBaseOptions = {
842
+ contactId: string;
843
+ email?: never;
844
+ } | {
845
+ contactId?: never;
846
+ email: string;
847
+ };
848
+ //#endregion
849
+ //#region src/contacts/segments/interfaces/add-contact-segment.interface.d.ts
850
+ type AddContactSegmentOptions = ContactSegmentsBaseOptions & {
851
+ segmentId: string;
852
+ };
853
+ interface AddContactSegmentResponseSuccess {
854
+ id: string;
855
+ }
856
+ type AddContactSegmentResponse = Response<AddContactSegmentResponseSuccess>;
857
+ //#endregion
858
+ //#region src/segments/interfaces/segment.d.ts
859
+ interface Segment {
860
+ created_at: string;
861
+ id: string;
862
+ name: string;
863
+ }
864
+ //#endregion
865
+ //#region src/contacts/segments/interfaces/list-contact-segments.interface.d.ts
866
+ type ListContactSegmentsOptions = PaginationOptions & ContactSegmentsBaseOptions;
867
+ type ListContactSegmentsResponseSuccess = PaginatedData<Segment[]>;
868
+ type ListContactSegmentsResponse = Response<ListContactSegmentsResponseSuccess>;
869
+ //#endregion
870
+ //#region src/contacts/segments/interfaces/remove-contact-segment.interface.d.ts
871
+ type RemoveContactSegmentOptions = ContactSegmentsBaseOptions & {
872
+ segmentId: string;
873
+ };
874
+ interface RemoveContactSegmentResponseSuccess {
875
+ id: string;
876
+ deleted: boolean;
877
+ }
878
+ type RemoveContactSegmentResponse = Response<RemoveContactSegmentResponseSuccess>;
879
+ //#endregion
880
+ //#region src/contacts/topics/interfaces/list-contact-topics.interface.d.ts
881
+ interface ListContactTopicsBaseOptions {
882
+ id?: string;
883
+ email?: string;
884
+ }
885
+ type ListContactTopicsOptions = ListContactTopicsBaseOptions & PaginationOptions;
886
+ interface ListContactTopicsRequestOptions extends GetOptions {}
887
+ interface ContactTopic {
888
+ id: string;
889
+ name: string;
890
+ description: string | null;
891
+ subscription: 'opt_in' | 'opt_out';
892
+ }
893
+ type ListContactTopicsResponseSuccess = PaginatedData<ContactTopic[]>;
894
+ type ListContactTopicsResponse = Response<ListContactTopicsResponseSuccess>;
895
+ //#endregion
896
+ //#region src/contacts/topics/interfaces/update-contact-topics.interface.d.ts
897
+ interface UpdateContactTopicsBaseOptions {
898
+ id?: string;
899
+ email?: string;
900
+ }
901
+ interface UpdateContactTopicsOptions extends UpdateContactTopicsBaseOptions {
902
+ topics: {
903
+ id: string;
904
+ subscription: 'opt_in' | 'opt_out';
905
+ }[];
906
+ }
907
+ interface UpdateContactTopicsRequestOptions extends PatchOptions {}
908
+ interface UpdateContactTopicsResponseSuccess {
909
+ id: string;
910
+ }
911
+ type UpdateContactTopicsResponse = Response<UpdateContactTopicsResponseSuccess>;
912
+ //#endregion
913
+ //#region src/domains/interfaces/create-domain-options.interface.d.ts
914
+ interface CreateDomainOptions {
915
+ name: string;
916
+ region?: DomainRegion;
917
+ customReturnPath?: string;
918
+ capabilities?: Partial<DomainCapabilities>;
919
+ openTracking?: boolean;
920
+ clickTracking?: boolean;
921
+ tls?: 'enforced' | 'opportunistic';
922
+ }
923
+ interface CreateDomainRequestOptions extends PostOptions {}
924
+ interface CreateDomainResponseSuccess extends Pick<Domain, 'name' | 'id' | 'status' | 'created_at' | 'region'> {
925
+ records: DomainRecords[];
926
+ capabilities: DomainCapabilities;
927
+ }
928
+ type CreateDomainResponse = Response<CreateDomainResponseSuccess>;
929
+ //#endregion
930
+ //#region src/domains/interfaces/get-domain.interface.d.ts
931
+ interface GetDomainResponseSuccess extends Pick<Domain, 'id' | 'name' | 'created_at' | 'region' | 'status' | 'capabilities'> {
932
+ object: 'domain';
933
+ records: DomainRecords[];
934
+ }
935
+ type GetDomainResponse = Response<GetDomainResponseSuccess>;
936
+ //#endregion
937
+ //#region src/domains/interfaces/list-domains.interface.d.ts
938
+ type ListDomainsOptions = PaginationOptions;
939
+ type ListDomainsResponseSuccess = {
940
+ data: Domain[];
941
+ object: 'list';
942
+ has_more: boolean;
943
+ };
944
+ type ListDomainsResponse = Response<ListDomainsResponseSuccess>;
945
+ //#endregion
946
+ //#region src/domains/interfaces/remove-domain.interface.d.ts
947
+ type RemoveDomainsResponseSuccess = Pick<Domain, 'id'> & {
948
+ object: 'domain';
949
+ deleted: boolean;
950
+ };
951
+ type RemoveDomainsResponse = Response<RemoveDomainsResponseSuccess>;
952
+ //#endregion
953
+ //#region src/domains/interfaces/update-domain.interface.d.ts
954
+ interface UpdateDomainsOptions {
955
+ id: string;
956
+ clickTracking?: boolean;
957
+ openTracking?: boolean;
958
+ tls?: 'enforced' | 'opportunistic';
959
+ capabilities?: Partial<DomainCapabilities>;
960
+ }
961
+ type UpdateDomainsResponseSuccess = Pick<Domain, 'id'> & {
962
+ object: 'domain';
963
+ };
964
+ type UpdateDomainsResponse = Response<UpdateDomainsResponseSuccess>;
965
+ //#endregion
966
+ //#region src/domains/interfaces/verify-domain.interface.d.ts
967
+ type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
968
+ object: 'domain';
969
+ };
970
+ type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
971
+ //#endregion
972
+ //#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
973
+ interface GetAttachmentOptions {
974
+ emailId: string;
975
+ id: string;
976
+ }
977
+ type GetAttachmentResponseSuccess = {
978
+ object: 'attachment';
979
+ } & AttachmentData;
980
+ type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
981
+ //#endregion
982
+ //#region src/emails/attachments/interfaces/list-attachments.interface.d.ts
983
+ type ListAttachmentsOptions = PaginationOptions & {
984
+ emailId: string;
985
+ };
986
+ interface ListAttachmentsResponseSuccess {
987
+ object: 'list';
988
+ has_more: boolean;
989
+ data: AttachmentData[];
990
+ }
991
+ type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
992
+ //#endregion
993
+ //#region src/emails/interfaces/cancel-email-options.interface.d.ts
994
+ interface CancelEmailResponseSuccess {
995
+ object: 'email';
996
+ id: string;
997
+ }
998
+ type CancelEmailResponse = Response<CancelEmailResponseSuccess>;
999
+ //#endregion
1000
+ //#region src/emails/interfaces/get-email-options.interface.d.ts
1001
+ interface GetEmailResponseSuccess {
1002
+ bcc: string[] | null;
1003
+ cc: string[] | null;
1004
+ created_at: string;
1005
+ from: string;
1006
+ html: string | null;
1007
+ id: string;
1008
+ last_event: 'bounced' | 'canceled' | 'clicked' | 'complained' | 'delivered' | 'delivery_delayed' | 'failed' | 'opened' | 'queued' | 'scheduled' | 'sent';
1009
+ reply_to: string[] | null;
1010
+ subject: string;
1011
+ text: string | null;
1012
+ tags?: {
1013
+ name: string;
1014
+ value: string;
1015
+ }[];
1016
+ to: string[];
1017
+ topic_id?: string | null;
1018
+ scheduled_at: string | null;
1019
+ object: 'email';
1020
+ }
1021
+ type GetEmailResponse = Response<GetEmailResponseSuccess>;
1022
+ //#endregion
1023
+ //#region src/emails/interfaces/list-emails-options.interface.d.ts
1024
+ type ListEmailsOptions = PaginationOptions;
1025
+ type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
1026
+ type ListEmailsResponseSuccess = {
1027
+ object: 'list';
1028
+ has_more: boolean;
1029
+ data: ListEmail[];
1030
+ };
1031
+ type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
1032
+ //#endregion
1033
+ //#region src/emails/interfaces/update-email-options.interface.d.ts
1034
+ interface UpdateEmailOptions {
1035
+ id: string;
1036
+ scheduledAt: string;
1037
+ }
1038
+ interface UpdateEmailResponseSuccess {
1039
+ id: string;
1040
+ object: 'email';
1041
+ }
1042
+ type UpdateEmailResponse = Response<UpdateEmailResponseSuccess>;
1043
+ //#endregion
1044
+ //#region src/emails/receiving/interfaces/forward-receiving-email.interface.d.ts
1045
+ interface ForwardReceivingEmailBodyOptions {
1046
+ text: string;
1047
+ html: string;
1048
+ }
1049
+ interface ForwardReceivingEmailBaseOptions {
1050
+ emailId: string;
1051
+ to: string | string[];
1052
+ from: string;
1053
+ }
1054
+ type ForwardReceivingEmailOptions = (ForwardReceivingEmailBaseOptions & {
1055
+ passthrough?: true;
1056
+ }) | (ForwardReceivingEmailBaseOptions & {
1057
+ passthrough: false;
1058
+ } & RequireAtLeastOne<ForwardReceivingEmailBodyOptions>);
1059
+ interface ForwardReceivingEmailResponseSuccess {
1060
+ id: string;
1061
+ }
1062
+ type ForwardReceivingEmailResponse = Response<ForwardReceivingEmailResponseSuccess>;
1063
+ //#endregion
1064
+ //#region src/emails/receiving/interfaces/get-receiving-email.interface.d.ts
1065
+ /**
1066
+ * Attachment metadata embedded in the GET /inbounds/{id} response.
1067
+ * These are raw DB values — fields are nullable and content_disposition is
1068
+ * not normalized to a literal union.
1069
+ *
1070
+ * Not to be confused with AttachmentData, which is the shape returned by the
1071
+ * dedicated attachment endpoints (includes download_url and expires_at).
1072
+ */
1073
+ interface InboundAttachment {
1074
+ id: string;
1075
+ filename: string | null;
1076
+ size: number;
1077
+ content_type: string;
1078
+ content_id: string | null;
1079
+ content_disposition: string | null;
1080
+ }
1081
+ interface GetReceivingEmailResponseSuccess {
1082
+ object: 'email';
1083
+ id: string;
1084
+ to: string[];
1085
+ from: string;
1086
+ created_at: string;
1087
+ subject: string;
1088
+ bcc: string[] | null;
1089
+ cc: string[] | null;
1090
+ reply_to: string[] | null;
1091
+ html: string | null;
1092
+ text: string | null;
1093
+ headers: Record<string, string> | null;
1094
+ message_id: string;
1095
+ raw?: {
1096
+ download_url: string;
1097
+ expires_at: string;
1098
+ } | null;
1099
+ attachments: InboundAttachment[];
1100
+ }
1101
+ type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
1102
+ //#endregion
1103
+ //#region src/emails/receiving/interfaces/list-receiving-emails.interface.d.ts
1104
+ type ListReceivingEmailsOptions = PaginationOptions;
1105
+ type ListReceivingEmail = Omit<GetReceivingEmailResponseSuccess, 'html' | 'text' | 'headers' | 'raw' | 'object'>;
1106
+ interface ListReceivingEmailsResponseSuccess {
1107
+ object: 'list';
1108
+ has_more: boolean;
1109
+ data: ListReceivingEmail[];
1110
+ }
1111
+ type ListReceivingEmailsResponse = {
1112
+ data: ListReceivingEmailsResponseSuccess;
1113
+ error: null;
1114
+ } | {
1115
+ data: null;
1116
+ error: ErrorResponse;
1117
+ };
1118
+ //#endregion
1119
+ //#region src/api-keys/api-keys.d.ts
1120
+ declare class ApiKeys {
1121
+ private readonly resend;
1122
+ constructor(resend: Resend);
1123
+ create(payload: CreateApiKeyOptions, options?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
1124
+ list(options?: ListApiKeysOptions): Promise<ListApiKeysResponse>;
1125
+ remove(id: string): Promise<RemoveApiKeyResponse>;
1126
+ }
1127
+ //#endregion
1128
+ //#region src/batch/batch.d.ts
1129
+ declare class Batch {
1130
+ private readonly resend;
1131
+ constructor(resend: Resend);
1132
+ send<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
1133
+ create<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
1134
+ }
1135
+ //#endregion
1136
+ //#region src/broadcasts/broadcasts.d.ts
1137
+ declare class Broadcasts {
1138
+ private readonly resend;
1139
+ constructor(resend: Resend);
1140
+ create(payload: CreateBroadcastOptions, options?: CreateBroadcastRequestOptions): Promise<SendBroadcastResponse>;
1141
+ send(id: string, payload?: SendBroadcastOptions): Promise<SendBroadcastResponse>;
1142
+ list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
1143
+ get(id: string): Promise<GetBroadcastResponse>;
1144
+ remove(id: string): Promise<RemoveBroadcastResponse>;
1145
+ update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
1146
+ }
1147
+ //#endregion
1148
+ //#region src/contact-properties/contact-properties.d.ts
1149
+ declare class ContactProperties {
1150
+ private readonly resend;
1151
+ constructor(resend: Resend);
1152
+ create(options: CreateContactPropertyOptions): Promise<CreateContactPropertyResponse>;
1153
+ list(options?: ListContactPropertiesOptions): Promise<ListContactPropertiesResponse>;
1154
+ get(id: string): Promise<GetContactPropertyResponse>;
1155
+ update(payload: UpdateContactPropertyOptions): Promise<UpdateContactPropertyResponse>;
1156
+ remove(id: string): Promise<RemoveContactPropertyResponse>;
1157
+ }
1158
+ //#endregion
1159
+ //#region src/contacts/segments/contact-segments.d.ts
1160
+ declare class ContactSegments {
1161
+ private readonly resend;
1162
+ constructor(resend: Resend);
1163
+ list(options: ListContactSegmentsOptions): Promise<ListContactSegmentsResponse>;
1164
+ add(options: AddContactSegmentOptions): Promise<AddContactSegmentResponse>;
1165
+ remove(options: RemoveContactSegmentOptions): Promise<RemoveContactSegmentResponse>;
1166
+ }
1167
+ //#endregion
1168
+ //#region src/contacts/topics/contact-topics.d.ts
1169
+ declare class ContactTopics {
1170
+ private readonly resend;
1171
+ constructor(resend: Resend);
1172
+ update(payload: UpdateContactTopicsOptions): Promise<UpdateContactTopicsResponse>;
1173
+ list(options: ListContactTopicsOptions): Promise<ListContactTopicsResponse>;
1174
+ }
1175
+ //#endregion
1176
+ //#region src/contacts/contacts.d.ts
1177
+ declare class Contacts {
1178
+ private readonly resend;
1179
+ readonly topics: ContactTopics;
1180
+ readonly segments: ContactSegments;
1181
+ constructor(resend: Resend);
1182
+ create(paylaod: CreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1183
+ create(paylaod: LegacyCreateContactOptions, options?: CreateContactRequestOptions): Promise<CreateContactResponse>;
1184
+ list(options?: ListContactsOptions): Promise<ListContactsResponse>;
1185
+ get(options: GetContactOptions): Promise<GetContactResponse>;
1186
+ update(options: UpdateContactOptions): Promise<UpdateContactResponse>;
1187
+ remove(payload: RemoveContactOptions): Promise<RemoveContactsResponse>;
1188
+ }
1189
+ //#endregion
1190
+ //#region src/domains/domains.d.ts
1191
+ declare class Domains {
1192
+ private readonly resend;
1193
+ constructor(resend: Resend);
1194
+ create(payload: CreateDomainOptions, options?: CreateDomainRequestOptions): Promise<CreateDomainResponse>;
1195
+ list(options?: ListDomainsOptions): Promise<ListDomainsResponse>;
1196
+ get(id: string): Promise<GetDomainResponse>;
1197
+ update(payload: UpdateDomainsOptions): Promise<UpdateDomainsResponse>;
1198
+ remove(id: string): Promise<RemoveDomainsResponse>;
1199
+ verify(id: string): Promise<VerifyDomainsResponse>;
1200
+ }
1201
+ //#endregion
1202
+ //#region src/emails/attachments/attachments.d.ts
1203
+ declare class Attachments$1 {
1204
+ private readonly resend;
1205
+ constructor(resend: Resend);
1206
+ get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
1207
+ list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
1208
+ }
1209
+ //#endregion
1210
+ //#region src/emails/receiving/attachments/attachments.d.ts
1211
+ declare class Attachments {
1212
+ private readonly resend;
1213
+ constructor(resend: Resend);
1214
+ get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
1215
+ list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
1216
+ }
1217
+ //#endregion
1218
+ //#region src/emails/receiving/receiving.d.ts
1219
+ declare class Receiving {
1220
+ private readonly resend;
1221
+ readonly attachments: Attachments;
1222
+ constructor(resend: Resend);
1223
+ get(id: string): Promise<GetReceivingEmailResponse>;
1224
+ list(options?: ListReceivingEmailsOptions): Promise<ListReceivingEmailsResponse>;
1225
+ forward(options: ForwardReceivingEmailOptions): Promise<ForwardReceivingEmailResponse>;
1226
+ private forwardPassthrough;
1227
+ private forwardWrapped;
1228
+ }
1229
+ //#endregion
1230
+ //#region src/emails/emails.d.ts
1231
+ declare class Emails {
1232
+ private readonly resend;
1233
+ readonly attachments: Attachments$1;
1234
+ readonly receiving: Receiving;
1235
+ constructor(resend: Resend);
1236
+ send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
1237
+ create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
1238
+ get(id: string): Promise<GetEmailResponse>;
1239
+ list(options?: ListEmailsOptions): Promise<ListEmailsResponse>;
1240
+ update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
1241
+ cancel(id: string): Promise<CancelEmailResponse>;
1242
+ }
1243
+ //#endregion
1244
+ //#region src/segments/interfaces/create-segment-options.interface.d.ts
1245
+ interface CreateSegmentOptions {
1246
+ name: string;
1247
+ }
1248
+ interface CreateSegmentRequestOptions extends PostOptions {}
1249
+ interface CreateSegmentResponseSuccess extends Pick<Segment, 'name' | 'id'> {
1250
+ object: 'segment';
1251
+ }
1252
+ type CreateSegmentResponse = Response<CreateSegmentResponseSuccess>;
1253
+ //#endregion
1254
+ //#region src/segments/interfaces/get-segment.interface.d.ts
1255
+ interface GetSegmentResponseSuccess extends Pick<Segment, 'id' | 'name' | 'created_at'> {
1256
+ object: 'segment';
1257
+ }
1258
+ type GetSegmentResponse = Response<GetSegmentResponseSuccess>;
1259
+ //#endregion
1260
+ //#region src/segments/interfaces/list-segments.interface.d.ts
1261
+ type ListSegmentsOptions = PaginationOptions;
1262
+ type ListSegmentsResponseSuccess = {
1263
+ object: 'list';
1264
+ data: Segment[];
1265
+ has_more: boolean;
1266
+ };
1267
+ type ListSegmentsResponse = Response<ListSegmentsResponseSuccess>;
1268
+ //#endregion
1269
+ //#region src/segments/interfaces/remove-segment.interface.d.ts
1270
+ interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
1271
+ object: 'segment';
1272
+ deleted: boolean;
1273
+ }
1274
+ type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
1275
+ //#endregion
1276
+ //#region src/segments/segments.d.ts
1277
+ declare class Segments {
1278
+ private readonly resend;
1279
+ constructor(resend: Resend);
1280
+ create(payload: CreateSegmentOptions, options?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
1281
+ list(options?: ListSegmentsOptions): Promise<ListSegmentsResponse>;
1282
+ get(id: string): Promise<GetSegmentResponse>;
1283
+ remove(id: string): Promise<RemoveSegmentResponse>;
1284
+ }
1285
+ //#endregion
1286
+ //#region src/templates/interfaces/template.d.ts
1287
+ interface Template {
1288
+ id: string;
1289
+ name: string;
1290
+ subject: string | null;
1291
+ html: string;
1292
+ text: string | null;
1293
+ status: 'draft' | 'published';
1294
+ variables: TemplateVariable[] | null;
1295
+ alias: string | null;
1296
+ from: string | null;
1297
+ reply_to: string[] | null;
1298
+ published_at: string | null;
1299
+ created_at: string;
1300
+ updated_at: string;
1301
+ has_unpublished_versions: boolean;
1302
+ current_version_id: string;
1303
+ }
1304
+ interface TemplateVariable {
1305
+ key: string;
1306
+ fallback_value: string | number | null;
1307
+ type: 'string' | 'number';
1308
+ created_at: string;
1309
+ updated_at: string;
1310
+ }
1311
+ //#endregion
1312
+ //#region src/templates/interfaces/create-template-options.interface.d.ts
1313
+ type TemplateContentCreationOptions = RequireAtLeastOne<{
1314
+ html: string;
1315
+ react: React.ReactNode;
1316
+ }>;
1317
+ type TemplateVariableCreationOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
1318
+ type: 'string';
1319
+ fallbackValue?: string | null;
1320
+ } | {
1321
+ type: 'number';
1322
+ fallbackValue?: number | null;
1323
+ });
1324
+ type TemplateOptionalFieldsForCreation = Partial<Pick<Template, 'subject' | 'text' | 'alias' | 'from'>> & {
1325
+ replyTo?: string[] | string;
1326
+ variables?: TemplateVariableCreationOptions[];
1327
+ };
1328
+ type CreateTemplateOptions = Pick<Template, 'name'> & TemplateOptionalFieldsForCreation & TemplateContentCreationOptions;
1329
+ interface CreateTemplateRequestOptions extends PostOptions {}
1330
+ interface CreateTemplateResponseSuccess extends Pick<Template, 'id'> {
1331
+ object: 'template';
1332
+ }
1333
+ type CreateTemplateResponse = Response<CreateTemplateResponseSuccess>;
1334
+ //#endregion
1335
+ //#region src/templates/interfaces/duplicate-template.interface.d.ts
1336
+ interface DuplicateTemplateResponseSuccess extends Pick<Template, 'id'> {
1337
+ object: 'template';
1338
+ }
1339
+ type DuplicateTemplateResponse = Response<DuplicateTemplateResponseSuccess>;
1340
+ //#endregion
1341
+ //#region src/templates/interfaces/publish-template.interface.d.ts
1342
+ interface PublishTemplateResponseSuccess extends Pick<Template, 'id'> {
1343
+ object: 'template';
1344
+ }
1345
+ type PublishTemplateResponse = Response<PublishTemplateResponseSuccess>;
1346
+ //#endregion
1347
+ //#region src/templates/chainable-template-result.d.ts
1348
+ declare class ChainableTemplateResult<T extends CreateTemplateResponse | DuplicateTemplateResponse> implements PromiseLike<T> {
1349
+ private readonly promise;
1350
+ private readonly publishFn;
1351
+ constructor(promise: Promise<T>, publishFn: (id: string) => Promise<PublishTemplateResponse>);
1352
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
1353
+ publish(): Promise<PublishTemplateResponse>;
1354
+ }
1355
+ //#endregion
1356
+ //#region src/templates/interfaces/get-template.interface.d.ts
1357
+ interface GetTemplateResponseSuccess extends Template {
1358
+ object: 'template';
1359
+ }
1360
+ type GetTemplateResponse = Response<GetTemplateResponseSuccess>;
1361
+ //#endregion
1362
+ //#region src/templates/interfaces/list-templates.interface.d.ts
1363
+ type ListTemplatesOptions = PaginationOptions;
1364
+ interface TemplateListItem extends Pick<Template, 'id' | 'name' | 'created_at' | 'updated_at' | 'status' | 'published_at' | 'alias'> {}
1365
+ interface ListTemplatesResponseSuccess {
1366
+ object: 'list';
1367
+ data: TemplateListItem[];
1368
+ has_more: boolean;
1369
+ }
1370
+ type ListTemplatesResponse = Response<ListTemplatesResponseSuccess>;
1371
+ //#endregion
1372
+ //#region src/templates/interfaces/remove-template.interface.d.ts
1373
+ interface RemoveTemplateResponseSuccess {
1374
+ object: 'template';
1375
+ id: string;
1376
+ deleted: boolean;
1377
+ }
1378
+ type RemoveTemplateResponse = Response<RemoveTemplateResponseSuccess>;
1379
+ //#endregion
1380
+ //#region src/templates/interfaces/update-template.interface.d.ts
1381
+ type TemplateVariableUpdateOptions = Pick<TemplateVariable, 'key' | 'type'> & ({
1382
+ type: 'string';
1383
+ fallbackValue?: string | null;
1384
+ } | {
1385
+ type: 'number';
1386
+ fallbackValue?: number | null;
1387
+ });
1388
+ interface UpdateTemplateOptions extends Partial<Pick<Template, 'name' | 'subject' | 'html' | 'text' | 'from' | 'alias'>> {
1389
+ variables?: TemplateVariableUpdateOptions[];
1390
+ replyTo?: string[] | string;
1391
+ }
1392
+ interface UpdateTemplateResponseSuccess extends Pick<Template, 'id'> {
1393
+ object: 'template';
1394
+ }
1395
+ type UpdateTemplateResponse = Response<UpdateTemplateResponseSuccess>;
1396
+ //#endregion
1397
+ //#region src/templates/templates.d.ts
1398
+ declare class Templates {
1399
+ private readonly resend;
1400
+ private renderAsync?;
1401
+ constructor(resend: Resend);
1402
+ create(payload: CreateTemplateOptions): ChainableTemplateResult<CreateTemplateResponse>;
1403
+ private performCreate;
1404
+ remove(identifier: string): Promise<RemoveTemplateResponse>;
1405
+ get(identifier: string): Promise<GetTemplateResponse>;
1406
+ list(options?: PaginationOptions): Promise<ListTemplatesResponse>;
1407
+ duplicate(identifier: string): ChainableTemplateResult<DuplicateTemplateResponse>;
1408
+ publish(identifier: string): Promise<PublishTemplateResponse>;
1409
+ update(identifier: string, payload: UpdateTemplateOptions): Promise<UpdateTemplateResponse>;
1410
+ }
1411
+ //#endregion
1412
+ //#region src/topics/interfaces/topic.d.ts
1413
+ interface Topic {
1414
+ id: string;
1415
+ name: string;
1416
+ description?: string;
1417
+ default_subscription: 'opt_in' | 'opt_out';
1418
+ created_at: string;
1419
+ }
1420
+ //#endregion
1421
+ //#region src/topics/interfaces/create-topic-options.interface.d.ts
1422
+ interface CreateTopicOptions {
1423
+ name: string;
1424
+ description?: string;
1425
+ defaultSubscription: 'opt_in' | 'opt_out';
1426
+ }
1427
+ type CreateTopicResponseSuccess = Pick<Topic, 'id'>;
1428
+ type CreateTopicResponse = Response<CreateTopicResponseSuccess>;
1429
+ //#endregion
1430
+ //#region src/topics/interfaces/get-contact.interface.d.ts
1431
+ interface GetTopicOptions {
1432
+ id: string;
1433
+ }
1434
+ type GetTopicResponseSuccess = Topic;
1435
+ type GetTopicResponse = Response<GetTopicResponseSuccess>;
1436
+ //#endregion
1437
+ //#region src/topics/interfaces/list-topics.interface.d.ts
1438
+ interface ListTopicsResponseSuccess {
1439
+ data: Topic[];
1440
+ }
1441
+ type ListTopicsResponse = Response<ListTopicsResponseSuccess>;
1442
+ //#endregion
1443
+ //#region src/topics/interfaces/remove-topic.interface.d.ts
1444
+ type RemoveTopicResponseSuccess = Pick<Topic, 'id'> & {
1445
+ object: 'topic';
1446
+ deleted: boolean;
1447
+ };
1448
+ type RemoveTopicResponse = Response<RemoveTopicResponseSuccess>;
1449
+ //#endregion
1450
+ //#region src/topics/interfaces/update-topic.interface.d.ts
1451
+ interface UpdateTopicOptions {
1452
+ id: string;
1453
+ name?: string;
1454
+ description?: string;
1455
+ }
1456
+ type UpdateTopicResponseSuccess = Pick<Topic, 'id'>;
1457
+ type UpdateTopicResponse = Response<UpdateTopicResponseSuccess>;
1458
+ //#endregion
1459
+ //#region src/topics/topics.d.ts
1460
+ declare class Topics {
1461
+ private readonly resend;
1462
+ constructor(resend: Resend);
1463
+ create(payload: CreateTopicOptions): Promise<CreateTopicResponse>;
1464
+ list(): Promise<ListTopicsResponse>;
1465
+ get(id: string): Promise<GetTopicResponse>;
1466
+ update(payload: UpdateTopicOptions): Promise<UpdateTopicResponse>;
1467
+ remove(id: string): Promise<RemoveTopicResponse>;
1468
+ }
1469
+ //#endregion
1470
+ //#region src/webhooks/interfaces/webhook-event.interface.d.ts
1471
+ type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
1472
+ interface BaseEmailEventData {
1473
+ broadcast_id?: string;
1474
+ created_at: string;
1475
+ email_id: string;
1476
+ from: string;
1477
+ to: string[];
1478
+ subject: string;
1479
+ template_id?: string;
1480
+ tags?: Record<string, string>;
1481
+ }
1482
+ interface EmailBounce {
1483
+ message: string;
1484
+ subType: string;
1485
+ type: string;
1486
+ }
1487
+ interface EmailClick {
1488
+ ipAddress: string;
1489
+ link: string;
1490
+ timestamp: string;
1491
+ userAgent: string;
1492
+ }
1493
+ interface EmailFailed {
1494
+ reason: string;
1495
+ }
1496
+ interface EmailSuppressed {
1497
+ message: string;
1498
+ type: string;
1499
+ }
1500
+ interface ReceivedEmailAttachment {
1501
+ id: string;
1502
+ filename: string | null;
1503
+ content_type: string;
1504
+ content_disposition: string | null;
1505
+ content_id: string | null;
1506
+ }
1507
+ interface ReceivedEmailEventData {
1508
+ email_id: string;
1509
+ created_at: string;
1510
+ from: string;
1511
+ to: string[];
1512
+ bcc: string[];
1513
+ cc: string[];
1514
+ message_id: string;
1515
+ subject: string;
1516
+ attachments: ReceivedEmailAttachment[];
1517
+ }
1518
+ interface ContactEventData {
1519
+ id: string;
1520
+ audience_id: string;
1521
+ segment_ids: string[];
1522
+ created_at: string;
1523
+ updated_at: string;
1524
+ email: string;
1525
+ first_name?: string;
1526
+ last_name?: string;
1527
+ unsubscribed: boolean;
1528
+ }
1529
+ interface DomainRecord {
1530
+ record: string;
1531
+ name: string;
1532
+ type: string;
1533
+ ttl: string;
1534
+ status: string;
1535
+ value: string;
1536
+ priority?: number;
1537
+ }
1538
+ interface DomainEventData {
1539
+ id: string;
1540
+ name: string;
1541
+ status: string;
1542
+ created_at: string;
1543
+ region: string;
1544
+ records: DomainRecord[];
1545
+ }
1546
+ interface EmailSentEvent {
1547
+ type: 'email.sent';
1548
+ created_at: string;
1549
+ data: BaseEmailEventData;
1550
+ }
1551
+ interface EmailScheduledEvent {
1552
+ type: 'email.scheduled';
1553
+ created_at: string;
1554
+ data: BaseEmailEventData;
1555
+ }
1556
+ interface EmailDeliveredEvent {
1557
+ type: 'email.delivered';
1558
+ created_at: string;
1559
+ data: BaseEmailEventData;
1560
+ }
1561
+ interface EmailDeliveryDelayedEvent {
1562
+ type: 'email.delivery_delayed';
1563
+ created_at: string;
1564
+ data: BaseEmailEventData;
1565
+ }
1566
+ interface EmailComplainedEvent {
1567
+ type: 'email.complained';
1568
+ created_at: string;
1569
+ data: BaseEmailEventData;
1570
+ }
1571
+ interface EmailBouncedEvent {
1572
+ type: 'email.bounced';
1573
+ created_at: string;
1574
+ data: BaseEmailEventData & {
1575
+ bounce: EmailBounce;
1576
+ };
1577
+ }
1578
+ interface EmailOpenedEvent {
1579
+ type: 'email.opened';
1580
+ created_at: string;
1581
+ data: BaseEmailEventData;
1582
+ }
1583
+ interface EmailClickedEvent {
1584
+ type: 'email.clicked';
1585
+ created_at: string;
1586
+ data: BaseEmailEventData & {
1587
+ click: EmailClick;
1588
+ };
1589
+ }
1590
+ interface EmailReceivedEvent {
1591
+ type: 'email.received';
1592
+ created_at: string;
1593
+ data: ReceivedEmailEventData;
1594
+ }
1595
+ interface EmailFailedEvent {
1596
+ type: 'email.failed';
1597
+ created_at: string;
1598
+ data: BaseEmailEventData & {
1599
+ failed: EmailFailed;
1600
+ };
1601
+ }
1602
+ interface EmailSuppressedEvent {
1603
+ type: 'email.suppressed';
1604
+ created_at: string;
1605
+ data: BaseEmailEventData & {
1606
+ suppressed: EmailSuppressed;
1607
+ };
1608
+ }
1609
+ interface ContactCreatedEvent {
1610
+ type: 'contact.created';
1611
+ created_at: string;
1612
+ data: ContactEventData;
1613
+ }
1614
+ interface ContactUpdatedEvent {
1615
+ type: 'contact.updated';
1616
+ created_at: string;
1617
+ data: ContactEventData;
1618
+ }
1619
+ interface ContactDeletedEvent {
1620
+ type: 'contact.deleted';
1621
+ created_at: string;
1622
+ data: ContactEventData;
1623
+ }
1624
+ interface DomainCreatedEvent {
1625
+ type: 'domain.created';
1626
+ created_at: string;
1627
+ data: DomainEventData;
1628
+ }
1629
+ interface DomainUpdatedEvent {
1630
+ type: 'domain.updated';
1631
+ created_at: string;
1632
+ data: DomainEventData;
1633
+ }
1634
+ interface DomainDeletedEvent {
1635
+ type: 'domain.deleted';
1636
+ created_at: string;
1637
+ data: DomainEventData;
1638
+ }
1639
+ type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent;
1640
+ //#endregion
1641
+ //#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
1642
+ interface CreateWebhookOptions {
1643
+ endpoint: string;
1644
+ events: WebhookEvent[];
1645
+ }
1646
+ interface CreateWebhookRequestOptions extends PostOptions {}
1647
+ interface CreateWebhookResponseSuccess {
1648
+ object: 'webhook';
1649
+ id: string;
1650
+ signing_secret: string;
1651
+ }
1652
+ type CreateWebhookResponse = Response<CreateWebhookResponseSuccess>;
1653
+ //#endregion
1654
+ //#region src/webhooks/interfaces/get-webhook.interface.d.ts
1655
+ interface GetWebhookResponseSuccess {
1656
+ object: 'webhook';
1657
+ id: string;
1658
+ created_at: string;
1659
+ status: 'enabled' | 'disabled';
1660
+ endpoint: string;
1661
+ events: WebhookEvent[] | null;
1662
+ signing_secret: string;
1663
+ }
1664
+ type GetWebhookResponse = Response<GetWebhookResponseSuccess>;
1665
+ //#endregion
1666
+ //#region src/webhooks/interfaces/list-webhooks.interface.d.ts
1667
+ type ListWebhooksOptions = PaginationOptions;
1668
+ interface Webhook {
1669
+ id: string;
1670
+ endpoint: string;
1671
+ created_at: string;
1672
+ status: 'enabled' | 'disabled';
1673
+ events: WebhookEvent[] | null;
1674
+ }
1675
+ type ListWebhooksResponseSuccess = {
1676
+ object: 'list';
1677
+ has_more: boolean;
1678
+ data: Webhook[];
1679
+ };
1680
+ type ListWebhooksResponse = Response<ListWebhooksResponseSuccess>;
1681
+ //#endregion
1682
+ //#region src/webhooks/interfaces/remove-webhook.interface.d.ts
1683
+ type RemoveWebhookResponseSuccess = Pick<Webhook, 'id'> & {
1684
+ object: 'webhook';
1685
+ deleted: boolean;
1686
+ };
1687
+ type RemoveWebhookResponse = Response<RemoveWebhookResponseSuccess>;
1688
+ //#endregion
1689
+ //#region src/webhooks/interfaces/update-webhook.interface.d.ts
1690
+ interface UpdateWebhookOptions {
1691
+ endpoint?: string;
1692
+ events?: WebhookEvent[];
1693
+ status?: 'enabled' | 'disabled';
1694
+ }
1695
+ interface UpdateWebhookResponseSuccess {
1696
+ object: 'webhook';
1697
+ id: string;
1698
+ }
1699
+ type UpdateWebhookResponse = Response<UpdateWebhookResponseSuccess>;
1700
+ //#endregion
1701
+ //#region src/webhooks/webhooks.d.ts
1702
+ interface Headers {
1703
+ id: string;
1704
+ timestamp: string;
1705
+ signature: string;
1706
+ }
1707
+ interface VerifyWebhookOptions {
1708
+ payload: string;
1709
+ headers: Headers;
1710
+ webhookSecret: string;
1711
+ }
1712
+ declare class Webhooks {
1713
+ private readonly resend;
1714
+ constructor(resend: Resend);
1715
+ create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
1716
+ get(id: string): Promise<GetWebhookResponse>;
1717
+ list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
1718
+ update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
1719
+ remove(id: string): Promise<RemoveWebhookResponse>;
1720
+ verify(payload: VerifyWebhookOptions): WebhookEventPayload;
1721
+ }
1722
+ //#endregion
1723
+ //#region src/resend.d.ts
1724
+ declare class Resend {
1725
+ readonly key?: string | undefined;
1726
+ private readonly headers;
1727
+ readonly apiKeys: ApiKeys;
1728
+ readonly segments: Segments;
1729
+ /**
1730
+ * @deprecated Use segments instead
1731
+ */
1732
+ readonly audiences: Segments;
1733
+ readonly batch: Batch;
1734
+ readonly broadcasts: Broadcasts;
1735
+ readonly contacts: Contacts;
1736
+ readonly contactProperties: ContactProperties;
1737
+ readonly domains: Domains;
1738
+ readonly emails: Emails;
1739
+ readonly webhooks: Webhooks;
1740
+ readonly templates: Templates;
1741
+ readonly topics: Topics;
1742
+ constructor(key?: string | undefined);
1743
+ fetchRequest<T>(path: string, options?: {}): Promise<Response<T>>;
1744
+ post<T>(path: string, entity?: unknown, options?: PostOptions & IdempotentRequest): Promise<Response<T>>;
1745
+ get<T>(path: string, options?: GetOptions): Promise<Response<T>>;
1746
+ put<T>(path: string, entity: unknown, options?: PutOptions): Promise<Response<T>>;
1747
+ patch<T>(path: string, entity: unknown, options?: PatchOptions): Promise<Response<T>>;
1748
+ delete<T>(path: string, query?: unknown): Promise<Response<T>>;
1749
+ }
1750
+ //#endregion
1751
+ export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, Tag, Template, TemplateVariable, Topic, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, Webhook, WebhookEvent, WebhookEventPayload };