resend 6.9.2 → 6.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
- //#region rolldown:runtime
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __getProtoOf = Object.getPrototypeOf;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
9
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
19
16
  }
20
17
  return to;
21
18
  };
@@ -23,15 +20,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
20
  value: mod,
24
21
  enumerable: true
25
22
  }) : target, mod));
26
-
27
23
  //#endregion
28
24
  let postal_mime = require("postal-mime");
29
25
  postal_mime = __toESM(postal_mime);
30
26
  let svix = require("svix");
31
-
32
27
  //#region package.json
33
- var version = "6.9.2";
34
-
28
+ var version = "6.9.4";
35
29
  //#endregion
36
30
  //#region src/common/utils/build-pagination-query.ts
37
31
  /**
@@ -46,7 +40,6 @@ function buildPaginationQuery(options) {
46
40
  if ("before" in options && options.before !== void 0) searchParams.set("before", options.before);
47
41
  return searchParams.toString();
48
42
  }
49
-
50
43
  //#endregion
51
44
  //#region src/api-keys/api-keys.ts
52
45
  var ApiKeys = class {
@@ -65,7 +58,6 @@ var ApiKeys = class {
65
58
  return await this.resend.delete(`/api-keys/${id}`);
66
59
  }
67
60
  };
68
-
69
61
  //#endregion
70
62
  //#region src/common/utils/parse-email-to-api-options.ts
71
63
  function parseAttachments(attachments) {
@@ -98,7 +90,6 @@ function parseEmailToApiOptions(email) {
98
90
  topic_id: email.topicId
99
91
  };
100
92
  }
101
-
102
93
  //#endregion
103
94
  //#region src/render.ts
104
95
  async function render(node) {
@@ -110,7 +101,6 @@ async function render(node) {
110
101
  }
111
102
  return render(node);
112
103
  }
113
-
114
104
  //#endregion
115
105
  //#region src/batch/batch.ts
116
106
  var Batch = class {
@@ -138,7 +128,6 @@ var Batch = class {
138
128
  });
139
129
  }
140
130
  };
141
-
142
131
  //#endregion
143
132
  //#region src/broadcasts/broadcasts.ts
144
133
  var Broadcasts = class {
@@ -192,7 +181,6 @@ var Broadcasts = class {
192
181
  });
193
182
  }
194
183
  };
195
-
196
184
  //#endregion
197
185
  //#region src/common/utils/parse-contact-properties-to-api-options.ts
198
186
  function parseContactPropertyFromApi(contactProperty) {
@@ -212,7 +200,6 @@ function parseContactPropertyToApiOptions(contactProperty) {
212
200
  };
213
201
  return { fallback_value: contactProperty.fallbackValue };
214
202
  }
215
-
216
203
  //#endregion
217
204
  //#region src/contact-properties/contact-properties.ts
218
205
  var ContactProperties = class {
@@ -284,7 +271,6 @@ var ContactProperties = class {
284
271
  return await this.resend.delete(`/contact-properties/${id}`);
285
272
  }
286
273
  };
287
-
288
274
  //#endregion
289
275
  //#region src/contacts/segments/contact-segments.ts
290
276
  var ContactSegments = class {
@@ -333,7 +319,6 @@ var ContactSegments = class {
333
319
  return this.resend.delete(`/contacts/${identifier}/segments/${options.segmentId}`);
334
320
  }
335
321
  };
336
-
337
322
  //#endregion
338
323
  //#region src/contacts/topics/contact-topics.ts
339
324
  var ContactTopics = class {
@@ -369,7 +354,6 @@ var ContactTopics = class {
369
354
  return this.resend.get(url);
370
355
  }
371
356
  };
372
-
373
357
  //#endregion
374
358
  //#region src/contacts/contacts.ts
375
359
  var Contacts = class {
@@ -470,7 +454,6 @@ var Contacts = class {
470
454
  return this.resend.delete(`/audiences/${payload.audienceId}/contacts/${payload?.email ? payload?.email : payload?.id}`);
471
455
  }
472
456
  };
473
-
474
457
  //#endregion
475
458
  //#region src/common/utils/parse-domain-to-api-options.ts
476
459
  function parseDomainToApiOptions(domain) {
@@ -484,7 +467,6 @@ function parseDomainToApiOptions(domain) {
484
467
  tls: domain.tls
485
468
  };
486
469
  }
487
-
488
470
  //#endregion
489
471
  //#region src/domains/domains.ts
490
472
  var Domains = class {
@@ -517,7 +499,6 @@ var Domains = class {
517
499
  return await this.resend.post(`/domains/${id}/verify`);
518
500
  }
519
501
  };
520
-
521
502
  //#endregion
522
503
  //#region src/emails/attachments/attachments.ts
523
504
  var Attachments$1 = class {
@@ -535,7 +516,6 @@ var Attachments$1 = class {
535
516
  return await this.resend.get(url);
536
517
  }
537
518
  };
538
-
539
519
  //#endregion
540
520
  //#region src/emails/receiving/attachments/attachments.ts
541
521
  var Attachments = class {
@@ -553,7 +533,6 @@ var Attachments = class {
553
533
  return await this.resend.get(url);
554
534
  }
555
535
  };
556
-
557
536
  //#endregion
558
537
  //#region src/emails/receiving/receiving.ts
559
538
  var Receiving = class {
@@ -671,7 +650,6 @@ var Receiving = class {
671
650
  });
672
651
  }
673
652
  };
674
-
675
653
  //#endregion
676
654
  //#region src/emails/emails.ts
677
655
  var Emails = class {
@@ -702,7 +680,6 @@ var Emails = class {
702
680
  return await this.resend.post(`/emails/${id}/cancel`);
703
681
  }
704
682
  };
705
-
706
683
  //#endregion
707
684
  //#region src/segments/segments.ts
708
685
  var Segments = class {
@@ -724,7 +701,6 @@ var Segments = class {
724
701
  return await this.resend.delete(`/segments/${id}`);
725
702
  }
726
703
  };
727
-
728
704
  //#endregion
729
705
  //#region src/common/utils/get-pagination-query-properties.ts
730
706
  function getPaginationQueryProperties(options = {}) {
@@ -734,7 +710,6 @@ function getPaginationQueryProperties(options = {}) {
734
710
  if (options.limit) query.set("limit", options.limit.toString());
735
711
  return query.size > 0 ? `?${query.toString()}` : "";
736
712
  }
737
-
738
713
  //#endregion
739
714
  //#region src/common/utils/parse-template-to-api-options.ts
740
715
  function parseVariables(variables) {
@@ -756,7 +731,6 @@ function parseTemplateToApiOptions(template) {
756
731
  variables: parseVariables(template.variables)
757
732
  };
758
733
  }
759
-
760
734
  //#endregion
761
735
  //#region src/templates/chainable-template-result.ts
762
736
  var ChainableTemplateResult = class {
@@ -777,7 +751,6 @@ var ChainableTemplateResult = class {
777
751
  return this.publishFn(data.id);
778
752
  }
779
753
  };
780
-
781
754
  //#endregion
782
755
  //#region src/templates/templates.ts
783
756
  var Templates = class {
@@ -818,7 +791,6 @@ var Templates = class {
818
791
  return await this.resend.patch(`/templates/${identifier}`, parseTemplateToApiOptions(payload));
819
792
  }
820
793
  };
821
-
822
794
  //#endregion
823
795
  //#region src/topics/topics.ts
824
796
  var Topics = class {
@@ -872,7 +844,6 @@ var Topics = class {
872
844
  return await this.resend.delete(`/topics/${id}`);
873
845
  }
874
846
  };
875
-
876
847
  //#endregion
877
848
  //#region src/webhooks/webhooks.ts
878
849
  var Webhooks = class {
@@ -904,7 +875,6 @@ var Webhooks = class {
904
875
  });
905
876
  }
906
877
  };
907
-
908
878
  //#endregion
909
879
  //#region src/resend.ts
910
880
  const defaultBaseUrl = "https://api.resend.com";
@@ -1045,6 +1015,5 @@ var Resend = class {
1045
1015
  return this.fetchRequest(path, requestOptions);
1046
1016
  }
1047
1017
  };
1048
-
1049
1018
  //#endregion
1050
- exports.Resend = Resend;
1019
+ exports.Resend = Resend;
package/dist/index.d.cts CHANGED
@@ -4,9 +4,32 @@ import * as React$1 from "react";
4
4
  interface ApiKey {
5
5
  created_at: string;
6
6
  id: string;
7
+ last_used_at: string | null;
7
8
  name: string;
8
9
  }
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
10
33
  //#region src/domains/interfaces/domain.d.ts
11
34
  type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
12
35
  type DomainCapabilityStatus = 'enabled' | 'disabled';
@@ -204,7 +227,7 @@ type ListApiKeysOptions = PaginationOptions;
204
227
  type ListApiKeysResponseSuccess = {
205
228
  object: 'list';
206
229
  has_more: boolean;
207
- data: Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
230
+ data: Pick<ApiKey, 'name' | 'id' | 'created_at' | 'last_used_at'>[];
208
231
  };
209
232
  type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
210
233
  //#endregion
@@ -352,7 +375,14 @@ type Tag = {
352
375
  };
353
376
  //#endregion
354
377
  //#region src/batch/interfaces/create-batch-options.interface.d.ts
355
- type CreateBatchOptions = CreateEmailOptions[];
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[];
356
386
  interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
357
387
  /**
358
388
  * @default 'strict'
@@ -939,18 +969,6 @@ type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
939
969
  };
940
970
  type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
941
971
  //#endregion
942
- //#region src/common/interfaces/attachment.interface.d.ts
943
- interface Attachment$1 {
944
- id: string;
945
- filename?: string;
946
- size: number;
947
- content_type: string;
948
- content_disposition: 'inline' | 'attachment';
949
- content_id?: string;
950
- download_url: string;
951
- expires_at: string;
952
- }
953
- //#endregion
954
972
  //#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
955
973
  interface GetAttachmentOptions {
956
974
  emailId: string;
@@ -958,22 +976,17 @@ interface GetAttachmentOptions {
958
976
  }
959
977
  type GetAttachmentResponseSuccess = {
960
978
  object: 'attachment';
961
- } & Attachment$1;
979
+ } & AttachmentData;
962
980
  type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
963
981
  //#endregion
964
982
  //#region src/emails/attachments/interfaces/list-attachments.interface.d.ts
965
983
  type ListAttachmentsOptions = PaginationOptions & {
966
984
  emailId: string;
967
985
  };
968
- interface ListAttachmentsApiResponse {
969
- object: 'list';
970
- has_more: boolean;
971
- data: Attachment$1[];
972
- }
973
986
  interface ListAttachmentsResponseSuccess {
974
987
  object: 'list';
975
988
  has_more: boolean;
976
- data: Attachment$1[];
989
+ data: AttachmentData[];
977
990
  }
978
991
  type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
979
992
  //#endregion
@@ -1007,6 +1020,16 @@ interface GetEmailResponseSuccess {
1007
1020
  }
1008
1021
  type GetEmailResponse = Response<GetEmailResponseSuccess>;
1009
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
1010
1033
  //#region src/emails/interfaces/update-email-options.interface.d.ts
1011
1034
  interface UpdateEmailOptions {
1012
1035
  id: string;
@@ -1039,6 +1062,22 @@ interface ForwardReceivingEmailResponseSuccess {
1039
1062
  type ForwardReceivingEmailResponse = Response<ForwardReceivingEmailResponseSuccess>;
1040
1063
  //#endregion
1041
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
+ }
1042
1081
  interface GetReceivingEmailResponseSuccess {
1043
1082
  object: 'email';
1044
1083
  id: string;
@@ -1051,20 +1090,13 @@ interface GetReceivingEmailResponseSuccess {
1051
1090
  reply_to: string[] | null;
1052
1091
  html: string | null;
1053
1092
  text: string | null;
1054
- headers: Record<string, string>;
1093
+ headers: Record<string, string> | null;
1055
1094
  message_id: string;
1056
- raw: {
1095
+ raw?: {
1057
1096
  download_url: string;
1058
1097
  expires_at: string;
1059
1098
  } | null;
1060
- attachments: Array<{
1061
- id: string;
1062
- filename: string | null;
1063
- size: number;
1064
- content_type: string;
1065
- content_id: string | null;
1066
- content_disposition: string | null;
1067
- }>;
1099
+ attachments: InboundAttachment[];
1068
1100
  }
1069
1101
  type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
1070
1102
  //#endregion
@@ -1175,16 +1207,6 @@ declare class Attachments$1 {
1175
1207
  list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
1176
1208
  }
1177
1209
  //#endregion
1178
- //#region src/emails/interfaces/list-emails-options.interface.d.ts
1179
- type ListEmailsOptions = PaginationOptions;
1180
- type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
1181
- type ListEmailsResponseSuccess = {
1182
- object: 'list';
1183
- has_more: boolean;
1184
- data: ListEmail[];
1185
- };
1186
- type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
1187
- //#endregion
1188
1210
  //#region src/emails/receiving/attachments/attachments.d.ts
1189
1211
  declare class Attachments {
1190
1212
  private readonly resend;
@@ -1726,4 +1748,4 @@ declare class Resend {
1726
1748
  delete<T>(path: string, query?: unknown): Promise<Response<T>>;
1727
1749
  }
1728
1750
  //#endregion
1729
- export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, 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, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, 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 };
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 };
package/dist/index.d.mts CHANGED
@@ -4,9 +4,32 @@ import * as React$1 from "react";
4
4
  interface ApiKey {
5
5
  created_at: string;
6
6
  id: string;
7
+ last_used_at: string | null;
7
8
  name: string;
8
9
  }
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
10
33
  //#region src/domains/interfaces/domain.d.ts
11
34
  type DomainRegion = 'us-east-1' | 'eu-west-1' | 'sa-east-1' | 'ap-northeast-1';
12
35
  type DomainCapabilityStatus = 'enabled' | 'disabled';
@@ -204,7 +227,7 @@ type ListApiKeysOptions = PaginationOptions;
204
227
  type ListApiKeysResponseSuccess = {
205
228
  object: 'list';
206
229
  has_more: boolean;
207
- data: Pick<ApiKey, 'name' | 'id' | 'created_at'>[];
230
+ data: Pick<ApiKey, 'name' | 'id' | 'created_at' | 'last_used_at'>[];
208
231
  };
209
232
  type ListApiKeysResponse = Response<ListApiKeysResponseSuccess>;
210
233
  //#endregion
@@ -352,7 +375,14 @@ type Tag = {
352
375
  };
353
376
  //#endregion
354
377
  //#region src/batch/interfaces/create-batch-options.interface.d.ts
355
- type CreateBatchOptions = CreateEmailOptions[];
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[];
356
386
  interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
357
387
  /**
358
388
  * @default 'strict'
@@ -939,18 +969,6 @@ type VerifyDomainsResponseSuccess = Pick<Domain, 'id'> & {
939
969
  };
940
970
  type VerifyDomainsResponse = Response<VerifyDomainsResponseSuccess>;
941
971
  //#endregion
942
- //#region src/common/interfaces/attachment.interface.d.ts
943
- interface Attachment$1 {
944
- id: string;
945
- filename?: string;
946
- size: number;
947
- content_type: string;
948
- content_disposition: 'inline' | 'attachment';
949
- content_id?: string;
950
- download_url: string;
951
- expires_at: string;
952
- }
953
- //#endregion
954
972
  //#region src/emails/attachments/interfaces/get-attachment.interface.d.ts
955
973
  interface GetAttachmentOptions {
956
974
  emailId: string;
@@ -958,22 +976,17 @@ interface GetAttachmentOptions {
958
976
  }
959
977
  type GetAttachmentResponseSuccess = {
960
978
  object: 'attachment';
961
- } & Attachment$1;
979
+ } & AttachmentData;
962
980
  type GetAttachmentResponse = Response<GetAttachmentResponseSuccess>;
963
981
  //#endregion
964
982
  //#region src/emails/attachments/interfaces/list-attachments.interface.d.ts
965
983
  type ListAttachmentsOptions = PaginationOptions & {
966
984
  emailId: string;
967
985
  };
968
- interface ListAttachmentsApiResponse {
969
- object: 'list';
970
- has_more: boolean;
971
- data: Attachment$1[];
972
- }
973
986
  interface ListAttachmentsResponseSuccess {
974
987
  object: 'list';
975
988
  has_more: boolean;
976
- data: Attachment$1[];
989
+ data: AttachmentData[];
977
990
  }
978
991
  type ListAttachmentsResponse = Response<ListAttachmentsResponseSuccess>;
979
992
  //#endregion
@@ -1007,6 +1020,16 @@ interface GetEmailResponseSuccess {
1007
1020
  }
1008
1021
  type GetEmailResponse = Response<GetEmailResponseSuccess>;
1009
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
1010
1033
  //#region src/emails/interfaces/update-email-options.interface.d.ts
1011
1034
  interface UpdateEmailOptions {
1012
1035
  id: string;
@@ -1039,6 +1062,22 @@ interface ForwardReceivingEmailResponseSuccess {
1039
1062
  type ForwardReceivingEmailResponse = Response<ForwardReceivingEmailResponseSuccess>;
1040
1063
  //#endregion
1041
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
+ }
1042
1081
  interface GetReceivingEmailResponseSuccess {
1043
1082
  object: 'email';
1044
1083
  id: string;
@@ -1051,20 +1090,13 @@ interface GetReceivingEmailResponseSuccess {
1051
1090
  reply_to: string[] | null;
1052
1091
  html: string | null;
1053
1092
  text: string | null;
1054
- headers: Record<string, string>;
1093
+ headers: Record<string, string> | null;
1055
1094
  message_id: string;
1056
- raw: {
1095
+ raw?: {
1057
1096
  download_url: string;
1058
1097
  expires_at: string;
1059
1098
  } | null;
1060
- attachments: Array<{
1061
- id: string;
1062
- filename: string | null;
1063
- size: number;
1064
- content_type: string;
1065
- content_id: string | null;
1066
- content_disposition: string | null;
1067
- }>;
1099
+ attachments: InboundAttachment[];
1068
1100
  }
1069
1101
  type GetReceivingEmailResponse = Response<GetReceivingEmailResponseSuccess>;
1070
1102
  //#endregion
@@ -1175,16 +1207,6 @@ declare class Attachments$1 {
1175
1207
  list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
1176
1208
  }
1177
1209
  //#endregion
1178
- //#region src/emails/interfaces/list-emails-options.interface.d.ts
1179
- type ListEmailsOptions = PaginationOptions;
1180
- type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
1181
- type ListEmailsResponseSuccess = {
1182
- object: 'list';
1183
- has_more: boolean;
1184
- data: ListEmail[];
1185
- };
1186
- type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
1187
- //#endregion
1188
1210
  //#region src/emails/receiving/attachments/attachments.d.ts
1189
1211
  declare class Attachments {
1190
1212
  private readonly resend;
@@ -1726,4 +1748,4 @@ declare class Resend {
1726
1748
  delete<T>(path: string, query?: unknown): Promise<Response<T>>;
1727
1749
  }
1728
1750
  //#endregion
1729
- export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, 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, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsApiResponse, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, 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 };
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 };
package/dist/index.mjs CHANGED
@@ -1,9 +1,7 @@
1
1
  import PostalMime from "postal-mime";
2
2
  import { Webhook } from "svix";
3
-
4
3
  //#region package.json
5
- var version = "6.9.2";
6
-
4
+ var version = "6.9.4";
7
5
  //#endregion
8
6
  //#region src/common/utils/build-pagination-query.ts
9
7
  /**
@@ -18,7 +16,6 @@ function buildPaginationQuery(options) {
18
16
  if ("before" in options && options.before !== void 0) searchParams.set("before", options.before);
19
17
  return searchParams.toString();
20
18
  }
21
-
22
19
  //#endregion
23
20
  //#region src/api-keys/api-keys.ts
24
21
  var ApiKeys = class {
@@ -37,7 +34,6 @@ var ApiKeys = class {
37
34
  return await this.resend.delete(`/api-keys/${id}`);
38
35
  }
39
36
  };
40
-
41
37
  //#endregion
42
38
  //#region src/common/utils/parse-email-to-api-options.ts
43
39
  function parseAttachments(attachments) {
@@ -70,7 +66,6 @@ function parseEmailToApiOptions(email) {
70
66
  topic_id: email.topicId
71
67
  };
72
68
  }
73
-
74
69
  //#endregion
75
70
  //#region src/render.ts
76
71
  async function render(node) {
@@ -82,7 +77,6 @@ async function render(node) {
82
77
  }
83
78
  return render(node);
84
79
  }
85
-
86
80
  //#endregion
87
81
  //#region src/batch/batch.ts
88
82
  var Batch = class {
@@ -110,7 +104,6 @@ var Batch = class {
110
104
  });
111
105
  }
112
106
  };
113
-
114
107
  //#endregion
115
108
  //#region src/broadcasts/broadcasts.ts
116
109
  var Broadcasts = class {
@@ -164,7 +157,6 @@ var Broadcasts = class {
164
157
  });
165
158
  }
166
159
  };
167
-
168
160
  //#endregion
169
161
  //#region src/common/utils/parse-contact-properties-to-api-options.ts
170
162
  function parseContactPropertyFromApi(contactProperty) {
@@ -184,7 +176,6 @@ function parseContactPropertyToApiOptions(contactProperty) {
184
176
  };
185
177
  return { fallback_value: contactProperty.fallbackValue };
186
178
  }
187
-
188
179
  //#endregion
189
180
  //#region src/contact-properties/contact-properties.ts
190
181
  var ContactProperties = class {
@@ -256,7 +247,6 @@ var ContactProperties = class {
256
247
  return await this.resend.delete(`/contact-properties/${id}`);
257
248
  }
258
249
  };
259
-
260
250
  //#endregion
261
251
  //#region src/contacts/segments/contact-segments.ts
262
252
  var ContactSegments = class {
@@ -305,7 +295,6 @@ var ContactSegments = class {
305
295
  return this.resend.delete(`/contacts/${identifier}/segments/${options.segmentId}`);
306
296
  }
307
297
  };
308
-
309
298
  //#endregion
310
299
  //#region src/contacts/topics/contact-topics.ts
311
300
  var ContactTopics = class {
@@ -341,7 +330,6 @@ var ContactTopics = class {
341
330
  return this.resend.get(url);
342
331
  }
343
332
  };
344
-
345
333
  //#endregion
346
334
  //#region src/contacts/contacts.ts
347
335
  var Contacts = class {
@@ -442,7 +430,6 @@ var Contacts = class {
442
430
  return this.resend.delete(`/audiences/${payload.audienceId}/contacts/${payload?.email ? payload?.email : payload?.id}`);
443
431
  }
444
432
  };
445
-
446
433
  //#endregion
447
434
  //#region src/common/utils/parse-domain-to-api-options.ts
448
435
  function parseDomainToApiOptions(domain) {
@@ -456,7 +443,6 @@ function parseDomainToApiOptions(domain) {
456
443
  tls: domain.tls
457
444
  };
458
445
  }
459
-
460
446
  //#endregion
461
447
  //#region src/domains/domains.ts
462
448
  var Domains = class {
@@ -489,7 +475,6 @@ var Domains = class {
489
475
  return await this.resend.post(`/domains/${id}/verify`);
490
476
  }
491
477
  };
492
-
493
478
  //#endregion
494
479
  //#region src/emails/attachments/attachments.ts
495
480
  var Attachments$1 = class {
@@ -507,7 +492,6 @@ var Attachments$1 = class {
507
492
  return await this.resend.get(url);
508
493
  }
509
494
  };
510
-
511
495
  //#endregion
512
496
  //#region src/emails/receiving/attachments/attachments.ts
513
497
  var Attachments = class {
@@ -525,7 +509,6 @@ var Attachments = class {
525
509
  return await this.resend.get(url);
526
510
  }
527
511
  };
528
-
529
512
  //#endregion
530
513
  //#region src/emails/receiving/receiving.ts
531
514
  var Receiving = class {
@@ -643,7 +626,6 @@ var Receiving = class {
643
626
  });
644
627
  }
645
628
  };
646
-
647
629
  //#endregion
648
630
  //#region src/emails/emails.ts
649
631
  var Emails = class {
@@ -674,7 +656,6 @@ var Emails = class {
674
656
  return await this.resend.post(`/emails/${id}/cancel`);
675
657
  }
676
658
  };
677
-
678
659
  //#endregion
679
660
  //#region src/segments/segments.ts
680
661
  var Segments = class {
@@ -696,7 +677,6 @@ var Segments = class {
696
677
  return await this.resend.delete(`/segments/${id}`);
697
678
  }
698
679
  };
699
-
700
680
  //#endregion
701
681
  //#region src/common/utils/get-pagination-query-properties.ts
702
682
  function getPaginationQueryProperties(options = {}) {
@@ -706,7 +686,6 @@ function getPaginationQueryProperties(options = {}) {
706
686
  if (options.limit) query.set("limit", options.limit.toString());
707
687
  return query.size > 0 ? `?${query.toString()}` : "";
708
688
  }
709
-
710
689
  //#endregion
711
690
  //#region src/common/utils/parse-template-to-api-options.ts
712
691
  function parseVariables(variables) {
@@ -728,7 +707,6 @@ function parseTemplateToApiOptions(template) {
728
707
  variables: parseVariables(template.variables)
729
708
  };
730
709
  }
731
-
732
710
  //#endregion
733
711
  //#region src/templates/chainable-template-result.ts
734
712
  var ChainableTemplateResult = class {
@@ -749,7 +727,6 @@ var ChainableTemplateResult = class {
749
727
  return this.publishFn(data.id);
750
728
  }
751
729
  };
752
-
753
730
  //#endregion
754
731
  //#region src/templates/templates.ts
755
732
  var Templates = class {
@@ -790,7 +767,6 @@ var Templates = class {
790
767
  return await this.resend.patch(`/templates/${identifier}`, parseTemplateToApiOptions(payload));
791
768
  }
792
769
  };
793
-
794
770
  //#endregion
795
771
  //#region src/topics/topics.ts
796
772
  var Topics = class {
@@ -844,7 +820,6 @@ var Topics = class {
844
820
  return await this.resend.delete(`/topics/${id}`);
845
821
  }
846
822
  };
847
-
848
823
  //#endregion
849
824
  //#region src/webhooks/webhooks.ts
850
825
  var Webhooks = class {
@@ -876,7 +851,6 @@ var Webhooks = class {
876
851
  });
877
852
  }
878
853
  };
879
-
880
854
  //#endregion
881
855
  //#region src/resend.ts
882
856
  const defaultBaseUrl = "https://api.resend.com";
@@ -1017,6 +991,5 @@ var Resend = class {
1017
991
  return this.fetchRequest(path, requestOptions);
1018
992
  }
1019
993
  };
1020
-
1021
994
  //#endregion
1022
- export { Resend };
995
+ export { Resend };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "6.9.2",
3
+ "version": "6.9.4",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -29,6 +29,19 @@
29
29
  }
30
30
  }
31
31
  },
32
+ "scripts": {
33
+ "build": "tsdown src/index.ts --format esm,cjs --dts",
34
+ "integration:nextjs": "cd ./integrations/nextjs && next build --turbopack",
35
+ "lint": "biome check .",
36
+ "lint:fix": "biome check . --write",
37
+ "prepublishOnly": "pnpm run build",
38
+ "test": "vitest run",
39
+ "test:dev": "cross-env TEST_MODE=dev vitest run",
40
+ "test:integrations": "vitest run integrations",
41
+ "test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
42
+ "test:watch": "vitest",
43
+ "typecheck": "tsc --noEmit"
44
+ },
32
45
  "repository": {
33
46
  "type": "git",
34
47
  "url": "git+https://github.com/resend/resend-node.git"
@@ -41,7 +54,7 @@
41
54
  "homepage": "https://github.com/resend/resend-node#readme",
42
55
  "dependencies": {
43
56
  "postal-mime": "2.7.3",
44
- "svix": "1.84.1"
57
+ "svix": "1.86.0"
45
58
  },
46
59
  "peerDependencies": {
47
60
  "@react-email/render": "*"
@@ -52,34 +65,23 @@
52
65
  }
53
66
  },
54
67
  "devDependencies": {
55
- "@biomejs/biome": "2.3.13",
68
+ "@biomejs/biome": "2.4.7",
56
69
  "@pollyjs/adapter-fetch": "6.0.7",
57
70
  "@pollyjs/core": "6.0.6",
58
71
  "@pollyjs/persister-fs": "6.0.6",
59
72
  "@types/mailparser": "3.4.6",
60
- "@types/node": "24.10.9",
61
- "@types/react": "19.2.10",
73
+ "@types/node": "24.11.0",
74
+ "@types/react": "19.2.14",
62
75
  "cross-env": "10.1.0",
63
- "dotenv": "17.2.3",
64
- "pkg-pr-new": "0.0.62",
76
+ "dotenv": "17.3.1",
77
+ "pkg-pr-new": "0.0.65",
65
78
  "react": "19.2.4",
66
79
  "react-dom": "19.2.4",
67
- "rimraf": "6.1.2",
68
- "tsdown": "0.20.1",
80
+ "rimraf": "6.1.3",
81
+ "tsdown": "0.21.0",
69
82
  "typescript": "5.9.3",
70
83
  "vitest": "4.0.18",
71
84
  "vitest-fetch-mock": "0.4.5"
72
85
  },
73
- "scripts": {
74
- "build": "tsdown src/index.ts --format esm,cjs --dts",
75
- "integration:nextjs": "cd ./integrations/nextjs && next build --turbopack",
76
- "lint": "biome check .",
77
- "lint:fix": "biome check . --write",
78
- "test": "vitest run",
79
- "test:dev": "cross-env TEST_MODE=dev vitest run",
80
- "test:integrations": "vitest run integrations",
81
- "test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
82
- "test:watch": "vitest",
83
- "typecheck": "tsc --noEmit"
84
- }
85
- }
86
+ "packageManager": "pnpm@10.30.3"
87
+ }