@depup/resend 6.20.0-depup.0 → 6.22.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 +2 -2
- package/changes.json +1 -1
- package/dist/index.cjs +44 -1
- package/dist/index.d.cts +172 -1
- package/dist/index.d.mts +172 -1
- package/dist/index.mjs +44 -1
- package/package.json +16 -15
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ 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.22.0 |
|
|
17
|
+
| Processed | 2026-08-23 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 1 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -25,7 +25,7 @@ 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.22.0";
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/common/utils/build-pagination-query.ts
|
|
31
31
|
function buildPaginationUrl(base, options) {
|
|
@@ -57,6 +57,9 @@ var ApiKeys = class {
|
|
|
57
57
|
const url = buildPaginationUrl("/api-keys", options);
|
|
58
58
|
return await this.resend.get(url);
|
|
59
59
|
}
|
|
60
|
+
async update(id, payload) {
|
|
61
|
+
return await this.resend.patch(`/api-keys/${id}`, payload);
|
|
62
|
+
}
|
|
60
63
|
async remove(id) {
|
|
61
64
|
return await this.resend.delete(`/api-keys/${id}`);
|
|
62
65
|
}
|
|
@@ -306,6 +309,14 @@ var Broadcasts = class {
|
|
|
306
309
|
async get(id) {
|
|
307
310
|
return await this.resend.get(`/broadcasts/${id}`);
|
|
308
311
|
}
|
|
312
|
+
async recipients(id, options) {
|
|
313
|
+
const url = `/broadcasts/${id}/recipients?${buildRecipientsQuery(options)}`;
|
|
314
|
+
return await this.resend.get(url);
|
|
315
|
+
}
|
|
316
|
+
async clickedLinks(id, options = {}) {
|
|
317
|
+
const url = buildPaginationUrl(`/broadcasts/${id}/clicked-links`, options);
|
|
318
|
+
return await this.resend.get(url);
|
|
319
|
+
}
|
|
309
320
|
async remove(id) {
|
|
310
321
|
return await this.resend.delete(`/broadcasts/${id}`);
|
|
311
322
|
}
|
|
@@ -328,6 +339,14 @@ var Broadcasts = class {
|
|
|
328
339
|
});
|
|
329
340
|
}
|
|
330
341
|
};
|
|
342
|
+
function buildRecipientsQuery(options) {
|
|
343
|
+
const { type, email, bounceType, ...pagination } = options;
|
|
344
|
+
const searchParams = new URLSearchParams(buildPaginationQuery(pagination));
|
|
345
|
+
searchParams.set("type", type);
|
|
346
|
+
if (email !== void 0) searchParams.set("email", email);
|
|
347
|
+
if (bounceType !== void 0) searchParams.set("bounce_type", bounceType);
|
|
348
|
+
return searchParams.toString();
|
|
349
|
+
}
|
|
331
350
|
//#endregion
|
|
332
351
|
//#region src/common/utils/parse-contact-properties-to-api-options.ts
|
|
333
352
|
function parseContactPropertyFromApi(contactProperty) {
|
|
@@ -890,7 +909,31 @@ var Emails = class {
|
|
|
890
909
|
async cancel(id) {
|
|
891
910
|
return await this.resend.post(`/emails/${id}/cancel`);
|
|
892
911
|
}
|
|
912
|
+
async share(id, payload) {
|
|
913
|
+
return await this.resend.post(`/emails/${id}/share`, { expires_in: payload?.expiresIn });
|
|
914
|
+
}
|
|
915
|
+
async metrics(options = {}) {
|
|
916
|
+
const queryString = buildMetricsQuery(options);
|
|
917
|
+
const url = queryString ? `/emails/metrics?${queryString}` : "/emails/metrics";
|
|
918
|
+
return await this.resend.get(url);
|
|
919
|
+
}
|
|
893
920
|
};
|
|
921
|
+
function buildMetricsQuery(options) {
|
|
922
|
+
const params = {
|
|
923
|
+
start_date: options.startDate,
|
|
924
|
+
end_date: options.endDate,
|
|
925
|
+
timezone: options.timezone,
|
|
926
|
+
granularity: options.granularity,
|
|
927
|
+
metrics: options.metrics?.join(","),
|
|
928
|
+
dimensions: options.dimensions?.join(","),
|
|
929
|
+
domain_id: options.domainId?.join(","),
|
|
930
|
+
email_id: options.emailId?.join(","),
|
|
931
|
+
broadcast_id: options.broadcastId?.join(",")
|
|
932
|
+
};
|
|
933
|
+
const searchParams = new URLSearchParams();
|
|
934
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") searchParams.set(key, value);
|
|
935
|
+
return searchParams.toString();
|
|
936
|
+
}
|
|
894
937
|
//#endregion
|
|
895
938
|
//#region src/events/events.ts
|
|
896
939
|
var Events = class {
|
package/dist/index.d.cts
CHANGED
|
@@ -264,6 +264,16 @@ type RemoveApiKeyResponseSuccess = Pick<ApiKey, 'id'> & {
|
|
|
264
264
|
};
|
|
265
265
|
type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
|
|
266
266
|
//#endregion
|
|
267
|
+
//#region src/api-keys/interfaces/update-api-key-options.interface.d.ts
|
|
268
|
+
interface UpdateApiKeyOptions {
|
|
269
|
+
name: string;
|
|
270
|
+
}
|
|
271
|
+
interface UpdateApiKeyResponseSuccess {
|
|
272
|
+
object: 'api_key';
|
|
273
|
+
id: string;
|
|
274
|
+
}
|
|
275
|
+
type UpdateApiKeyResponse = Response<UpdateApiKeyResponseSuccess>;
|
|
276
|
+
//#endregion
|
|
267
277
|
//#region src/automations/interfaces/automation-step.interface.d.ts
|
|
268
278
|
type ConditionRule = {
|
|
269
279
|
type: 'rule';
|
|
@@ -819,6 +829,65 @@ interface GetBroadcastResponseSuccess extends Broadcast {
|
|
|
819
829
|
}
|
|
820
830
|
type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
|
|
821
831
|
//#endregion
|
|
832
|
+
//#region src/broadcasts/interfaces/list-broadcast-clicked-links.interface.d.ts
|
|
833
|
+
type ListBroadcastClickedLinksOptions = PaginationOptions;
|
|
834
|
+
type BroadcastClickedLink = {
|
|
835
|
+
/**
|
|
836
|
+
* `id` is an opaque cursor for this row, used only for pagination.
|
|
837
|
+
* It does not identify any entity in Resend.
|
|
838
|
+
*/
|
|
839
|
+
id: string;
|
|
840
|
+
url: string;
|
|
841
|
+
clicks: number;
|
|
842
|
+
unique_clicks: number;
|
|
843
|
+
};
|
|
844
|
+
type ListBroadcastClickedLinksResponseSuccess = PaginatedData<BroadcastClickedLink[]>;
|
|
845
|
+
type ListBroadcastClickedLinksResponse = Response<ListBroadcastClickedLinksResponseSuccess>;
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region src/broadcasts/interfaces/list-broadcast-recipients.interface.d.ts
|
|
848
|
+
type BroadcastRecipientEventType = 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | 'unsubscribed' | 'suppressed';
|
|
849
|
+
type BroadcastRecipientBounceType = 'permanent' | 'transient' | 'undetermined';
|
|
850
|
+
type ListBroadcastRecipientsOptions<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginationOptions & {
|
|
851
|
+
type: T;
|
|
852
|
+
email?: string;
|
|
853
|
+
bounceType?: T extends 'bounced' ? BroadcastRecipientBounceType : never;
|
|
854
|
+
};
|
|
855
|
+
interface BroadcastRecipientClickedLink {
|
|
856
|
+
url: string;
|
|
857
|
+
clicks: number;
|
|
858
|
+
}
|
|
859
|
+
type BroadcastRecipientBase = {
|
|
860
|
+
id: string;
|
|
861
|
+
contact_id: string | null;
|
|
862
|
+
email: string;
|
|
863
|
+
};
|
|
864
|
+
type BroadcastRecipientLoose = BroadcastRecipientBase & {
|
|
865
|
+
count?: number;
|
|
866
|
+
clicked_links?: BroadcastRecipientClickedLink[];
|
|
867
|
+
bounce_type?: BroadcastRecipientBounceType;
|
|
868
|
+
};
|
|
869
|
+
type IsUnion<T, B = T> = T extends B ? ([B] extends [T] ? false : true) : never;
|
|
870
|
+
type BroadcastRecipientFieldsByType = {
|
|
871
|
+
sent: unknown;
|
|
872
|
+
delivered: unknown;
|
|
873
|
+
opened: {
|
|
874
|
+
count: number;
|
|
875
|
+
};
|
|
876
|
+
clicked: {
|
|
877
|
+
count: number;
|
|
878
|
+
clicked_links: BroadcastRecipientClickedLink[];
|
|
879
|
+
};
|
|
880
|
+
bounced: {
|
|
881
|
+
bounce_type: BroadcastRecipientBounceType;
|
|
882
|
+
};
|
|
883
|
+
complained: unknown;
|
|
884
|
+
unsubscribed: unknown;
|
|
885
|
+
suppressed: unknown;
|
|
886
|
+
};
|
|
887
|
+
type BroadcastRecipient<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = IsUnion<T> extends true ? BroadcastRecipientLoose : BroadcastRecipientBase & BroadcastRecipientFieldsByType[T];
|
|
888
|
+
type ListBroadcastRecipientsResponseSuccess<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginatedData<BroadcastRecipient<T>[]>;
|
|
889
|
+
type ListBroadcastRecipientsResponse<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = Response<ListBroadcastRecipientsResponseSuccess<T>>;
|
|
890
|
+
//#endregion
|
|
822
891
|
//#region src/broadcasts/interfaces/list-broadcasts.interface.d.ts
|
|
823
892
|
type ListBroadcastsOptions = PaginationOptions;
|
|
824
893
|
type ListBroadcastsResponseSuccess = {
|
|
@@ -1409,6 +1478,92 @@ interface GetEmailResponseSuccess {
|
|
|
1409
1478
|
}
|
|
1410
1479
|
type GetEmailResponse = Response<GetEmailResponseSuccess>;
|
|
1411
1480
|
//#endregion
|
|
1481
|
+
//#region src/emails/interfaces/get-metrics.interface.d.ts
|
|
1482
|
+
type EmailMetric = 'received' | 'delivered' | 'complained' | 'suppressed' | 'bounced' | 'bounced_transient' | 'bounced_permanent' | 'bounced_undetermined' | 'opened' | 'clicked' | 'unsubscribed' | 'delivery_delayed' | 'failed' | 'sent' | 'unique_opened' | 'unique_clicked' | 'delivery_rate' | 'open_rate' | 'click_rate' | 'bounce_rate' | 'complaint_rate' | 'unsubscribe_rate';
|
|
1483
|
+
type EmailMetricsDimension = 'period' | 'domain' | 'email' | 'broadcast';
|
|
1484
|
+
type EmailMetricsGranularity = 'hourly' | 'daily' | 'weekly' | 'monthly';
|
|
1485
|
+
type EmailMetricsCommonOptions = {
|
|
1486
|
+
/**
|
|
1487
|
+
* The start of the date range, as an ISO 8601 date or datetime.
|
|
1488
|
+
* Defaults to 6 days before `endDate`.
|
|
1489
|
+
*
|
|
1490
|
+
* @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
|
|
1491
|
+
*/
|
|
1492
|
+
startDate?: string;
|
|
1493
|
+
/**
|
|
1494
|
+
* The end of the date range, as an ISO 8601 date or datetime.
|
|
1495
|
+
* Defaults to now.
|
|
1496
|
+
*
|
|
1497
|
+
* @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
|
|
1498
|
+
*/
|
|
1499
|
+
endDate?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* The IANA timezone used to bucket periods when `period` is in `dimensions`.
|
|
1502
|
+
* Defaults to `UTC`.
|
|
1503
|
+
*/
|
|
1504
|
+
timezone?: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* The bucket size used when `period` is in `dimensions`.
|
|
1507
|
+
* Defaults to `daily`.
|
|
1508
|
+
*/
|
|
1509
|
+
granularity?: EmailMetricsGranularity;
|
|
1510
|
+
/**
|
|
1511
|
+
* The metrics to include in the response. Defaults to all metrics.
|
|
1512
|
+
*/
|
|
1513
|
+
metrics?: EmailMetric[];
|
|
1514
|
+
/**
|
|
1515
|
+
* Restrict the response to these sending domain IDs.
|
|
1516
|
+
*/
|
|
1517
|
+
domainId?: string[];
|
|
1518
|
+
};
|
|
1519
|
+
type GetEmailsMetricsOptions = EmailMetricsCommonOptions & ({
|
|
1520
|
+
/**
|
|
1521
|
+
* The dimensions to break the response down by. Defaults to `[]`,
|
|
1522
|
+
* which returns a single `totals` row for the whole range, with no
|
|
1523
|
+
* `data`. Cannot combine `broadcast` with `email`/`emailId`.
|
|
1524
|
+
*/
|
|
1525
|
+
dimensions?: Exclude<EmailMetricsDimension, 'broadcast'>[];
|
|
1526
|
+
/**
|
|
1527
|
+
* Restrict the response to these email IDs. Cannot be combined with
|
|
1528
|
+
* the `broadcast` dimension or `broadcastId`.
|
|
1529
|
+
*/
|
|
1530
|
+
emailId?: string[];
|
|
1531
|
+
broadcastId?: never;
|
|
1532
|
+
} | {
|
|
1533
|
+
/**
|
|
1534
|
+
* The dimensions to break the response down by. Defaults to `[]`,
|
|
1535
|
+
* which returns a single `totals` row for the whole range, with no
|
|
1536
|
+
* `data`. Cannot combine `email` with `broadcast`/`broadcastId`.
|
|
1537
|
+
*/
|
|
1538
|
+
dimensions?: Exclude<EmailMetricsDimension, 'email'>[];
|
|
1539
|
+
emailId?: never;
|
|
1540
|
+
/**
|
|
1541
|
+
* Restrict the response to these broadcast IDs. Cannot be combined
|
|
1542
|
+
* with the `email` dimension or `emailId`.
|
|
1543
|
+
*/
|
|
1544
|
+
broadcastId?: string[];
|
|
1545
|
+
});
|
|
1546
|
+
type EmailMetricsTotals = Partial<Record<EmailMetric, number>>;
|
|
1547
|
+
type EmailMetricsDataRow = EmailMetricsTotals & {
|
|
1548
|
+
period?: string;
|
|
1549
|
+
domain_id?: string;
|
|
1550
|
+
domain_name?: string;
|
|
1551
|
+
email_id?: string;
|
|
1552
|
+
broadcast_id?: string;
|
|
1553
|
+
broadcast_name?: string;
|
|
1554
|
+
};
|
|
1555
|
+
interface GetEmailsMetricsResponseSuccess {
|
|
1556
|
+
object: 'metrics';
|
|
1557
|
+
start_date: string;
|
|
1558
|
+
end_date: string;
|
|
1559
|
+
metrics: EmailMetric[];
|
|
1560
|
+
dimensions: EmailMetricsDimension[];
|
|
1561
|
+
granularity: EmailMetricsGranularity;
|
|
1562
|
+
totals: EmailMetricsTotals;
|
|
1563
|
+
data?: EmailMetricsDataRow[];
|
|
1564
|
+
}
|
|
1565
|
+
type GetEmailsMetricsResponse = Response<GetEmailsMetricsResponseSuccess>;
|
|
1566
|
+
//#endregion
|
|
1412
1567
|
//#region src/emails/interfaces/list-emails-options.interface.d.ts
|
|
1413
1568
|
type ListEmailsOptions = PaginationOptions;
|
|
1414
1569
|
type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
|
|
@@ -1419,6 +1574,17 @@ type ListEmailsResponseSuccess = {
|
|
|
1419
1574
|
};
|
|
1420
1575
|
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1421
1576
|
//#endregion
|
|
1577
|
+
//#region src/emails/interfaces/share-email-options.interface.d.ts
|
|
1578
|
+
interface ShareEmailOptions {
|
|
1579
|
+
expiresIn?: string;
|
|
1580
|
+
}
|
|
1581
|
+
interface ShareEmailResponseSuccess {
|
|
1582
|
+
object: 'email';
|
|
1583
|
+
id: string;
|
|
1584
|
+
url: string;
|
|
1585
|
+
}
|
|
1586
|
+
type ShareEmailResponse = Response<ShareEmailResponseSuccess>;
|
|
1587
|
+
//#endregion
|
|
1422
1588
|
//#region src/emails/interfaces/update-email-options.interface.d.ts
|
|
1423
1589
|
interface UpdateEmailOptions {
|
|
1424
1590
|
id: string;
|
|
@@ -1653,6 +1819,7 @@ declare class ApiKeys {
|
|
|
1653
1819
|
constructor(resend: Resend);
|
|
1654
1820
|
create(payload: CreateApiKeyOptions, options?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
|
|
1655
1821
|
list(options?: ListApiKeysOptions): Promise<ListApiKeysResponse>;
|
|
1822
|
+
update(id: string, payload: UpdateApiKeyOptions): Promise<UpdateApiKeyResponse>;
|
|
1656
1823
|
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
1657
1824
|
}
|
|
1658
1825
|
//#endregion
|
|
@@ -1694,6 +1861,8 @@ declare class Broadcasts {
|
|
|
1694
1861
|
send(id: string, payload?: SendBroadcastOptions): Promise<SendBroadcastResponse>;
|
|
1695
1862
|
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
1696
1863
|
get(id: string): Promise<GetBroadcastResponse>;
|
|
1864
|
+
recipients<T extends BroadcastRecipientEventType>(id: string, options: ListBroadcastRecipientsOptions<T>): Promise<ListBroadcastRecipientsResponse<T>>;
|
|
1865
|
+
clickedLinks(id: string, options?: ListBroadcastClickedLinksOptions): Promise<ListBroadcastClickedLinksResponse>;
|
|
1697
1866
|
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
1698
1867
|
cancel(id: string): Promise<CancelBroadcastResponse>;
|
|
1699
1868
|
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
@@ -1816,6 +1985,8 @@ declare class Emails {
|
|
|
1816
1985
|
list(options?: ListEmailsOptions): Promise<ListEmailsResponse>;
|
|
1817
1986
|
update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
|
|
1818
1987
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1988
|
+
share(id: string, payload?: ShareEmailOptions): Promise<ShareEmailResponse>;
|
|
1989
|
+
metrics(options?: GetEmailsMetricsOptions): Promise<GetEmailsMetricsResponse>;
|
|
1819
1990
|
}
|
|
1820
1991
|
//#endregion
|
|
1821
1992
|
//#region src/events/events.d.ts
|
|
@@ -2472,4 +2643,4 @@ declare class Resend {
|
|
|
2472
2643
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2473
2644
|
}
|
|
2474
2645
|
//#endregion
|
|
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 };
|
|
2646
|
+
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, BroadcastClickedLink, BroadcastRecipient, BroadcastRecipientBounceType, BroadcastRecipientClickedLink, BroadcastRecipientEventType, 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, EmailMetric, EmailMetricsDataRow, EmailMetricsDimension, EmailMetricsGranularity, EmailMetricsTotals, 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, GetEmailsMetricsOptions, GetEmailsMetricsResponse, GetEmailsMetricsResponseSuccess, 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, ListBroadcastClickedLinksOptions, ListBroadcastClickedLinksResponse, ListBroadcastClickedLinksResponseSuccess, ListBroadcastRecipientsOptions, ListBroadcastRecipientsResponse, ListBroadcastRecipientsResponseSuccess, 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, ShareEmailOptions, ShareEmailResponse, ShareEmailResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateApiKeyOptions, UpdateApiKeyResponse, UpdateApiKeyResponseSuccess, 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
|
@@ -264,6 +264,16 @@ type RemoveApiKeyResponseSuccess = Pick<ApiKey, 'id'> & {
|
|
|
264
264
|
};
|
|
265
265
|
type RemoveApiKeyResponse = Response<RemoveApiKeyResponseSuccess>;
|
|
266
266
|
//#endregion
|
|
267
|
+
//#region src/api-keys/interfaces/update-api-key-options.interface.d.ts
|
|
268
|
+
interface UpdateApiKeyOptions {
|
|
269
|
+
name: string;
|
|
270
|
+
}
|
|
271
|
+
interface UpdateApiKeyResponseSuccess {
|
|
272
|
+
object: 'api_key';
|
|
273
|
+
id: string;
|
|
274
|
+
}
|
|
275
|
+
type UpdateApiKeyResponse = Response<UpdateApiKeyResponseSuccess>;
|
|
276
|
+
//#endregion
|
|
267
277
|
//#region src/automations/interfaces/automation-step.interface.d.ts
|
|
268
278
|
type ConditionRule = {
|
|
269
279
|
type: 'rule';
|
|
@@ -819,6 +829,65 @@ interface GetBroadcastResponseSuccess extends Broadcast {
|
|
|
819
829
|
}
|
|
820
830
|
type GetBroadcastResponse = Response<GetBroadcastResponseSuccess>;
|
|
821
831
|
//#endregion
|
|
832
|
+
//#region src/broadcasts/interfaces/list-broadcast-clicked-links.interface.d.ts
|
|
833
|
+
type ListBroadcastClickedLinksOptions = PaginationOptions;
|
|
834
|
+
type BroadcastClickedLink = {
|
|
835
|
+
/**
|
|
836
|
+
* `id` is an opaque cursor for this row, used only for pagination.
|
|
837
|
+
* It does not identify any entity in Resend.
|
|
838
|
+
*/
|
|
839
|
+
id: string;
|
|
840
|
+
url: string;
|
|
841
|
+
clicks: number;
|
|
842
|
+
unique_clicks: number;
|
|
843
|
+
};
|
|
844
|
+
type ListBroadcastClickedLinksResponseSuccess = PaginatedData<BroadcastClickedLink[]>;
|
|
845
|
+
type ListBroadcastClickedLinksResponse = Response<ListBroadcastClickedLinksResponseSuccess>;
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region src/broadcasts/interfaces/list-broadcast-recipients.interface.d.ts
|
|
848
|
+
type BroadcastRecipientEventType = 'sent' | 'delivered' | 'opened' | 'clicked' | 'bounced' | 'complained' | 'unsubscribed' | 'suppressed';
|
|
849
|
+
type BroadcastRecipientBounceType = 'permanent' | 'transient' | 'undetermined';
|
|
850
|
+
type ListBroadcastRecipientsOptions<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginationOptions & {
|
|
851
|
+
type: T;
|
|
852
|
+
email?: string;
|
|
853
|
+
bounceType?: T extends 'bounced' ? BroadcastRecipientBounceType : never;
|
|
854
|
+
};
|
|
855
|
+
interface BroadcastRecipientClickedLink {
|
|
856
|
+
url: string;
|
|
857
|
+
clicks: number;
|
|
858
|
+
}
|
|
859
|
+
type BroadcastRecipientBase = {
|
|
860
|
+
id: string;
|
|
861
|
+
contact_id: string | null;
|
|
862
|
+
email: string;
|
|
863
|
+
};
|
|
864
|
+
type BroadcastRecipientLoose = BroadcastRecipientBase & {
|
|
865
|
+
count?: number;
|
|
866
|
+
clicked_links?: BroadcastRecipientClickedLink[];
|
|
867
|
+
bounce_type?: BroadcastRecipientBounceType;
|
|
868
|
+
};
|
|
869
|
+
type IsUnion<T, B = T> = T extends B ? ([B] extends [T] ? false : true) : never;
|
|
870
|
+
type BroadcastRecipientFieldsByType = {
|
|
871
|
+
sent: unknown;
|
|
872
|
+
delivered: unknown;
|
|
873
|
+
opened: {
|
|
874
|
+
count: number;
|
|
875
|
+
};
|
|
876
|
+
clicked: {
|
|
877
|
+
count: number;
|
|
878
|
+
clicked_links: BroadcastRecipientClickedLink[];
|
|
879
|
+
};
|
|
880
|
+
bounced: {
|
|
881
|
+
bounce_type: BroadcastRecipientBounceType;
|
|
882
|
+
};
|
|
883
|
+
complained: unknown;
|
|
884
|
+
unsubscribed: unknown;
|
|
885
|
+
suppressed: unknown;
|
|
886
|
+
};
|
|
887
|
+
type BroadcastRecipient<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = IsUnion<T> extends true ? BroadcastRecipientLoose : BroadcastRecipientBase & BroadcastRecipientFieldsByType[T];
|
|
888
|
+
type ListBroadcastRecipientsResponseSuccess<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = PaginatedData<BroadcastRecipient<T>[]>;
|
|
889
|
+
type ListBroadcastRecipientsResponse<T extends BroadcastRecipientEventType = BroadcastRecipientEventType> = Response<ListBroadcastRecipientsResponseSuccess<T>>;
|
|
890
|
+
//#endregion
|
|
822
891
|
//#region src/broadcasts/interfaces/list-broadcasts.interface.d.ts
|
|
823
892
|
type ListBroadcastsOptions = PaginationOptions;
|
|
824
893
|
type ListBroadcastsResponseSuccess = {
|
|
@@ -1409,6 +1478,92 @@ interface GetEmailResponseSuccess {
|
|
|
1409
1478
|
}
|
|
1410
1479
|
type GetEmailResponse = Response<GetEmailResponseSuccess>;
|
|
1411
1480
|
//#endregion
|
|
1481
|
+
//#region src/emails/interfaces/get-metrics.interface.d.ts
|
|
1482
|
+
type EmailMetric = 'received' | 'delivered' | 'complained' | 'suppressed' | 'bounced' | 'bounced_transient' | 'bounced_permanent' | 'bounced_undetermined' | 'opened' | 'clicked' | 'unsubscribed' | 'delivery_delayed' | 'failed' | 'sent' | 'unique_opened' | 'unique_clicked' | 'delivery_rate' | 'open_rate' | 'click_rate' | 'bounce_rate' | 'complaint_rate' | 'unsubscribe_rate';
|
|
1483
|
+
type EmailMetricsDimension = 'period' | 'domain' | 'email' | 'broadcast';
|
|
1484
|
+
type EmailMetricsGranularity = 'hourly' | 'daily' | 'weekly' | 'monthly';
|
|
1485
|
+
type EmailMetricsCommonOptions = {
|
|
1486
|
+
/**
|
|
1487
|
+
* The start of the date range, as an ISO 8601 date or datetime.
|
|
1488
|
+
* Defaults to 6 days before `endDate`.
|
|
1489
|
+
*
|
|
1490
|
+
* @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
|
|
1491
|
+
*/
|
|
1492
|
+
startDate?: string;
|
|
1493
|
+
/**
|
|
1494
|
+
* The end of the date range, as an ISO 8601 date or datetime.
|
|
1495
|
+
* Defaults to now.
|
|
1496
|
+
*
|
|
1497
|
+
* @link https://resend.com/docs/api-reference/emails/get-metrics#query-parameters
|
|
1498
|
+
*/
|
|
1499
|
+
endDate?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* The IANA timezone used to bucket periods when `period` is in `dimensions`.
|
|
1502
|
+
* Defaults to `UTC`.
|
|
1503
|
+
*/
|
|
1504
|
+
timezone?: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* The bucket size used when `period` is in `dimensions`.
|
|
1507
|
+
* Defaults to `daily`.
|
|
1508
|
+
*/
|
|
1509
|
+
granularity?: EmailMetricsGranularity;
|
|
1510
|
+
/**
|
|
1511
|
+
* The metrics to include in the response. Defaults to all metrics.
|
|
1512
|
+
*/
|
|
1513
|
+
metrics?: EmailMetric[];
|
|
1514
|
+
/**
|
|
1515
|
+
* Restrict the response to these sending domain IDs.
|
|
1516
|
+
*/
|
|
1517
|
+
domainId?: string[];
|
|
1518
|
+
};
|
|
1519
|
+
type GetEmailsMetricsOptions = EmailMetricsCommonOptions & ({
|
|
1520
|
+
/**
|
|
1521
|
+
* The dimensions to break the response down by. Defaults to `[]`,
|
|
1522
|
+
* which returns a single `totals` row for the whole range, with no
|
|
1523
|
+
* `data`. Cannot combine `broadcast` with `email`/`emailId`.
|
|
1524
|
+
*/
|
|
1525
|
+
dimensions?: Exclude<EmailMetricsDimension, 'broadcast'>[];
|
|
1526
|
+
/**
|
|
1527
|
+
* Restrict the response to these email IDs. Cannot be combined with
|
|
1528
|
+
* the `broadcast` dimension or `broadcastId`.
|
|
1529
|
+
*/
|
|
1530
|
+
emailId?: string[];
|
|
1531
|
+
broadcastId?: never;
|
|
1532
|
+
} | {
|
|
1533
|
+
/**
|
|
1534
|
+
* The dimensions to break the response down by. Defaults to `[]`,
|
|
1535
|
+
* which returns a single `totals` row for the whole range, with no
|
|
1536
|
+
* `data`. Cannot combine `email` with `broadcast`/`broadcastId`.
|
|
1537
|
+
*/
|
|
1538
|
+
dimensions?: Exclude<EmailMetricsDimension, 'email'>[];
|
|
1539
|
+
emailId?: never;
|
|
1540
|
+
/**
|
|
1541
|
+
* Restrict the response to these broadcast IDs. Cannot be combined
|
|
1542
|
+
* with the `email` dimension or `emailId`.
|
|
1543
|
+
*/
|
|
1544
|
+
broadcastId?: string[];
|
|
1545
|
+
});
|
|
1546
|
+
type EmailMetricsTotals = Partial<Record<EmailMetric, number>>;
|
|
1547
|
+
type EmailMetricsDataRow = EmailMetricsTotals & {
|
|
1548
|
+
period?: string;
|
|
1549
|
+
domain_id?: string;
|
|
1550
|
+
domain_name?: string;
|
|
1551
|
+
email_id?: string;
|
|
1552
|
+
broadcast_id?: string;
|
|
1553
|
+
broadcast_name?: string;
|
|
1554
|
+
};
|
|
1555
|
+
interface GetEmailsMetricsResponseSuccess {
|
|
1556
|
+
object: 'metrics';
|
|
1557
|
+
start_date: string;
|
|
1558
|
+
end_date: string;
|
|
1559
|
+
metrics: EmailMetric[];
|
|
1560
|
+
dimensions: EmailMetricsDimension[];
|
|
1561
|
+
granularity: EmailMetricsGranularity;
|
|
1562
|
+
totals: EmailMetricsTotals;
|
|
1563
|
+
data?: EmailMetricsDataRow[];
|
|
1564
|
+
}
|
|
1565
|
+
type GetEmailsMetricsResponse = Response<GetEmailsMetricsResponseSuccess>;
|
|
1566
|
+
//#endregion
|
|
1412
1567
|
//#region src/emails/interfaces/list-emails-options.interface.d.ts
|
|
1413
1568
|
type ListEmailsOptions = PaginationOptions;
|
|
1414
1569
|
type ListEmail = Omit<GetEmailResponseSuccess, 'html' | 'text' | 'tags' | 'object'>;
|
|
@@ -1419,6 +1574,17 @@ type ListEmailsResponseSuccess = {
|
|
|
1419
1574
|
};
|
|
1420
1575
|
type ListEmailsResponse = Response<ListEmailsResponseSuccess>;
|
|
1421
1576
|
//#endregion
|
|
1577
|
+
//#region src/emails/interfaces/share-email-options.interface.d.ts
|
|
1578
|
+
interface ShareEmailOptions {
|
|
1579
|
+
expiresIn?: string;
|
|
1580
|
+
}
|
|
1581
|
+
interface ShareEmailResponseSuccess {
|
|
1582
|
+
object: 'email';
|
|
1583
|
+
id: string;
|
|
1584
|
+
url: string;
|
|
1585
|
+
}
|
|
1586
|
+
type ShareEmailResponse = Response<ShareEmailResponseSuccess>;
|
|
1587
|
+
//#endregion
|
|
1422
1588
|
//#region src/emails/interfaces/update-email-options.interface.d.ts
|
|
1423
1589
|
interface UpdateEmailOptions {
|
|
1424
1590
|
id: string;
|
|
@@ -1653,6 +1819,7 @@ declare class ApiKeys {
|
|
|
1653
1819
|
constructor(resend: Resend);
|
|
1654
1820
|
create(payload: CreateApiKeyOptions, options?: CreateApiKeyRequestOptions): Promise<CreateApiKeyResponse>;
|
|
1655
1821
|
list(options?: ListApiKeysOptions): Promise<ListApiKeysResponse>;
|
|
1822
|
+
update(id: string, payload: UpdateApiKeyOptions): Promise<UpdateApiKeyResponse>;
|
|
1656
1823
|
remove(id: string): Promise<RemoveApiKeyResponse>;
|
|
1657
1824
|
}
|
|
1658
1825
|
//#endregion
|
|
@@ -1694,6 +1861,8 @@ declare class Broadcasts {
|
|
|
1694
1861
|
send(id: string, payload?: SendBroadcastOptions): Promise<SendBroadcastResponse>;
|
|
1695
1862
|
list(options?: ListBroadcastsOptions): Promise<ListBroadcastsResponse>;
|
|
1696
1863
|
get(id: string): Promise<GetBroadcastResponse>;
|
|
1864
|
+
recipients<T extends BroadcastRecipientEventType>(id: string, options: ListBroadcastRecipientsOptions<T>): Promise<ListBroadcastRecipientsResponse<T>>;
|
|
1865
|
+
clickedLinks(id: string, options?: ListBroadcastClickedLinksOptions): Promise<ListBroadcastClickedLinksResponse>;
|
|
1697
1866
|
remove(id: string): Promise<RemoveBroadcastResponse>;
|
|
1698
1867
|
cancel(id: string): Promise<CancelBroadcastResponse>;
|
|
1699
1868
|
update(id: string, payload: UpdateBroadcastOptions): Promise<UpdateBroadcastResponse>;
|
|
@@ -1816,6 +1985,8 @@ declare class Emails {
|
|
|
1816
1985
|
list(options?: ListEmailsOptions): Promise<ListEmailsResponse>;
|
|
1817
1986
|
update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
|
|
1818
1987
|
cancel(id: string): Promise<CancelEmailResponse>;
|
|
1988
|
+
share(id: string, payload?: ShareEmailOptions): Promise<ShareEmailResponse>;
|
|
1989
|
+
metrics(options?: GetEmailsMetricsOptions): Promise<GetEmailsMetricsResponse>;
|
|
1819
1990
|
}
|
|
1820
1991
|
//#endregion
|
|
1821
1992
|
//#region src/events/events.d.ts
|
|
@@ -2472,4 +2643,4 @@ declare class Resend {
|
|
|
2472
2643
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2473
2644
|
}
|
|
2474
2645
|
//#endregion
|
|
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 };
|
|
2646
|
+
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, BroadcastClickedLink, BroadcastRecipient, BroadcastRecipientBounceType, BroadcastRecipientClickedLink, BroadcastRecipientEventType, 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, EmailMetric, EmailMetricsDataRow, EmailMetricsDimension, EmailMetricsGranularity, EmailMetricsTotals, 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, GetEmailsMetricsOptions, GetEmailsMetricsResponse, GetEmailsMetricsResponseSuccess, 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, ListBroadcastClickedLinksOptions, ListBroadcastClickedLinksResponse, ListBroadcastClickedLinksResponseSuccess, ListBroadcastRecipientsOptions, ListBroadcastRecipientsResponse, ListBroadcastRecipientsResponseSuccess, 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, ShareEmailOptions, ShareEmailResponse, ShareEmailResponseSuccess, StopAutomationResponse, StopAutomationResponseSuccess, Suppression, SuppressionAddedEvent, SuppressionListEntry, SuppressionOrigin, SuppressionRemovedEvent, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TrackingCaaRecord, TrackingRecord, TriggerStepConfig, UpdateApiKeyOptions, UpdateApiKeyResponse, UpdateApiKeyResponseSuccess, 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,7 +1,7 @@
|
|
|
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.22.0";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/common/utils/build-pagination-query.ts
|
|
7
7
|
function buildPaginationUrl(base, options) {
|
|
@@ -33,6 +33,9 @@ var ApiKeys = class {
|
|
|
33
33
|
const url = buildPaginationUrl("/api-keys", options);
|
|
34
34
|
return await this.resend.get(url);
|
|
35
35
|
}
|
|
36
|
+
async update(id, payload) {
|
|
37
|
+
return await this.resend.patch(`/api-keys/${id}`, payload);
|
|
38
|
+
}
|
|
36
39
|
async remove(id) {
|
|
37
40
|
return await this.resend.delete(`/api-keys/${id}`);
|
|
38
41
|
}
|
|
@@ -282,6 +285,14 @@ var Broadcasts = class {
|
|
|
282
285
|
async get(id) {
|
|
283
286
|
return await this.resend.get(`/broadcasts/${id}`);
|
|
284
287
|
}
|
|
288
|
+
async recipients(id, options) {
|
|
289
|
+
const url = `/broadcasts/${id}/recipients?${buildRecipientsQuery(options)}`;
|
|
290
|
+
return await this.resend.get(url);
|
|
291
|
+
}
|
|
292
|
+
async clickedLinks(id, options = {}) {
|
|
293
|
+
const url = buildPaginationUrl(`/broadcasts/${id}/clicked-links`, options);
|
|
294
|
+
return await this.resend.get(url);
|
|
295
|
+
}
|
|
285
296
|
async remove(id) {
|
|
286
297
|
return await this.resend.delete(`/broadcasts/${id}`);
|
|
287
298
|
}
|
|
@@ -304,6 +315,14 @@ var Broadcasts = class {
|
|
|
304
315
|
});
|
|
305
316
|
}
|
|
306
317
|
};
|
|
318
|
+
function buildRecipientsQuery(options) {
|
|
319
|
+
const { type, email, bounceType, ...pagination } = options;
|
|
320
|
+
const searchParams = new URLSearchParams(buildPaginationQuery(pagination));
|
|
321
|
+
searchParams.set("type", type);
|
|
322
|
+
if (email !== void 0) searchParams.set("email", email);
|
|
323
|
+
if (bounceType !== void 0) searchParams.set("bounce_type", bounceType);
|
|
324
|
+
return searchParams.toString();
|
|
325
|
+
}
|
|
307
326
|
//#endregion
|
|
308
327
|
//#region src/common/utils/parse-contact-properties-to-api-options.ts
|
|
309
328
|
function parseContactPropertyFromApi(contactProperty) {
|
|
@@ -866,7 +885,31 @@ var Emails = class {
|
|
|
866
885
|
async cancel(id) {
|
|
867
886
|
return await this.resend.post(`/emails/${id}/cancel`);
|
|
868
887
|
}
|
|
888
|
+
async share(id, payload) {
|
|
889
|
+
return await this.resend.post(`/emails/${id}/share`, { expires_in: payload?.expiresIn });
|
|
890
|
+
}
|
|
891
|
+
async metrics(options = {}) {
|
|
892
|
+
const queryString = buildMetricsQuery(options);
|
|
893
|
+
const url = queryString ? `/emails/metrics?${queryString}` : "/emails/metrics";
|
|
894
|
+
return await this.resend.get(url);
|
|
895
|
+
}
|
|
869
896
|
};
|
|
897
|
+
function buildMetricsQuery(options) {
|
|
898
|
+
const params = {
|
|
899
|
+
start_date: options.startDate,
|
|
900
|
+
end_date: options.endDate,
|
|
901
|
+
timezone: options.timezone,
|
|
902
|
+
granularity: options.granularity,
|
|
903
|
+
metrics: options.metrics?.join(","),
|
|
904
|
+
dimensions: options.dimensions?.join(","),
|
|
905
|
+
domain_id: options.domainId?.join(","),
|
|
906
|
+
email_id: options.emailId?.join(","),
|
|
907
|
+
broadcast_id: options.broadcastId?.join(",")
|
|
908
|
+
};
|
|
909
|
+
const searchParams = new URLSearchParams();
|
|
910
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== "") searchParams.set(key, value);
|
|
911
|
+
return searchParams.toString();
|
|
912
|
+
}
|
|
870
913
|
//#endregion
|
|
871
914
|
//#region src/events/events.ts
|
|
872
915
|
var Events = class {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/resend",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.22.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,6 +31,18 @@
|
|
|
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
|
+
},
|
|
34
46
|
"repository": {
|
|
35
47
|
"type": "git",
|
|
36
48
|
"url": "git+https://github.com/resend/resend-node.git"
|
|
@@ -72,18 +84,7 @@
|
|
|
72
84
|
"vitest": "4.1.10",
|
|
73
85
|
"vitest-fetch-mock": "0.4.5"
|
|
74
86
|
},
|
|
75
|
-
"
|
|
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
|
-
},
|
|
87
|
+
"packageManager": "pnpm@11.12.0",
|
|
87
88
|
"keywords": [
|
|
88
89
|
"resend",
|
|
89
90
|
"depup",
|
|
@@ -101,8 +102,8 @@
|
|
|
101
102
|
},
|
|
102
103
|
"depsUpdated": 1,
|
|
103
104
|
"originalPackage": "resend",
|
|
104
|
-
"originalVersion": "6.
|
|
105
|
-
"processedAt": "2026-08-
|
|
105
|
+
"originalVersion": "6.22.0",
|
|
106
|
+
"processedAt": "2026-08-23T00:28:33.045Z",
|
|
106
107
|
"smokeTest": "passed"
|
|
107
108
|
}
|
|
108
109
|
}
|