resend 6.1.0 → 6.2.0-canary.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.d.mts +273 -151
- package/dist/index.d.ts +273 -151
- package/dist/index.js +114 -2
- package/dist/index.mjs +114 -2
- package/package.json +17 -15
- package/readme.md +14 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,87 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
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 invalid_from_address: 403;
|
|
27
|
+
readonly validation_error: 403;
|
|
28
|
+
readonly not_found: 404;
|
|
29
|
+
readonly method_not_allowed: 405;
|
|
30
|
+
readonly application_error: 500;
|
|
31
|
+
readonly internal_server_error: 500;
|
|
32
|
+
};
|
|
33
|
+
type RESEND_ERROR_CODE_KEY = keyof typeof RESEND_ERROR_CODES_BY_KEY;
|
|
34
|
+
interface ErrorResponse {
|
|
35
|
+
message: string;
|
|
36
|
+
name: RESEND_ERROR_CODE_KEY;
|
|
37
|
+
}
|
|
38
|
+
type Tag$1 = {
|
|
39
|
+
name: string;
|
|
40
|
+
value: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
interface EmailApiAttachment {
|
|
44
|
+
content?: string | Buffer;
|
|
45
|
+
filename?: string | false | undefined;
|
|
46
|
+
path?: string;
|
|
47
|
+
content_type?: string;
|
|
48
|
+
content_id?: string;
|
|
49
|
+
}
|
|
50
|
+
interface EmailApiOptions {
|
|
51
|
+
from: string;
|
|
52
|
+
to: string | string[];
|
|
53
|
+
subject: string;
|
|
54
|
+
region?: string;
|
|
55
|
+
headers?: Record<string, string>;
|
|
56
|
+
html?: string;
|
|
57
|
+
text?: string;
|
|
58
|
+
bcc?: string | string[];
|
|
59
|
+
cc?: string | string[];
|
|
60
|
+
reply_to?: string | string[];
|
|
61
|
+
scheduled_at?: string;
|
|
62
|
+
tags?: Tag$1[];
|
|
63
|
+
attachments?: EmailApiAttachment[];
|
|
64
|
+
}
|
|
65
|
+
|
|
3
66
|
interface GetOptions {
|
|
4
67
|
query?: Record<string, unknown>;
|
|
5
68
|
headers?: HeadersInit;
|
|
6
69
|
}
|
|
7
70
|
|
|
71
|
+
interface IdempotentRequest {
|
|
72
|
+
/**
|
|
73
|
+
* Unique key that ensures the same operation is not processed multiple times.
|
|
74
|
+
* Allows for safe retries without duplicating operations.
|
|
75
|
+
* If provided, will be sent as the `Idempotency-Key` header.
|
|
76
|
+
*/
|
|
77
|
+
idempotencyKey?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface List<T> {
|
|
81
|
+
readonly object: 'list';
|
|
82
|
+
data: T[];
|
|
83
|
+
}
|
|
84
|
+
|
|
8
85
|
type PaginationOptions = {
|
|
9
86
|
/**
|
|
10
87
|
* Maximum number of items to return (1-100, default: 20)
|
|
@@ -24,6 +101,13 @@ type PaginationOptions = {
|
|
|
24
101
|
after?: never;
|
|
25
102
|
});
|
|
26
103
|
|
|
104
|
+
interface PatchOptions {
|
|
105
|
+
query?: {
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
headers?: HeadersInit;
|
|
109
|
+
}
|
|
110
|
+
|
|
27
111
|
interface PostOptions {
|
|
28
112
|
query?: {
|
|
29
113
|
[key: string]: unknown;
|
|
@@ -38,29 +122,9 @@ interface PutOptions {
|
|
|
38
122
|
headers?: HeadersInit;
|
|
39
123
|
}
|
|
40
124
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
readonly invalid_idempotent_request: 409;
|
|
45
|
-
readonly concurrent_idempotent_requests: 409;
|
|
46
|
-
readonly invalid_access: 422;
|
|
47
|
-
readonly invalid_parameter: 422;
|
|
48
|
-
readonly invalid_region: 422;
|
|
49
|
-
readonly rate_limit_exceeded: 429;
|
|
50
|
-
readonly missing_api_key: 401;
|
|
51
|
-
readonly invalid_api_key: 403;
|
|
52
|
-
readonly invalid_from_address: 403;
|
|
53
|
-
readonly validation_error: 403;
|
|
54
|
-
readonly not_found: 404;
|
|
55
|
-
readonly method_not_allowed: 405;
|
|
56
|
-
readonly application_error: 500;
|
|
57
|
-
readonly internal_server_error: 500;
|
|
58
|
-
};
|
|
59
|
-
type RESEND_ERROR_CODE_KEY = keyof typeof RESEND_ERROR_CODES_BY_KEY;
|
|
60
|
-
interface ErrorResponse {
|
|
61
|
-
message: string;
|
|
62
|
-
name: RESEND_ERROR_CODE_KEY;
|
|
63
|
-
}
|
|
125
|
+
type RequireAtLeastOne<T> = {
|
|
126
|
+
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
127
|
+
}[keyof T];
|
|
64
128
|
|
|
65
129
|
interface CreateApiKeyOptions {
|
|
66
130
|
name: string;
|
|
@@ -81,12 +145,6 @@ type CreateApiKeyResponse = {
|
|
|
81
145
|
error: ErrorResponse;
|
|
82
146
|
};
|
|
83
147
|
|
|
84
|
-
interface ApiKey {
|
|
85
|
-
created_at: string;
|
|
86
|
-
id: string;
|
|
87
|
-
name: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
148
|
type ListApiKeysOptions = PaginationOptions;
|
|
91
149
|
type ListApiKeysResponseSuccess = {
|
|
92
150
|
object: 'list';
|
|
@@ -110,6 +168,42 @@ type RemoveApiKeyResponse = {
|
|
|
110
168
|
error: ErrorResponse;
|
|
111
169
|
};
|
|
112
170
|
|
|
171
|
+
interface InboundAttachment {
|
|
172
|
+
id: string;
|
|
173
|
+
filename?: string;
|
|
174
|
+
contentType: string;
|
|
175
|
+
contentDisposition: 'inline' | 'attachment';
|
|
176
|
+
contentId?: string;
|
|
177
|
+
content: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
interface GetAttachmentOptions {
|
|
181
|
+
inboundId: string;
|
|
182
|
+
id: string;
|
|
183
|
+
}
|
|
184
|
+
interface GetAttachmentResponseSuccess {
|
|
185
|
+
object: 'attachment';
|
|
186
|
+
data: InboundAttachment;
|
|
187
|
+
}
|
|
188
|
+
type GetAttachmentResponse = {
|
|
189
|
+
data: GetAttachmentResponseSuccess;
|
|
190
|
+
error: null;
|
|
191
|
+
} | {
|
|
192
|
+
data: null;
|
|
193
|
+
error: ErrorResponse;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
interface ListAttachmentsOptions {
|
|
197
|
+
inboundId: string;
|
|
198
|
+
}
|
|
199
|
+
type ListAttachmentsResponse = {
|
|
200
|
+
data: InboundAttachment[];
|
|
201
|
+
error: null;
|
|
202
|
+
} | {
|
|
203
|
+
data: null;
|
|
204
|
+
error: ErrorResponse;
|
|
205
|
+
};
|
|
206
|
+
|
|
113
207
|
interface Audience {
|
|
114
208
|
created_at: string;
|
|
115
209
|
id: string;
|
|
@@ -169,19 +263,6 @@ type RemoveAudiencesResponse = {
|
|
|
169
263
|
error: ErrorResponse;
|
|
170
264
|
};
|
|
171
265
|
|
|
172
|
-
interface IdempotentRequest {
|
|
173
|
-
/**
|
|
174
|
-
* Unique key that ensures the same operation is not processed multiple times.
|
|
175
|
-
* Allows for safe retries without duplicating operations.
|
|
176
|
-
* If provided, will be sent as the `Idempotency-Key` header.
|
|
177
|
-
*/
|
|
178
|
-
idempotencyKey?: string;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
type RequireAtLeastOne<T> = {
|
|
182
|
-
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
183
|
-
}[keyof T];
|
|
184
|
-
|
|
185
266
|
interface EmailRenderOptions$1 {
|
|
186
267
|
/**
|
|
187
268
|
* The React component used to write the message.
|
|
@@ -340,6 +421,20 @@ type CreateBatchResponse<Options extends CreateBatchRequestOptions> = {
|
|
|
340
421
|
error: ErrorResponse;
|
|
341
422
|
};
|
|
342
423
|
|
|
424
|
+
interface Broadcast {
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
audience_id: string | null;
|
|
428
|
+
from: string | null;
|
|
429
|
+
subject: string | null;
|
|
430
|
+
reply_to: string[] | null;
|
|
431
|
+
preview_text: string | null;
|
|
432
|
+
status: 'draft' | 'sent' | 'queued';
|
|
433
|
+
created_at: string;
|
|
434
|
+
scheduled_at: string | null;
|
|
435
|
+
sent_at: string | null;
|
|
436
|
+
}
|
|
437
|
+
|
|
343
438
|
interface EmailRenderOptions {
|
|
344
439
|
/**
|
|
345
440
|
* The React component used to write the message.
|
|
@@ -413,6 +508,43 @@ type CreateBroadcastResponse = {
|
|
|
413
508
|
error: ErrorResponse;
|
|
414
509
|
};
|
|
415
510
|
|
|
511
|
+
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
512
|
+
object: 'broadcast';
|
|
513
|
+
}
|
|
514
|
+
type GetBroadcastResponse = {
|
|
515
|
+
data: GetBroadcastResponseSuccess;
|
|
516
|
+
error: null;
|
|
517
|
+
} | {
|
|
518
|
+
data: null;
|
|
519
|
+
error: ErrorResponse;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
type ListBroadcastsOptions = PaginationOptions;
|
|
523
|
+
type ListBroadcastsResponseSuccess = {
|
|
524
|
+
object: 'list';
|
|
525
|
+
has_more: boolean;
|
|
526
|
+
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
527
|
+
};
|
|
528
|
+
type ListBroadcastsResponse = {
|
|
529
|
+
data: ListBroadcastsResponseSuccess;
|
|
530
|
+
error: null;
|
|
531
|
+
} | {
|
|
532
|
+
data: null;
|
|
533
|
+
error: ErrorResponse;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
537
|
+
object: 'broadcast';
|
|
538
|
+
deleted: boolean;
|
|
539
|
+
}
|
|
540
|
+
type RemoveBroadcastResponse = {
|
|
541
|
+
data: RemoveBroadcastResponseSuccess;
|
|
542
|
+
error: null;
|
|
543
|
+
} | {
|
|
544
|
+
data: null;
|
|
545
|
+
error: ErrorResponse;
|
|
546
|
+
};
|
|
547
|
+
|
|
416
548
|
interface SendBroadcastBaseOptions {
|
|
417
549
|
/**
|
|
418
550
|
* Schedule email to be sent later.
|
|
@@ -438,6 +570,28 @@ type SendBroadcastResponse = {
|
|
|
438
570
|
error: ErrorResponse;
|
|
439
571
|
};
|
|
440
572
|
|
|
573
|
+
interface UpdateBroadcastResponseSuccess {
|
|
574
|
+
id: string;
|
|
575
|
+
}
|
|
576
|
+
type UpdateBroadcastOptions = {
|
|
577
|
+
name?: string;
|
|
578
|
+
audienceId?: string;
|
|
579
|
+
from?: string;
|
|
580
|
+
html?: string;
|
|
581
|
+
react?: React.ReactNode;
|
|
582
|
+
text?: string;
|
|
583
|
+
subject?: string;
|
|
584
|
+
replyTo?: string[];
|
|
585
|
+
previewText?: string;
|
|
586
|
+
};
|
|
587
|
+
type UpdateBroadcastResponse = {
|
|
588
|
+
data: UpdateBroadcastResponseSuccess;
|
|
589
|
+
error: null;
|
|
590
|
+
} | {
|
|
591
|
+
data: null;
|
|
592
|
+
error: ErrorResponse;
|
|
593
|
+
};
|
|
594
|
+
|
|
441
595
|
interface Contact {
|
|
442
596
|
created_at: string;
|
|
443
597
|
id: string;
|
|
@@ -558,6 +712,7 @@ type UpdateContactResponse = {
|
|
|
558
712
|
};
|
|
559
713
|
|
|
560
714
|
type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
|
|
715
|
+
type DomainNameservers = 'Amazon Route 53' | 'Cloudflare' | 'Digital Ocean' | 'GoDaddy' | 'Google Domains' | 'Namecheap' | 'Unidentified' | 'Vercel';
|
|
561
716
|
type DomainStatus = 'pending' | 'verified' | 'failed' | 'temporary_failure' | 'not_started';
|
|
562
717
|
type DomainRecords = DomainSpfRecord | DomainDkimRecord;
|
|
563
718
|
interface DomainSpfRecord {
|
|
@@ -674,6 +829,18 @@ type VerifyDomainsResponse = {
|
|
|
674
829
|
error: ErrorResponse;
|
|
675
830
|
};
|
|
676
831
|
|
|
832
|
+
interface CancelEmailResponseSuccess {
|
|
833
|
+
object: 'email';
|
|
834
|
+
id: string;
|
|
835
|
+
}
|
|
836
|
+
type CancelEmailResponse = {
|
|
837
|
+
data: CancelEmailResponseSuccess;
|
|
838
|
+
error: null;
|
|
839
|
+
} | {
|
|
840
|
+
data: null;
|
|
841
|
+
error: ErrorResponse;
|
|
842
|
+
};
|
|
843
|
+
|
|
677
844
|
interface GetEmailResponseSuccess {
|
|
678
845
|
bcc: string[] | null;
|
|
679
846
|
cc: string[] | null;
|
|
@@ -701,6 +868,54 @@ type GetEmailResponse = {
|
|
|
701
868
|
error: ErrorResponse;
|
|
702
869
|
};
|
|
703
870
|
|
|
871
|
+
interface UpdateEmailOptions {
|
|
872
|
+
id: string;
|
|
873
|
+
scheduledAt: string;
|
|
874
|
+
}
|
|
875
|
+
interface UpdateEmailResponseSuccess {
|
|
876
|
+
id: string;
|
|
877
|
+
object: 'email';
|
|
878
|
+
}
|
|
879
|
+
type UpdateEmailResponse = {
|
|
880
|
+
data: UpdateEmailResponseSuccess;
|
|
881
|
+
error: null;
|
|
882
|
+
} | {
|
|
883
|
+
data: null;
|
|
884
|
+
error: ErrorResponse;
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
interface InboundEmail {
|
|
888
|
+
id: string;
|
|
889
|
+
to: string[];
|
|
890
|
+
from: string;
|
|
891
|
+
createdAt: string;
|
|
892
|
+
subject: string;
|
|
893
|
+
bcc: string[] | null;
|
|
894
|
+
cc: string[] | null;
|
|
895
|
+
replyTo: string[] | null;
|
|
896
|
+
html: string | null;
|
|
897
|
+
text: string | null;
|
|
898
|
+
attachments: InboundEmailAttachment[];
|
|
899
|
+
}
|
|
900
|
+
interface InboundEmailAttachment {
|
|
901
|
+
id: string;
|
|
902
|
+
filename: string;
|
|
903
|
+
contentType: string;
|
|
904
|
+
contentId: string;
|
|
905
|
+
contentDisposition: string;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
interface GetInboundEmailResponseSuccess extends InboundEmail {
|
|
909
|
+
object: 'inbound';
|
|
910
|
+
}
|
|
911
|
+
type GetInboundEmailResponse = {
|
|
912
|
+
data: GetInboundEmailResponseSuccess;
|
|
913
|
+
error: null;
|
|
914
|
+
} | {
|
|
915
|
+
data: null;
|
|
916
|
+
error: ErrorResponse;
|
|
917
|
+
};
|
|
918
|
+
|
|
704
919
|
declare class ApiKeys {
|
|
705
920
|
private readonly resend;
|
|
706
921
|
constructor(resend: Resend);
|
|
@@ -709,6 +924,13 @@ declare class ApiKeys {
|
|
|
709
924
|
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
710
925
|
}
|
|
711
926
|
|
|
927
|
+
declare class Attachments {
|
|
928
|
+
private readonly resend;
|
|
929
|
+
constructor(resend: Resend);
|
|
930
|
+
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
931
|
+
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
932
|
+
}
|
|
933
|
+
|
|
712
934
|
declare class Audiences {
|
|
713
935
|
private readonly resend;
|
|
714
936
|
constructor(resend: Resend);
|
|
@@ -725,79 +947,6 @@ declare class Batch {
|
|
|
725
947
|
create<Options extends CreateBatchRequestOptions>(payload: CreateBatchOptions, options?: Options): Promise<CreateBatchResponse<Options>>;
|
|
726
948
|
}
|
|
727
949
|
|
|
728
|
-
interface Broadcast {
|
|
729
|
-
id: string;
|
|
730
|
-
name: string;
|
|
731
|
-
audience_id: string | null;
|
|
732
|
-
from: string | null;
|
|
733
|
-
subject: string | null;
|
|
734
|
-
reply_to: string[] | null;
|
|
735
|
-
preview_text: string | null;
|
|
736
|
-
status: 'draft' | 'sent' | 'queued';
|
|
737
|
-
created_at: string;
|
|
738
|
-
scheduled_at: string | null;
|
|
739
|
-
sent_at: string | null;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
interface GetBroadcastResponseSuccess extends Broadcast {
|
|
743
|
-
object: 'broadcast';
|
|
744
|
-
}
|
|
745
|
-
type GetBroadcastResponse = {
|
|
746
|
-
data: GetBroadcastResponseSuccess;
|
|
747
|
-
error: null;
|
|
748
|
-
} | {
|
|
749
|
-
data: null;
|
|
750
|
-
error: ErrorResponse;
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
type ListBroadcastsOptions = PaginationOptions;
|
|
754
|
-
type ListBroadcastsResponseSuccess = {
|
|
755
|
-
object: 'list';
|
|
756
|
-
has_more: boolean;
|
|
757
|
-
data: Pick<Broadcast, 'id' | 'name' | 'audience_id' | 'status' | 'created_at' | 'scheduled_at' | 'sent_at'>[];
|
|
758
|
-
};
|
|
759
|
-
type ListBroadcastsResponse = {
|
|
760
|
-
data: ListBroadcastsResponseSuccess;
|
|
761
|
-
error: null;
|
|
762
|
-
} | {
|
|
763
|
-
data: null;
|
|
764
|
-
error: ErrorResponse;
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
interface RemoveBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
768
|
-
object: 'broadcast';
|
|
769
|
-
deleted: boolean;
|
|
770
|
-
}
|
|
771
|
-
type RemoveBroadcastResponse = {
|
|
772
|
-
data: RemoveBroadcastResponseSuccess;
|
|
773
|
-
error: null;
|
|
774
|
-
} | {
|
|
775
|
-
data: null;
|
|
776
|
-
error: ErrorResponse;
|
|
777
|
-
};
|
|
778
|
-
|
|
779
|
-
interface UpdateBroadcastResponseSuccess {
|
|
780
|
-
id: string;
|
|
781
|
-
}
|
|
782
|
-
type UpdateBroadcastOptions = {
|
|
783
|
-
name?: string;
|
|
784
|
-
audienceId?: string;
|
|
785
|
-
from?: string;
|
|
786
|
-
html?: string;
|
|
787
|
-
react?: React.ReactNode;
|
|
788
|
-
text?: string;
|
|
789
|
-
subject?: string;
|
|
790
|
-
replyTo?: string[];
|
|
791
|
-
previewText?: string;
|
|
792
|
-
};
|
|
793
|
-
type UpdateBroadcastResponse = {
|
|
794
|
-
data: UpdateBroadcastResponseSuccess;
|
|
795
|
-
error: null;
|
|
796
|
-
} | {
|
|
797
|
-
data: null;
|
|
798
|
-
error: ErrorResponse;
|
|
799
|
-
};
|
|
800
|
-
|
|
801
950
|
declare class Broadcasts {
|
|
802
951
|
private readonly resend;
|
|
803
952
|
constructor(resend: Resend);
|
|
@@ -809,13 +958,6 @@ declare class Broadcasts {
|
|
|
809
958
|
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
810
959
|
}
|
|
811
960
|
|
|
812
|
-
interface PatchOptions {
|
|
813
|
-
query?: {
|
|
814
|
-
[key: string]: unknown;
|
|
815
|
-
};
|
|
816
|
-
headers?: HeadersInit;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
961
|
declare class Contacts {
|
|
820
962
|
private readonly resend;
|
|
821
963
|
constructor(resend: Resend);
|
|
@@ -837,18 +979,6 @@ declare class Domains {
|
|
|
837
979
|
verify(id: string): Promise<VerifyDomainsResponse>;
|
|
838
980
|
}
|
|
839
981
|
|
|
840
|
-
interface CancelEmailResponseSuccess {
|
|
841
|
-
object: 'email';
|
|
842
|
-
id: string;
|
|
843
|
-
}
|
|
844
|
-
type CancelEmailResponse = {
|
|
845
|
-
data: CancelEmailResponseSuccess;
|
|
846
|
-
error: null;
|
|
847
|
-
} | {
|
|
848
|
-
data: null;
|
|
849
|
-
error: ErrorResponse;
|
|
850
|
-
};
|
|
851
|
-
|
|
852
982
|
type ListEmailsOptions = PaginationOptions;
|
|
853
983
|
type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
|
|
854
984
|
type ListEmailsResponseSuccess = {
|
|
@@ -864,22 +994,6 @@ type ListEmailsResponse = {
|
|
|
864
994
|
error: ErrorResponse;
|
|
865
995
|
};
|
|
866
996
|
|
|
867
|
-
interface UpdateEmailOptions {
|
|
868
|
-
id: string;
|
|
869
|
-
scheduledAt: string;
|
|
870
|
-
}
|
|
871
|
-
interface UpdateEmailResponseSuccess {
|
|
872
|
-
id: string;
|
|
873
|
-
object: 'email';
|
|
874
|
-
}
|
|
875
|
-
type UpdateEmailResponse = {
|
|
876
|
-
data: UpdateEmailResponseSuccess;
|
|
877
|
-
error: null;
|
|
878
|
-
} | {
|
|
879
|
-
data: null;
|
|
880
|
-
error: ErrorResponse;
|
|
881
|
-
};
|
|
882
|
-
|
|
883
997
|
declare class Emails {
|
|
884
998
|
private readonly resend;
|
|
885
999
|
constructor(resend: Resend);
|
|
@@ -891,16 +1005,24 @@ declare class Emails {
|
|
|
891
1005
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
892
1006
|
}
|
|
893
1007
|
|
|
1008
|
+
declare class Inbound {
|
|
1009
|
+
private readonly resend;
|
|
1010
|
+
constructor(resend: Resend);
|
|
1011
|
+
get(id: string): Promise<GetInboundEmailResponse>;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
894
1014
|
declare class Resend {
|
|
895
1015
|
readonly key?: string | undefined;
|
|
896
1016
|
private readonly headers;
|
|
897
1017
|
readonly apiKeys: ApiKeys;
|
|
1018
|
+
readonly attachments: Attachments;
|
|
898
1019
|
readonly audiences: Audiences;
|
|
899
1020
|
readonly batch: Batch;
|
|
900
1021
|
readonly broadcasts: Broadcasts;
|
|
901
1022
|
readonly contacts: Contacts;
|
|
902
1023
|
readonly domains: Domains;
|
|
903
1024
|
readonly emails: Emails;
|
|
1025
|
+
readonly inbound: Inbound;
|
|
904
1026
|
constructor(key?: string | undefined);
|
|
905
1027
|
fetchRequest<T>(path: string, options?: {}): Promise<{
|
|
906
1028
|
data: T;
|
|
@@ -946,4 +1068,4 @@ declare class Resend {
|
|
|
946
1068
|
}>;
|
|
947
1069
|
}
|
|
948
1070
|
|
|
949
|
-
export { type Attachment, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateAudienceOptions, type CreateAudienceRequestOptions, type CreateAudienceResponse, type CreateAudienceResponseSuccess, 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 ErrorResponse, type GetAudienceResponse, type GetAudienceResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAudiencesOptions, type ListAudiencesResponse, type ListAudiencesResponseSuccess, type ListContactsOptions, type ListContactsResponse, type ListContactsResponseSuccess, type ListDomainsOptions, type ListDomainsResponse, type ListDomainsResponseSuccess, type PaginationOptions, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveAudiencesResponse, type RemoveAudiencesResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, Resend, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess };
|
|
1071
|
+
export { type ApiKey, type Attachment, type Audience, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateAudienceOptions, type CreateAudienceRequestOptions, type CreateAudienceResponse, type CreateAudienceResponseSuccess, 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 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 GetAudienceResponse, type GetAudienceResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetInboundEmailResponse, type GetInboundEmailResponseSuccess, type GetOptions, type IdempotentRequest, type InboundAttachment, type InboundEmail, type InboundEmailAttachment, type List, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAudiencesOptions, type ListAudiencesResponse, type ListAudiencesResponseSuccess, type ListBroadcastsOptions, type ListBroadcastsResponse, type ListBroadcastsResponseSuccess, type ListContactsOptions, type ListContactsResponse, type ListContactsResponseSuccess, type ListDomainsOptions, type ListDomainsResponse, type ListDomainsResponseSuccess, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveAudiencesResponse, type RemoveAudiencesResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RequireAtLeastOne, Resend, 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 VerifyDomainsResponse, type VerifyDomainsResponseSuccess };
|