resend 6.2.0-canary.0 → 6.2.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +54 -31
- package/dist/index.d.ts +54 -31
- package/dist/index.js +43 -97
- package/dist/index.mjs +43 -97
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -171,14 +171,14 @@ type RemoveApiKeyResponse = {
|
|
|
171
171
|
interface InboundAttachment {
|
|
172
172
|
id: string;
|
|
173
173
|
filename?: string;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
content_type: string;
|
|
175
|
+
content_disposition: 'inline' | 'attachment';
|
|
176
|
+
content_id?: string;
|
|
177
177
|
content: string;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
interface GetAttachmentOptions {
|
|
181
|
-
|
|
181
|
+
emailId: string;
|
|
182
182
|
id: string;
|
|
183
183
|
}
|
|
184
184
|
interface GetAttachmentResponseSuccess {
|
|
@@ -193,11 +193,16 @@ type GetAttachmentResponse = {
|
|
|
193
193
|
error: ErrorResponse;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
type ListAttachmentsOptions = PaginationOptions & {
|
|
197
|
+
emailId: string;
|
|
198
|
+
};
|
|
199
|
+
interface ListAttachmentsResponseSuccess {
|
|
200
|
+
object: 'list';
|
|
201
|
+
has_more: boolean;
|
|
202
|
+
data: InboundAttachment[];
|
|
198
203
|
}
|
|
199
204
|
type ListAttachmentsResponse = {
|
|
200
|
-
data:
|
|
205
|
+
data: ListAttachmentsResponseSuccess;
|
|
201
206
|
error: null;
|
|
202
207
|
} | {
|
|
203
208
|
data: null;
|
|
@@ -884,29 +889,26 @@ type UpdateEmailResponse = {
|
|
|
884
889
|
error: ErrorResponse;
|
|
885
890
|
};
|
|
886
891
|
|
|
887
|
-
interface
|
|
892
|
+
interface GetInboundEmailResponseSuccess {
|
|
893
|
+
object: 'inbound';
|
|
888
894
|
id: string;
|
|
889
895
|
to: string[];
|
|
890
896
|
from: string;
|
|
891
|
-
|
|
897
|
+
created_at: string;
|
|
892
898
|
subject: string;
|
|
893
899
|
bcc: string[] | null;
|
|
894
900
|
cc: string[] | null;
|
|
895
|
-
|
|
901
|
+
reply_to: string[] | null;
|
|
896
902
|
html: string | null;
|
|
897
903
|
text: string | null;
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
interface GetInboundEmailResponseSuccess extends InboundEmail {
|
|
909
|
-
object: 'inbound';
|
|
904
|
+
headers: Record<string, string>;
|
|
905
|
+
attachments: Array<{
|
|
906
|
+
id: string;
|
|
907
|
+
filename: string;
|
|
908
|
+
content_type: string;
|
|
909
|
+
content_id: string;
|
|
910
|
+
content_disposition: string;
|
|
911
|
+
}>;
|
|
910
912
|
}
|
|
911
913
|
type GetInboundEmailResponse = {
|
|
912
914
|
data: GetInboundEmailResponseSuccess;
|
|
@@ -916,6 +918,21 @@ type GetInboundEmailResponse = {
|
|
|
916
918
|
error: ErrorResponse;
|
|
917
919
|
};
|
|
918
920
|
|
|
921
|
+
type ListInboundEmailsOptions = PaginationOptions;
|
|
922
|
+
type ListInboundEmail = Omit<GetInboundEmailResponseSuccess, 'html' | 'text' | 'headers' | 'object'>;
|
|
923
|
+
interface ListInboundEmailsResponseSuccess {
|
|
924
|
+
object: 'list';
|
|
925
|
+
has_more: boolean;
|
|
926
|
+
data: ListInboundEmail[];
|
|
927
|
+
}
|
|
928
|
+
type ListInboundEmailsResponse = {
|
|
929
|
+
data: ListInboundEmailsResponseSuccess;
|
|
930
|
+
error: null;
|
|
931
|
+
} | {
|
|
932
|
+
data: null;
|
|
933
|
+
error: ErrorResponse;
|
|
934
|
+
};
|
|
935
|
+
|
|
919
936
|
declare class ApiKeys {
|
|
920
937
|
private readonly resend;
|
|
921
938
|
constructor(resend: Resend);
|
|
@@ -924,13 +941,18 @@ declare class ApiKeys {
|
|
|
924
941
|
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
925
942
|
}
|
|
926
943
|
|
|
927
|
-
declare class
|
|
944
|
+
declare class Receiving$1 {
|
|
928
945
|
private readonly resend;
|
|
929
946
|
constructor(resend: Resend);
|
|
930
947
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
931
948
|
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
932
949
|
}
|
|
933
950
|
|
|
951
|
+
declare class Attachments {
|
|
952
|
+
readonly receiving: Receiving$1;
|
|
953
|
+
constructor(resend: Resend);
|
|
954
|
+
}
|
|
955
|
+
|
|
934
956
|
declare class Audiences {
|
|
935
957
|
private readonly resend;
|
|
936
958
|
constructor(resend: Resend);
|
|
@@ -994,8 +1016,16 @@ type ListEmailsResponse = {
|
|
|
994
1016
|
error: ErrorResponse;
|
|
995
1017
|
};
|
|
996
1018
|
|
|
1019
|
+
declare class Receiving {
|
|
1020
|
+
private readonly resend;
|
|
1021
|
+
constructor(resend: Resend);
|
|
1022
|
+
get(id: string): Promise<GetInboundEmailResponse>;
|
|
1023
|
+
list(options?: ListInboundEmailsOptions): Promise<ListInboundEmailsResponse>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
997
1026
|
declare class Emails {
|
|
998
1027
|
private readonly resend;
|
|
1028
|
+
readonly receiving: Receiving;
|
|
999
1029
|
constructor(resend: Resend);
|
|
1000
1030
|
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1001
1031
|
create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
@@ -1005,12 +1035,6 @@ declare class Emails {
|
|
|
1005
1035
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1006
1036
|
}
|
|
1007
1037
|
|
|
1008
|
-
declare class Inbound {
|
|
1009
|
-
private readonly resend;
|
|
1010
|
-
constructor(resend: Resend);
|
|
1011
|
-
get(id: string): Promise<GetInboundEmailResponse>;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
1038
|
declare class Resend {
|
|
1015
1039
|
readonly key?: string | undefined;
|
|
1016
1040
|
private readonly headers;
|
|
@@ -1022,7 +1046,6 @@ declare class Resend {
|
|
|
1022
1046
|
readonly contacts: Contacts;
|
|
1023
1047
|
readonly domains: Domains;
|
|
1024
1048
|
readonly emails: Emails;
|
|
1025
|
-
readonly inbound: Inbound;
|
|
1026
1049
|
constructor(key?: string | undefined);
|
|
1027
1050
|
fetchRequest<T>(path: string, options?: {}): Promise<{
|
|
1028
1051
|
data: T;
|
|
@@ -1068,4 +1091,4 @@ declare class Resend {
|
|
|
1068
1091
|
}>;
|
|
1069
1092
|
}
|
|
1070
1093
|
|
|
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
|
|
1094
|
+
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 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 ListInboundEmail, type ListInboundEmailsOptions, type ListInboundEmailsResponse, type ListInboundEmailsResponseSuccess, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -171,14 +171,14 @@ type RemoveApiKeyResponse = {
|
|
|
171
171
|
interface InboundAttachment {
|
|
172
172
|
id: string;
|
|
173
173
|
filename?: string;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
content_type: string;
|
|
175
|
+
content_disposition: 'inline' | 'attachment';
|
|
176
|
+
content_id?: string;
|
|
177
177
|
content: string;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
interface GetAttachmentOptions {
|
|
181
|
-
|
|
181
|
+
emailId: string;
|
|
182
182
|
id: string;
|
|
183
183
|
}
|
|
184
184
|
interface GetAttachmentResponseSuccess {
|
|
@@ -193,11 +193,16 @@ type GetAttachmentResponse = {
|
|
|
193
193
|
error: ErrorResponse;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
type ListAttachmentsOptions = PaginationOptions & {
|
|
197
|
+
emailId: string;
|
|
198
|
+
};
|
|
199
|
+
interface ListAttachmentsResponseSuccess {
|
|
200
|
+
object: 'list';
|
|
201
|
+
has_more: boolean;
|
|
202
|
+
data: InboundAttachment[];
|
|
198
203
|
}
|
|
199
204
|
type ListAttachmentsResponse = {
|
|
200
|
-
data:
|
|
205
|
+
data: ListAttachmentsResponseSuccess;
|
|
201
206
|
error: null;
|
|
202
207
|
} | {
|
|
203
208
|
data: null;
|
|
@@ -884,29 +889,26 @@ type UpdateEmailResponse = {
|
|
|
884
889
|
error: ErrorResponse;
|
|
885
890
|
};
|
|
886
891
|
|
|
887
|
-
interface
|
|
892
|
+
interface GetInboundEmailResponseSuccess {
|
|
893
|
+
object: 'inbound';
|
|
888
894
|
id: string;
|
|
889
895
|
to: string[];
|
|
890
896
|
from: string;
|
|
891
|
-
|
|
897
|
+
created_at: string;
|
|
892
898
|
subject: string;
|
|
893
899
|
bcc: string[] | null;
|
|
894
900
|
cc: string[] | null;
|
|
895
|
-
|
|
901
|
+
reply_to: string[] | null;
|
|
896
902
|
html: string | null;
|
|
897
903
|
text: string | null;
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
interface GetInboundEmailResponseSuccess extends InboundEmail {
|
|
909
|
-
object: 'inbound';
|
|
904
|
+
headers: Record<string, string>;
|
|
905
|
+
attachments: Array<{
|
|
906
|
+
id: string;
|
|
907
|
+
filename: string;
|
|
908
|
+
content_type: string;
|
|
909
|
+
content_id: string;
|
|
910
|
+
content_disposition: string;
|
|
911
|
+
}>;
|
|
910
912
|
}
|
|
911
913
|
type GetInboundEmailResponse = {
|
|
912
914
|
data: GetInboundEmailResponseSuccess;
|
|
@@ -916,6 +918,21 @@ type GetInboundEmailResponse = {
|
|
|
916
918
|
error: ErrorResponse;
|
|
917
919
|
};
|
|
918
920
|
|
|
921
|
+
type ListInboundEmailsOptions = PaginationOptions;
|
|
922
|
+
type ListInboundEmail = Omit<GetInboundEmailResponseSuccess, 'html' | 'text' | 'headers' | 'object'>;
|
|
923
|
+
interface ListInboundEmailsResponseSuccess {
|
|
924
|
+
object: 'list';
|
|
925
|
+
has_more: boolean;
|
|
926
|
+
data: ListInboundEmail[];
|
|
927
|
+
}
|
|
928
|
+
type ListInboundEmailsResponse = {
|
|
929
|
+
data: ListInboundEmailsResponseSuccess;
|
|
930
|
+
error: null;
|
|
931
|
+
} | {
|
|
932
|
+
data: null;
|
|
933
|
+
error: ErrorResponse;
|
|
934
|
+
};
|
|
935
|
+
|
|
919
936
|
declare class ApiKeys {
|
|
920
937
|
private readonly resend;
|
|
921
938
|
constructor(resend: Resend);
|
|
@@ -924,13 +941,18 @@ declare class ApiKeys {
|
|
|
924
941
|
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
925
942
|
}
|
|
926
943
|
|
|
927
|
-
declare class
|
|
944
|
+
declare class Receiving$1 {
|
|
928
945
|
private readonly resend;
|
|
929
946
|
constructor(resend: Resend);
|
|
930
947
|
get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
|
|
931
948
|
list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
|
|
932
949
|
}
|
|
933
950
|
|
|
951
|
+
declare class Attachments {
|
|
952
|
+
readonly receiving: Receiving$1;
|
|
953
|
+
constructor(resend: Resend);
|
|
954
|
+
}
|
|
955
|
+
|
|
934
956
|
declare class Audiences {
|
|
935
957
|
private readonly resend;
|
|
936
958
|
constructor(resend: Resend);
|
|
@@ -994,8 +1016,16 @@ type ListEmailsResponse = {
|
|
|
994
1016
|
error: ErrorResponse;
|
|
995
1017
|
};
|
|
996
1018
|
|
|
1019
|
+
declare class Receiving {
|
|
1020
|
+
private readonly resend;
|
|
1021
|
+
constructor(resend: Resend);
|
|
1022
|
+
get(id: string): Promise<GetInboundEmailResponse>;
|
|
1023
|
+
list(options?: ListInboundEmailsOptions): Promise<ListInboundEmailsResponse>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
997
1026
|
declare class Emails {
|
|
998
1027
|
private readonly resend;
|
|
1028
|
+
readonly receiving: Receiving;
|
|
999
1029
|
constructor(resend: Resend);
|
|
1000
1030
|
send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
1001
1031
|
create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
|
|
@@ -1005,12 +1035,6 @@ declare class Emails {
|
|
|
1005
1035
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1006
1036
|
}
|
|
1007
1037
|
|
|
1008
|
-
declare class Inbound {
|
|
1009
|
-
private readonly resend;
|
|
1010
|
-
constructor(resend: Resend);
|
|
1011
|
-
get(id: string): Promise<GetInboundEmailResponse>;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
1038
|
declare class Resend {
|
|
1015
1039
|
readonly key?: string | undefined;
|
|
1016
1040
|
private readonly headers;
|
|
@@ -1022,7 +1046,6 @@ declare class Resend {
|
|
|
1022
1046
|
readonly contacts: Contacts;
|
|
1023
1047
|
readonly domains: Domains;
|
|
1024
1048
|
readonly emails: Emails;
|
|
1025
|
-
readonly inbound: Inbound;
|
|
1026
1049
|
constructor(key?: string | undefined);
|
|
1027
1050
|
fetchRequest<T>(path: string, options?: {}): Promise<{
|
|
1028
1051
|
data: T;
|
|
@@ -1068,4 +1091,4 @@ declare class Resend {
|
|
|
1068
1091
|
}>;
|
|
1069
1092
|
}
|
|
1070
1093
|
|
|
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
|
|
1094
|
+
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 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 ListInboundEmail, type ListInboundEmailsOptions, type ListInboundEmailsResponse, type ListInboundEmailsResponseSuccess, 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 };
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,7 @@ __export(index_exports, {
|
|
|
84
84
|
module.exports = __toCommonJS(index_exports);
|
|
85
85
|
|
|
86
86
|
// package.json
|
|
87
|
-
var version = "6.2.0-canary.
|
|
87
|
+
var version = "6.2.0-canary.2";
|
|
88
88
|
|
|
89
89
|
// src/common/utils/build-pagination-query.ts
|
|
90
90
|
function buildPaginationQuery(options) {
|
|
@@ -134,70 +134,38 @@ var ApiKeys = class {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
// src/attachments/
|
|
138
|
-
var
|
|
137
|
+
// src/attachments/receiving/receiving.ts
|
|
138
|
+
var Receiving = class {
|
|
139
139
|
constructor(resend) {
|
|
140
140
|
this.resend = resend;
|
|
141
141
|
}
|
|
142
142
|
get(options) {
|
|
143
143
|
return __async(this, null, function* () {
|
|
144
|
-
const {
|
|
144
|
+
const { emailId, id } = options;
|
|
145
145
|
const data = yield this.resend.get(
|
|
146
|
-
`/emails/
|
|
146
|
+
`/emails/receiving/${emailId}/attachments/${id}`
|
|
147
147
|
);
|
|
148
|
-
|
|
149
|
-
return {
|
|
150
|
-
data: null,
|
|
151
|
-
error: data.error
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const apiResponse = data.data;
|
|
155
|
-
const transformedData = {
|
|
156
|
-
object: apiResponse.object,
|
|
157
|
-
data: {
|
|
158
|
-
id: apiResponse.data.id,
|
|
159
|
-
filename: apiResponse.data.filename,
|
|
160
|
-
contentType: apiResponse.data.content_type,
|
|
161
|
-
contentDisposition: apiResponse.data.content_disposition,
|
|
162
|
-
contentId: apiResponse.data.content_id,
|
|
163
|
-
content: apiResponse.data.content
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
return {
|
|
167
|
-
data: transformedData,
|
|
168
|
-
error: null
|
|
169
|
-
};
|
|
148
|
+
return data;
|
|
170
149
|
});
|
|
171
150
|
}
|
|
172
151
|
list(options) {
|
|
173
152
|
return __async(this, null, function* () {
|
|
174
|
-
const {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
return {
|
|
180
|
-
data: null,
|
|
181
|
-
error: data.error
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
const apiResponse = data.data;
|
|
185
|
-
const transformedData = apiResponse.data.map((attachment) => ({
|
|
186
|
-
id: attachment.id,
|
|
187
|
-
filename: attachment.filename,
|
|
188
|
-
contentType: attachment.content_type,
|
|
189
|
-
contentDisposition: attachment.content_disposition,
|
|
190
|
-
contentId: attachment.content_id,
|
|
191
|
-
content: attachment.content
|
|
192
|
-
}));
|
|
193
|
-
return {
|
|
194
|
-
data: transformedData,
|
|
195
|
-
error: null
|
|
196
|
-
};
|
|
153
|
+
const { emailId } = options;
|
|
154
|
+
const queryString = buildPaginationQuery(options);
|
|
155
|
+
const url = queryString ? `/emails/receiving/${emailId}/attachments?${queryString}` : `/emails/receiving/${emailId}/attachments`;
|
|
156
|
+
const data = yield this.resend.get(url);
|
|
157
|
+
return data;
|
|
197
158
|
});
|
|
198
159
|
}
|
|
199
160
|
};
|
|
200
161
|
|
|
162
|
+
// src/attachments/attachments.ts
|
|
163
|
+
var Attachments = class {
|
|
164
|
+
constructor(resend) {
|
|
165
|
+
this.receiving = new Receiving(resend);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
201
169
|
// src/audiences/audiences.ts
|
|
202
170
|
var Audiences = class {
|
|
203
171
|
constructor(resend) {
|
|
@@ -274,7 +242,7 @@ function render(node) {
|
|
|
274
242
|
}).catch(() => {
|
|
275
243
|
reject(
|
|
276
244
|
Error(
|
|
277
|
-
"Failed to render React component. Make sure to install `@react-email/render`"
|
|
245
|
+
"Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`."
|
|
278
246
|
)
|
|
279
247
|
);
|
|
280
248
|
});
|
|
@@ -557,10 +525,34 @@ var Domains = class {
|
|
|
557
525
|
}
|
|
558
526
|
};
|
|
559
527
|
|
|
528
|
+
// src/emails/receiving/receiving.ts
|
|
529
|
+
var Receiving2 = class {
|
|
530
|
+
constructor(resend) {
|
|
531
|
+
this.resend = resend;
|
|
532
|
+
}
|
|
533
|
+
get(id) {
|
|
534
|
+
return __async(this, null, function* () {
|
|
535
|
+
const data = yield this.resend.get(
|
|
536
|
+
`/emails/receiving/${id}`
|
|
537
|
+
);
|
|
538
|
+
return data;
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
list() {
|
|
542
|
+
return __async(this, arguments, function* (options = {}) {
|
|
543
|
+
const queryString = buildPaginationQuery(options);
|
|
544
|
+
const url = queryString ? `/emails/receiving?${queryString}` : "/emails/receiving";
|
|
545
|
+
const data = yield this.resend.get(url);
|
|
546
|
+
return data;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
|
|
560
551
|
// src/emails/emails.ts
|
|
561
552
|
var Emails = class {
|
|
562
553
|
constructor(resend) {
|
|
563
554
|
this.resend = resend;
|
|
555
|
+
this.receiving = new Receiving2(resend);
|
|
564
556
|
}
|
|
565
557
|
send(_0) {
|
|
566
558
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
@@ -617,51 +609,6 @@ var Emails = class {
|
|
|
617
609
|
}
|
|
618
610
|
};
|
|
619
611
|
|
|
620
|
-
// src/inbound/inbound.ts
|
|
621
|
-
var Inbound = class {
|
|
622
|
-
constructor(resend) {
|
|
623
|
-
this.resend = resend;
|
|
624
|
-
}
|
|
625
|
-
get(id) {
|
|
626
|
-
return __async(this, null, function* () {
|
|
627
|
-
const data = yield this.resend.get(
|
|
628
|
-
`/emails/inbound/${id}`
|
|
629
|
-
);
|
|
630
|
-
if (data.error) {
|
|
631
|
-
return {
|
|
632
|
-
data: null,
|
|
633
|
-
error: data.error
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
const apiResponse = data.data;
|
|
637
|
-
const transformedData = {
|
|
638
|
-
object: apiResponse.object,
|
|
639
|
-
id: apiResponse.id,
|
|
640
|
-
to: apiResponse.to,
|
|
641
|
-
from: apiResponse.from,
|
|
642
|
-
createdAt: apiResponse.created_at,
|
|
643
|
-
subject: apiResponse.subject,
|
|
644
|
-
bcc: apiResponse.bcc,
|
|
645
|
-
cc: apiResponse.cc,
|
|
646
|
-
replyTo: apiResponse.reply_to,
|
|
647
|
-
html: apiResponse.html,
|
|
648
|
-
text: apiResponse.text,
|
|
649
|
-
attachments: apiResponse.attachments.map((attachment) => ({
|
|
650
|
-
id: attachment.id,
|
|
651
|
-
filename: attachment.filename,
|
|
652
|
-
contentType: attachment.content_type,
|
|
653
|
-
contentId: attachment.content_id,
|
|
654
|
-
contentDisposition: attachment.content_disposition
|
|
655
|
-
}))
|
|
656
|
-
};
|
|
657
|
-
return {
|
|
658
|
-
data: transformedData,
|
|
659
|
-
error: null
|
|
660
|
-
};
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
|
|
665
612
|
// src/resend.ts
|
|
666
613
|
var defaultBaseUrl = "https://api.resend.com";
|
|
667
614
|
var defaultUserAgent = `resend-node:${version}`;
|
|
@@ -678,7 +625,6 @@ var Resend = class {
|
|
|
678
625
|
this.contacts = new Contacts(this);
|
|
679
626
|
this.domains = new Domains(this);
|
|
680
627
|
this.emails = new Emails(this);
|
|
681
|
-
this.inbound = new Inbound(this);
|
|
682
628
|
if (!key) {
|
|
683
629
|
if (typeof process !== "undefined" && process.env) {
|
|
684
630
|
this.key = process.env.RESEND_API_KEY;
|
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// package.json
|
|
54
|
-
var version = "6.2.0-canary.
|
|
54
|
+
var version = "6.2.0-canary.2";
|
|
55
55
|
|
|
56
56
|
// src/common/utils/build-pagination-query.ts
|
|
57
57
|
function buildPaginationQuery(options) {
|
|
@@ -101,70 +101,38 @@ var ApiKeys = class {
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
// src/attachments/
|
|
105
|
-
var
|
|
104
|
+
// src/attachments/receiving/receiving.ts
|
|
105
|
+
var Receiving = class {
|
|
106
106
|
constructor(resend) {
|
|
107
107
|
this.resend = resend;
|
|
108
108
|
}
|
|
109
109
|
get(options) {
|
|
110
110
|
return __async(this, null, function* () {
|
|
111
|
-
const {
|
|
111
|
+
const { emailId, id } = options;
|
|
112
112
|
const data = yield this.resend.get(
|
|
113
|
-
`/emails/
|
|
113
|
+
`/emails/receiving/${emailId}/attachments/${id}`
|
|
114
114
|
);
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
data: null,
|
|
118
|
-
error: data.error
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
const apiResponse = data.data;
|
|
122
|
-
const transformedData = {
|
|
123
|
-
object: apiResponse.object,
|
|
124
|
-
data: {
|
|
125
|
-
id: apiResponse.data.id,
|
|
126
|
-
filename: apiResponse.data.filename,
|
|
127
|
-
contentType: apiResponse.data.content_type,
|
|
128
|
-
contentDisposition: apiResponse.data.content_disposition,
|
|
129
|
-
contentId: apiResponse.data.content_id,
|
|
130
|
-
content: apiResponse.data.content
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
return {
|
|
134
|
-
data: transformedData,
|
|
135
|
-
error: null
|
|
136
|
-
};
|
|
115
|
+
return data;
|
|
137
116
|
});
|
|
138
117
|
}
|
|
139
118
|
list(options) {
|
|
140
119
|
return __async(this, null, function* () {
|
|
141
|
-
const {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
return {
|
|
147
|
-
data: null,
|
|
148
|
-
error: data.error
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
const apiResponse = data.data;
|
|
152
|
-
const transformedData = apiResponse.data.map((attachment) => ({
|
|
153
|
-
id: attachment.id,
|
|
154
|
-
filename: attachment.filename,
|
|
155
|
-
contentType: attachment.content_type,
|
|
156
|
-
contentDisposition: attachment.content_disposition,
|
|
157
|
-
contentId: attachment.content_id,
|
|
158
|
-
content: attachment.content
|
|
159
|
-
}));
|
|
160
|
-
return {
|
|
161
|
-
data: transformedData,
|
|
162
|
-
error: null
|
|
163
|
-
};
|
|
120
|
+
const { emailId } = options;
|
|
121
|
+
const queryString = buildPaginationQuery(options);
|
|
122
|
+
const url = queryString ? `/emails/receiving/${emailId}/attachments?${queryString}` : `/emails/receiving/${emailId}/attachments`;
|
|
123
|
+
const data = yield this.resend.get(url);
|
|
124
|
+
return data;
|
|
164
125
|
});
|
|
165
126
|
}
|
|
166
127
|
};
|
|
167
128
|
|
|
129
|
+
// src/attachments/attachments.ts
|
|
130
|
+
var Attachments = class {
|
|
131
|
+
constructor(resend) {
|
|
132
|
+
this.receiving = new Receiving(resend);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
168
136
|
// src/audiences/audiences.ts
|
|
169
137
|
var Audiences = class {
|
|
170
138
|
constructor(resend) {
|
|
@@ -241,7 +209,7 @@ function render(node) {
|
|
|
241
209
|
}).catch(() => {
|
|
242
210
|
reject(
|
|
243
211
|
Error(
|
|
244
|
-
"Failed to render React component. Make sure to install `@react-email/render`"
|
|
212
|
+
"Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`."
|
|
245
213
|
)
|
|
246
214
|
);
|
|
247
215
|
});
|
|
@@ -524,10 +492,34 @@ var Domains = class {
|
|
|
524
492
|
}
|
|
525
493
|
};
|
|
526
494
|
|
|
495
|
+
// src/emails/receiving/receiving.ts
|
|
496
|
+
var Receiving2 = class {
|
|
497
|
+
constructor(resend) {
|
|
498
|
+
this.resend = resend;
|
|
499
|
+
}
|
|
500
|
+
get(id) {
|
|
501
|
+
return __async(this, null, function* () {
|
|
502
|
+
const data = yield this.resend.get(
|
|
503
|
+
`/emails/receiving/${id}`
|
|
504
|
+
);
|
|
505
|
+
return data;
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
list() {
|
|
509
|
+
return __async(this, arguments, function* (options = {}) {
|
|
510
|
+
const queryString = buildPaginationQuery(options);
|
|
511
|
+
const url = queryString ? `/emails/receiving?${queryString}` : "/emails/receiving";
|
|
512
|
+
const data = yield this.resend.get(url);
|
|
513
|
+
return data;
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
527
518
|
// src/emails/emails.ts
|
|
528
519
|
var Emails = class {
|
|
529
520
|
constructor(resend) {
|
|
530
521
|
this.resend = resend;
|
|
522
|
+
this.receiving = new Receiving2(resend);
|
|
531
523
|
}
|
|
532
524
|
send(_0) {
|
|
533
525
|
return __async(this, arguments, function* (payload, options = {}) {
|
|
@@ -584,51 +576,6 @@ var Emails = class {
|
|
|
584
576
|
}
|
|
585
577
|
};
|
|
586
578
|
|
|
587
|
-
// src/inbound/inbound.ts
|
|
588
|
-
var Inbound = class {
|
|
589
|
-
constructor(resend) {
|
|
590
|
-
this.resend = resend;
|
|
591
|
-
}
|
|
592
|
-
get(id) {
|
|
593
|
-
return __async(this, null, function* () {
|
|
594
|
-
const data = yield this.resend.get(
|
|
595
|
-
`/emails/inbound/${id}`
|
|
596
|
-
);
|
|
597
|
-
if (data.error) {
|
|
598
|
-
return {
|
|
599
|
-
data: null,
|
|
600
|
-
error: data.error
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
const apiResponse = data.data;
|
|
604
|
-
const transformedData = {
|
|
605
|
-
object: apiResponse.object,
|
|
606
|
-
id: apiResponse.id,
|
|
607
|
-
to: apiResponse.to,
|
|
608
|
-
from: apiResponse.from,
|
|
609
|
-
createdAt: apiResponse.created_at,
|
|
610
|
-
subject: apiResponse.subject,
|
|
611
|
-
bcc: apiResponse.bcc,
|
|
612
|
-
cc: apiResponse.cc,
|
|
613
|
-
replyTo: apiResponse.reply_to,
|
|
614
|
-
html: apiResponse.html,
|
|
615
|
-
text: apiResponse.text,
|
|
616
|
-
attachments: apiResponse.attachments.map((attachment) => ({
|
|
617
|
-
id: attachment.id,
|
|
618
|
-
filename: attachment.filename,
|
|
619
|
-
contentType: attachment.content_type,
|
|
620
|
-
contentId: attachment.content_id,
|
|
621
|
-
contentDisposition: attachment.content_disposition
|
|
622
|
-
}))
|
|
623
|
-
};
|
|
624
|
-
return {
|
|
625
|
-
data: transformedData,
|
|
626
|
-
error: null
|
|
627
|
-
};
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
|
|
632
579
|
// src/resend.ts
|
|
633
580
|
var defaultBaseUrl = "https://api.resend.com";
|
|
634
581
|
var defaultUserAgent = `resend-node:${version}`;
|
|
@@ -645,7 +592,6 @@ var Resend = class {
|
|
|
645
592
|
this.contacts = new Contacts(this);
|
|
646
593
|
this.domains = new Domains(this);
|
|
647
594
|
this.emails = new Emails(this);
|
|
648
|
-
this.inbound = new Inbound(this);
|
|
649
595
|
if (!key) {
|
|
650
596
|
if (typeof process !== "undefined" && process.env) {
|
|
651
597
|
this.key = process.env.RESEND_API_KEY;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend",
|
|
3
|
-
"version": "6.2.0-canary.
|
|
3
|
+
"version": "6.2.0-canary.2",
|
|
4
4
|
"description": "Node.js library for the Resend API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/resendlabs/resend-node#readme",
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@react-email/render": "
|
|
47
|
+
"@react-email/render": "*"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"@react-email/render": {
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@biomejs/biome": "2.2.
|
|
56
|
-
"@types/node": "22.18.
|
|
57
|
-
"@types/react": "19.
|
|
55
|
+
"@biomejs/biome": "2.2.5",
|
|
56
|
+
"@types/node": "22.18.9",
|
|
57
|
+
"@types/react": "19.2.0",
|
|
58
58
|
"pkg-pr-new": "0.0.60",
|
|
59
59
|
"tsup": "8.5.0",
|
|
60
|
-
"typescript": "5.9.
|
|
60
|
+
"typescript": "5.9.3",
|
|
61
61
|
"vitest": "3.2.4",
|
|
62
62
|
"vitest-fetch-mock": "0.4.5"
|
|
63
63
|
},
|
|
64
|
-
"packageManager": "pnpm@10.
|
|
64
|
+
"packageManager": "pnpm@10.18.2"
|
|
65
65
|
}
|