@depup/resend 6.20.0-depup.0 → 6.25.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 +4 -3
- package/changes.json +6 -2
- package/dist/index.cjs +79 -3
- package/dist/index.d.cts +260 -6
- package/dist/index.d.mts +260 -6
- package/dist/index.mjs +79 -3
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -13,16 +13,17 @@ 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.25.0 |
|
|
17
|
+
| Processed | 2026-08-30 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 2 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
25
|
| postal-mime | 2.7.5 | ^3.0.0 |
|
|
26
|
+
| standardwebhooks | 1.0.0 | ^1.1.1 |
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
package/changes.json
CHANGED
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
"postal-mime": {
|
|
4
4
|
"from": "2.7.5",
|
|
5
5
|
"to": "^3.0.0"
|
|
6
|
+
},
|
|
7
|
+
"standardwebhooks": {
|
|
8
|
+
"from": "1.0.0",
|
|
9
|
+
"to": "^1.1.1"
|
|
6
10
|
}
|
|
7
11
|
},
|
|
8
|
-
"timestamp": "2026-08-
|
|
9
|
-
"totalUpdated":
|
|
12
|
+
"timestamp": "2026-08-30T00:59:10.398Z",
|
|
13
|
+
"totalUpdated": 2
|
|
10
14
|
}
|
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.25.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,10 +909,34 @@ 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
|
-
var Events = class {
|
|
939
|
+
var Events$1 = class {
|
|
897
940
|
constructor(resend) {
|
|
898
941
|
this.resend = resend;
|
|
899
942
|
}
|
|
@@ -961,6 +1004,9 @@ var Segments = class {
|
|
|
961
1004
|
async get(id) {
|
|
962
1005
|
return await this.resend.get(`/segments/${id}`);
|
|
963
1006
|
}
|
|
1007
|
+
async update(id, payload) {
|
|
1008
|
+
return await this.resend.patch(`/segments/${id}`, payload);
|
|
1009
|
+
}
|
|
964
1010
|
async remove(id) {
|
|
965
1011
|
return await this.resend.delete(`/segments/${id}`);
|
|
966
1012
|
}
|
|
@@ -1154,10 +1200,40 @@ var Topics = class {
|
|
|
1154
1200
|
}
|
|
1155
1201
|
};
|
|
1156
1202
|
//#endregion
|
|
1203
|
+
//#region src/webhooks/events/attempts/attempts.ts
|
|
1204
|
+
var Attempts = class {
|
|
1205
|
+
constructor(resend) {
|
|
1206
|
+
this.resend = resend;
|
|
1207
|
+
}
|
|
1208
|
+
async list(options) {
|
|
1209
|
+
const { webhookId, eventId } = options;
|
|
1210
|
+
const url = buildPaginationUrl(`/webhooks/${webhookId}/events/${eventId}/attempts`, options);
|
|
1211
|
+
return await this.resend.get(url);
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
//#endregion
|
|
1215
|
+
//#region src/webhooks/events/events.ts
|
|
1216
|
+
var Events = class {
|
|
1217
|
+
constructor(resend) {
|
|
1218
|
+
this.resend = resend;
|
|
1219
|
+
this.attempts = new Attempts(resend);
|
|
1220
|
+
}
|
|
1221
|
+
async list(options) {
|
|
1222
|
+
const { webhookId } = options;
|
|
1223
|
+
const url = buildPaginationUrl(`/webhooks/${webhookId}/events`, options);
|
|
1224
|
+
return await this.resend.get(url);
|
|
1225
|
+
}
|
|
1226
|
+
async get(options) {
|
|
1227
|
+
const { webhookId, eventId } = options;
|
|
1228
|
+
return await this.resend.get(`/webhooks/${webhookId}/events/${eventId}`);
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
//#endregion
|
|
1157
1232
|
//#region src/webhooks/webhooks.ts
|
|
1158
1233
|
var Webhooks = class {
|
|
1159
1234
|
constructor(resend) {
|
|
1160
1235
|
this.resend = resend;
|
|
1236
|
+
this.events = new Events(resend);
|
|
1161
1237
|
}
|
|
1162
1238
|
async create(payload, options = {}) {
|
|
1163
1239
|
return await this.resend.post("/webhooks", payload, options);
|
|
@@ -1206,7 +1282,7 @@ var Resend = class {
|
|
|
1206
1282
|
this.contacts = new Contacts(this);
|
|
1207
1283
|
this.domains = new Domains(this);
|
|
1208
1284
|
this.emails = new Emails(this);
|
|
1209
|
-
this.events = new Events(this);
|
|
1285
|
+
this.events = new Events$1(this);
|
|
1210
1286
|
this.logs = new Logs(this);
|
|
1211
1287
|
this.oauthGrants = new OAuthGrants(this);
|
|
1212
1288
|
this.suppressions = new Suppressions(this);
|
package/dist/index.d.cts
CHANGED
|
@@ -50,7 +50,7 @@ interface DomainSpfRecord {
|
|
|
50
50
|
record: 'SPF';
|
|
51
51
|
name: string;
|
|
52
52
|
value: string;
|
|
53
|
-
type: 'MX' | 'TXT';
|
|
53
|
+
type: 'MX' | 'TXT' | 'CNAME';
|
|
54
54
|
ttl: string;
|
|
55
55
|
status: DomainRecordStatus;
|
|
56
56
|
routing_policy?: string;
|
|
@@ -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,10 +1985,12 @@ 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
|
|
1822
|
-
declare class Events {
|
|
1993
|
+
declare class Events$1 {
|
|
1823
1994
|
private readonly resend;
|
|
1824
1995
|
constructor(resend: Resend);
|
|
1825
1996
|
send(payload: SendEventOptions): Promise<SendEventResponse>;
|
|
@@ -1878,6 +2049,15 @@ interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
|
1878
2049
|
}
|
|
1879
2050
|
type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
|
|
1880
2051
|
//#endregion
|
|
2052
|
+
//#region src/segments/interfaces/update-segment.interface.d.ts
|
|
2053
|
+
interface UpdateSegmentOptions {
|
|
2054
|
+
name: string;
|
|
2055
|
+
}
|
|
2056
|
+
interface UpdateSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
2057
|
+
object: 'segment';
|
|
2058
|
+
}
|
|
2059
|
+
type UpdateSegmentResponse = Response<UpdateSegmentResponseSuccess>;
|
|
2060
|
+
//#endregion
|
|
1881
2061
|
//#region src/segments/segments.d.ts
|
|
1882
2062
|
declare class Segments {
|
|
1883
2063
|
private readonly resend;
|
|
@@ -1885,6 +2065,7 @@ declare class Segments {
|
|
|
1885
2065
|
create(payload: CreateSegmentOptions, options?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
|
|
1886
2066
|
list(options?: ListSegmentsOptions): Promise<ListSegmentsResponse>;
|
|
1887
2067
|
get(id: string): Promise<GetSegmentResponse>;
|
|
2068
|
+
update(id: string, payload: UpdateSegmentOptions): Promise<UpdateSegmentResponse>;
|
|
1888
2069
|
remove(id: string): Promise<RemoveSegmentResponse>;
|
|
1889
2070
|
}
|
|
1890
2071
|
//#endregion
|
|
@@ -2217,8 +2398,8 @@ interface ContactEventData {
|
|
|
2217
2398
|
created_at: string;
|
|
2218
2399
|
updated_at: string;
|
|
2219
2400
|
email: string;
|
|
2220
|
-
first_name?: string;
|
|
2221
|
-
last_name?: string;
|
|
2401
|
+
first_name?: string | null;
|
|
2402
|
+
last_name?: string | null;
|
|
2222
2403
|
unsubscribed: boolean;
|
|
2223
2404
|
}
|
|
2224
2405
|
interface DomainRecord {
|
|
@@ -2350,6 +2531,78 @@ interface SuppressionRemovedEvent {
|
|
|
2350
2531
|
}
|
|
2351
2532
|
type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent | SuppressionAddedEvent | SuppressionRemovedEvent;
|
|
2352
2533
|
//#endregion
|
|
2534
|
+
//#region src/webhooks/interfaces/list-webhook-events.interface.d.ts
|
|
2535
|
+
type WebhookEventLogStatus = 'success' | 'pending' | 'failed' | 'attempting';
|
|
2536
|
+
interface WebhookEventLog {
|
|
2537
|
+
id: string;
|
|
2538
|
+
type: WebhookEvent;
|
|
2539
|
+
created_at: string;
|
|
2540
|
+
status: WebhookEventLogStatus;
|
|
2541
|
+
}
|
|
2542
|
+
type ListWebhookEventsOptions = {
|
|
2543
|
+
webhookId: string;
|
|
2544
|
+
limit?: number;
|
|
2545
|
+
after?: string;
|
|
2546
|
+
};
|
|
2547
|
+
type ListWebhookEventsResponseSuccess = {
|
|
2548
|
+
object: 'list';
|
|
2549
|
+
has_more: boolean;
|
|
2550
|
+
data: WebhookEventLog[];
|
|
2551
|
+
};
|
|
2552
|
+
type ListWebhookEventsResponse = Response<ListWebhookEventsResponseSuccess>;
|
|
2553
|
+
//#endregion
|
|
2554
|
+
//#region src/webhooks/interfaces/get-webhook-event.interface.d.ts
|
|
2555
|
+
interface GetWebhookEventOptions {
|
|
2556
|
+
webhookId: string;
|
|
2557
|
+
eventId: string;
|
|
2558
|
+
}
|
|
2559
|
+
interface GetWebhookEventResponseSuccess {
|
|
2560
|
+
object: 'webhook_event';
|
|
2561
|
+
id: string;
|
|
2562
|
+
type: WebhookEvent;
|
|
2563
|
+
created_at: string;
|
|
2564
|
+
status: WebhookEventLogStatus;
|
|
2565
|
+
next_attempt_at: string | null;
|
|
2566
|
+
payload: WebhookEventPayload;
|
|
2567
|
+
}
|
|
2568
|
+
type GetWebhookEventResponse = Response<GetWebhookEventResponseSuccess>;
|
|
2569
|
+
//#endregion
|
|
2570
|
+
//#region src/webhooks/interfaces/list-webhook-event-attempts.interface.d.ts
|
|
2571
|
+
interface WebhookEventAttempt {
|
|
2572
|
+
id: string;
|
|
2573
|
+
http_status_code: number;
|
|
2574
|
+
response: string;
|
|
2575
|
+
sent_at: string;
|
|
2576
|
+
}
|
|
2577
|
+
type ListWebhookEventAttemptsOptions = {
|
|
2578
|
+
webhookId: string;
|
|
2579
|
+
eventId: string;
|
|
2580
|
+
limit?: number;
|
|
2581
|
+
after?: string;
|
|
2582
|
+
};
|
|
2583
|
+
type ListWebhookEventAttemptsResponseSuccess = {
|
|
2584
|
+
object: 'list';
|
|
2585
|
+
has_more: boolean;
|
|
2586
|
+
data: WebhookEventAttempt[];
|
|
2587
|
+
};
|
|
2588
|
+
type ListWebhookEventAttemptsResponse = Response<ListWebhookEventAttemptsResponseSuccess>;
|
|
2589
|
+
//#endregion
|
|
2590
|
+
//#region src/webhooks/events/attempts/attempts.d.ts
|
|
2591
|
+
declare class Attempts {
|
|
2592
|
+
private readonly resend;
|
|
2593
|
+
constructor(resend: Resend);
|
|
2594
|
+
list(options: ListWebhookEventAttemptsOptions): Promise<ListWebhookEventAttemptsResponse>;
|
|
2595
|
+
}
|
|
2596
|
+
//#endregion
|
|
2597
|
+
//#region src/webhooks/events/events.d.ts
|
|
2598
|
+
declare class Events {
|
|
2599
|
+
private readonly resend;
|
|
2600
|
+
readonly attempts: Attempts;
|
|
2601
|
+
constructor(resend: Resend);
|
|
2602
|
+
list(options: ListWebhookEventsOptions): Promise<ListWebhookEventsResponse>;
|
|
2603
|
+
get(options: GetWebhookEventOptions): Promise<GetWebhookEventResponse>;
|
|
2604
|
+
}
|
|
2605
|
+
//#endregion
|
|
2353
2606
|
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
|
|
2354
2607
|
interface CreateWebhookOptions {
|
|
2355
2608
|
endpoint: string;
|
|
@@ -2423,6 +2676,7 @@ interface VerifyWebhookOptions {
|
|
|
2423
2676
|
}
|
|
2424
2677
|
declare class Webhooks {
|
|
2425
2678
|
private readonly resend;
|
|
2679
|
+
readonly events: Events;
|
|
2426
2680
|
constructor(resend: Resend);
|
|
2427
2681
|
create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
|
|
2428
2682
|
get(id: string): Promise<GetWebhookResponse>;
|
|
@@ -2455,7 +2709,7 @@ declare class Resend {
|
|
|
2455
2709
|
readonly contacts: Contacts;
|
|
2456
2710
|
readonly domains: Domains;
|
|
2457
2711
|
readonly emails: Emails;
|
|
2458
|
-
readonly events: Events;
|
|
2712
|
+
readonly events: Events$1;
|
|
2459
2713
|
readonly logs: Logs;
|
|
2460
2714
|
readonly oauthGrants: OAuthGrants;
|
|
2461
2715
|
readonly suppressions: Suppressions;
|
|
@@ -2472,4 +2726,4 @@ declare class Resend {
|
|
|
2472
2726
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2473
2727
|
}
|
|
2474
2728
|
//#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 };
|
|
2729
|
+
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, GetWebhookEventOptions, GetWebhookEventResponse, GetWebhookEventResponseSuccess, 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, ListWebhookEventAttemptsOptions, ListWebhookEventAttemptsResponse, ListWebhookEventAttemptsResponseSuccess, ListWebhookEventsOptions, ListWebhookEventsResponse, ListWebhookEventsResponseSuccess, 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, UpdateSegmentOptions, UpdateSegmentResponse, UpdateSegmentResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventAttempt, WebhookEventLog, WebhookEventLogStatus, WebhookEventPayload };
|
package/dist/index.d.mts
CHANGED
|
@@ -50,7 +50,7 @@ interface DomainSpfRecord {
|
|
|
50
50
|
record: 'SPF';
|
|
51
51
|
name: string;
|
|
52
52
|
value: string;
|
|
53
|
-
type: 'MX' | 'TXT';
|
|
53
|
+
type: 'MX' | 'TXT' | 'CNAME';
|
|
54
54
|
ttl: string;
|
|
55
55
|
status: DomainRecordStatus;
|
|
56
56
|
routing_policy?: string;
|
|
@@ -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,10 +1985,12 @@ 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
|
|
1822
|
-
declare class Events {
|
|
1993
|
+
declare class Events$1 {
|
|
1823
1994
|
private readonly resend;
|
|
1824
1995
|
constructor(resend: Resend);
|
|
1825
1996
|
send(payload: SendEventOptions): Promise<SendEventResponse>;
|
|
@@ -1878,6 +2049,15 @@ interface RemoveSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
|
1878
2049
|
}
|
|
1879
2050
|
type RemoveSegmentResponse = Response<RemoveSegmentResponseSuccess>;
|
|
1880
2051
|
//#endregion
|
|
2052
|
+
//#region src/segments/interfaces/update-segment.interface.d.ts
|
|
2053
|
+
interface UpdateSegmentOptions {
|
|
2054
|
+
name: string;
|
|
2055
|
+
}
|
|
2056
|
+
interface UpdateSegmentResponseSuccess extends Pick<Segment, 'id'> {
|
|
2057
|
+
object: 'segment';
|
|
2058
|
+
}
|
|
2059
|
+
type UpdateSegmentResponse = Response<UpdateSegmentResponseSuccess>;
|
|
2060
|
+
//#endregion
|
|
1881
2061
|
//#region src/segments/segments.d.ts
|
|
1882
2062
|
declare class Segments {
|
|
1883
2063
|
private readonly resend;
|
|
@@ -1885,6 +2065,7 @@ declare class Segments {
|
|
|
1885
2065
|
create(payload: CreateSegmentOptions, options?: CreateSegmentRequestOptions): Promise<CreateSegmentResponse>;
|
|
1886
2066
|
list(options?: ListSegmentsOptions): Promise<ListSegmentsResponse>;
|
|
1887
2067
|
get(id: string): Promise<GetSegmentResponse>;
|
|
2068
|
+
update(id: string, payload: UpdateSegmentOptions): Promise<UpdateSegmentResponse>;
|
|
1888
2069
|
remove(id: string): Promise<RemoveSegmentResponse>;
|
|
1889
2070
|
}
|
|
1890
2071
|
//#endregion
|
|
@@ -2217,8 +2398,8 @@ interface ContactEventData {
|
|
|
2217
2398
|
created_at: string;
|
|
2218
2399
|
updated_at: string;
|
|
2219
2400
|
email: string;
|
|
2220
|
-
first_name?: string;
|
|
2221
|
-
last_name?: string;
|
|
2401
|
+
first_name?: string | null;
|
|
2402
|
+
last_name?: string | null;
|
|
2222
2403
|
unsubscribed: boolean;
|
|
2223
2404
|
}
|
|
2224
2405
|
interface DomainRecord {
|
|
@@ -2350,6 +2531,78 @@ interface SuppressionRemovedEvent {
|
|
|
2350
2531
|
}
|
|
2351
2532
|
type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent | SuppressionAddedEvent | SuppressionRemovedEvent;
|
|
2352
2533
|
//#endregion
|
|
2534
|
+
//#region src/webhooks/interfaces/list-webhook-events.interface.d.ts
|
|
2535
|
+
type WebhookEventLogStatus = 'success' | 'pending' | 'failed' | 'attempting';
|
|
2536
|
+
interface WebhookEventLog {
|
|
2537
|
+
id: string;
|
|
2538
|
+
type: WebhookEvent;
|
|
2539
|
+
created_at: string;
|
|
2540
|
+
status: WebhookEventLogStatus;
|
|
2541
|
+
}
|
|
2542
|
+
type ListWebhookEventsOptions = {
|
|
2543
|
+
webhookId: string;
|
|
2544
|
+
limit?: number;
|
|
2545
|
+
after?: string;
|
|
2546
|
+
};
|
|
2547
|
+
type ListWebhookEventsResponseSuccess = {
|
|
2548
|
+
object: 'list';
|
|
2549
|
+
has_more: boolean;
|
|
2550
|
+
data: WebhookEventLog[];
|
|
2551
|
+
};
|
|
2552
|
+
type ListWebhookEventsResponse = Response<ListWebhookEventsResponseSuccess>;
|
|
2553
|
+
//#endregion
|
|
2554
|
+
//#region src/webhooks/interfaces/get-webhook-event.interface.d.ts
|
|
2555
|
+
interface GetWebhookEventOptions {
|
|
2556
|
+
webhookId: string;
|
|
2557
|
+
eventId: string;
|
|
2558
|
+
}
|
|
2559
|
+
interface GetWebhookEventResponseSuccess {
|
|
2560
|
+
object: 'webhook_event';
|
|
2561
|
+
id: string;
|
|
2562
|
+
type: WebhookEvent;
|
|
2563
|
+
created_at: string;
|
|
2564
|
+
status: WebhookEventLogStatus;
|
|
2565
|
+
next_attempt_at: string | null;
|
|
2566
|
+
payload: WebhookEventPayload;
|
|
2567
|
+
}
|
|
2568
|
+
type GetWebhookEventResponse = Response<GetWebhookEventResponseSuccess>;
|
|
2569
|
+
//#endregion
|
|
2570
|
+
//#region src/webhooks/interfaces/list-webhook-event-attempts.interface.d.ts
|
|
2571
|
+
interface WebhookEventAttempt {
|
|
2572
|
+
id: string;
|
|
2573
|
+
http_status_code: number;
|
|
2574
|
+
response: string;
|
|
2575
|
+
sent_at: string;
|
|
2576
|
+
}
|
|
2577
|
+
type ListWebhookEventAttemptsOptions = {
|
|
2578
|
+
webhookId: string;
|
|
2579
|
+
eventId: string;
|
|
2580
|
+
limit?: number;
|
|
2581
|
+
after?: string;
|
|
2582
|
+
};
|
|
2583
|
+
type ListWebhookEventAttemptsResponseSuccess = {
|
|
2584
|
+
object: 'list';
|
|
2585
|
+
has_more: boolean;
|
|
2586
|
+
data: WebhookEventAttempt[];
|
|
2587
|
+
};
|
|
2588
|
+
type ListWebhookEventAttemptsResponse = Response<ListWebhookEventAttemptsResponseSuccess>;
|
|
2589
|
+
//#endregion
|
|
2590
|
+
//#region src/webhooks/events/attempts/attempts.d.ts
|
|
2591
|
+
declare class Attempts {
|
|
2592
|
+
private readonly resend;
|
|
2593
|
+
constructor(resend: Resend);
|
|
2594
|
+
list(options: ListWebhookEventAttemptsOptions): Promise<ListWebhookEventAttemptsResponse>;
|
|
2595
|
+
}
|
|
2596
|
+
//#endregion
|
|
2597
|
+
//#region src/webhooks/events/events.d.ts
|
|
2598
|
+
declare class Events {
|
|
2599
|
+
private readonly resend;
|
|
2600
|
+
readonly attempts: Attempts;
|
|
2601
|
+
constructor(resend: Resend);
|
|
2602
|
+
list(options: ListWebhookEventsOptions): Promise<ListWebhookEventsResponse>;
|
|
2603
|
+
get(options: GetWebhookEventOptions): Promise<GetWebhookEventResponse>;
|
|
2604
|
+
}
|
|
2605
|
+
//#endregion
|
|
2353
2606
|
//#region src/webhooks/interfaces/create-webhook-options.interface.d.ts
|
|
2354
2607
|
interface CreateWebhookOptions {
|
|
2355
2608
|
endpoint: string;
|
|
@@ -2423,6 +2676,7 @@ interface VerifyWebhookOptions {
|
|
|
2423
2676
|
}
|
|
2424
2677
|
declare class Webhooks {
|
|
2425
2678
|
private readonly resend;
|
|
2679
|
+
readonly events: Events;
|
|
2426
2680
|
constructor(resend: Resend);
|
|
2427
2681
|
create(payload: CreateWebhookOptions, options?: CreateWebhookRequestOptions): Promise<CreateWebhookResponse>;
|
|
2428
2682
|
get(id: string): Promise<GetWebhookResponse>;
|
|
@@ -2455,7 +2709,7 @@ declare class Resend {
|
|
|
2455
2709
|
readonly contacts: Contacts;
|
|
2456
2710
|
readonly domains: Domains;
|
|
2457
2711
|
readonly emails: Emails;
|
|
2458
|
-
readonly events: Events;
|
|
2712
|
+
readonly events: Events$1;
|
|
2459
2713
|
readonly logs: Logs;
|
|
2460
2714
|
readonly oauthGrants: OAuthGrants;
|
|
2461
2715
|
readonly suppressions: Suppressions;
|
|
@@ -2472,4 +2726,4 @@ declare class Resend {
|
|
|
2472
2726
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
2473
2727
|
}
|
|
2474
2728
|
//#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 };
|
|
2729
|
+
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, GetWebhookEventOptions, GetWebhookEventResponse, GetWebhookEventResponseSuccess, 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, ListWebhookEventAttemptsOptions, ListWebhookEventAttemptsResponse, ListWebhookEventAttemptsResponseSuccess, ListWebhookEventsOptions, ListWebhookEventsResponse, ListWebhookEventsResponseSuccess, 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, UpdateSegmentOptions, UpdateSegmentResponse, UpdateSegmentResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, VerifyDomainClaimResponse, VerifyDomainClaimResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventAttempt, WebhookEventLog, WebhookEventLogStatus, 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.25.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,10 +885,34 @@ 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
|
-
var Events = class {
|
|
915
|
+
var Events$1 = class {
|
|
873
916
|
constructor(resend) {
|
|
874
917
|
this.resend = resend;
|
|
875
918
|
}
|
|
@@ -937,6 +980,9 @@ var Segments = class {
|
|
|
937
980
|
async get(id) {
|
|
938
981
|
return await this.resend.get(`/segments/${id}`);
|
|
939
982
|
}
|
|
983
|
+
async update(id, payload) {
|
|
984
|
+
return await this.resend.patch(`/segments/${id}`, payload);
|
|
985
|
+
}
|
|
940
986
|
async remove(id) {
|
|
941
987
|
return await this.resend.delete(`/segments/${id}`);
|
|
942
988
|
}
|
|
@@ -1130,10 +1176,40 @@ var Topics = class {
|
|
|
1130
1176
|
}
|
|
1131
1177
|
};
|
|
1132
1178
|
//#endregion
|
|
1179
|
+
//#region src/webhooks/events/attempts/attempts.ts
|
|
1180
|
+
var Attempts = class {
|
|
1181
|
+
constructor(resend) {
|
|
1182
|
+
this.resend = resend;
|
|
1183
|
+
}
|
|
1184
|
+
async list(options) {
|
|
1185
|
+
const { webhookId, eventId } = options;
|
|
1186
|
+
const url = buildPaginationUrl(`/webhooks/${webhookId}/events/${eventId}/attempts`, options);
|
|
1187
|
+
return await this.resend.get(url);
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
//#endregion
|
|
1191
|
+
//#region src/webhooks/events/events.ts
|
|
1192
|
+
var Events = class {
|
|
1193
|
+
constructor(resend) {
|
|
1194
|
+
this.resend = resend;
|
|
1195
|
+
this.attempts = new Attempts(resend);
|
|
1196
|
+
}
|
|
1197
|
+
async list(options) {
|
|
1198
|
+
const { webhookId } = options;
|
|
1199
|
+
const url = buildPaginationUrl(`/webhooks/${webhookId}/events`, options);
|
|
1200
|
+
return await this.resend.get(url);
|
|
1201
|
+
}
|
|
1202
|
+
async get(options) {
|
|
1203
|
+
const { webhookId, eventId } = options;
|
|
1204
|
+
return await this.resend.get(`/webhooks/${webhookId}/events/${eventId}`);
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
//#endregion
|
|
1133
1208
|
//#region src/webhooks/webhooks.ts
|
|
1134
1209
|
var Webhooks = class {
|
|
1135
1210
|
constructor(resend) {
|
|
1136
1211
|
this.resend = resend;
|
|
1212
|
+
this.events = new Events(resend);
|
|
1137
1213
|
}
|
|
1138
1214
|
async create(payload, options = {}) {
|
|
1139
1215
|
return await this.resend.post("/webhooks", payload, options);
|
|
@@ -1182,7 +1258,7 @@ var Resend = class {
|
|
|
1182
1258
|
this.contacts = new Contacts(this);
|
|
1183
1259
|
this.domains = new Domains(this);
|
|
1184
1260
|
this.emails = new Emails(this);
|
|
1185
|
-
this.events = new Events(this);
|
|
1261
|
+
this.events = new Events$1(this);
|
|
1186
1262
|
this.logs = new Logs(this);
|
|
1187
1263
|
this.oauthGrants = new OAuthGrants(this);
|
|
1188
1264
|
this.suppressions = new Suppressions(this);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/resend",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"homepage": "https://github.com/resend/resend-node#readme",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"postal-mime": "^3.0.0",
|
|
46
|
-
"standardwebhooks": "1.
|
|
46
|
+
"standardwebhooks": "^1.1.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@react-email/render": "*"
|
|
@@ -97,12 +97,16 @@
|
|
|
97
97
|
"postal-mime": {
|
|
98
98
|
"from": "2.7.5",
|
|
99
99
|
"to": "^3.0.0"
|
|
100
|
+
},
|
|
101
|
+
"standardwebhooks": {
|
|
102
|
+
"from": "1.0.0",
|
|
103
|
+
"to": "^1.1.1"
|
|
100
104
|
}
|
|
101
105
|
},
|
|
102
|
-
"depsUpdated":
|
|
106
|
+
"depsUpdated": 2,
|
|
103
107
|
"originalPackage": "resend",
|
|
104
|
-
"originalVersion": "6.
|
|
105
|
-
"processedAt": "2026-08-
|
|
108
|
+
"originalVersion": "6.25.0",
|
|
109
|
+
"processedAt": "2026-08-30T00:59:15.970Z",
|
|
106
110
|
"smokeTest": "passed"
|
|
107
111
|
}
|
|
108
112
|
}
|