@depup/resend 6.18.1-depup.0 → 6.20.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/changes.json +8 -3
- package/dist/index.cjs +28 -37
- package/dist/index.d.cts +23 -2
- package/dist/index.d.mts +23 -2
- package/dist/index.mjs +28 -37
- package/package.json +23 -19
package/README.md
CHANGED
|
@@ -13,10 +13,16 @@ npm install @depup/resend
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [resend](https://www.npmjs.com/package/resend) @ 6.
|
|
17
|
-
| Processed | 2026-08-
|
|
16
|
+
| Original | [resend](https://www.npmjs.com/package/resend) @ 6.20.0 |
|
|
17
|
+
| Processed | 2026-08-16 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 1 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| postal-mime | 2.7.5 | ^3.0.0 |
|
|
20
26
|
|
|
21
27
|
---
|
|
22
28
|
|
package/changes.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -25,9 +25,13 @@ let postal_mime = require("postal-mime");
|
|
|
25
25
|
postal_mime = __toESM(postal_mime);
|
|
26
26
|
let standardwebhooks = require("standardwebhooks");
|
|
27
27
|
//#region package.json
|
|
28
|
-
var version = "6.
|
|
28
|
+
var version = "6.20.0";
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/common/utils/build-pagination-query.ts
|
|
31
|
+
function buildPaginationUrl(base, options) {
|
|
32
|
+
const queryString = buildPaginationQuery(options);
|
|
33
|
+
return queryString ? `${base}?${queryString}` : base;
|
|
34
|
+
}
|
|
31
35
|
/**
|
|
32
36
|
* Builds a query string from pagination options
|
|
33
37
|
* @param options - Pagination options containing limit and either after or before (but not both)
|
|
@@ -50,8 +54,7 @@ var ApiKeys = class {
|
|
|
50
54
|
return await this.resend.post("/api-keys", payload, options);
|
|
51
55
|
}
|
|
52
56
|
async list(options = {}) {
|
|
53
|
-
const
|
|
54
|
-
const url = queryString ? `/api-keys?${queryString}` : "/api-keys";
|
|
57
|
+
const url = buildPaginationUrl("/api-keys", options);
|
|
55
58
|
return await this.resend.get(url);
|
|
56
59
|
}
|
|
57
60
|
async remove(id) {
|
|
@@ -193,6 +196,9 @@ var Automations = class {
|
|
|
193
196
|
if (payload.connections !== void 0) apiPayload.connections = payload.connections.map(parseConnection);
|
|
194
197
|
return await this.resend.patch(`/automations/${id}`, apiPayload);
|
|
195
198
|
}
|
|
199
|
+
async duplicate(id) {
|
|
200
|
+
return await this.resend.post(`/automations/${id}/duplicate`);
|
|
201
|
+
}
|
|
196
202
|
async stop(id) {
|
|
197
203
|
return await this.resend.post(`/automations/${id}/stop`);
|
|
198
204
|
}
|
|
@@ -294,8 +300,7 @@ var Broadcasts = class {
|
|
|
294
300
|
return await this.resend.post(`/broadcasts/${id}/send`, { scheduled_at: payload?.scheduledAt });
|
|
295
301
|
}
|
|
296
302
|
async list(options = {}) {
|
|
297
|
-
const
|
|
298
|
-
const url = queryString ? `/broadcasts?${queryString}` : "/broadcasts";
|
|
303
|
+
const url = buildPaginationUrl("/broadcasts", options);
|
|
299
304
|
return await this.resend.get(url);
|
|
300
305
|
}
|
|
301
306
|
async get(id) {
|
|
@@ -304,6 +309,9 @@ var Broadcasts = class {
|
|
|
304
309
|
async remove(id) {
|
|
305
310
|
return await this.resend.delete(`/broadcasts/${id}`);
|
|
306
311
|
}
|
|
312
|
+
async cancel(id) {
|
|
313
|
+
return await this.resend.post(`/broadcasts/${id}/cancel`);
|
|
314
|
+
}
|
|
307
315
|
async update(id, payload) {
|
|
308
316
|
const html = payload.react ? await render(payload.react) : payload.html;
|
|
309
317
|
return await this.resend.patch(`/broadcasts/${id}`, {
|
|
@@ -350,8 +358,7 @@ var ContactProperties = class {
|
|
|
350
358
|
return await this.resend.post("/contact-properties", apiOptions);
|
|
351
359
|
}
|
|
352
360
|
async list(options = {}) {
|
|
353
|
-
const
|
|
354
|
-
const url = queryString ? `/contact-properties?${queryString}` : "/contact-properties";
|
|
361
|
+
const url = buildPaginationUrl("/contact-properties", options);
|
|
355
362
|
const response = await this.resend.get(url);
|
|
356
363
|
if (response.data) return {
|
|
357
364
|
data: {
|
|
@@ -470,9 +477,7 @@ var ContactSegments = class {
|
|
|
470
477
|
name: "missing_required_field"
|
|
471
478
|
}
|
|
472
479
|
};
|
|
473
|
-
const
|
|
474
|
-
const queryString = buildPaginationQuery(options);
|
|
475
|
-
const url = queryString ? `/contacts/${identifier}/segments?${queryString}` : `/contacts/${identifier}/segments`;
|
|
480
|
+
const url = buildPaginationUrl(`/contacts/${options.email ? options.email : options.contactId}/segments`, options);
|
|
476
481
|
return await this.resend.get(url);
|
|
477
482
|
}
|
|
478
483
|
async add(options) {
|
|
@@ -531,9 +536,7 @@ var ContactTopics = class {
|
|
|
531
536
|
name: "missing_required_field"
|
|
532
537
|
}
|
|
533
538
|
};
|
|
534
|
-
const
|
|
535
|
-
const queryString = buildPaginationQuery(options);
|
|
536
|
-
const url = queryString ? `/contacts/${identifier}/topics?${queryString}` : `/contacts/${identifier}/topics`;
|
|
539
|
+
const url = buildPaginationUrl(`/contacts/${options.email ? options.email : options.id}/topics`, options);
|
|
537
540
|
return this.resend.get(url);
|
|
538
541
|
}
|
|
539
542
|
};
|
|
@@ -578,12 +581,10 @@ var Contacts = class {
|
|
|
578
581
|
async list(options = {}) {
|
|
579
582
|
const segmentId = options.segmentId ?? options.audienceId;
|
|
580
583
|
if (!segmentId) {
|
|
581
|
-
const
|
|
582
|
-
const url = queryString ? `/contacts?${queryString}` : "/contacts";
|
|
584
|
+
const url = buildPaginationUrl("/contacts", options);
|
|
583
585
|
return await this.resend.get(url);
|
|
584
586
|
}
|
|
585
|
-
const
|
|
586
|
-
const url = queryString ? `/segments/${segmentId}/contacts?${queryString}` : `/segments/${segmentId}/contacts`;
|
|
587
|
+
const url = buildPaginationUrl(`/segments/${segmentId}/contacts`, options);
|
|
587
588
|
return await this.resend.get(url);
|
|
588
589
|
}
|
|
589
590
|
async get(options) {
|
|
@@ -686,8 +687,7 @@ var Domains = class {
|
|
|
686
687
|
return await this.resend.post("/domains", parseDomainToApiOptions(payload), options);
|
|
687
688
|
}
|
|
688
689
|
async list(options = {}) {
|
|
689
|
-
const
|
|
690
|
-
const url = queryString ? `/domains?${queryString}` : "/domains";
|
|
690
|
+
const url = buildPaginationUrl("/domains", options);
|
|
691
691
|
return await this.resend.get(url);
|
|
692
692
|
}
|
|
693
693
|
async get(id) {
|
|
@@ -721,8 +721,7 @@ var Attachments$1 = class {
|
|
|
721
721
|
}
|
|
722
722
|
async list(options) {
|
|
723
723
|
const { emailId } = options;
|
|
724
|
-
const
|
|
725
|
-
const url = queryString ? `/emails/${emailId}/attachments?${queryString}` : `/emails/${emailId}/attachments`;
|
|
724
|
+
const url = buildPaginationUrl(`/emails/${emailId}/attachments`, options);
|
|
726
725
|
return await this.resend.get(url);
|
|
727
726
|
}
|
|
728
727
|
};
|
|
@@ -738,8 +737,7 @@ var Attachments = class {
|
|
|
738
737
|
}
|
|
739
738
|
async list(options) {
|
|
740
739
|
const { emailId } = options;
|
|
741
|
-
const
|
|
742
|
-
const url = queryString ? `/emails/receiving/${emailId}/attachments?${queryString}` : `/emails/receiving/${emailId}/attachments`;
|
|
740
|
+
const url = buildPaginationUrl(`/emails/receiving/${emailId}/attachments`, options);
|
|
743
741
|
return await this.resend.get(url);
|
|
744
742
|
}
|
|
745
743
|
};
|
|
@@ -758,8 +756,7 @@ var Receiving = class {
|
|
|
758
756
|
return await this.resend.get(path);
|
|
759
757
|
}
|
|
760
758
|
async list(options = {}) {
|
|
761
|
-
const
|
|
762
|
-
const url = queryString ? `/emails/receiving?${queryString}` : "/emails/receiving";
|
|
759
|
+
const url = buildPaginationUrl("/emails/receiving", options);
|
|
763
760
|
return await this.resend.get(url);
|
|
764
761
|
}
|
|
765
762
|
async forward(options, requestOptions = {}) {
|
|
@@ -884,8 +881,7 @@ var Emails = class {
|
|
|
884
881
|
return await this.resend.get(`/emails/${id}`);
|
|
885
882
|
}
|
|
886
883
|
async list(options = {}) {
|
|
887
|
-
const
|
|
888
|
-
const url = queryString ? `/emails?${queryString}` : "/emails";
|
|
884
|
+
const url = buildPaginationUrl("/emails", options);
|
|
889
885
|
return await this.resend.get(url);
|
|
890
886
|
}
|
|
891
887
|
async update(payload) {
|
|
@@ -911,8 +907,7 @@ var Events = class {
|
|
|
911
907
|
return await this.resend.get(`/events/${encodeURIComponent(identifier)}`);
|
|
912
908
|
}
|
|
913
909
|
async list(options = {}) {
|
|
914
|
-
const
|
|
915
|
-
const url = queryString ? `/events?${queryString}` : "/events";
|
|
910
|
+
const url = buildPaginationUrl("/events", options);
|
|
916
911
|
return await this.resend.get(url);
|
|
917
912
|
}
|
|
918
913
|
async update(identifier, payload) {
|
|
@@ -929,8 +924,7 @@ var Logs = class {
|
|
|
929
924
|
this.resend = resend;
|
|
930
925
|
}
|
|
931
926
|
async list(options = {}) {
|
|
932
|
-
const
|
|
933
|
-
const url = queryString ? `/logs?${queryString}` : "/logs";
|
|
927
|
+
const url = buildPaginationUrl("/logs", options);
|
|
934
928
|
return await this.resend.get(url);
|
|
935
929
|
}
|
|
936
930
|
async get(id) {
|
|
@@ -944,8 +938,7 @@ var OAuthGrants = class {
|
|
|
944
938
|
this.resend = resend;
|
|
945
939
|
}
|
|
946
940
|
async list(options = {}) {
|
|
947
|
-
const
|
|
948
|
-
const url = queryString ? `/oauth/grants?${queryString}` : "/oauth/grants";
|
|
941
|
+
const url = buildPaginationUrl("/oauth/grants", options);
|
|
949
942
|
return await this.resend.get(url);
|
|
950
943
|
}
|
|
951
944
|
async revoke(id) {
|
|
@@ -962,8 +955,7 @@ var Segments = class {
|
|
|
962
955
|
return await this.resend.post("/segments", payload, options);
|
|
963
956
|
}
|
|
964
957
|
async list(options = {}) {
|
|
965
|
-
const
|
|
966
|
-
const url = queryString ? `/segments?${queryString}` : "/segments";
|
|
958
|
+
const url = buildPaginationUrl("/segments", options);
|
|
967
959
|
return await this.resend.get(url);
|
|
968
960
|
}
|
|
969
961
|
async get(id) {
|
|
@@ -1174,8 +1166,7 @@ var Webhooks = class {
|
|
|
1174
1166
|
return await this.resend.get(`/webhooks/${id}`);
|
|
1175
1167
|
}
|
|
1176
1168
|
async list(options = {}) {
|
|
1177
|
-
const
|
|
1178
|
-
const url = queryString ? `/webhooks?${queryString}` : "/webhooks";
|
|
1169
|
+
const url = buildPaginationUrl("/webhooks", options);
|
|
1179
1170
|
return await this.resend.get(url);
|
|
1180
1171
|
}
|
|
1181
1172
|
async update(id, payload) {
|
package/dist/index.d.cts
CHANGED
|
@@ -447,6 +447,12 @@ interface CreateAutomationResponseSuccess {
|
|
|
447
447
|
}
|
|
448
448
|
type CreateAutomationResponse = Response<CreateAutomationResponseSuccess>;
|
|
449
449
|
//#endregion
|
|
450
|
+
//#region src/automations/interfaces/duplicate-automation.interface.d.ts
|
|
451
|
+
interface DuplicateAutomationResponseSuccess extends Pick<Automation, 'id'> {
|
|
452
|
+
object: 'automation';
|
|
453
|
+
}
|
|
454
|
+
type DuplicateAutomationResponse = Response<DuplicateAutomationResponseSuccess>;
|
|
455
|
+
//#endregion
|
|
450
456
|
//#region src/automations/interfaces/get-automation.interface.d.ts
|
|
451
457
|
interface GetAutomationResponseSuccess extends Automation {
|
|
452
458
|
object: 'automation';
|
|
@@ -629,13 +635,19 @@ type Tag = {
|
|
|
629
635
|
};
|
|
630
636
|
//#endregion
|
|
631
637
|
//#region src/batch/interfaces/create-batch-options.interface.d.ts
|
|
638
|
+
/**
|
|
639
|
+
* Distributes over union members, unlike the built-in `Omit`, which would
|
|
640
|
+
* collapse `CreateEmailOptions` into a single object type and lose the
|
|
641
|
+
* mutual exclusivity between its `react`/`html`/`text` and `template` variants.
|
|
642
|
+
*/
|
|
643
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
632
644
|
/**
|
|
633
645
|
* Email options for batch sending. Same as CreateEmailOptions but without attachments,
|
|
634
646
|
* as these are not supported in the batch API.
|
|
635
647
|
*
|
|
636
648
|
* @link https://resend.com/docs/dashboard/emails/batch-sending#limitations
|
|
637
649
|
*/
|
|
638
|
-
type CreateBatchEmailOptions =
|
|
650
|
+
type CreateBatchEmailOptions = DistributiveOmit<CreateEmailOptions, 'attachments'>;
|
|
639
651
|
type CreateBatchOptions = CreateBatchEmailOptions[];
|
|
640
652
|
interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
|
|
641
653
|
/**
|
|
@@ -683,6 +695,12 @@ interface Broadcast {
|
|
|
683
695
|
text: string | null;
|
|
684
696
|
}
|
|
685
697
|
//#endregion
|
|
698
|
+
//#region src/broadcasts/interfaces/cancel-broadcast.interface.d.ts
|
|
699
|
+
interface CancelBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
700
|
+
object: 'broadcast';
|
|
701
|
+
}
|
|
702
|
+
type CancelBroadcastResponse = Response<CancelBroadcastResponseSuccess>;
|
|
703
|
+
//#endregion
|
|
686
704
|
//#region src/broadcasts/interfaces/create-broadcast-options.interface.d.ts
|
|
687
705
|
interface EmailRenderOptions {
|
|
688
706
|
/**
|
|
@@ -1656,6 +1674,7 @@ declare class Automations {
|
|
|
1656
1674
|
get(id: string): Promise<GetAutomationResponse>;
|
|
1657
1675
|
remove(id: string): Promise<RemoveAutomationResponse>;
|
|
1658
1676
|
update(id: string, payload: UpdateAutomationOptions): Promise<UpdateAutomationResponse>;
|
|
1677
|
+
duplicate(id: string): Promise<DuplicateAutomationResponse>;
|
|
1659
1678
|
stop(id: string): Promise<StopAutomationResponse>;
|
|
1660
1679
|
}
|
|
1661
1680
|
//#endregion
|
|
@@ -1676,6 +1695,7 @@ declare class Broadcasts {
|
|
|
1676
1695
|
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
1677
1696
|
get(id: string): Promise<GetBroadcastResponse>;
|
|
1678
1697
|
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
1698
|
+
cancel(id: string): Promise<CancelBroadcastResponse>;
|
|
1679
1699
|
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
1680
1700
|
}
|
|
1681
1701
|
//#endregion
|
|
@@ -2146,6 +2166,7 @@ interface BaseEmailEventData {
|
|
|
2146
2166
|
broadcast_id?: string;
|
|
2147
2167
|
created_at: string;
|
|
2148
2168
|
email_id: string;
|
|
2169
|
+
message_id: string;
|
|
2149
2170
|
from: string;
|
|
2150
2171
|
to: string[];
|
|
2151
2172
|
subject: string;
|
|
@@ -2451,4 +2472,4 @@ declare class Resend {
|
|
|
2451
2472
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2452
2473
|
}
|
|
2453
2474
|
//#endregion
|
|
2454
|
-
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, AddSuppressionOptions, AddSuppressionResponse, AddSuppressionResponseSuccess, AddToSegmentStepConfig, ApiContactProperty, ApiKey, Attachment, AttachmentData, Automation, AutomationConnection, AutomationConnectionType, AutomationResponseConnection, AutomationResponseStep, AutomationRun, AutomationRunItem, AutomationRunStatus, AutomationRunStep, AutomationRunStepStatus, AutomationStatus, AutomationStep, AutomationStepType, BatchAddSuppressionsOptions, BatchAddSuppressionsResponse, BatchAddSuppressionsResponseSuccess, BatchRemoveSuppressionsOptions, BatchRemoveSuppressionsResponse, BatchRemoveSuppressionsResponseSuccess, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ClaimDomainOptions, ClaimDomainRequestOptions, ClaimDomainResponse, ClaimDomainResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeleteStepConfig, ContactDeletedEvent, ContactImport, ContactImportColumnMap, ContactImportCounts, ContactImportOnConflict, ContactImportPropertyMapping, ContactImportPropertyType, ContactImportSegment, ContactImportStatus, ContactImportTopic, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdateStepConfig, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAutomationOptions, CreateAutomationResponse, CreateAutomationResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactImportOptions, CreateContactImportRequestOptions, CreateContactImportResponse, CreateContactImportResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DelayStepConfig, DeleteOptions, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainClaim, DomainClaimBlockedReason, DomainClaimRecord, DomainClaimStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecordStatus, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailRequestOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetAutomationResponse, GetAutomationResponseSuccess, GetAutomationRunOptions, GetAutomationRunResponse, GetAutomationRunResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactImportResponse, GetContactImportResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainClaimResponse, GetDomainClaimResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetSuppressionResponse, GetSuppressionResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListAutomationRunsOptions, ListAutomationRunsResponse, ListAutomationRunsResponseSuccess, ListAutomationsOptions, ListAutomationsResponse, ListAutomationsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactImportsOptions, ListContactImportsResponse, ListContactImportsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListSuppressionsOptions, ListSuppressionsResponse, ListSuppressionsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, OAuthGrant, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAutomationResponse, RemoveAutomationResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveSuppressionResponse, RemoveSuppressionResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type ResendOptions, type Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateAutomationOptions, UpdateAutomationResponse, UpdateAutomationResponseSuccess, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload };
|
|
2475
|
+
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, AddSuppressionOptions, AddSuppressionResponse, AddSuppressionResponseSuccess, AddToSegmentStepConfig, ApiContactProperty, ApiKey, Attachment, AttachmentData, Automation, AutomationConnection, AutomationConnectionType, AutomationResponseConnection, AutomationResponseStep, AutomationRun, AutomationRunItem, AutomationRunStatus, AutomationRunStep, AutomationRunStepStatus, AutomationStatus, AutomationStep, AutomationStepType, BatchAddSuppressionsOptions, BatchAddSuppressionsResponse, BatchAddSuppressionsResponseSuccess, BatchRemoveSuppressionsOptions, BatchRemoveSuppressionsResponse, BatchRemoveSuppressionsResponseSuccess, Broadcast, CancelBroadcastResponse, CancelBroadcastResponseSuccess, CancelEmailResponse, CancelEmailResponseSuccess, ClaimDomainOptions, ClaimDomainRequestOptions, ClaimDomainResponse, ClaimDomainResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeleteStepConfig, ContactDeletedEvent, ContactImport, ContactImportColumnMap, ContactImportCounts, ContactImportOnConflict, ContactImportPropertyMapping, ContactImportPropertyType, ContactImportSegment, ContactImportStatus, ContactImportTopic, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdateStepConfig, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAutomationOptions, CreateAutomationResponse, CreateAutomationResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactImportOptions, CreateContactImportRequestOptions, CreateContactImportResponse, CreateContactImportResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DelayStepConfig, DeleteOptions, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainClaim, DomainClaimBlockedReason, DomainClaimRecord, DomainClaimStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecordStatus, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateAutomationResponse, DuplicateAutomationResponseSuccess, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailRequestOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetAutomationResponse, GetAutomationResponseSuccess, GetAutomationRunOptions, GetAutomationRunResponse, GetAutomationRunResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactImportResponse, GetContactImportResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainClaimResponse, GetDomainClaimResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetSuppressionResponse, GetSuppressionResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListAutomationRunsOptions, ListAutomationRunsResponse, ListAutomationRunsResponseSuccess, ListAutomationsOptions, ListAutomationsResponse, ListAutomationsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactImportsOptions, ListContactImportsResponse, ListContactImportsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListSuppressionsOptions, ListSuppressionsResponse, ListSuppressionsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, OAuthGrant, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAutomationResponse, RemoveAutomationResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveSuppressionResponse, RemoveSuppressionResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type ResendOptions, type Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateAutomationOptions, UpdateAutomationResponse, UpdateAutomationResponseSuccess, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.d.mts
CHANGED
|
@@ -447,6 +447,12 @@ interface CreateAutomationResponseSuccess {
|
|
|
447
447
|
}
|
|
448
448
|
type CreateAutomationResponse = Response<CreateAutomationResponseSuccess>;
|
|
449
449
|
//#endregion
|
|
450
|
+
//#region src/automations/interfaces/duplicate-automation.interface.d.ts
|
|
451
|
+
interface DuplicateAutomationResponseSuccess extends Pick<Automation, 'id'> {
|
|
452
|
+
object: 'automation';
|
|
453
|
+
}
|
|
454
|
+
type DuplicateAutomationResponse = Response<DuplicateAutomationResponseSuccess>;
|
|
455
|
+
//#endregion
|
|
450
456
|
//#region src/automations/interfaces/get-automation.interface.d.ts
|
|
451
457
|
interface GetAutomationResponseSuccess extends Automation {
|
|
452
458
|
object: 'automation';
|
|
@@ -629,13 +635,19 @@ type Tag = {
|
|
|
629
635
|
};
|
|
630
636
|
//#endregion
|
|
631
637
|
//#region src/batch/interfaces/create-batch-options.interface.d.ts
|
|
638
|
+
/**
|
|
639
|
+
* Distributes over union members, unlike the built-in `Omit`, which would
|
|
640
|
+
* collapse `CreateEmailOptions` into a single object type and lose the
|
|
641
|
+
* mutual exclusivity between its `react`/`html`/`text` and `template` variants.
|
|
642
|
+
*/
|
|
643
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
632
644
|
/**
|
|
633
645
|
* Email options for batch sending. Same as CreateEmailOptions but without attachments,
|
|
634
646
|
* as these are not supported in the batch API.
|
|
635
647
|
*
|
|
636
648
|
* @link https://resend.com/docs/dashboard/emails/batch-sending#limitations
|
|
637
649
|
*/
|
|
638
|
-
type CreateBatchEmailOptions =
|
|
650
|
+
type CreateBatchEmailOptions = DistributiveOmit<CreateEmailOptions, 'attachments'>;
|
|
639
651
|
type CreateBatchOptions = CreateBatchEmailOptions[];
|
|
640
652
|
interface CreateBatchRequestOptions extends PostOptions, IdempotentRequest {
|
|
641
653
|
/**
|
|
@@ -683,6 +695,12 @@ interface Broadcast {
|
|
|
683
695
|
text: string | null;
|
|
684
696
|
}
|
|
685
697
|
//#endregion
|
|
698
|
+
//#region src/broadcasts/interfaces/cancel-broadcast.interface.d.ts
|
|
699
|
+
interface CancelBroadcastResponseSuccess extends Pick<Broadcast, 'id'> {
|
|
700
|
+
object: 'broadcast';
|
|
701
|
+
}
|
|
702
|
+
type CancelBroadcastResponse = Response<CancelBroadcastResponseSuccess>;
|
|
703
|
+
//#endregion
|
|
686
704
|
//#region src/broadcasts/interfaces/create-broadcast-options.interface.d.ts
|
|
687
705
|
interface EmailRenderOptions {
|
|
688
706
|
/**
|
|
@@ -1656,6 +1674,7 @@ declare class Automations {
|
|
|
1656
1674
|
get(id: string): Promise<GetAutomationResponse>;
|
|
1657
1675
|
remove(id: string): Promise<RemoveAutomationResponse>;
|
|
1658
1676
|
update(id: string, payload: UpdateAutomationOptions): Promise<UpdateAutomationResponse>;
|
|
1677
|
+
duplicate(id: string): Promise<DuplicateAutomationResponse>;
|
|
1659
1678
|
stop(id: string): Promise<StopAutomationResponse>;
|
|
1660
1679
|
}
|
|
1661
1680
|
//#endregion
|
|
@@ -1676,6 +1695,7 @@ declare class Broadcasts {
|
|
|
1676
1695
|
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
1677
1696
|
get(id: string): Promise<GetBroadcastResponse>;
|
|
1678
1697
|
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
1698
|
+
cancel(id: string): Promise<CancelBroadcastResponse>;
|
|
1679
1699
|
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
1680
1700
|
}
|
|
1681
1701
|
//#endregion
|
|
@@ -2146,6 +2166,7 @@ interface BaseEmailEventData {
|
|
|
2146
2166
|
broadcast_id?: string;
|
|
2147
2167
|
created_at: string;
|
|
2148
2168
|
email_id: string;
|
|
2169
|
+
message_id: string;
|
|
2149
2170
|
from: string;
|
|
2150
2171
|
to: string[];
|
|
2151
2172
|
subject: string;
|
|
@@ -2451,4 +2472,4 @@ declare class Resend {
|
|
|
2451
2472
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2452
2473
|
}
|
|
2453
2474
|
//#endregion
|
|
2454
|
-
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, AddSuppressionOptions, AddSuppressionResponse, AddSuppressionResponseSuccess, AddToSegmentStepConfig, ApiContactProperty, ApiKey, Attachment, AttachmentData, Automation, AutomationConnection, AutomationConnectionType, AutomationResponseConnection, AutomationResponseStep, AutomationRun, AutomationRunItem, AutomationRunStatus, AutomationRunStep, AutomationRunStepStatus, AutomationStatus, AutomationStep, AutomationStepType, BatchAddSuppressionsOptions, BatchAddSuppressionsResponse, BatchAddSuppressionsResponseSuccess, BatchRemoveSuppressionsOptions, BatchRemoveSuppressionsResponse, BatchRemoveSuppressionsResponseSuccess, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ClaimDomainOptions, ClaimDomainRequestOptions, ClaimDomainResponse, ClaimDomainResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeleteStepConfig, ContactDeletedEvent, ContactImport, ContactImportColumnMap, ContactImportCounts, ContactImportOnConflict, ContactImportPropertyMapping, ContactImportPropertyType, ContactImportSegment, ContactImportStatus, ContactImportTopic, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdateStepConfig, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAutomationOptions, CreateAutomationResponse, CreateAutomationResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactImportOptions, CreateContactImportRequestOptions, CreateContactImportResponse, CreateContactImportResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DelayStepConfig, DeleteOptions, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainClaim, DomainClaimBlockedReason, DomainClaimRecord, DomainClaimStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecordStatus, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailRequestOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetAutomationResponse, GetAutomationResponseSuccess, GetAutomationRunOptions, GetAutomationRunResponse, GetAutomationRunResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactImportResponse, GetContactImportResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainClaimResponse, GetDomainClaimResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetSuppressionResponse, GetSuppressionResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListAutomationRunsOptions, ListAutomationRunsResponse, ListAutomationRunsResponseSuccess, ListAutomationsOptions, ListAutomationsResponse, ListAutomationsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactImportsOptions, ListContactImportsResponse, ListContactImportsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListSuppressionsOptions, ListSuppressionsResponse, ListSuppressionsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, OAuthGrant, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAutomationResponse, RemoveAutomationResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveSuppressionResponse, RemoveSuppressionResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type ResendOptions, type Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateAutomationOptions, UpdateAutomationResponse, UpdateAutomationResponseSuccess, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload };
|
|
2475
|
+
export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, AddSuppressionOptions, AddSuppressionResponse, AddSuppressionResponseSuccess, AddToSegmentStepConfig, ApiContactProperty, ApiKey, Attachment, AttachmentData, Automation, AutomationConnection, AutomationConnectionType, AutomationResponseConnection, AutomationResponseStep, AutomationRun, AutomationRunItem, AutomationRunStatus, AutomationRunStep, AutomationRunStepStatus, AutomationStatus, AutomationStep, AutomationStepType, BatchAddSuppressionsOptions, BatchAddSuppressionsResponse, BatchAddSuppressionsResponseSuccess, BatchRemoveSuppressionsOptions, BatchRemoveSuppressionsResponse, BatchRemoveSuppressionsResponseSuccess, Broadcast, CancelBroadcastResponse, CancelBroadcastResponseSuccess, CancelEmailResponse, CancelEmailResponseSuccess, ClaimDomainOptions, ClaimDomainRequestOptions, ClaimDomainResponse, ClaimDomainResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeleteStepConfig, ContactDeletedEvent, ContactImport, ContactImportColumnMap, ContactImportCounts, ContactImportOnConflict, ContactImportPropertyMapping, ContactImportPropertyType, ContactImportSegment, ContactImportStatus, ContactImportTopic, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdateStepConfig, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateAutomationOptions, CreateAutomationResponse, CreateAutomationResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactImportOptions, CreateContactImportRequestOptions, CreateContactImportResponse, CreateContactImportResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DelayStepConfig, DeleteOptions, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainClaim, DomainClaimBlockedReason, DomainClaimRecord, DomainClaimStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecordStatus, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateAutomationResponse, DuplicateAutomationResponseSuccess, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailRequestOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetAutomationResponse, GetAutomationResponseSuccess, GetAutomationRunOptions, GetAutomationRunResponse, GetAutomationRunResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactImportResponse, GetContactImportResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainClaimResponse, GetDomainClaimResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetLogResponse, GetLogResponseSuccess, GetOptions, GetReceivingEmailOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetSuppressionResponse, GetSuppressionResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListAutomationRunsOptions, ListAutomationRunsResponse, ListAutomationRunsResponseSuccess, ListAutomationsOptions, ListAutomationsResponse, ListAutomationsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactImportsOptions, ListContactImportsResponse, ListContactImportsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListLogsOptions, ListLogsResponse, ListLogsResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListSuppressionsOptions, ListSuppressionsResponse, ListSuppressionsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, Log, OAuthGrant, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveAutomationResponse, RemoveAutomationResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveSuppressionResponse, RemoveSuppressionResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RequireAtLeastOne, Resend, type ResendOptions, type Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateAutomationOptions, UpdateAutomationResponse, UpdateAutomationResponseSuccess, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import PostalMime from "postal-mime";
|
|
2
2
|
import { Webhook } from "standardwebhooks";
|
|
3
3
|
//#region package.json
|
|
4
|
-
var version = "6.
|
|
4
|
+
var version = "6.20.0";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/common/utils/build-pagination-query.ts
|
|
7
|
+
function buildPaginationUrl(base, options) {
|
|
8
|
+
const queryString = buildPaginationQuery(options);
|
|
9
|
+
return queryString ? `${base}?${queryString}` : base;
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* Builds a query string from pagination options
|
|
9
13
|
* @param options - Pagination options containing limit and either after or before (but not both)
|
|
@@ -26,8 +30,7 @@ var ApiKeys = class {
|
|
|
26
30
|
return await this.resend.post("/api-keys", payload, options);
|
|
27
31
|
}
|
|
28
32
|
async list(options = {}) {
|
|
29
|
-
const
|
|
30
|
-
const url = queryString ? `/api-keys?${queryString}` : "/api-keys";
|
|
33
|
+
const url = buildPaginationUrl("/api-keys", options);
|
|
31
34
|
return await this.resend.get(url);
|
|
32
35
|
}
|
|
33
36
|
async remove(id) {
|
|
@@ -169,6 +172,9 @@ var Automations = class {
|
|
|
169
172
|
if (payload.connections !== void 0) apiPayload.connections = payload.connections.map(parseConnection);
|
|
170
173
|
return await this.resend.patch(`/automations/${id}`, apiPayload);
|
|
171
174
|
}
|
|
175
|
+
async duplicate(id) {
|
|
176
|
+
return await this.resend.post(`/automations/${id}/duplicate`);
|
|
177
|
+
}
|
|
172
178
|
async stop(id) {
|
|
173
179
|
return await this.resend.post(`/automations/${id}/stop`);
|
|
174
180
|
}
|
|
@@ -270,8 +276,7 @@ var Broadcasts = class {
|
|
|
270
276
|
return await this.resend.post(`/broadcasts/${id}/send`, { scheduled_at: payload?.scheduledAt });
|
|
271
277
|
}
|
|
272
278
|
async list(options = {}) {
|
|
273
|
-
const
|
|
274
|
-
const url = queryString ? `/broadcasts?${queryString}` : "/broadcasts";
|
|
279
|
+
const url = buildPaginationUrl("/broadcasts", options);
|
|
275
280
|
return await this.resend.get(url);
|
|
276
281
|
}
|
|
277
282
|
async get(id) {
|
|
@@ -280,6 +285,9 @@ var Broadcasts = class {
|
|
|
280
285
|
async remove(id) {
|
|
281
286
|
return await this.resend.delete(`/broadcasts/${id}`);
|
|
282
287
|
}
|
|
288
|
+
async cancel(id) {
|
|
289
|
+
return await this.resend.post(`/broadcasts/${id}/cancel`);
|
|
290
|
+
}
|
|
283
291
|
async update(id, payload) {
|
|
284
292
|
const html = payload.react ? await render(payload.react) : payload.html;
|
|
285
293
|
return await this.resend.patch(`/broadcasts/${id}`, {
|
|
@@ -326,8 +334,7 @@ var ContactProperties = class {
|
|
|
326
334
|
return await this.resend.post("/contact-properties", apiOptions);
|
|
327
335
|
}
|
|
328
336
|
async list(options = {}) {
|
|
329
|
-
const
|
|
330
|
-
const url = queryString ? `/contact-properties?${queryString}` : "/contact-properties";
|
|
337
|
+
const url = buildPaginationUrl("/contact-properties", options);
|
|
331
338
|
const response = await this.resend.get(url);
|
|
332
339
|
if (response.data) return {
|
|
333
340
|
data: {
|
|
@@ -446,9 +453,7 @@ var ContactSegments = class {
|
|
|
446
453
|
name: "missing_required_field"
|
|
447
454
|
}
|
|
448
455
|
};
|
|
449
|
-
const
|
|
450
|
-
const queryString = buildPaginationQuery(options);
|
|
451
|
-
const url = queryString ? `/contacts/${identifier}/segments?${queryString}` : `/contacts/${identifier}/segments`;
|
|
456
|
+
const url = buildPaginationUrl(`/contacts/${options.email ? options.email : options.contactId}/segments`, options);
|
|
452
457
|
return await this.resend.get(url);
|
|
453
458
|
}
|
|
454
459
|
async add(options) {
|
|
@@ -507,9 +512,7 @@ var ContactTopics = class {
|
|
|
507
512
|
name: "missing_required_field"
|
|
508
513
|
}
|
|
509
514
|
};
|
|
510
|
-
const
|
|
511
|
-
const queryString = buildPaginationQuery(options);
|
|
512
|
-
const url = queryString ? `/contacts/${identifier}/topics?${queryString}` : `/contacts/${identifier}/topics`;
|
|
515
|
+
const url = buildPaginationUrl(`/contacts/${options.email ? options.email : options.id}/topics`, options);
|
|
513
516
|
return this.resend.get(url);
|
|
514
517
|
}
|
|
515
518
|
};
|
|
@@ -554,12 +557,10 @@ var Contacts = class {
|
|
|
554
557
|
async list(options = {}) {
|
|
555
558
|
const segmentId = options.segmentId ?? options.audienceId;
|
|
556
559
|
if (!segmentId) {
|
|
557
|
-
const
|
|
558
|
-
const url = queryString ? `/contacts?${queryString}` : "/contacts";
|
|
560
|
+
const url = buildPaginationUrl("/contacts", options);
|
|
559
561
|
return await this.resend.get(url);
|
|
560
562
|
}
|
|
561
|
-
const
|
|
562
|
-
const url = queryString ? `/segments/${segmentId}/contacts?${queryString}` : `/segments/${segmentId}/contacts`;
|
|
563
|
+
const url = buildPaginationUrl(`/segments/${segmentId}/contacts`, options);
|
|
563
564
|
return await this.resend.get(url);
|
|
564
565
|
}
|
|
565
566
|
async get(options) {
|
|
@@ -662,8 +663,7 @@ var Domains = class {
|
|
|
662
663
|
return await this.resend.post("/domains", parseDomainToApiOptions(payload), options);
|
|
663
664
|
}
|
|
664
665
|
async list(options = {}) {
|
|
665
|
-
const
|
|
666
|
-
const url = queryString ? `/domains?${queryString}` : "/domains";
|
|
666
|
+
const url = buildPaginationUrl("/domains", options);
|
|
667
667
|
return await this.resend.get(url);
|
|
668
668
|
}
|
|
669
669
|
async get(id) {
|
|
@@ -697,8 +697,7 @@ var Attachments$1 = class {
|
|
|
697
697
|
}
|
|
698
698
|
async list(options) {
|
|
699
699
|
const { emailId } = options;
|
|
700
|
-
const
|
|
701
|
-
const url = queryString ? `/emails/${emailId}/attachments?${queryString}` : `/emails/${emailId}/attachments`;
|
|
700
|
+
const url = buildPaginationUrl(`/emails/${emailId}/attachments`, options);
|
|
702
701
|
return await this.resend.get(url);
|
|
703
702
|
}
|
|
704
703
|
};
|
|
@@ -714,8 +713,7 @@ var Attachments = class {
|
|
|
714
713
|
}
|
|
715
714
|
async list(options) {
|
|
716
715
|
const { emailId } = options;
|
|
717
|
-
const
|
|
718
|
-
const url = queryString ? `/emails/receiving/${emailId}/attachments?${queryString}` : `/emails/receiving/${emailId}/attachments`;
|
|
716
|
+
const url = buildPaginationUrl(`/emails/receiving/${emailId}/attachments`, options);
|
|
719
717
|
return await this.resend.get(url);
|
|
720
718
|
}
|
|
721
719
|
};
|
|
@@ -734,8 +732,7 @@ var Receiving = class {
|
|
|
734
732
|
return await this.resend.get(path);
|
|
735
733
|
}
|
|
736
734
|
async list(options = {}) {
|
|
737
|
-
const
|
|
738
|
-
const url = queryString ? `/emails/receiving?${queryString}` : "/emails/receiving";
|
|
735
|
+
const url = buildPaginationUrl("/emails/receiving", options);
|
|
739
736
|
return await this.resend.get(url);
|
|
740
737
|
}
|
|
741
738
|
async forward(options, requestOptions = {}) {
|
|
@@ -860,8 +857,7 @@ var Emails = class {
|
|
|
860
857
|
return await this.resend.get(`/emails/${id}`);
|
|
861
858
|
}
|
|
862
859
|
async list(options = {}) {
|
|
863
|
-
const
|
|
864
|
-
const url = queryString ? `/emails?${queryString}` : "/emails";
|
|
860
|
+
const url = buildPaginationUrl("/emails", options);
|
|
865
861
|
return await this.resend.get(url);
|
|
866
862
|
}
|
|
867
863
|
async update(payload) {
|
|
@@ -887,8 +883,7 @@ var Events = class {
|
|
|
887
883
|
return await this.resend.get(`/events/${encodeURIComponent(identifier)}`);
|
|
888
884
|
}
|
|
889
885
|
async list(options = {}) {
|
|
890
|
-
const
|
|
891
|
-
const url = queryString ? `/events?${queryString}` : "/events";
|
|
886
|
+
const url = buildPaginationUrl("/events", options);
|
|
892
887
|
return await this.resend.get(url);
|
|
893
888
|
}
|
|
894
889
|
async update(identifier, payload) {
|
|
@@ -905,8 +900,7 @@ var Logs = class {
|
|
|
905
900
|
this.resend = resend;
|
|
906
901
|
}
|
|
907
902
|
async list(options = {}) {
|
|
908
|
-
const
|
|
909
|
-
const url = queryString ? `/logs?${queryString}` : "/logs";
|
|
903
|
+
const url = buildPaginationUrl("/logs", options);
|
|
910
904
|
return await this.resend.get(url);
|
|
911
905
|
}
|
|
912
906
|
async get(id) {
|
|
@@ -920,8 +914,7 @@ var OAuthGrants = class {
|
|
|
920
914
|
this.resend = resend;
|
|
921
915
|
}
|
|
922
916
|
async list(options = {}) {
|
|
923
|
-
const
|
|
924
|
-
const url = queryString ? `/oauth/grants?${queryString}` : "/oauth/grants";
|
|
917
|
+
const url = buildPaginationUrl("/oauth/grants", options);
|
|
925
918
|
return await this.resend.get(url);
|
|
926
919
|
}
|
|
927
920
|
async revoke(id) {
|
|
@@ -938,8 +931,7 @@ var Segments = class {
|
|
|
938
931
|
return await this.resend.post("/segments", payload, options);
|
|
939
932
|
}
|
|
940
933
|
async list(options = {}) {
|
|
941
|
-
const
|
|
942
|
-
const url = queryString ? `/segments?${queryString}` : "/segments";
|
|
934
|
+
const url = buildPaginationUrl("/segments", options);
|
|
943
935
|
return await this.resend.get(url);
|
|
944
936
|
}
|
|
945
937
|
async get(id) {
|
|
@@ -1150,8 +1142,7 @@ var Webhooks = class {
|
|
|
1150
1142
|
return await this.resend.get(`/webhooks/${id}`);
|
|
1151
1143
|
}
|
|
1152
1144
|
async list(options = {}) {
|
|
1153
|
-
const
|
|
1154
|
-
const url = queryString ? `/webhooks?${queryString}` : "/webhooks";
|
|
1145
|
+
const url = buildPaginationUrl("/webhooks", options);
|
|
1155
1146
|
return await this.resend.get(url);
|
|
1156
1147
|
}
|
|
1157
1148
|
async update(id, payload) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/resend",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.20.0-depup.0",
|
|
4
4
|
"description": "Node.js library for the Resend API (with updated dependencies)",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -31,18 +31,6 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
36
|
-
"integration:nextjs": "cd ./e2e/nextjs && next build --turbopack",
|
|
37
|
-
"lint": "biome check .",
|
|
38
|
-
"lint:fix": "biome check . --write",
|
|
39
|
-
"test": "vitest run --exclude e2e",
|
|
40
|
-
"test:dev": "cross-env TEST_MODE=dev vitest run --exclude e2e",
|
|
41
|
-
"test:e2e": "vitest run e2e",
|
|
42
|
-
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run --exclude e2e",
|
|
43
|
-
"test:watch": "vitest --exclude e2e",
|
|
44
|
-
"typecheck": "tsc --noEmit"
|
|
45
|
-
},
|
|
46
34
|
"repository": {
|
|
47
35
|
"type": "git",
|
|
48
36
|
"url": "git+https://github.com/resend/resend-node.git"
|
|
@@ -54,7 +42,7 @@
|
|
|
54
42
|
},
|
|
55
43
|
"homepage": "https://github.com/resend/resend-node#readme",
|
|
56
44
|
"dependencies": {
|
|
57
|
-
"postal-mime": "
|
|
45
|
+
"postal-mime": "^3.0.0",
|
|
58
46
|
"standardwebhooks": "1.0.0"
|
|
59
47
|
},
|
|
60
48
|
"peerDependencies": {
|
|
@@ -84,7 +72,18 @@
|
|
|
84
72
|
"vitest": "4.1.10",
|
|
85
73
|
"vitest-fetch-mock": "0.4.5"
|
|
86
74
|
},
|
|
87
|
-
"
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "tsdown src/index.ts --format esm,cjs --dts",
|
|
77
|
+
"integration:nextjs": "cd ./e2e/nextjs && next build --turbopack",
|
|
78
|
+
"lint": "biome check .",
|
|
79
|
+
"lint:fix": "biome check . --write",
|
|
80
|
+
"test": "vitest run --exclude e2e",
|
|
81
|
+
"test:dev": "cross-env TEST_MODE=dev vitest run --exclude e2e",
|
|
82
|
+
"test:e2e": "vitest run e2e",
|
|
83
|
+
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run --exclude e2e",
|
|
84
|
+
"test:watch": "vitest --exclude e2e",
|
|
85
|
+
"typecheck": "tsc --noEmit"
|
|
86
|
+
},
|
|
88
87
|
"keywords": [
|
|
89
88
|
"resend",
|
|
90
89
|
"depup",
|
|
@@ -94,11 +93,16 @@
|
|
|
94
93
|
"patched"
|
|
95
94
|
],
|
|
96
95
|
"depup": {
|
|
97
|
-
"changes": {
|
|
98
|
-
|
|
96
|
+
"changes": {
|
|
97
|
+
"postal-mime": {
|
|
98
|
+
"from": "2.7.5",
|
|
99
|
+
"to": "^3.0.0"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"depsUpdated": 1,
|
|
99
103
|
"originalPackage": "resend",
|
|
100
|
-
"originalVersion": "6.
|
|
101
|
-
"processedAt": "2026-08-
|
|
104
|
+
"originalVersion": "6.20.0",
|
|
105
|
+
"processedAt": "2026-08-16T00:29:03.900Z",
|
|
102
106
|
"smokeTest": "passed"
|
|
103
107
|
}
|
|
104
108
|
}
|