resend 6.3.0-canary.2 → 6.3.0-canary.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.d.mts CHANGED
@@ -176,7 +176,7 @@ type RemoveApiKeyResponse = {
176
176
  error: ErrorResponse;
177
177
  };
178
178
 
179
- interface InboundAttachment {
179
+ interface Attachment$1 {
180
180
  id: string;
181
181
  filename?: string;
182
182
  size: number;
@@ -191,10 +191,9 @@ interface GetAttachmentOptions {
191
191
  emailId: string;
192
192
  id: string;
193
193
  }
194
- interface GetAttachmentResponseSuccess {
194
+ type GetAttachmentResponseSuccess = {
195
195
  object: 'attachment';
196
- data: InboundAttachment;
197
- }
196
+ } & Attachment$1;
198
197
  type GetAttachmentResponse = {
199
198
  data: GetAttachmentResponseSuccess;
200
199
  error: null;
@@ -206,10 +205,15 @@ type GetAttachmentResponse = {
206
205
  type ListAttachmentsOptions = PaginationOptions & {
207
206
  emailId: string;
208
207
  };
208
+ interface ListAttachmentsApiResponse {
209
+ object: 'list';
210
+ has_more: boolean;
211
+ data: Attachment$1[];
212
+ }
209
213
  interface ListAttachmentsResponseSuccess {
210
214
  object: 'list';
211
215
  has_more: boolean;
212
- data: InboundAttachment[];
216
+ data: Attachment$1[];
213
217
  }
214
218
  type ListAttachmentsResponse = {
215
219
  data: ListAttachmentsResponseSuccess;
@@ -959,8 +963,16 @@ declare class Receiving$1 {
959
963
  list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
960
964
  }
961
965
 
966
+ declare class Sending {
967
+ private readonly resend;
968
+ constructor(resend: Resend);
969
+ get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
970
+ list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
971
+ }
972
+
962
973
  declare class Attachments {
963
974
  readonly receiving: Receiving$1;
975
+ readonly sending: Sending;
964
976
  constructor(resend: Resend);
965
977
  }
966
978
 
@@ -1508,15 +1520,18 @@ declare class Topics {
1508
1520
  remove(id: string): Promise<RemoveTopicResponse>;
1509
1521
  }
1510
1522
 
1523
+ type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
1524
+
1511
1525
  interface CreateWebhookOptions {
1512
1526
  endpoint: string;
1513
- events: string[];
1527
+ events: WebhookEvent[];
1514
1528
  }
1515
1529
  interface CreateWebhookRequestOptions extends PostOptions {
1516
1530
  }
1517
1531
  interface CreateWebhookResponseSuccess {
1518
1532
  object: 'webhook';
1519
1533
  id: string;
1534
+ signing_secret: string;
1520
1535
  }
1521
1536
  type CreateWebhookResponse = {
1522
1537
  data: CreateWebhookResponseSuccess;
@@ -1530,9 +1545,10 @@ interface GetWebhookResponseSuccess {
1530
1545
  object: 'webhook';
1531
1546
  id: string;
1532
1547
  created_at: string;
1533
- status: string;
1548
+ status: 'enabled' | 'disabled';
1534
1549
  endpoint: string;
1535
- events: string[] | null;
1550
+ events: WebhookEvent[] | null;
1551
+ signing_secret: string;
1536
1552
  }
1537
1553
  type GetWebhookResponse = {
1538
1554
  data: GetWebhookResponseSuccess;
@@ -1547,8 +1563,8 @@ interface Webhook {
1547
1563
  id: string;
1548
1564
  endpoint: string;
1549
1565
  created_at: string;
1550
- status: string;
1551
- events: string[] | null;
1566
+ status: 'enabled' | 'disabled';
1567
+ events: WebhookEvent[] | null;
1552
1568
  }
1553
1569
  type ListWebhooksResponseSuccess = {
1554
1570
  object: 'list';
@@ -1575,6 +1591,23 @@ type RemoveWebhookResponse = {
1575
1591
  error: ErrorResponse;
1576
1592
  };
1577
1593
 
1594
+ interface UpdateWebhookOptions {
1595
+ endpoint?: string;
1596
+ events?: WebhookEvent[];
1597
+ status?: 'enabled' | 'disabled';
1598
+ }
1599
+ interface UpdateWebhookResponseSuccess {
1600
+ object: 'webhook';
1601
+ id: string;
1602
+ }
1603
+ type UpdateWebhookResponse = {
1604
+ data: UpdateWebhookResponseSuccess;
1605
+ error: null;
1606
+ } | {
1607
+ data: null;
1608
+ error: ErrorResponse;
1609
+ };
1610
+
1578
1611
  interface Headers {
1579
1612
  id: string;
1580
1613
  timestamp: string;
@@ -1591,6 +1624,7 @@ declare class Webhooks {
1591
1624
  create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
1592
1625
  get(id: string): Promise<GetWebhookResponse>;
1593
1626
  list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
1627
+ update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
1594
1628
  remove(id: string): Promise<RemoveWebhookResponse>;
1595
1629
  verify(payload: VerifyWebhookOptions): unknown;
1596
1630
  }
@@ -1659,4 +1693,4 @@ declare class Resend {
1659
1693
  }>;
1660
1694
  }
1661
1695
 
1662
- export { type ApiKey, type Attachment, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateBatchOptions, type CreateBatchRequestOptions, type CreateBatchResponse, type CreateBatchSuccessResponse, type CreateBroadcastOptions, type CreateBroadcastRequestOptions, type CreateBroadcastResponse, type CreateBroadcastResponseSuccess, type CreateContactOptions, type CreateContactRequestOptions, type CreateContactResponse, type CreateContactResponseSuccess, type CreateDomainOptions, type CreateDomainRequestOptions, type CreateDomainResponse, type CreateDomainResponseSuccess, type CreateEmailOptions, type CreateEmailRequestOptions, type CreateEmailResponse, type CreateEmailResponseSuccess, type CreateSegmentOptions, type CreateSegmentRequestOptions, type CreateSegmentResponse, type CreateSegmentResponseSuccess, type CreateWebhookOptions, type CreateWebhookRequestOptions, type CreateWebhookResponse, type CreateWebhookResponseSuccess, type Domain, type DomainApiOptions, type DomainDkimRecord, type DomainNameservers, type DomainRecords, type DomainRegion, type DomainSpfRecord, type DomainStatus, type EmailApiAttachment, type EmailApiOptions, type ErrorResponse, type GetAttachmentOptions, type GetAttachmentResponse, type GetAttachmentResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetInboundEmailResponse, type GetInboundEmailResponseSuccess, type GetOptions, type GetSegmentResponse, type GetSegmentResponseSuccess, type GetWebhookResponse, type GetWebhookResponseSuccess, type IdempotentRequest, type InboundAttachment, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAudienceContactsOptions, 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 ListSegmentsOptions, type ListSegmentsResponse, type ListSegmentsResponseSuccess, type ListWebhooksOptions, type ListWebhooksResponse, type ListWebhooksResponseSuccess, type PaginatedData, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type ReceivingRecord, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RemoveSegmentResponse, type RemoveSegmentResponseSuccess, type RemoveWebhookResponse, type RemoveWebhookResponseSuccess, type RequireAtLeastOne, Resend, type Segment, type SelectingField, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateBroadcastOptions, type UpdateBroadcastResponse, type UpdateBroadcastResponseSuccess, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type UpdateEmailOptions, type UpdateEmailResponse, type UpdateEmailResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess, type Webhook };
1696
+ export { type ApiKey, type Attachment, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateBatchOptions, type CreateBatchRequestOptions, type CreateBatchResponse, type CreateBatchSuccessResponse, type CreateBroadcastOptions, type CreateBroadcastRequestOptions, type CreateBroadcastResponse, type CreateBroadcastResponseSuccess, type CreateContactOptions, type CreateContactRequestOptions, type CreateContactResponse, type CreateContactResponseSuccess, type CreateDomainOptions, type CreateDomainRequestOptions, type CreateDomainResponse, type CreateDomainResponseSuccess, type CreateEmailOptions, type CreateEmailRequestOptions, type CreateEmailResponse, type CreateEmailResponseSuccess, type CreateSegmentOptions, type CreateSegmentRequestOptions, type CreateSegmentResponse, type CreateSegmentResponseSuccess, type CreateWebhookOptions, type CreateWebhookRequestOptions, type CreateWebhookResponse, type CreateWebhookResponseSuccess, type Domain, type DomainApiOptions, type DomainDkimRecord, type DomainNameservers, type DomainRecords, type DomainRegion, type DomainSpfRecord, type DomainStatus, type EmailApiAttachment, type EmailApiOptions, type ErrorResponse, type GetAttachmentOptions, type GetAttachmentResponse, type GetAttachmentResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetInboundEmailResponse, type GetInboundEmailResponseSuccess, type GetOptions, type GetSegmentResponse, type GetSegmentResponseSuccess, type GetWebhookResponse, type GetWebhookResponseSuccess, type IdempotentRequest, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsApiResponse, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAttachmentsResponseSuccess, type ListAudienceContactsOptions, 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 ListSegmentsOptions, type ListSegmentsResponse, type ListSegmentsResponseSuccess, type ListWebhooksOptions, type ListWebhooksResponse, type ListWebhooksResponseSuccess, type PaginatedData, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type ReceivingRecord, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RemoveSegmentResponse, type RemoveSegmentResponseSuccess, type RemoveWebhookResponse, type RemoveWebhookResponseSuccess, type RequireAtLeastOne, Resend, type Segment, type SelectingField, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateBroadcastOptions, type UpdateBroadcastResponse, type UpdateBroadcastResponseSuccess, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type UpdateEmailOptions, type UpdateEmailResponse, type UpdateEmailResponseSuccess, type UpdateWebhookOptions, type UpdateWebhookResponse, type UpdateWebhookResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess, type Webhook, type WebhookEvent };
package/dist/index.d.ts CHANGED
@@ -176,7 +176,7 @@ type RemoveApiKeyResponse = {
176
176
  error: ErrorResponse;
177
177
  };
178
178
 
179
- interface InboundAttachment {
179
+ interface Attachment$1 {
180
180
  id: string;
181
181
  filename?: string;
182
182
  size: number;
@@ -191,10 +191,9 @@ interface GetAttachmentOptions {
191
191
  emailId: string;
192
192
  id: string;
193
193
  }
194
- interface GetAttachmentResponseSuccess {
194
+ type GetAttachmentResponseSuccess = {
195
195
  object: 'attachment';
196
- data: InboundAttachment;
197
- }
196
+ } & Attachment$1;
198
197
  type GetAttachmentResponse = {
199
198
  data: GetAttachmentResponseSuccess;
200
199
  error: null;
@@ -206,10 +205,15 @@ type GetAttachmentResponse = {
206
205
  type ListAttachmentsOptions = PaginationOptions & {
207
206
  emailId: string;
208
207
  };
208
+ interface ListAttachmentsApiResponse {
209
+ object: 'list';
210
+ has_more: boolean;
211
+ data: Attachment$1[];
212
+ }
209
213
  interface ListAttachmentsResponseSuccess {
210
214
  object: 'list';
211
215
  has_more: boolean;
212
- data: InboundAttachment[];
216
+ data: Attachment$1[];
213
217
  }
214
218
  type ListAttachmentsResponse = {
215
219
  data: ListAttachmentsResponseSuccess;
@@ -959,8 +963,16 @@ declare class Receiving$1 {
959
963
  list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
960
964
  }
961
965
 
966
+ declare class Sending {
967
+ private readonly resend;
968
+ constructor(resend: Resend);
969
+ get(options: GetAttachmentOptions): Promise<GetAttachmentResponse>;
970
+ list(options: ListAttachmentsOptions): Promise<ListAttachmentsResponse>;
971
+ }
972
+
962
973
  declare class Attachments {
963
974
  readonly receiving: Receiving$1;
975
+ readonly sending: Sending;
964
976
  constructor(resend: Resend);
965
977
  }
966
978
 
@@ -1508,15 +1520,18 @@ declare class Topics {
1508
1520
  remove(id: string): Promise<RemoveTopicResponse>;
1509
1521
  }
1510
1522
 
1523
+ type WebhookEvent = 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'domain.created' | 'domain.updated' | 'domain.deleted';
1524
+
1511
1525
  interface CreateWebhookOptions {
1512
1526
  endpoint: string;
1513
- events: string[];
1527
+ events: WebhookEvent[];
1514
1528
  }
1515
1529
  interface CreateWebhookRequestOptions extends PostOptions {
1516
1530
  }
1517
1531
  interface CreateWebhookResponseSuccess {
1518
1532
  object: 'webhook';
1519
1533
  id: string;
1534
+ signing_secret: string;
1520
1535
  }
1521
1536
  type CreateWebhookResponse = {
1522
1537
  data: CreateWebhookResponseSuccess;
@@ -1530,9 +1545,10 @@ interface GetWebhookResponseSuccess {
1530
1545
  object: 'webhook';
1531
1546
  id: string;
1532
1547
  created_at: string;
1533
- status: string;
1548
+ status: 'enabled' | 'disabled';
1534
1549
  endpoint: string;
1535
- events: string[] | null;
1550
+ events: WebhookEvent[] | null;
1551
+ signing_secret: string;
1536
1552
  }
1537
1553
  type GetWebhookResponse = {
1538
1554
  data: GetWebhookResponseSuccess;
@@ -1547,8 +1563,8 @@ interface Webhook {
1547
1563
  id: string;
1548
1564
  endpoint: string;
1549
1565
  created_at: string;
1550
- status: string;
1551
- events: string[] | null;
1566
+ status: 'enabled' | 'disabled';
1567
+ events: WebhookEvent[] | null;
1552
1568
  }
1553
1569
  type ListWebhooksResponseSuccess = {
1554
1570
  object: 'list';
@@ -1575,6 +1591,23 @@ type RemoveWebhookResponse = {
1575
1591
  error: ErrorResponse;
1576
1592
  };
1577
1593
 
1594
+ interface UpdateWebhookOptions {
1595
+ endpoint?: string;
1596
+ events?: WebhookEvent[];
1597
+ status?: 'enabled' | 'disabled';
1598
+ }
1599
+ interface UpdateWebhookResponseSuccess {
1600
+ object: 'webhook';
1601
+ id: string;
1602
+ }
1603
+ type UpdateWebhookResponse = {
1604
+ data: UpdateWebhookResponseSuccess;
1605
+ error: null;
1606
+ } | {
1607
+ data: null;
1608
+ error: ErrorResponse;
1609
+ };
1610
+
1578
1611
  interface Headers {
1579
1612
  id: string;
1580
1613
  timestamp: string;
@@ -1591,6 +1624,7 @@ declare class Webhooks {
1591
1624
  create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
1592
1625
  get(id: string): Promise<GetWebhookResponse>;
1593
1626
  list(options?: ListWebhooksOptions): Promise<ListWebhooksResponse>;
1627
+ update(id: string, payload: UpdateWebhookOptions): Promise<UpdateWebhookResponse>;
1594
1628
  remove(id: string): Promise<RemoveWebhookResponse>;
1595
1629
  verify(payload: VerifyWebhookOptions): unknown;
1596
1630
  }
@@ -1659,4 +1693,4 @@ declare class Resend {
1659
1693
  }>;
1660
1694
  }
1661
1695
 
1662
- export { type ApiKey, type Attachment, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateBatchOptions, type CreateBatchRequestOptions, type CreateBatchResponse, type CreateBatchSuccessResponse, type CreateBroadcastOptions, type CreateBroadcastRequestOptions, type CreateBroadcastResponse, type CreateBroadcastResponseSuccess, type CreateContactOptions, type CreateContactRequestOptions, type CreateContactResponse, type CreateContactResponseSuccess, type CreateDomainOptions, type CreateDomainRequestOptions, type CreateDomainResponse, type CreateDomainResponseSuccess, type CreateEmailOptions, type CreateEmailRequestOptions, type CreateEmailResponse, type CreateEmailResponseSuccess, type CreateSegmentOptions, type CreateSegmentRequestOptions, type CreateSegmentResponse, type CreateSegmentResponseSuccess, type CreateWebhookOptions, type CreateWebhookRequestOptions, type CreateWebhookResponse, type CreateWebhookResponseSuccess, type Domain, type DomainApiOptions, type DomainDkimRecord, type DomainNameservers, type DomainRecords, type DomainRegion, type DomainSpfRecord, type DomainStatus, type EmailApiAttachment, type EmailApiOptions, type ErrorResponse, type GetAttachmentOptions, type GetAttachmentResponse, type GetAttachmentResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetInboundEmailResponse, type GetInboundEmailResponseSuccess, type GetOptions, type GetSegmentResponse, type GetSegmentResponseSuccess, type GetWebhookResponse, type GetWebhookResponseSuccess, type IdempotentRequest, type InboundAttachment, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAudienceContactsOptions, 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 ListSegmentsOptions, type ListSegmentsResponse, type ListSegmentsResponseSuccess, type ListWebhooksOptions, type ListWebhooksResponse, type ListWebhooksResponseSuccess, type PaginatedData, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type ReceivingRecord, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RemoveSegmentResponse, type RemoveSegmentResponseSuccess, type RemoveWebhookResponse, type RemoveWebhookResponseSuccess, type RequireAtLeastOne, Resend, type Segment, type SelectingField, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateBroadcastOptions, type UpdateBroadcastResponse, type UpdateBroadcastResponseSuccess, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type UpdateEmailOptions, type UpdateEmailResponse, type UpdateEmailResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess, type Webhook };
1696
+ export { type ApiKey, type Attachment, type Broadcast, type CancelEmailResponse, type CancelEmailResponseSuccess, type Contact, type CreateApiKeyOptions, type CreateApiKeyRequestOptions, type CreateApiKeyResponse, type CreateApiKeyResponseSuccess, type CreateBatchOptions, type CreateBatchRequestOptions, type CreateBatchResponse, type CreateBatchSuccessResponse, type CreateBroadcastOptions, type CreateBroadcastRequestOptions, type CreateBroadcastResponse, type CreateBroadcastResponseSuccess, type CreateContactOptions, type CreateContactRequestOptions, type CreateContactResponse, type CreateContactResponseSuccess, type CreateDomainOptions, type CreateDomainRequestOptions, type CreateDomainResponse, type CreateDomainResponseSuccess, type CreateEmailOptions, type CreateEmailRequestOptions, type CreateEmailResponse, type CreateEmailResponseSuccess, type CreateSegmentOptions, type CreateSegmentRequestOptions, type CreateSegmentResponse, type CreateSegmentResponseSuccess, type CreateWebhookOptions, type CreateWebhookRequestOptions, type CreateWebhookResponse, type CreateWebhookResponseSuccess, type Domain, type DomainApiOptions, type DomainDkimRecord, type DomainNameservers, type DomainRecords, type DomainRegion, type DomainSpfRecord, type DomainStatus, type EmailApiAttachment, type EmailApiOptions, type ErrorResponse, type GetAttachmentOptions, type GetAttachmentResponse, type GetAttachmentResponseSuccess, type GetBroadcastResponse, type GetBroadcastResponseSuccess, type GetContactOptions, type GetContactResponse, type GetContactResponseSuccess, type GetDomainResponse, type GetDomainResponseSuccess, type GetEmailResponse, type GetEmailResponseSuccess, type GetInboundEmailResponse, type GetInboundEmailResponseSuccess, type GetOptions, type GetSegmentResponse, type GetSegmentResponseSuccess, type GetWebhookResponse, type GetWebhookResponseSuccess, type IdempotentRequest, type ListApiKeysOptions, type ListApiKeysResponse, type ListApiKeysResponseSuccess, type ListAttachmentsApiResponse, type ListAttachmentsOptions, type ListAttachmentsResponse, type ListAttachmentsResponseSuccess, type ListAudienceContactsOptions, 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 ListSegmentsOptions, type ListSegmentsResponse, type ListSegmentsResponseSuccess, type ListWebhooksOptions, type ListWebhooksResponse, type ListWebhooksResponseSuccess, type PaginatedData, type PaginationOptions, type PatchOptions, type PostOptions, type PutOptions, type ReceivingRecord, type RemoveApiKeyResponse, type RemoveApiKeyResponseSuccess, type RemoveBroadcastResponse, type RemoveBroadcastResponseSuccess, type RemoveContactOptions, type RemoveContactsResponse, type RemoveContactsResponseSuccess, type RemoveDomainsResponse, type RemoveDomainsResponseSuccess, type RemoveSegmentResponse, type RemoveSegmentResponseSuccess, type RemoveWebhookResponse, type RemoveWebhookResponseSuccess, type RequireAtLeastOne, Resend, type Segment, type SelectingField, type SendBroadcastOptions, type SendBroadcastRequestOptions, type SendBroadcastResponse, type SendBroadcastResponseSuccess, type Tag, type UpdateBroadcastOptions, type UpdateBroadcastResponse, type UpdateBroadcastResponseSuccess, type UpdateContactOptions, type UpdateContactResponse, type UpdateContactResponseSuccess, type UpdateDomainsOptions, type UpdateDomainsResponse, type UpdateDomainsResponseSuccess, type UpdateEmailOptions, type UpdateEmailResponse, type UpdateEmailResponseSuccess, type UpdateWebhookOptions, type UpdateWebhookResponse, type UpdateWebhookResponseSuccess, type VerifyDomainsResponse, type VerifyDomainsResponseSuccess, type Webhook, type WebhookEvent };
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ __export(index_exports, {
64
64
  module.exports = __toCommonJS(index_exports);
65
65
 
66
66
  // package.json
67
- var version = "6.3.0-canary.2";
67
+ var version = "6.3.0-canary.4";
68
68
 
69
69
  // src/common/utils/build-pagination-query.ts
70
70
  function buildPaginationQuery(options) {
@@ -129,10 +129,32 @@ var Receiving = class {
129
129
  }
130
130
  };
131
131
 
132
+ // src/attachments/sending/sending.ts
133
+ var Sending = class {
134
+ constructor(resend) {
135
+ this.resend = resend;
136
+ }
137
+ async get(options) {
138
+ const { emailId, id } = options;
139
+ const data = await this.resend.get(
140
+ `/emails/sending/${emailId}/attachments/${id}`
141
+ );
142
+ return data;
143
+ }
144
+ async list(options) {
145
+ const { emailId } = options;
146
+ const queryString = buildPaginationQuery(options);
147
+ const url = queryString ? `/emails/sending/${emailId}/attachments?${queryString}` : `/emails/sending/${emailId}/attachments`;
148
+ const data = await this.resend.get(url);
149
+ return data;
150
+ }
151
+ };
152
+
132
153
  // src/attachments/attachments.ts
133
154
  var Attachments = class {
134
155
  constructor(resend) {
135
156
  this.receiving = new Receiving(resend);
157
+ this.sending = new Sending(resend);
136
158
  }
137
159
  };
138
160
 
@@ -1016,6 +1038,13 @@ var Webhooks = class {
1016
1038
  const data = await this.resend.get(url);
1017
1039
  return data;
1018
1040
  }
1041
+ async update(id, payload) {
1042
+ const data = await this.resend.patch(
1043
+ `/webhooks/${id}`,
1044
+ payload
1045
+ );
1046
+ return data;
1047
+ }
1019
1048
  async remove(id) {
1020
1049
  const data = await this.resend.delete(
1021
1050
  `/webhooks/${id}`
package/dist/index.mjs CHANGED
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
 
33
33
  // package.json
34
- var version = "6.3.0-canary.2";
34
+ var version = "6.3.0-canary.4";
35
35
 
36
36
  // src/common/utils/build-pagination-query.ts
37
37
  function buildPaginationQuery(options) {
@@ -96,10 +96,32 @@ var Receiving = class {
96
96
  }
97
97
  };
98
98
 
99
+ // src/attachments/sending/sending.ts
100
+ var Sending = class {
101
+ constructor(resend) {
102
+ this.resend = resend;
103
+ }
104
+ async get(options) {
105
+ const { emailId, id } = options;
106
+ const data = await this.resend.get(
107
+ `/emails/sending/${emailId}/attachments/${id}`
108
+ );
109
+ return data;
110
+ }
111
+ async list(options) {
112
+ const { emailId } = options;
113
+ const queryString = buildPaginationQuery(options);
114
+ const url = queryString ? `/emails/sending/${emailId}/attachments?${queryString}` : `/emails/sending/${emailId}/attachments`;
115
+ const data = await this.resend.get(url);
116
+ return data;
117
+ }
118
+ };
119
+
99
120
  // src/attachments/attachments.ts
100
121
  var Attachments = class {
101
122
  constructor(resend) {
102
123
  this.receiving = new Receiving(resend);
124
+ this.sending = new Sending(resend);
103
125
  }
104
126
  };
105
127
 
@@ -983,6 +1005,13 @@ var Webhooks = class {
983
1005
  const data = await this.resend.get(url);
984
1006
  return data;
985
1007
  }
1008
+ async update(id, payload) {
1009
+ const data = await this.resend.patch(
1010
+ `/webhooks/${id}`,
1011
+ payload
1012
+ );
1013
+ return data;
1014
+ }
986
1015
  async remove(id) {
987
1016
  const data = await this.resend.delete(
988
1017
  `/webhooks/${id}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "6.3.0-canary.2",
3
+ "version": "6.3.0-canary.4",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",